From 79d6bcc267a584ce4cd7f8124c59293a159723b6 Mon Sep 17 00:00:00 2001 From: tinysec Date: Mon, 24 Nov 2025 21:30:41 +0800 Subject: [PATCH 1/4] init --- .github/workflows/ci.yaml | 120 + .gitignore | 61 +- .globalconfig | 3 + BinaryNinja.csproj | 33 + Constant.cs | 10 + Delegate/BNProgressFunction.cs | 48 + Delegate/MatchConstantDelegate.cs | 35 + Delegate/MatchDataDelegate.cs | 35 + Delegate/MatchTextDelegate.cs | 38 + Enumeration/BNActionType.cs | 30 + Enumeration/BNAnalysisMode.cs | 30 + Enumeration/BNAnalysisSkipReason.cs | 55 + Enumeration/BNAnalysisState.cs | 45 + Enumeration/BNAnalysisWarningActionType.cs | 30 + .../BNBaseAddressDetectionConfidence.cs | 25 + .../BNBaseAddressDetectionPOISetting.cs | 25 + Enumeration/BNBaseAddressDetectionPOIType.cs | 35 + Enumeration/BNBinaryViewEventType.cs | 20 + Enumeration/BNBraceRequirement.cs | 25 + Enumeration/BNBranchType.cs | 60 + Enumeration/BNBuiltinType.cs | 45 + Enumeration/BNCallingConventionName.cs | 65 + Enumeration/BNCollaborationPermissionLevel.cs | 25 + Enumeration/BNDataFlowQueryOption.cs | 20 + Enumeration/BNDeadStoreElimination.cs | 25 + Enumeration/BNDisassemblyAddressMode.cs | 65 + Enumeration/BNDisassemblyBlockLabels.cs | 25 + .../BNDisassemblyCallParameterHints.cs | 25 + Enumeration/BNDisassemblyOption.cs | 105 + Enumeration/BNEarlyReturn.cs | 35 + Enumeration/BNEdgePenStyle.cs | 40 + Enumeration/BNEndianness.cs | 20 + Enumeration/BNExprFolding.cs | 25 + Enumeration/BNFindFlag.cs | 25 + Enumeration/BNFindRangeType.cs | 25 + Enumeration/BNFindType.cs | 35 + .../BNFirmwareNinjaMemoryAccessType.cs | 25 + Enumeration/BNFirmwareNinjaMemoryHeuristic.cs | 45 + .../BNFirmwareNinjaSectionAnalysisMode.cs | 25 + Enumeration/BNFirmwareNinjaSectionType.cs | 30 + Enumeration/BNFlagRole.cs | 70 + Enumeration/BNFlowGraphOption.cs | 50 + Enumeration/BNFormInputFieldType.cs | 65 + Enumeration/BNFunctionAnalysisSkipOverride.cs | 25 + Enumeration/BNFunctionGraphType.cs | 70 + Enumeration/BNFunctionUpdateType.cs | 25 + Enumeration/BNHighLevelILOperation.cs | 640 ++ Enumeration/BNHighlightColorStyle.cs | 25 + Enumeration/BNHighlightStandardColor.cs | 60 + Enumeration/BNILBranchDependence.cs | 25 + Enumeration/BNILInstructionAttribute.cs | 75 + Enumeration/BNImplicitRegisterExtend.cs | 25 + Enumeration/BNInstructionTextTokenContext.cs | 80 + Enumeration/BNInstructionTextTokenType.cs | 272 + Enumeration/BNIntegerDisplayType.cs | 80 + Enumeration/BNIntrinsicClass.cs | 20 + Enumeration/BNLinearDisassemblyLineType.cs | 115 + .../BNLinearViewObjectIdentifierType.cs | 25 + Enumeration/BNLogLevel.cs | 35 + Enumeration/BNLowLevelILFlagCondition.cs | 120 + Enumeration/BNLowLevelILOperation.cs | 725 +++ Enumeration/BNMediumLevelILOperation.cs | 710 +++ Enumeration/BNMemberAccess.cs | 30 + Enumeration/BNMemberScope.cs | 35 + Enumeration/BNMergeConflictDataType.cs | 25 + Enumeration/BNMessageBoxButtonResult.cs | 30 + Enumeration/BNMessageBoxButtonSet.cs | 25 + Enumeration/BNMessageBoxIcon.cs | 30 + Enumeration/BNMetadataType.cs | 55 + Enumeration/BNModificationStatus.cs | 25 + Enumeration/BNNameType.cs | 460 ++ Enumeration/BNNamedTypeReferenceClass.cs | 40 + Enumeration/BNOperatorPrecedence.cs | 110 + Enumeration/BNPluginCommandType.cs | 65 + Enumeration/BNPluginLoadOrder.cs | 25 + Enumeration/BNPluginOrigin.cs | 25 + Enumeration/BNPluginStatus.cs | 65 + Enumeration/BNPluginType.cs | 40 + Enumeration/BNPointerBaseType.cs | 30 + Enumeration/BNPointerSuffix.cs | 37 + Enumeration/BNReferenceType.cs | 30 + Enumeration/BNRegisterValueType.cs | 95 + Enumeration/BNRelocationType.cs | 40 + Enumeration/BNRemoteFileType.cs | 30 + .../BNRenderLayerDefaultEnableState.cs | 25 + Enumeration/BNReportType.cs | 30 + Enumeration/BNSaveOption.cs | 25 + Enumeration/BNScopeType.cs | 35 + .../BNScriptingProviderExecuteResult.cs | 30 + .../BNScriptingProviderInputReadyState.cs | 25 + Enumeration/BNSectionSemantics.cs | 35 + Enumeration/BNSegmentFlag.cs | 45 + Enumeration/BNSettingsScope.cs | 40 + Enumeration/BNStringType.cs | 30 + Enumeration/BNStructureVariant.cs | 25 + Enumeration/BNSwitchRecovery.cs | 25 + Enumeration/BNSymbolBinding.cs | 30 + Enumeration/BNSymbolDisplayResult.cs | 25 + Enumeration/BNSymbolDisplayType.cs | 25 + Enumeration/BNSymbolType.cs | 55 + Enumeration/BNSyncStatus.cs | 45 + Enumeration/BNTagReferenceType.cs | 25 + Enumeration/BNTagTypeType.cs | 25 + Enumeration/BNThemeColor.cs | 645 ++ Enumeration/BNTokenEscapingType.cs | 30 + Enumeration/BNTransformCapabilities.cs | 25 + Enumeration/BNTransformResult.cs | 30 + Enumeration/BNTransformSessionMode.cs | 25 + Enumeration/BNTransformType.cs | 55 + Enumeration/BNTypeClass.cs | 75 + Enumeration/BNTypeContainerType.cs | 55 + Enumeration/BNTypeDefinitionLineType.cs | 65 + Enumeration/BNTypeParserErrorSeverity.cs | 40 + Enumeration/BNTypeParserOption.cs | 20 + Enumeration/BNTypeReferenceType.cs | 25 + Enumeration/BNUpdateResult.cs | 30 + Enumeration/BNVariableSourceType.cs | 25 + Enumeration/PluginLoadStatus.cs | 25 + Form/LabelField.cs | 27 + Form/SeparatorField.cs | 19 + Form/TextLineField.cs | 33 + Function/BNAbortAnalysis.cs | 24 + Function/BNAbortBaseAddressDetection.cs | 24 + Function/BNAbortFlowGraphLayoutRequest.cs | 24 + Function/BNActivityGetName.cs | 24 + Function/BNAddAnalysisCompletionEvent.cs | 30 + Function/BNAddAnalysisOption.cs | 28 + Function/BNAddArchitectureRedirection.cs | 30 + Function/BNAddAutoAddressTag.cs | 33 + Function/BNAddAutoDataTag.cs | 30 + Function/BNAddAutoFunctionTag.cs | 27 + Function/BNAddAutoSection.cs | 55 + Function/BNAddAutoSegment.cs | 40 + Function/BNAddAutoSegments.cs | 30 + Function/BNAddBinaryMemoryRegion.cs | 37 + Function/BNAddBinaryViewTypeLibrary.cs | 27 + Function/BNAddDataMemoryRegion.cs | 37 + Function/BNAddDataReference.cs | 30 + Function/BNAddDebugDataVariable.cs | 40 + Function/BNAddDebugDataVariableInfo.cs | 27 + Function/BNAddDebugFunction.cs | 27 + Function/BNAddDebugType.cs | 37 + Function/BNAddEntryPointForAnalysis.cs | 30 + Function/BNAddEnumerationBuilderMember.cs | 28 + .../BNAddEnumerationBuilderMemberWithValue.cs | 31 + Function/BNAddExpressionParserMagicValue.cs | 31 + Function/BNAddExpressionParserMagicValues.cs | 34 + Function/BNAddFlowGraphNode.cs | 27 + Function/BNAddFlowGraphNodeOutgoingEdge.cs | 33 + Function/BNAddFlowGraphRenderLayer.cs | 27 + Function/BNAddFunctionForAnalysis.cs | 36 + Function/BNAddGraphReportToCollection.cs | 34 + Function/BNAddGuidedSourceBlocks.cs | 30 + Function/BNAddHTMLReportToCollection.cs | 37 + Function/BNAddHighLevelILArrayIndexToken.cs | 39 + Function/BNAddHighLevelILConstantTextToken.cs | 42 + Function/BNAddHighLevelILFloatSizeToken.cs | 30 + Function/BNAddHighLevelILIntegerTextToken.cs | 36 + Function/BNAddHighLevelILPointerTextToken.cs | 45 + Function/BNAddHighLevelILSizeToken.cs | 30 + Function/BNAddHighLevelILVarTextToken.cs | 36 + Function/BNAddLinearViewCursorRenderLayer.cs | 27 + Function/BNAddLowLevelILLabelForAddress.cs | 30 + Function/BNAddMarkdownReportToCollection.cs | 37 + .../BNAddNamesForOuterStructureMembers.cs | 36 + Function/BNAddOptionalPluginDependency.cs | 33 + Function/BNAddPlainTextReportToCollection.cs | 34 + Function/BNAddRelatedPlatform.cs | 30 + Function/BNAddRemoteMemoryRegion.cs | 37 + Function/BNAddRequiredPluginDependency.cs | 33 + Function/BNAddStructureBuilderMember.cs | 37 + .../BNAddStructureBuilderMemberAtOffset.cs | 43 + Function/BNAddTag.cs | 30 + Function/BNAddTagType.cs | 27 + Function/BNAddToEntryFunctions.cs | 27 + Function/BNAddTypeArchiveTypes.cs | 30 + Function/BNAddTypeBuilderPointerSuffix.cs | 27 + Function/BNAddTypeLibraryAlternateName.cs | 28 + Function/BNAddTypeLibraryNamedObject.cs | 30 + Function/BNAddTypeLibraryNamedType.cs | 30 + Function/BNAddTypeLibraryNamedTypeSource.cs | 31 + Function/BNAddTypeLibraryPlatform.cs | 27 + Function/BNAddTypeMemberTokens.cs | 51 + Function/BNAddUnbackedMemoryRegion.cs | 40 + Function/BNAddUserAddressTag.cs | 33 + Function/BNAddUserCodeReference.cs | 33 + Function/BNAddUserDataReference.cs | 30 + Function/BNAddUserDataTag.cs | 30 + Function/BNAddUserFunctionTag.cs | 27 + Function/BNAddUserSection.cs | 55 + Function/BNAddUserSegment.cs | 39 + Function/BNAddUserSegments.cs | 30 + Function/BNAddUserTypeFieldReference.cs | 39 + Function/BNAddUserTypeReference.cs | 33 + Function/BNAllocString.cs | 25 + Function/BNAllocStringList.cs | 28 + Function/BNAllocStringWithLength.cs | 28 + Function/BNAlwaysBranch.cs | 30 + Function/BNAnalysisContextGetBinaryView.cs | 24 + Function/BNAnalysisContextGetFunction.cs | 24 + ...BNAnalysisContextGetHighLevelILFunction.cs | 24 + .../BNAnalysisContextGetLiftedILFunction.cs | 24 + .../BNAnalysisContextGetLowLevelILFunction.cs | 24 + ...AnalysisContextGetMediumLevelILFunction.cs | 24 + Function/BNAnalysisContextInform.cs | 28 + Function/BNAnalysisIsAborted.cs | 24 + Function/BNAnalysisMergeConflictGetBase.cs | 24 + .../BNAnalysisMergeConflictGetBaseFile.cs | 24 + .../BNAnalysisMergeConflictGetBaseSnapshot.cs | 24 + .../BNAnalysisMergeConflictGetDataType.cs | 24 + .../BNAnalysisMergeConflictGetDatabase.cs | 24 + Function/BNAnalysisMergeConflictGetFirst.cs | 24 + .../BNAnalysisMergeConflictGetFirstFile.cs | 24 + ...BNAnalysisMergeConflictGetFirstSnapshot.cs | 24 + Function/BNAnalysisMergeConflictGetKey.cs | 24 + .../BNAnalysisMergeConflictGetPathItem.cs | 28 + ...lysisMergeConflictGetPathItemSerialized.cs | 28 + ...NAnalysisMergeConflictGetPathItemString.cs | 28 + Function/BNAnalysisMergeConflictGetSecond.cs | 24 + .../BNAnalysisMergeConflictGetSecondFile.cs | 24 + ...NAnalysisMergeConflictGetSecondSnapshot.cs | 24 + Function/BNAnalysisMergeConflictGetType.cs | 24 + ...BNAnalysisMergeConflictSplitterCanSplit.cs | 31 + .../BNAnalysisMergeConflictSplitterGetName.cs | 24 + .../BNAnalysisMergeConflictSplitterSplit.cs | 43 + Function/BNAnalysisMergeConflictSuccess.cs | 28 + ...sicBlocksContextAddBasicBlockToFunction.cs | 27 + ...alyzeBasicBlocksContextAddTempReference.cs | 27 + ...alyzeBasicBlocksContextCreateBasicBlock.cs | 30 + .../BNAnalyzeBasicBlocksContextFinalize.cs | 24 + ...ocksContextSetContextualFunctionReturns.cs | 33 + ...sicBlocksContextSetDirectCodeReferences.cs | 33 + ...asicBlocksContextSetDirectNoReturnCalls.cs | 30 + ...cksContextSetHaltedDisassemblyAddresses.cs | 30 + ...extSetInlinedUnresolvedIndirectBranches.cs | 30 + Function/BNAnalyzeFunction.cs | 24 + Function/BNAppendDataBuffer.cs | 27 + Function/BNAppendDataBufferContents.cs | 30 + Function/BNAppendPath.cs | 28 + Function/BNAppendSymbolQueue.cs | 36 + Function/BNApplyAutoDiscoveredFunctionType.cs | 27 + Function/BNApplyDebugInfo.cs | 27 + Function/BNApplyImportedTypes.cs | 30 + Function/BNApplyRenderLayerToFlowGraph.cs | 27 + .../BNApplyRenderLayerToLinearViewObject.cs | 45 + Function/BNApplySnapshotData.cs | 45 + Function/BNArchitectureAlwaysBranch.cs | 33 + Function/BNArchitectureAnalyzeBasicBlocks.cs | 30 + Function/BNArchitectureConvertToNop.cs | 33 + ...BNArchitectureDefaultAnalyzeBasicBlocks.cs | 27 + .../BNArchitectureGetRelocationHandler.cs | 28 + Function/BNArchitectureInvertBranch.cs | 33 + ...BNArchitectureRegisterRelocationHandler.cs | 31 + ...ureSetDefaultAnalyzeBasicBlocksCallback.cs | 24 + Function/BNArchitectureSkipAndReturnValue.cs | 36 + Function/BNAreArgumentRegistersSharedIndex.cs | 24 + .../BNAreArgumentRegistersUsedForVarArgs.cs | 24 + Function/BNAreAutoUpdatesEnabled.cs | 20 + Function/BNAreUpdatesAvailable.cs | 34 + Function/BNAssemble.cs | 37 + Function/BNAssignDataBuffer.cs | 29 + ...enticateEnterpriseServerWithCredentials.cs | 31 + ...NAuthenticateEnterpriseServerWithMethod.cs | 28 + Function/BNBasicBlockAddInstructionData.cs | 30 + .../BNBasicBlockAddPendingOutgoingEdge.cs | 36 + Function/BNBasicBlockCanExit.cs | 24 + Function/BNBasicBlockGetInstructionData.cs | 30 + .../BNBasicBlockHasInvalidInstructions.cs | 24 + ...NBasicBlockHasUndeterminedOutgoingEdges.cs | 24 + .../BNBasicBlockIsFallThroughToFunction.cs | 24 + Function/BNBasicBlockSetCanExit.cs | 27 + .../BNBasicBlockSetFallThroughToFunction.cs | 27 + .../BNBasicBlockSetHasInvalidInstructions.cs | 27 + ...NBasicBlockSetUndeterminedOutgoingEdges.cs | 27 + Function/BNBeginBackgroundTask.cs | 27 + Function/BNBeginBulkAddSegments.cs | 24 + Function/BNBeginBulkModifySymbols.cs | 24 + Function/BNBeginKeyValueStoreNamespace.cs | 28 + Function/BNBeginUndoActions.cs | 27 + Function/BNBinaryViewAddExternalLibrary.cs | 34 + Function/BNBinaryViewAddExternalLocation.cs | 40 + Function/BNBinaryViewAttachTypeArchive.cs | 31 + Function/BNBinaryViewDetachTypeArchive.cs | 28 + ...BNBinaryViewDisassociateTypeArchiveType.cs | 28 + .../BNBinaryViewExportObjectToTypeLibrary.cs | 33 + .../BNBinaryViewExportTypeToTypeLibrary.cs | 33 + Function/BNBinaryViewFinalizeNewSegments.cs | 24 + ...yViewGetAssociatedTypeArchiveTypeSource.cs | 34 + ...yViewGetAssociatedTypeArchiveTypeTarget.cs | 34 + ...BinaryViewGetAssociatedTypeArchiveTypes.cs | 34 + ...BinaryViewGetAssociatedTypesFromArchive.cs | 34 + Function/BNBinaryViewGetAutoMetadata.cs | 24 + Function/BNBinaryViewGetExternalLibraries.cs | 27 + Function/BNBinaryViewGetExternalLibrary.cs | 28 + Function/BNBinaryViewGetExternalLocation.cs | 27 + Function/BNBinaryViewGetExternalLocations.cs | 27 + Function/BNBinaryViewGetLoadSettings.cs | 28 + .../BNBinaryViewGetLoadSettingsTypeNames.cs | 27 + Function/BNBinaryViewGetMetadata.cs | 24 + Function/BNBinaryViewGetTypeArchive.cs | 28 + Function/BNBinaryViewGetTypeArchivePath.cs | 28 + .../BNBinaryViewGetTypeArchiveSyncStatus.cs | 28 + .../BNBinaryViewGetTypeArchiveTypeNameList.cs | 27 + .../BNBinaryViewGetTypeArchiveTypeNames.cs | 33 + Function/BNBinaryViewGetTypeArchives.cs | 30 + Function/BNBinaryViewGetTypeNameByGuid.cs | 28 + .../BNBinaryViewImportTypeLibraryObject.cs | 30 + Function/BNBinaryViewImportTypeLibraryType.cs | 30 + ...BNBinaryViewImportTypeLibraryTypeByGuid.cs | 28 + ...BNBinaryViewLookupImportedObjectLibrary.cs | 36 + .../BNBinaryViewLookupImportedTypeLibrary.cs | 33 + Function/BNBinaryViewPullTypeArchiveTypes.cs | 43 + Function/BNBinaryViewPushTypeArchiveTypes.cs | 43 + Function/BNBinaryViewQueryMetadata.cs | 28 + ...BNBinaryViewRecordImportedObjectLibrary.cs | 36 + Function/BNBinaryViewRemoveExternalLibrary.cs | 28 + .../BNBinaryViewRemoveExternalLocation.cs | 27 + Function/BNBinaryViewRemoveMetadata.cs | 28 + Function/BNBinaryViewSetLoadSettings.cs | 31 + Function/BNBinaryViewSetManualDependencies.cs | 37 + Function/BNBinaryViewStoreMetadata.cs | 34 + .../BNCacheHighLevelILPossibleValueSet.cs | 27 + Function/BNCacheLowLevelILPossibleValueSet.cs | 27 + .../BNCacheMediumLevelILPossibleValueSet.cs | 27 + Function/BNCanArchitectureAssemble.cs | 24 + Function/BNCanAssemble.cs | 27 + Function/BNCanCancelBackgroundTask.cs | 24 + Function/BNCanDecode.cs | 27 + Function/BNCanFunctionReturn.cs | 24 + Function/BNCanRedo.cs | 24 + Function/BNCanUndo.cs | 24 + Function/BNCancelAnalysisCompletionEvent.cs | 24 + Function/BNCancelBackgroundTask.cs | 24 + Function/BNCancelBulkAddSegments.cs | 24 + .../BNCancelEnterpriseServerAuthentication.cs | 20 + Function/BNCancelScriptInput.cs | 24 + Function/BNCheckForStringAnnotationType.cs | 42 + .../BNClearBasicBlockPendingOutgoingEdges.cs | 24 + Function/BNClearDataBuffer.cs | 24 + .../BNClearFieldResolutionForVariableAt.cs | 30 + Function/BNClearFlowGraphNodes.cs | 24 + Function/BNClearForcedVariableVersion.cs | 30 + Function/BNClearTypeLibraryPlatforms.cs | 24 + Function/BNClearUndoEntries.cs | 24 + Function/BNClearUserGlobalPointerValue.cs | 24 + Function/BNClearUserVariableValue.cs | 33 + Function/BNCloseFile.cs | 24 + Function/BNCloseLogs.cs | 20 + Function/BNCloseTypeArchive.cs | 24 + Function/BNCollaborationAssignSnapshotMap.cs | 27 + Function/BNCollaborationChangesetGetAuthor.cs | 24 + .../BNCollaborationChangesetGetDatabase.cs | 24 + Function/BNCollaborationChangesetGetFile.cs | 24 + Function/BNCollaborationChangesetGetName.cs | 24 + .../BNCollaborationChangesetGetSnapshotIds.cs | 27 + Function/BNCollaborationChangesetSetName.cs | 28 + Function/BNCollaborationCreateRemote.cs | 28 + Function/BNCollaborationDefaultFilePath.cs | 24 + Function/BNCollaborationDefaultProjectPath.cs | 24 + .../BNCollaborationDeleteDataFromKeychain.cs | 25 + .../BNCollaborationDownloadDatabaseForFile.cs | 37 + Function/BNCollaborationDownloadFile.cs | 34 + .../BNCollaborationDownloadTypeArchive.cs | 37 + Function/BNCollaborationDumpDatabase.cs | 24 + Function/BNCollaborationFreeIdList.cs | 27 + Function/BNCollaborationFreeLazyT.cs | 24 + Function/BNCollaborationFreeSnapshotIdList.cs | 27 + Function/BNCollaborationGetActiveRemote.cs | 20 + .../BNCollaborationGetDataFromKeychain.cs | 31 + ...CollaborationGetLocalSnapshotFromRemote.cs | 31 + ...onGetLocalSnapshotFromRemoteTypeArchive.cs | 27 + Function/BNCollaborationGetRemoteByAddress.cs | 25 + Function/BNCollaborationGetRemoteById.cs | 25 + Function/BNCollaborationGetRemoteByName.cs | 25 + ...laborationGetRemoteFileForLocalDatabase.cs | 27 + ...orationGetRemoteFileForLocalTypeArchive.cs | 24 + ...NCollaborationGetRemoteForLocalDatabase.cs | 27 + ...llaborationGetRemoteForLocalTypeArchive.cs | 24 + ...orationGetRemoteProjectForLocalDatabase.cs | 27 + ...tionGetRemoteProjectForLocalTypeArchive.cs | 24 + ...CollaborationGetRemoteSnapshotFromLocal.cs | 27 + ...onGetRemoteSnapshotFromLocalTypeArchive.cs | 28 + Function/BNCollaborationGetRemotes.cs | 24 + Function/BNCollaborationGetSnapshotAuthor.cs | 31 + Function/BNCollaborationGroupContainsUser.cs | 28 + Function/BNCollaborationGroupGetId.cs | 24 + Function/BNCollaborationGroupGetName.cs | 24 + Function/BNCollaborationGroupGetRemote.cs | 24 + Function/BNCollaborationGroupGetUrl.cs | 24 + Function/BNCollaborationGroupGetUsers.cs | 34 + Function/BNCollaborationGroupSetName.cs | 28 + Function/BNCollaborationGroupSetUsernames.cs | 31 + Function/BNCollaborationHasDataInKeychain.cs | 25 + Function/BNCollaborationIgnoreSnapshot.cs | 27 + .../BNCollaborationIsCollaborationDatabase.cs | 24 + ...CollaborationIsCollaborationTypeArchive.cs | 24 + Function/BNCollaborationIsSnapshotIgnored.cs | 27 + ...llaborationIsTypeArchiveSnapshotIgnored.cs | 28 + Function/BNCollaborationLazyTCreate.cs | 27 + Function/BNCollaborationLazyTDereference.cs | 24 + Function/BNCollaborationLoadRemotes.cs | 20 + Function/BNCollaborationMergeDatabase.cs | 36 + Function/BNCollaborationMergeSnapshots.cs | 39 + Function/BNCollaborationPermissionCanAdmin.cs | 24 + Function/BNCollaborationPermissionCanEdit.cs | 24 + Function/BNCollaborationPermissionCanView.cs | 24 + .../BNCollaborationPermissionGetGroupId.cs | 24 + .../BNCollaborationPermissionGetGroupName.cs | 24 + Function/BNCollaborationPermissionGetId.cs | 24 + Function/BNCollaborationPermissionGetLevel.cs | 24 + .../BNCollaborationPermissionGetProject.cs | 24 + .../BNCollaborationPermissionGetRemote.cs | 24 + Function/BNCollaborationPermissionGetUrl.cs | 24 + .../BNCollaborationPermissionGetUserId.cs | 24 + .../BNCollaborationPermissionGetUsername.cs | 24 + Function/BNCollaborationPermissionSetLevel.cs | 27 + Function/BNCollaborationPullDatabase.cs | 48 + Function/BNCollaborationPullTypeArchive.cs | 42 + Function/BNCollaborationPushDatabase.cs | 36 + Function/BNCollaborationPushTypeArchive.cs | 36 + Function/BNCollaborationRemoveRemote.cs | 24 + Function/BNCollaborationSaveRemotes.cs | 20 + Function/BNCollaborationSetActiveRemote.cs | 24 + Function/BNCollaborationSetSnapshotAuthor.cs | 31 + .../BNCollaborationSnapshotCreateUndoEntry.cs | 34 + Function/BNCollaborationSnapshotDownload.cs | 36 + ...laborationSnapshotDownloadAnalysisCache.cs | 36 + ...llaborationSnapshotDownloadSnapshotFile.cs | 36 + Function/BNCollaborationSnapshotFinalize.cs | 24 + ...borationSnapshotGetAnalysisCacheBuildId.cs | 24 + Function/BNCollaborationSnapshotGetAuthor.cs | 24 + ...NCollaborationSnapshotGetAuthorUsername.cs | 24 + .../BNCollaborationSnapshotGetChildIds.cs | 27 + .../BNCollaborationSnapshotGetChildren.cs | 27 + Function/BNCollaborationSnapshotGetCreated.cs | 24 + .../BNCollaborationSnapshotGetDescription.cs | 24 + Function/BNCollaborationSnapshotGetFile.cs | 24 + Function/BNCollaborationSnapshotGetHash.cs | 24 + Function/BNCollaborationSnapshotGetId.cs | 24 + .../BNCollaborationSnapshotGetLastModified.cs | 24 + Function/BNCollaborationSnapshotGetName.cs | 24 + .../BNCollaborationSnapshotGetParentIds.cs | 27 + Function/BNCollaborationSnapshotGetParents.cs | 27 + Function/BNCollaborationSnapshotGetProject.cs | 24 + Function/BNCollaborationSnapshotGetRemote.cs | 24 + ...ollaborationSnapshotGetSnapshotFileHash.cs | 24 + Function/BNCollaborationSnapshotGetTitle.cs | 24 + .../BNCollaborationSnapshotGetUndoEntries.cs | 27 + ...BNCollaborationSnapshotGetUndoEntryById.cs | 27 + Function/BNCollaborationSnapshotGetUrl.cs | 24 + ...llaborationSnapshotHasPulledUndoEntries.cs | 24 + .../BNCollaborationSnapshotIsFinalized.cs | 24 + .../BNCollaborationSnapshotPullUndoEntries.cs | 30 + .../BNCollaborationStoreDataInKeychain.cs | 34 + Function/BNCollaborationSyncDatabase.cs | 45 + Function/BNCollaborationSyncTypeArchive.cs | 39 + Function/BNCollaborationUndoEntryGetData.cs | 28 + Function/BNCollaborationUndoEntryGetFile.cs | 24 + Function/BNCollaborationUndoEntryGetId.cs | 24 + Function/BNCollaborationUndoEntryGetParent.cs | 24 + .../BNCollaborationUndoEntryGetParentId.cs | 27 + .../BNCollaborationUndoEntryGetProject.cs | 24 + Function/BNCollaborationUndoEntryGetRemote.cs | 24 + .../BNCollaborationUndoEntryGetSnapshot.cs | 24 + Function/BNCollaborationUndoEntryGetUrl.cs | 24 + Function/BNCollaborationUploadDatabase.cs | 42 + Function/BNCollaborationUploadTypeArchive.cs | 42 + Function/BNCollaborationUserGetEmail.cs | 24 + Function/BNCollaborationUserGetId.cs | 24 + Function/BNCollaborationUserGetLastLogin.cs | 24 + Function/BNCollaborationUserGetRemote.cs | 24 + Function/BNCollaborationUserGetUrl.cs | 24 + Function/BNCollaborationUserGetUsername.cs | 24 + Function/BNCollaborationUserIsActive.cs | 24 + Function/BNCollaborationUserSetEmail.cs | 28 + Function/BNCollaborationUserSetIsActive.cs | 27 + Function/BNCollaborationUserSetUsername.cs | 28 + Function/BNCommitUndoActions.cs | 28 + Function/BNCompareLinearViewCursors.cs | 27 + Function/BNCompareLinearViewObjectChildren.cs | 30 + .../BNComponentAddAllMembersFromComponent.cs | 27 + Function/BNComponentAddComponent.cs | 27 + Function/BNComponentAddDataVariable.cs | 27 + Function/BNComponentAddFunctionReference.cs | 27 + Function/BNComponentContainsComponent.cs | 27 + Function/BNComponentContainsDataVariable.cs | 27 + Function/BNComponentContainsFunction.cs | 27 + Function/BNComponentFreeReferencedTypes.cs | 27 + Function/BNComponentGetContainedComponents.cs | 27 + .../BNComponentGetContainedDataVariables.cs | 27 + Function/BNComponentGetContainedFunctions.cs | 27 + Function/BNComponentGetDisplayName.cs | 24 + Function/BNComponentGetGuid.cs | 24 + Function/BNComponentGetOriginalName.cs | 24 + Function/BNComponentGetParent.cs | 24 + .../BNComponentGetReferencedDataVariables.cs | 27 + ...nentGetReferencedDataVariablesRecursive.cs | 27 + Function/BNComponentGetReferencedTypes.cs | 27 + .../BNComponentGetReferencedTypesRecursive.cs | 27 + Function/BNComponentGetView.cs | 24 + Function/BNComponentRemoveAllFunctions.cs | 24 + Function/BNComponentRemoveComponent.cs | 24 + Function/BNComponentRemoveDataVariable.cs | 27 + .../BNComponentRemoveFunctionReference.cs | 27 + Function/BNComponentSetName.cs | 28 + Function/BNComponentsEqual.cs | 27 + Function/BNComponentsNotEqual.cs | 27 + Function/BNConnectEnterpriseServer.cs | 20 + Function/BNConnectWebsocketClient.cs | 40 + Function/BNConvertToNop.cs | 30 + Function/BNCopyFile.cs | 28 + Function/BNCoreEnumFromString.cs | 31 + Function/BNCoreEnumToString.cs | 31 + Function/BNCreateActivity.cs | 31 + Function/BNCreateActivityWithEligibility.cs | 34 + Function/BNCreateAnalysisContext.cs | 20 + Function/BNCreateArrayType.cs | 27 + Function/BNCreateArrayTypeBuilder.cs | 27 + Function/BNCreateAutoStackVariable.cs | 34 + Function/BNCreateAutoVariable.cs | 37 + Function/BNCreateBaseAddressDetection.cs | 24 + Function/BNCreateBinaryDataView.cs | 24 + Function/BNCreateBinaryDataViewFromBuffer.cs | 27 + Function/BNCreateBinaryDataViewFromData.cs | 30 + Function/BNCreateBinaryDataViewFromFile.cs | 27 + .../BNCreateBinaryDataViewFromFilename.cs | 28 + Function/BNCreateBinaryReader.cs | 24 + Function/BNCreateBinaryViewOfType.cs | 27 + Function/BNCreateBinaryWriter.cs | 24 + Function/BNCreateBoolType.cs | 20 + Function/BNCreateBoolTypeBuilder.cs | 20 + Function/BNCreateCallingConvention.cs | 31 + Function/BNCreateComponent.cs | 24 + Function/BNCreateComponentWithName.cs | 28 + Function/BNCreateComponentWithParent.cs | 28 + .../BNCreateComponentWithParentAndName.cs | 31 + Function/BNCreateCustomBinaryView.cs | 33 + Function/BNCreateCustomFlowGraph.cs | 24 + ...ateCustomLanguageRepresentationFunction.cs | 36 + Function/BNCreateCustomPlatform.cs | 31 + Function/BNCreateCustomPlatformWithTypes.cs | 40 + Function/BNCreateDataBuffer.cs | 27 + Function/BNCreateDataRenderer.cs | 24 + Function/BNCreateDatabase.cs | 31 + Function/BNCreateDatabaseWithProgress.cs | 37 + Function/BNCreateDirectory.cs | 28 + Function/BNCreateDisassemblySettings.cs | 20 + Function/BNCreateDisassemblyTextRenderer.cs | 27 + Function/BNCreateDownloadProviderInstance.cs | 24 + Function/BNCreateEnumerationBuilder.cs | 20 + ...CreateEnumerationBuilderFromEnumeration.cs | 24 + Function/BNCreateEnumerationType.cs | 33 + Function/BNCreateEnumerationTypeBuilder.cs | 33 + ...CreateEnumerationTypeBuilderWithBuilder.cs | 33 + Function/BNCreateEnumerationTypeOfWidth.cs | 30 + Function/BNCreateFileMetadata.cs | 20 + Function/BNCreateFirmwareNinja.cs | 24 + Function/BNCreateFirmwareNinjaRelationship.cs | 24 + Function/BNCreateFloatType.cs | 28 + Function/BNCreateFloatTypeBuilder.cs | 28 + Function/BNCreateFlowGraph.cs | 20 + Function/BNCreateFlowGraphNode.cs | 24 + Function/BNCreateForcedVariableVersion.cs | 30 + Function/BNCreateFunctionGraph.cs | 30 + Function/BNCreateFunctionType.cs | 60 + Function/BNCreateFunctionTypeBuilder.cs | 60 + ...reateHighLevelILDisassemblyTextRenderer.cs | 27 + Function/BNCreateHighLevelILFunction.cs | 27 + Function/BNCreateHighLevelILFunctionGraph.cs | 27 + ...CreateHighLevelILImmediateFunctionGraph.cs | 27 + Function/BNCreateImmediateFunctionGraph.cs | 30 + Function/BNCreateIntegerType.cs | 31 + Function/BNCreateIntegerTypeBuilder.cs | 31 + Function/BNCreateKeyValueStore.cs | 20 + .../BNCreateKeyValueStoreFromDataBuffer.cs | 24 + .../BNCreateLanguageRepresentationFunction.cs | 33 + Function/BNCreateLinearViewCursor.cs | 24 + Function/BNCreateLinearViewDataOnly.cs | 27 + Function/BNCreateLinearViewDisassembly.cs | 27 + Function/BNCreateLinearViewHighLevelIL.cs | 27 + .../BNCreateLinearViewHighLevelILSSAForm.cs | 27 + ...NCreateLinearViewLanguageRepresentation.cs | 31 + Function/BNCreateLinearViewLiftedIL.cs | 27 + Function/BNCreateLinearViewLowLevelIL.cs | 27 + .../BNCreateLinearViewLowLevelILSSAForm.cs | 27 + .../BNCreateLinearViewMappedMediumLevelIL.cs | 27 + ...ateLinearViewMappedMediumLevelILSSAForm.cs | 27 + Function/BNCreateLinearViewMediumLevelIL.cs | 27 + .../BNCreateLinearViewMediumLevelILSSAForm.cs | 27 + ...eateLinearViewSingleFunctionDisassembly.cs | 27 + ...eateLinearViewSingleFunctionHighLevelIL.cs | 27 + ...earViewSingleFunctionHighLevelILSSAForm.cs | 27 + ...iewSingleFunctionLanguageRepresentation.cs | 31 + ...NCreateLinearViewSingleFunctionLiftedIL.cs | 27 + ...reateLinearViewSingleFunctionLowLevelIL.cs | 27 + ...nearViewSingleFunctionLowLevelILSSAForm.cs | 27 + ...arViewSingleFunctionMappedMediumLevelIL.cs | 27 + ...ingleFunctionMappedMediumLevelILSSAForm.cs | 27 + ...teLinearViewSingleFunctionMediumLevelIL.cs | 27 + ...rViewSingleFunctionMediumLevelILSSAForm.cs | 27 + ...CreateLowLevelILDisassemblyTextRenderer.cs | 27 + Function/BNCreateLowLevelILFunction.cs | 27 + Function/BNCreateLowLevelILFunctionGraph.cs | 27 + ...NCreateLowLevelILImmediateFunctionGraph.cs | 27 + ...ateMediumLevelILDisassemblyTextRenderer.cs | 27 + Function/BNCreateMediumLevelILFunction.cs | 30 + .../BNCreateMediumLevelILFunctionGraph.cs | 27 + ...eateMediumLevelILImmediateFunctionGraph.cs | 27 + Function/BNCreateMetadataArray.cs | 27 + Function/BNCreateMetadataBooleanData.cs | 24 + Function/BNCreateMetadataBooleanListData.cs | 27 + Function/BNCreateMetadataDoubleData.cs | 24 + Function/BNCreateMetadataDoubleListData.cs | 27 + Function/BNCreateMetadataOfType.cs | 24 + Function/BNCreateMetadataRawData.cs | 27 + Function/BNCreateMetadataSignedIntegerData.cs | 24 + .../BNCreateMetadataSignedIntegerListData.cs | 27 + Function/BNCreateMetadataStringData.cs | 25 + Function/BNCreateMetadataStringListData.cs | 28 + .../BNCreateMetadataUnsignedIntegerData.cs | 24 + ...BNCreateMetadataUnsignedIntegerListData.cs | 27 + Function/BNCreateMetadataValueStore.cs | 31 + Function/BNCreateNamedType.cs | 31 + Function/BNCreateNamedTypeBuilder.cs | 31 + Function/BNCreateNamedTypeReference.cs | 36 + Function/BNCreateNamedTypeReferenceBuilder.cs | 36 + ...CreateNamedTypeReferenceBuilderFromType.cs | 27 + ...eNamedTypeReferenceBuilderFromTypeAndId.cs | 31 + ...ateNamedTypeReferenceBuilderWithBuilder.cs | 36 + .../BNCreateNamedTypeReferenceFromType.cs | 27 + ...BNCreateNamedTypeReferenceFromTypeAndId.cs | 31 + Function/BNCreatePlatform.cs | 28 + Function/BNCreatePlatformWithTypes.cs | 37 + Function/BNCreatePointerType.cs | 36 + Function/BNCreatePointerTypeBuilder.cs | 36 + Function/BNCreatePointerTypeBuilderOfWidth.cs | 36 + Function/BNCreatePointerTypeOfWidth.cs | 37 + Function/BNCreateProject.cs | 28 + Function/BNCreateRelocationHandler.cs | 24 + Function/BNCreateReportCollection.cs | 20 + Function/BNCreateRepositoryManager.cs | 25 + Function/BNCreateSaveSettings.cs | 20 + Function/BNCreateScriptingProviderInstance.cs | 24 + Function/BNCreateSegment.cs | 39 + Function/BNCreateSettings.cs | 25 + Function/BNCreateSnapshotedView.cs | 28 + .../BNCreateSnapshotedViewWithProgress.cs | 34 + Function/BNCreateStructureBuilder.cs | 20 + .../BNCreateStructureBuilderFromStructure.cs | 24 + .../BNCreateStructureBuilderWithOptions.cs | 27 + Function/BNCreateStructureFromOffsetAccess.cs | 30 + Function/BNCreateStructureMemberFromAccess.cs | 30 + Function/BNCreateStructureType.cs | 24 + Function/BNCreateStructureTypeBuilder.cs | 24 + ...BNCreateStructureTypeBuilderWithBuilder.cs | 24 + Function/BNCreateSymbol.cs | 46 + Function/BNCreateSymbolQueue.cs | 20 + Function/BNCreateTag.cs | 28 + Function/BNCreateTagType.cs | 24 + Function/BNCreateTemporaryFile.cs | 20 + Function/BNCreateTemporaryFileWithContents.cs | 24 + Function/BNCreateTransformSession.cs | 25 + .../BNCreateTransformSessionFromBinaryView.cs | 24 + ...eTransformSessionFromBinaryViewWithMode.cs | 27 + Function/BNCreateTransformSessionWithMode.cs | 28 + Function/BNCreateTypeArchive.cs | 28 + Function/BNCreateTypeArchiveWithId.cs | 31 + Function/BNCreateTypeBuilderFromType.cs | 24 + Function/BNCreateUserFunction.cs | 30 + Function/BNCreateUserStackVariable.cs | 34 + Function/BNCreateUserVariable.cs | 37 + Function/BNCreateValueType.cs | 25 + Function/BNCreateValueTypeBuilder.cs | 25 + Function/BNCreateVarArgsType.cs | 20 + Function/BNCreateVarArgsTypeBuilder.cs | 20 + Function/BNCreateVoidType.cs | 23 + Function/BNCreateVoidTypeBuilder.cs | 20 + Function/BNCreateWebsocketProviderClient.cs | 24 + Function/BNCreateWideCharType.cs | 28 + Function/BNCreateWideCharTypeBuilder.cs | 28 + Function/BNCreateWorkflow.cs | 25 + Function/BNDataBufferToBase64.cs | 24 + Function/BNDataBufferToEscapedString.cs | 30 + Function/BNDatabaseHasGlobal.cs | 28 + Function/BNDatabaseReloadConnection.cs | 24 + Function/BNDeauthenticateEnterpriseServer.cs | 20 + Function/BNDecode.cs | 36 + Function/BNDecodeBase64.cs | 25 + Function/BNDecodeEscapedString.cs | 26 + Function/BNDecodeWithContext.cs | 33 + Function/BNDefaultDisassemblySettings.cs | 20 + Function/BNDefaultGraphDisassemblySettings.cs | 20 + .../BNDefaultLinearDisassemblySettings.cs | 20 + Function/BNDefineAnalysisType.cs | 34 + Function/BNDefineAnalysisTypes.cs | 42 + Function/BNDefineAutoSymbol.cs | 27 + ...BNDefineAutoSymbolAndVariableOrFunction.cs | 33 + Function/BNDefineDataVariable.cs | 30 + Function/BNDefineImportedFunction.cs | 33 + Function/BNDefineRelocation.cs | 36 + Function/BNDefineSymbolRelocation.cs | 38 + Function/BNDefineUserAnalysisType.cs | 30 + Function/BNDefineUserAnalysisTypes.cs | 36 + Function/BNDefineUserDataVariable.cs | 30 + Function/BNDefineUserSymbol.cs | 27 + Function/BNDeleteAutoStackVariable.cs | 29 + Function/BNDeleteDirectory.cs | 26 + Function/BNDeleteFile.cs | 26 + Function/BNDeleteSecretsProviderData.cs | 29 + Function/BNDeleteTypeArchiveType.cs | 29 + Function/BNDeleteUserStackVariable.cs | 29 + Function/BNDeleteUserVariable.cs | 29 + Function/BNDemangleGNU3.cs | 41 + Function/BNDemangleGNU3WithOptions.cs | 41 + Function/BNDemangleGeneric.cs | 41 + Function/BNDemangleLLVM.cs | 35 + Function/BNDemangleLLVMWithOptions.cs | 35 + Function/BNDemangleMS.cs | 41 + Function/BNDemangleMSPlatform.cs | 41 + Function/BNDemangleMSWithOptions.cs | 41 + Function/BNDemanglerDemangle.cs | 41 + Function/BNDeserializeSettings.cs | 37 + Function/BNDestroySymbolQueue.cs | 26 + Function/BNDetectBaseAddress.cs | 29 + Function/BNDetectSearchMode.cs | 36 + Function/BNDisablePlugins.cs | 28 + .../BNDisassemblyTextRendererHasDataFlow.cs | 26 + .../BNDisassemblyTextRendererWrapComment.cs | 44 + Function/BNDisconnectWebsocketClient.cs | 26 + Function/BNDuplicateDataBuffer.cs | 26 + Function/BNDuplicateDisassemblySettings.cs | 26 + Function/BNDuplicateEnumerationBuilder.cs | 26 + Function/BNDuplicateLinearViewCursor.cs | 24 + Function/BNDuplicateStringRef.cs | 26 + Function/BNDuplicateStructureBuilder.cs | 26 + Function/BNDuplicateType.cs | 26 + Function/BNDuplicateTypeBuilder.cs | 26 + Function/BNDuplicateTypeContainer.cs | 24 + Function/BNDuplicateTypeLibrary.cs | 26 + Function/BNEncode.cs | 36 + Function/BNEndBulkAddSegments.cs | 24 + Function/BNEndBulkModifySymbols.cs | 24 + Function/BNEndKeyValueStoreNamespace.cs | 24 + Function/BNEnumerateTypesForAccess.cs | 44 + Function/BNEscapeTypeName.cs | 29 + Function/BNExecuteMainThreadAction.cs | 26 + Function/BNExecuteOnMainThread.cs | 29 + Function/BNExecuteOnMainThreadAndWait.cs | 29 + Function/BNExecuteScriptInput.cs | 29 + Function/BNExecuteScriptInputFromFilename.cs | 29 + Function/BNExecuteWorkerProcess.cs | 44 + Function/BNExternalLibraryGetBackingFile.cs | 26 + Function/BNExternalLibraryGetName.cs | 24 + Function/BNExternalLibrarySetBackingFile.cs | 29 + .../BNExternalLocationGetExternalLibrary.cs | 26 + Function/BNExternalLocationGetSourceSymbol.cs | 26 + .../BNExternalLocationGetTargetAddress.cs | 26 + Function/BNExternalLocationGetTargetSymbol.cs | 26 + .../BNExternalLocationHasTargetAddress.cs | 26 + Function/BNExternalLocationHasTargetSymbol.cs | 26 + .../BNExternalLocationSetExternalLibrary.cs | 29 + .../BNExternalLocationSetTargetAddress.cs | 29 + Function/BNExternalLocationSetTargetSymbol.cs | 29 + Function/BNFileMetadataGetSessionId.cs | 24 + Function/BNFileSize.cs | 29 + Function/BNFinalizeArchitectureHook.cs | 24 + Function/BNFinalizeEnumerationBuilder.cs | 24 + Function/BNFinalizeHighLevelILFunction.cs | 26 + Function/BNFinalizeLowLevelILFunction.cs | 24 + Function/BNFinalizeMediumLevelILFunction.cs | 24 + .../BNFinalizeNamedTypeReferenceBuilder.cs | 26 + Function/BNFinalizeStructureBuilder.cs | 24 + Function/BNFinalizeTypeBuilder.cs | 24 + Function/BNFinalizeTypeLibrary.cs | 24 + Function/BNFindAllConstantWithProgress.cs | 51 + Function/BNFindAllDataWithProgress.cs | 48 + Function/BNFindAllTextWithProgress.cs | 55 + Function/BNFindNextConstant.cs | 39 + Function/BNFindNextConstantWithProgress.cs | 48 + Function/BNFindNextData.cs | 36 + Function/BNFindNextDataWithProgress.cs | 46 + Function/BNFindNextText.cs | 43 + Function/BNFindNextTextWithProgress.cs | 52 + Function/BNFinishBackgroundTask.cs | 24 + Function/BNFinishPrepareForLayout.cs | 26 + Function/BNFirmwareNinjaAddRelationship.cs | 29 + .../BNFirmwareNinjaFindSectionsWithEntropy.cs | 41 + .../BNFirmwareNinjaFreeBoardDeviceAccesses.cs | 29 + Function/BNFirmwareNinjaFreeBoardNames.cs | 29 + Function/BNFirmwareNinjaFreeDevices.cs | 29 + ...FirmwareNinjaFreeFunctionMemoryAccesses.cs | 29 + Function/BNFirmwareNinjaFreeRelationships.cs | 29 + Function/BNFirmwareNinjaFreeSections.cs | 29 + .../BNFirmwareNinjaGetAddressReferenceTree.cs | 38 + .../BNFirmwareNinjaGetBoardDeviceAccesses.cs | 38 + ...NFirmwareNinjaGetFunctionMemoryAccesses.cs | 35 + ...rmwareNinjaGetMemoryRegionReferenceTree.cs | 41 + .../BNFirmwareNinjaGetRelationshipByGuid.cs | 29 + Function/BNFirmwareNinjaQueryBoardDevices.cs | 35 + ...wareNinjaQueryBoardNamesForArchitecture.cs | 32 + Function/BNFirmwareNinjaQueryCustomDevices.cs | 29 + ...QueryFunctionMemoryAccessesFromMetadata.cs | 29 + Function/BNFirmwareNinjaQueryRelationships.cs | 29 + ...BNFirmwareNinjaReferenceNodeGetChildren.cs | 29 + ...rmwareNinjaReferenceNodeGetDataVariable.cs | 29 + ...BNFirmwareNinjaReferenceNodeGetFunction.cs | 26 + ...BNFirmwareNinjaReferenceNodeHasChildren.cs | 26 + ...irmwareNinjaReferenceNodeIsDataVariable.cs | 26 + .../BNFirmwareNinjaReferenceNodeIsFunction.cs | 26 + ...FirmwareNinjaRelationshipGetDescription.cs | 26 + .../BNFirmwareNinjaRelationshipGetGuid.cs | 26 + ...mwareNinjaRelationshipGetPrimaryAddress.cs | 29 + ...NinjaRelationshipGetPrimaryDataVariable.cs | 29 + ...wareNinjaRelationshipGetPrimaryFunction.cs | 26 + ...NFirmwareNinjaRelationshipGetProvenance.cs | 26 + ...areNinjaRelationshipGetSecondaryAddress.cs | 29 + ...njaRelationshipGetSecondaryDataVariable.cs | 29 + ...tionshipGetSecondaryExternalProjectFile.cs | 26 + ...aRelationshipGetSecondaryExternalSymbol.cs | 26 + ...reNinjaRelationshipGetSecondaryFunction.cs | 26 + ...rmwareNinjaRelationshipPrimaryIsAddress.cs | 26 + ...eNinjaRelationshipPrimaryIsDataVariable.cs | 26 + ...mwareNinjaRelationshipPrimaryIsFunction.cs | 26 + ...wareNinjaRelationshipSecondaryIsAddress.cs | 26 + ...injaRelationshipSecondaryIsDataVariable.cs | 26 + ...aRelationshipSecondaryIsExternalAddress.cs | 26 + ...jaRelationshipSecondaryIsExternalSymbol.cs | 26 + ...areNinjaRelationshipSecondaryIsFunction.cs | 26 + ...FirmwareNinjaRelationshipSetDescription.cs | 29 + ...mwareNinjaRelationshipSetPrimaryAddress.cs | 29 + ...NinjaRelationshipSetPrimaryDataVariable.cs | 29 + ...wareNinjaRelationshipSetPrimaryFunction.cs | 29 + ...NFirmwareNinjaRelationshipSetProvenance.cs | 29 + ...areNinjaRelationshipSetSecondaryAddress.cs | 29 + ...njaRelationshipSetSecondaryDataVariable.cs | 29 + ...RelationshipSetSecondaryExternalAddress.cs | 32 + ...aRelationshipSetSecondaryExternalSymbol.cs | 32 + ...reNinjaRelationshipSetSecondaryFunction.cs | 29 + Function/BNFirmwareNinjaRemoveCustomDevice.cs | 29 + ...BNFirmwareNinjaRemoveRelationshipByGuid.cs | 29 + Function/BNFirmwareNinjaStoreCustomDevice.cs | 38 + ...jaStoreFunctionMemoryAccessesToMetadata.cs | 32 + Function/BNFlowGraphHasNodes.cs | 24 + Function/BNFlowGraphHasUpdates.cs | 26 + Function/BNFlowGraphLayoutLayout.cs | 35 + .../BNFlowGraphNodeSetOutgoingEdgePoints.cs | 33 + .../BNFlowGraphNodeSetVisibilityRegion.cs | 36 + Function/BNFlowGraphNodeSetX.cs | 27 + Function/BNFlowGraphNodeSetY.cs | 27 + Function/BNFlowGraphSetHeight.cs | 27 + Function/BNFlowGraphSetWidth.cs | 27 + Function/BNFlowGraphUpdateQueryMode.cs | 26 + Function/BNForgetUndoActions.cs | 28 + Function/BNFormatLines.cs | 38 + Function/BNFormatTypeParserParseErrors.cs | 29 + Function/BNFreeActivity.cs | 26 + Function/BNFreeAddressList.cs | 24 + Function/BNFreeAddressRanges.cs | 24 + Function/BNFreeAllTypeFieldReferences.cs | 26 + Function/BNFreeAllTypeReferences.cs | 26 + Function/BNFreeAnalysisCompletionEvent.cs | 26 + Function/BNFreeAnalysisContext.cs | 26 + Function/BNFreeAnalysisInfo.cs | 24 + Function/BNFreeAnalysisMergeConflict.cs | 26 + Function/BNFreeAnalysisMergeConflictList.cs | 29 + ...BNFreeAnalysisMergeConflictSplitterList.cs | 29 + Function/BNFreeAnalysisPerformanceInfo.cs | 29 + Function/BNFreeArchitectureAndAddressList.cs | 24 + Function/BNFreeArchitectureList.cs | 26 + Function/BNFreeBackgroundTask.cs | 26 + Function/BNFreeBackgroundTaskList.cs | 27 + Function/BNFreeBaseAddressDetection.cs | 26 + Function/BNFreeBaseAddressDetectionReasons.cs | 26 + Function/BNFreeBaseStructureList.cs | 27 + Function/BNFreeBasicBlock.cs | 26 + Function/BNFreeBasicBlockEdgeList.cs | 27 + Function/BNFreeBasicBlockList.cs | 27 + Function/BNFreeBinaryReader.cs | 26 + Function/BNFreeBinaryView.cs | 26 + Function/BNFreeBinaryViewTypeList.cs | 24 + Function/BNFreeBinaryWriter.cs | 26 + Function/BNFreeCallingConvention.cs | 26 + Function/BNFreeCallingConventionList.cs | 27 + Function/BNFreeCodeReferences.cs | 27 + Function/BNFreeCollaborationChangeset.cs | 26 + Function/BNFreeCollaborationChangesetList.cs | 29 + Function/BNFreeCollaborationGroup.cs | 26 + Function/BNFreeCollaborationGroupList.cs | 29 + Function/BNFreeCollaborationPermission.cs | 26 + Function/BNFreeCollaborationPermissionList.cs | 29 + Function/BNFreeCollaborationSnapshot.cs | 26 + Function/BNFreeCollaborationSnapshotList.cs | 29 + Function/BNFreeCollaborationUndoEntry.cs | 26 + Function/BNFreeCollaborationUndoEntryList.cs | 29 + Function/BNFreeCollaborationUser.cs | 26 + Function/BNFreeCollaborationUserList.cs | 29 + Function/BNFreeComponent.cs | 26 + Function/BNFreeComponents.cs | 27 + Function/BNFreeConstantReferenceList.cs | 26 + Function/BNFreeDataBuffer.cs | 26 + Function/BNFreeDataReferences.cs | 24 + Function/BNFreeDataRenderer.cs | 26 + Function/BNFreeDataVariable.cs | 24 + Function/BNFreeDataVariableAndName.cs | 26 + ...eeDataVariableAndNameAndDebugParserList.cs | 29 + Function/BNFreeDataVariables.cs | 27 + Function/BNFreeDataVariablesAndName.cs | 29 + Function/BNFreeDatabase.cs | 26 + Function/BNFreeDebugFunctions.cs | 29 + Function/BNFreeDebugInfoParserList.cs | 29 + Function/BNFreeDebugInfoParserReference.cs | 26 + Function/BNFreeDebugInfoReference.cs | 26 + Function/BNFreeDebugTypes.cs | 29 + Function/BNFreeDemangledName.cs | 29 + Function/BNFreeDemanglerList.cs | 26 + Function/BNFreeDisassemblySettings.cs | 26 + Function/BNFreeDisassemblyTextLines.cs | 29 + Function/BNFreeDisassemblyTextRenderer.cs | 26 + Function/BNFreeDownloadInstance.cs | 26 + Function/BNFreeDownloadInstanceResponse.cs | 26 + Function/BNFreeDownloadProviderList.cs | 26 + Function/BNFreeEnumeration.cs | 26 + Function/BNFreeEnumerationBuilder.cs | 26 + Function/BNFreeEnumerationMemberList.cs | 27 + Function/BNFreeExternalLibrary.cs | 26 + Function/BNFreeExternalLibraryList.cs | 27 + Function/BNFreeExternalLocation.cs | 26 + Function/BNFreeExternalLocationList.cs | 29 + Function/BNFreeFieldResolutionInfo.cs | 26 + Function/BNFreeFileMetadata.cs | 26 + Function/BNFreeFirmwareNinja.cs | 26 + Function/BNFreeFirmwareNinjaReferenceNode.cs | 26 + Function/BNFreeFirmwareNinjaReferenceNodes.cs | 29 + Function/BNFreeFirmwareNinjaRelationship.cs | 26 + ...NFreeFlagConditionsForSemanticFlagGroup.cs | 26 + Function/BNFreeFlowGraph.cs | 26 + Function/BNFreeFlowGraphLayoutList.cs | 26 + Function/BNFreeFlowGraphLayoutRequest.cs | 26 + Function/BNFreeFlowGraphNode.cs | 26 + Function/BNFreeFlowGraphNodeEdgeList.cs | 27 + Function/BNFreeFlowGraphNodeList.cs | 27 + Function/BNFreeFormInputResults.cs | 27 + Function/BNFreeFullInfoUpdateChannels.cs | 29 + Function/BNFreeFunction.cs | 26 + Function/BNFreeFunctionList.cs | 27 + Function/BNFreeHighLevelILFunction.cs | 26 + Function/BNFreeHighLevelILTokenEmitter.cs | 26 + Function/BNFreeILBranchDependenceList.cs | 24 + Function/BNFreeILInstructionList.cs | 24 + Function/BNFreeILReferences.cs | 27 + Function/BNFreeIndirectBranchList.cs | 24 + Function/BNFreeInheritedStructureMember.cs | 26 + .../BNFreeInheritedStructureMemberList.cs | 29 + Function/BNFreeInstructionText.cs | 27 + Function/BNFreeInstructionTextLines.cs | 29 + Function/BNFreeKeyValueStore.cs | 26 + Function/BNFreeLLILVariableVersionList.cs | 26 + Function/BNFreeLLILVariablesList.cs | 26 + .../BNFreeLanguageRepresentationFunction.cs | 26 + ...eLanguageRepresentationFunctionTypeList.cs | 26 + Function/BNFreeLineFormatterList.cs | 26 + Function/BNFreeLineFormatterSettings.cs | 26 + Function/BNFreeLinearDisassemblyLines.cs | 27 + Function/BNFreeLinearViewCursor.cs | 26 + Function/BNFreeLinearViewCursorPath.cs | 27 + Function/BNFreeLinearViewCursorPathObjects.cs | 29 + Function/BNFreeLinearViewObject.cs | 26 + Function/BNFreeLinearViewObjectIdentifier.cs | 24 + Function/BNFreeLogger.cs | 26 + Function/BNFreeLowLevelILFunction.cs | 26 + Function/BNFreeMainThreadAction.cs | 26 + Function/BNFreeMediumLevelILFunction.cs | 26 + Function/BNFreeMemoryUsageInfo.cs | 29 + Function/BNFreeMergedVariableList.cs | 29 + Function/BNFreeMetadata.cs | 26 + Function/BNFreeMetadataArray.cs | 24 + Function/BNFreeMetadataBooleanList.cs | 29 + Function/BNFreeMetadataDoubleList.cs | 27 + Function/BNFreeMetadataRaw.cs | 26 + Function/BNFreeMetadataSignedIntegerList.cs | 27 + Function/BNFreeMetadataStringList.cs | 27 + Function/BNFreeMetadataUnsignedIntegerList.cs | 27 + Function/BNFreeMetadataValueStore.cs | 24 + Function/BNFreeNameAndTypeList.cs | 27 + Function/BNFreeNameSpace.cs | 24 + Function/BNFreeNameSpaceList.cs | 29 + Function/BNFreeNamedTypeReference.cs | 26 + Function/BNFreeNamedTypeReferenceBuilder.cs | 26 + Function/BNFreeOutputTypeList.cs | 27 + Function/BNFreeParameterVariables.cs | 26 + Function/BNFreeParseError.cs | 24 + Function/BNFreePath.cs | 26 + Function/BNFreePendingBasicBlockEdgeList.cs | 24 + Function/BNFreePlatform.cs | 26 + Function/BNFreePlatformList.cs | 27 + Function/BNFreePlatformOSList.cs | 27 + Function/BNFreePlugin.cs | 26 + Function/BNFreePluginCommandList.cs | 24 + Function/BNFreePluginPlatforms.cs | 29 + Function/BNFreePluginTypes.cs | 26 + Function/BNFreePointerSuffixList.cs | 27 + Function/BNFreePossibleValueSet.cs | 24 + Function/BNFreeProject.cs | 26 + Function/BNFreeProjectFile.cs | 26 + Function/BNFreeProjectFileList.cs | 29 + Function/BNFreeProjectFolder.cs | 26 + Function/BNFreeProjectFolderList.cs | 29 + Function/BNFreeProjectList.cs | 29 + Function/BNFreeQualifiedName.cs | 24 + Function/BNFreeQualifiedNameAndType.cs | 24 + Function/BNFreeQualifiedNameAndTypeArray.cs | 27 + Function/BNFreeQualifiedNameArray.cs | 29 + Function/BNFreeQualifiedNameTypeAndId.cs | 26 + Function/BNFreeRegisterList.cs | 24 + Function/BNFreeRegisterSet.cs | 26 + Function/BNFreeRegisterStackAdjustments.cs | 26 + Function/BNFreeRelocation.cs | 26 + Function/BNFreeRelocationHandler.cs | 26 + Function/BNFreeRelocationList.cs | 29 + Function/BNFreeRelocationRanges.cs | 24 + Function/BNFreeRemote.cs | 26 + Function/BNFreeRemoteFile.cs | 26 + Function/BNFreeRemoteFileList.cs | 29 + Function/BNFreeRemoteFolder.cs | 26 + Function/BNFreeRemoteFolderList.cs | 29 + Function/BNFreeRemoteList.cs | 29 + Function/BNFreeRemoteProject.cs | 26 + Function/BNFreeRemoteProjectList.cs | 29 + Function/BNFreeRenderLayerList.cs | 24 + Function/BNFreeReportCollection.cs | 26 + Function/BNFreeRepository.cs | 26 + Function/BNFreeRepositoryManager.cs | 26 + ...BNFreeRepositoryManagerRepositoriesList.cs | 26 + Function/BNFreeRepositoryPluginList.cs | 26 + Function/BNFreeSaveSettings.cs | 26 + Function/BNFreeScriptingInstance.cs | 26 + Function/BNFreeScriptingProviderList.cs | 26 + Function/BNFreeSecretsProviderList.cs | 26 + Function/BNFreeSection.cs | 26 + Function/BNFreeSectionList.cs | 29 + Function/BNFreeSegment.cs | 26 + Function/BNFreeSegmentList.cs | 29 + Function/BNFreeSettings.cs | 26 + Function/BNFreeSnapshot.cs | 26 + Function/BNFreeSnapshotList.cs | 29 + Function/BNFreeStackVariableReferenceList.cs | 29 + Function/BNFreeString.cs | 24 + Function/BNFreeStringList.cs | 27 + Function/BNFreeStringRef.cs | 26 + Function/BNFreeStringReferenceList.cs | 24 + Function/BNFreeStructure.cs | 26 + Function/BNFreeStructureBuilder.cs | 26 + Function/BNFreeStructureMember.cs | 24 + Function/BNFreeStructureMemberList.cs | 27 + Function/BNFreeSymbol.cs | 26 + Function/BNFreeSymbolList.cs | 27 + Function/BNFreeSymbolRawBytes.cs | 24 + Function/BNFreeSystemCallList.cs | 29 + Function/BNFreeTag.cs | 26 + Function/BNFreeTagList.cs | 29 + Function/BNFreeTagReferenceTypeCounts.cs | 32 + Function/BNFreeTagReferences.cs | 29 + Function/BNFreeTagType.cs | 26 + Function/BNFreeTagTypeList.cs | 27 + Function/BNFreeTemporaryFile.cs | 26 + Function/BNFreeTransformContext.cs | 26 + Function/BNFreeTransformContextList.cs | 27 + Function/BNFreeTransformParameterList.cs | 27 + Function/BNFreeTransformSession.cs | 26 + Function/BNFreeTransformTypeList.cs | 24 + Function/BNFreeType.cs | 26 + Function/BNFreeTypeAndNameList.cs | 27 + Function/BNFreeTypeArchiveList.cs | 29 + Function/BNFreeTypeArchiveMergeConflict.cs | 26 + .../BNFreeTypeArchiveMergeConflictList.cs | 29 + Function/BNFreeTypeArchiveReference.cs | 24 + Function/BNFreeTypeAttributeList.cs | 29 + Function/BNFreeTypeBuilder.cs | 26 + Function/BNFreeTypeContainer.cs | 26 + Function/BNFreeTypeDefinitionLineList.cs | 29 + Function/BNFreeTypeFieldReferenceSizeInfo.cs | 29 + Function/BNFreeTypeFieldReferenceSizes.cs | 27 + Function/BNFreeTypeFieldReferenceTypeInfo.cs | 29 + Function/BNFreeTypeFieldReferenceTypes.cs | 27 + Function/BNFreeTypeFieldReferences.cs | 29 + Function/BNFreeTypeIdList.cs | 29 + Function/BNFreeTypeLibrary.cs | 26 + Function/BNFreeTypeLibraryList.cs | 27 + Function/BNFreeTypeList.cs | 27 + Function/BNFreeTypeNameList.cs | 27 + Function/BNFreeTypeParameterList.cs | 29 + Function/BNFreeTypeParserErrors.cs | 29 + Function/BNFreeTypeParserList.cs | 26 + Function/BNFreeTypeParserResult.cs | 24 + Function/BNFreeTypePrinterList.cs | 26 + Function/BNFreeTypeReferences.cs | 29 + Function/BNFreeUndoAction.cs | 26 + Function/BNFreeUndoActionList.cs | 29 + Function/BNFreeUndoEntries.cs | 29 + Function/BNFreeUndoEntry.cs | 26 + Function/BNFreeUndoEntryList.cs | 27 + Function/BNFreeUnicodeBlockList.cs | 35 + Function/BNFreeUnicodeRangeList.cs | 29 + Function/BNFreeUpdateChannelList.cs | 29 + Function/BNFreeUpdateChannelVersionList.cs | 29 + Function/BNFreeUser.cs | 26 + Function/BNFreeUserList.cs | 29 + Function/BNFreeUserVariableValues.cs | 26 + Function/BNFreeVariableFieldResolutions.cs | 29 + Function/BNFreeVariableList.cs | 24 + Function/BNFreeVariableNameAndType.cs | 26 + Function/BNFreeVariableNameAndTypeList.cs | 27 + Function/BNFreeVariableReferenceSourceList.cs | 27 + Function/BNFreeWebsocketClient.cs | 26 + Function/BNFreeWebsocketProviderList.cs | 26 + Function/BNFreeWorkflow.cs | 26 + Function/BNFreeWorkflowList.cs | 27 + Function/BNFromVariableIdentifier.cs | 24 + Function/BNFunctionCheckForDebugReport.cs | 29 + Function/BNFunctionCollapseRegion.cs | 29 + Function/BNFunctionExpandAll.cs | 26 + Function/BNFunctionExpandRegion.cs | 29 + Function/BNFunctionGetAutoMetadata.cs | 26 + Function/BNFunctionGetMetadata.cs | 26 + .../BNFunctionHasExplicitlyDefinedType.cs | 24 + Function/BNFunctionHasUserAnnotations.cs | 24 + Function/BNFunctionHasUserType.cs | 24 + Function/BNFunctionHasVariableArguments.cs | 24 + Function/BNFunctionIsRegionCollapsed.cs | 29 + Function/BNFunctionQueryMetadata.cs | 29 + Function/BNFunctionRemoveMetadata.cs | 29 + Function/BNFunctionStoreMetadata.cs | 35 + Function/BNFunctionToggleRegion.cs | 29 + Function/BNFunctionTypeBuilderCanReturn.cs | 24 + Function/BNFunctionTypeCanReturn.cs | 26 + .../BNFunctionUsesIncomingGlobalPointer.cs | 26 + Function/BNFuzzyMatchSingle.cs | 29 + Function/BNGenerateAutoDebugTypeId.cs | 40 + Function/BNGenerateAutoDemangledTypeId.cs | 41 + Function/BNGenerateAutoPlatformTypeId.cs | 29 + Function/BNGenerateAutoTypeId.cs | 44 + Function/BNGenerateHighLevelILSSAForm.cs | 30 + Function/BNGenerateLowLevelILSSAForm.cs | 24 + Function/BNGenerateMediumLevelILSSAForm.cs | 42 + Function/BNGetActiveMemoryRegionAt.cs | 29 + Function/BNGetActiveUpdateChannel.cs | 23 + Function/BNGetAddressForDataOffset.cs | 30 + Function/BNGetAddressInput.cs | 58 + Function/BNGetAddressRenderedWidth.cs | 26 + Function/BNGetAddressTagReferences.cs | 27 + Function/BNGetAddressTags.cs | 33 + Function/BNGetAddressTagsInRange.cs | 36 + Function/BNGetAddressTagsOfType.cs | 38 + Function/BNGetAllAddressTagReferences.cs | 27 + .../BNGetAllArchitectureFlagWriteTypes.cs | 27 + Function/BNGetAllArchitectureFlags.cs | 27 + Function/BNGetAllArchitectureIntrinsics.cs | 27 + .../BNGetAllArchitectureRegisterStacks.cs | 29 + Function/BNGetAllArchitectureRegisters.cs | 27 + ...BNGetAllArchitectureSemanticFlagClasses.cs | 27 + .../BNGetAllArchitectureSemanticFlagGroups.cs | 27 + Function/BNGetAllEntryFunctions.cs | 27 + Function/BNGetAllFieldsReferenced.cs | 30 + Function/BNGetAllFunctionTagReferences.cs | 27 + .../BNGetAllMediumLevelILBranchDependence.cs | 30 + Function/BNGetAllPluginCommands.cs | 24 + Function/BNGetAllReferencesForType.cs | 35 + Function/BNGetAllReferencesForTypeField.cs | 38 + Function/BNGetAllSizesReferenced.cs | 30 + Function/BNGetAllTagReferenceTypeCounts.cs | 35 + Function/BNGetAllTagReferences.cs | 27 + Function/BNGetAllTagReferencesOfType.cs | 32 + Function/BNGetAllTagReferencesOfTypeCount.cs | 29 + Function/BNGetAllTypesReferenced.cs | 30 + Function/BNGetAllUserVariableValues.cs | 29 + Function/BNGetAllVariableFieldResolutions.cs | 29 + Function/BNGetAllocatedRanges.cs | 27 + Function/BNGetAnalysisAutoTypeContainer.cs | 24 + .../BNGetAnalysisDependencySortedTypeList.cs | 27 + Function/BNGetAnalysisEntryPoint.cs | 26 + Function/BNGetAnalysisFunction.cs | 30 + Function/BNGetAnalysisFunctionList.cs | 27 + ...BNGetAnalysisFunctionsContainingAddress.cs | 30 + Function/BNGetAnalysisFunctionsForAddress.cs | 30 + Function/BNGetAnalysisInfo.cs | 24 + .../BNGetAnalysisMergeConflictSplitterList.cs | 26 + Function/BNGetAnalysisProgress.cs | 24 + Function/BNGetAnalysisSkipReason.cs | 26 + Function/BNGetAnalysisState.cs | 24 + Function/BNGetAnalysisSystemCallName.cs | 30 + Function/BNGetAnalysisSystemCallType.cs | 30 + Function/BNGetAnalysisTypeById.cs | 28 + Function/BNGetAnalysisTypeByName.cs | 27 + Function/BNGetAnalysisTypeByRef.cs | 29 + Function/BNGetAnalysisTypeContainer.cs | 24 + Function/BNGetAnalysisTypeId.cs | 27 + Function/BNGetAnalysisTypeList.cs | 27 + Function/BNGetAnalysisTypeNameById.cs | 28 + Function/BNGetAnalysisTypeNames.cs | 31 + Function/BNGetAnalysisUserTypeContainer.cs | 24 + Function/BNGetArchitectureAddressSize.cs | 26 + Function/BNGetArchitectureByName.cs | 25 + ...NGetArchitectureCallingConventionByName.cs | 29 + .../BNGetArchitectureCallingConventions.cs | 27 + ...BNGetArchitectureCdeclCallingConvention.cs | 26 + ...GetArchitectureDefaultCallingConvention.cs | 26 + .../BNGetArchitectureDefaultIntegerSize.cs | 26 + Function/BNGetArchitectureEndianness.cs | 26 + ...etArchitectureFastcallCallingConvention.cs | 26 + ...NGetArchitectureFlagConditionLowLevelIL.cs | 33 + ...ctureFlagConditionsForSemanticFlagGroup.cs | 30 + Function/BNGetArchitectureFlagName.cs | 27 + Function/BNGetArchitectureFlagRole.cs | 30 + .../BNGetArchitectureFlagWriteLowLevelIL.cs | 45 + .../BNGetArchitectureFlagWriteTypeName.cs | 29 + ...chitectureFlagsRequiredForFlagCondition.cs | 33 + ...ectureFlagsRequiredForSemanticFlagGroup.cs | 30 + ...ArchitectureFlagsWrittenByFlagWriteType.cs | 30 + Function/BNGetArchitectureForViewType.cs | 30 + Function/BNGetArchitectureGlobalRegisters.cs | 27 + .../BNGetArchitectureInstructionAlignment.cs | 26 + Function/BNGetArchitectureIntrinsicClass.cs | 27 + Function/BNGetArchitectureIntrinsicInputs.cs | 30 + Function/BNGetArchitectureIntrinsicName.cs | 27 + Function/BNGetArchitectureIntrinsicOutputs.cs | 30 + Function/BNGetArchitectureLinkRegister.cs | 26 + Function/BNGetArchitectureList.cs | 24 + .../BNGetArchitectureMaxInstructionLength.cs | 26 + Function/BNGetArchitectureName.cs | 24 + .../BNGetArchitectureOpcodeDisplayLength.cs | 26 + Function/BNGetArchitectureRegisterByName.cs | 28 + Function/BNGetArchitectureRegisterInfo.cs | 27 + Function/BNGetArchitectureRegisterName.cs | 27 + ...GetArchitectureRegisterStackForRegister.cs | 29 + .../BNGetArchitectureRegisterStackInfo.cs | 29 + .../BNGetArchitectureRegisterStackName.cs | 27 + ...chitectureSemanticClassForFlagWriteType.cs | 27 + .../BNGetArchitectureSemanticFlagClassName.cs | 27 + ...ArchitectureSemanticFlagGroupLowLevelIL.cs | 31 + .../BNGetArchitectureSemanticFlagGroupName.cs | 27 + .../BNGetArchitectureStackPointerRegister.cs | 24 + .../BNGetArchitectureStandalonePlatform.cs | 24 + ...GetArchitectureStdcallCallingConvention.cs | 26 + Function/BNGetArchitectureSystemRegisters.cs | 27 + Function/BNGetArchitectureTypeLibraries.cs | 27 + .../BNGetAssociatedArchitectureByAddress.cs | 27 + Function/BNGetAssociatedPlatformByAddress.cs | 27 + Function/BNGetAutoAddressTagReferences.cs | 29 + Function/BNGetAutoAddressTags.cs | 33 + Function/BNGetAutoAddressTagsInRange.cs | 36 + Function/BNGetAutoAddressTagsOfType.cs | 38 + Function/BNGetAutoDataTagReferences.cs | 27 + Function/BNGetAutoDataTags.cs | 30 + Function/BNGetAutoDataTagsInRange.cs | 33 + Function/BNGetAutoDataTagsOfType.cs | 35 + Function/BNGetAutoDebugTypeIdSource.cs | 30 + Function/BNGetAutoDemangledTypeIdSource.cs | 30 + Function/BNGetAutoFunctionTagReferences.cs | 29 + Function/BNGetAutoFunctionTags.cs | 27 + Function/BNGetAutoFunctionTagsOfType.cs | 30 + Function/BNGetAutoPlatformTypeIdSource.cs | 26 + Function/BNGetBackedAddressRanges.cs | 27 + Function/BNGetBackgroundAnalysisTask.cs | 26 + Function/BNGetBackgroundTaskProgressText.cs | 24 + Function/BNGetBackgroundTaskRuntimeSeconds.cs | 24 + Function/BNGetBaseAddressDetectionReasons.cs | 32 + Function/BNGetBaseAddressDetectionScores.cs | 38 + Function/BNGetBaseMemoryMapDescription.cs | 24 + Function/BNGetBaseStructuresForStructure.cs | 27 + .../BNGetBaseStructuresForStructureBuilder.cs | 27 + Function/BNGetBasicBlockArchitecture.cs | 26 + Function/BNGetBasicBlockDisassemblyText.cs | 30 + Function/BNGetBasicBlockDominanceFrontier.cs | 30 + .../BNGetBasicBlockDominatorTreeChildren.cs | 30 + Function/BNGetBasicBlockDominators.cs | 30 + Function/BNGetBasicBlockEnd.cs | 24 + Function/BNGetBasicBlockFunction.cs | 24 + Function/BNGetBasicBlockFunctionGraphType.cs | 24 + .../BNGetBasicBlockHighLevelILFunction.cs | 26 + Function/BNGetBasicBlockHighlight.cs | 24 + Function/BNGetBasicBlockImmediateDominator.cs | 27 + Function/BNGetBasicBlockIncomingEdges.cs | 27 + Function/BNGetBasicBlockIndex.cs | 24 + ...tBasicBlockInstructionContainingAddress.cs | 30 + ...NGetBasicBlockIteratedDominanceFrontier.cs | 59 + Function/BNGetBasicBlockLength.cs | 24 + Function/BNGetBasicBlockLowLevelILFunction.cs | 24 + .../BNGetBasicBlockMediumLevelILFunction.cs | 26 + Function/BNGetBasicBlockOutgoingEdges.cs | 27 + .../BNGetBasicBlockPendingOutgoingEdges.cs | 27 + Function/BNGetBasicBlockSource.cs | 24 + Function/BNGetBasicBlockSourceBlock.cs | 24 + Function/BNGetBasicBlockStart.cs | 24 + Function/BNGetBasicBlockStrictDominators.cs | 30 + Function/BNGetBasicBlocksForAddress.cs | 30 + Function/BNGetBasicBlocksStartingAtAddress.cs | 30 + Function/BNGetBinaryReaderEndianness.cs | 24 + Function/BNGetBinaryReaderVirtualBase.cs | 24 + ...GetBinaryViewDefaultLoadSettingsForData.cs | 29 + .../BNGetBinaryViewLoadSettingsForData.cs | 29 + Function/BNGetBinaryViewTypeByName.cs | 25 + Function/BNGetBinaryViewTypeLibraries.cs | 27 + Function/BNGetBinaryViewTypeLibrary.cs | 28 + Function/BNGetBinaryViewTypeLongName.cs | 26 + Function/BNGetBinaryViewTypeName.cs | 26 + Function/BNGetBinaryViewTypes.cs | 25 + Function/BNGetBinaryViewTypesForData.cs | 27 + Function/BNGetBinaryWriterEndianness.cs | 24 + Function/BNGetBuildId.cs | 28 + Function/BNGetBundledPluginDirectory.cs | 30 + .../BNGetCachedHighLevelILPossibleValueSet.cs | 29 + .../BNGetCachedLowLevelILPossibleValueSet.cs | 27 + ...NGetCachedMediumLevelILPossibleValueSet.cs | 27 + Function/BNGetCallRegisterStackAdjustment.cs | 35 + ...RegisterStackAdjustmentForRegisterStack.cs | 35 + Function/BNGetCallStackAdjustment.cs | 32 + Function/BNGetCallTypeAdjustment.cs | 32 + Function/BNGetCalleeForAnalysis.cs | 35 + Function/BNGetCalleeSavedRegisters.cs | 29 + Function/BNGetCallees.cs | 30 + Function/BNGetCallerSavedRegisters.cs | 29 + Function/BNGetCallers.cs | 31 + .../BNGetCallingConventionArchitecture.cs | 26 + Function/BNGetCallingConventionName.cs | 26 + Function/BNGetCheckboxInput.cs | 60 + Function/BNGetChildType.cs | 24 + Function/BNGetChoiceInput.cs | 62 + Function/BNGetCodeReferences.cs | 36 + Function/BNGetCodeReferencesForType.cs | 36 + Function/BNGetCodeReferencesForTypeField.cs | 39 + .../BNGetCodeReferencesForTypeFieldsFrom.cs | 30 + ...tCodeReferencesForTypeFieldsFromInRange.cs | 33 + Function/BNGetCodeReferencesForTypeFrom.cs | 30 + .../BNGetCodeReferencesForTypeFromInRange.cs | 33 + Function/BNGetCodeReferencesFrom.cs | 30 + Function/BNGetCodeReferencesFromInRange.cs | 33 + Function/BNGetCodeReferencesInRange.cs | 40 + Function/BNGetCommentForAddress.cs | 28 + Function/BNGetCommentedAddresses.cs | 27 + Function/BNGetComponentByGuid.cs | 28 + Function/BNGetComponentByPath.cs | 28 + Function/BNGetConstantData.cs | 36 + .../BNGetConstantsReferencedByInstruction.cs | 35 + ...tantsReferencedByInstructionIfAvailable.cs | 35 + Function/BNGetCurrentCoreABIVersion.cs | 28 + Function/BNGetCurrentOffset.cs | 24 + Function/BNGetCurrentStackTraceString.cs | 23 + Function/BNGetCurrentView.cs | 24 + Function/BNGetDataBufferByte.cs | 29 + Function/BNGetDataBufferContents.cs | 26 + Function/BNGetDataBufferContentsAt.cs | 29 + Function/BNGetDataBufferLength.cs | 24 + Function/BNGetDataBufferSlice.cs | 32 + Function/BNGetDataReferences.cs | 37 + Function/BNGetDataReferencesForType.cs | 36 + Function/BNGetDataReferencesForTypeField.cs | 39 + Function/BNGetDataReferencesFrom.cs | 30 + .../BNGetDataReferencesFromForTypeField.cs | 39 + Function/BNGetDataReferencesFromInRange.cs | 33 + Function/BNGetDataReferencesInRange.cs | 39 + Function/BNGetDataRendererContainer.cs | 23 + Function/BNGetDataTagReferences.cs | 27 + Function/BNGetDataTags.cs | 30 + Function/BNGetDataTagsInRange.cs | 33 + Function/BNGetDataTagsOfType.cs | 35 + Function/BNGetDataVariableAtAddress.cs | 30 + Function/BNGetDataVariableParentComponents.cs | 30 + Function/BNGetDataVariables.cs | 27 + Function/BNGetDatabaseCurrentSnapshot.cs | 26 + Function/BNGetDatabaseFile.cs | 26 + Function/BNGetDatabaseGlobalKeys.cs | 29 + Function/BNGetDatabaseSnapshot.cs | 29 + Function/BNGetDatabaseSnapshots.cs | 29 + Function/BNGetDebugDataVariableByAddress.cs | 35 + Function/BNGetDebugDataVariableByName.cs | 35 + Function/BNGetDebugDataVariables.cs | 32 + Function/BNGetDebugDataVariablesByAddress.cs | 32 + Function/BNGetDebugDataVariablesByName.cs | 32 + Function/BNGetDebugFunctions.cs | 32 + Function/BNGetDebugInfo.cs | 24 + Function/BNGetDebugInfoParserByName.cs | 26 + Function/BNGetDebugInfoParserName.cs | 26 + Function/BNGetDebugInfoParsers.cs | 26 + Function/BNGetDebugInfoParsersForView.cs | 29 + Function/BNGetDebugInfoTypeContainer.cs | 29 + Function/BNGetDebugParserNames.cs | 29 + Function/BNGetDebugTypeByName.cs | 32 + Function/BNGetDebugTypes.cs | 32 + Function/BNGetDebugTypesByName.cs | 32 + Function/BNGetDefaultArchitecture.cs | 26 + ...aultArchitectureFlagConditionLowLevelIL.cs | 35 + ...tDefaultArchitectureFlagWriteLowLevelIL.cs | 42 + Function/BNGetDefaultEndianness.cs | 26 + ...ultIncomingVariableForParameterVariable.cs | 29 + ...IndexForMediumLevelILVariableDefinition.cs | 30 + Function/BNGetDefaultLineFormatter.cs | 23 + Function/BNGetDefaultLineFormatterSettings.cs | 29 + ...ultParameterVariableForIncomingVariable.cs | 29 + Function/BNGetDefaultPlatform.cs | 26 + Function/BNGetDefaultTypeParser.cs | 23 + Function/BNGetDemanglerByName.cs | 26 + Function/BNGetDemanglerList.cs | 26 + Function/BNGetDemanglerName.cs | 26 + Function/BNGetDirectoryNameInput.cs | 53 + Function/BNGetDisassemblyAddressBaseOffset.cs | 26 + Function/BNGetDisassemblyAddressMode.cs | 26 + Function/BNGetDisassemblyBlockLabels.cs | 26 + .../BNGetDisassemblyCallParameterHints.cs | 26 + Function/BNGetDisassemblyGutterWidth.cs | 26 + .../BNGetDisassemblyMaximumSymbolWidth.cs | 26 + ...NGetDisassemblyTextRendererArchitecture.cs | 26 + .../BNGetDisassemblyTextRendererBasicBlock.cs | 26 + .../BNGetDisassemblyTextRendererFunction.cs | 26 + ...assemblyTextRendererHighLevelILFunction.cs | 26 + ...emblyTextRendererInstructionAnnotations.cs | 32 + ...tDisassemblyTextRendererInstructionText.cs | 38 + ...GetDisassemblyTextRendererIntegerTokens.cs | 38 + Function/BNGetDisassemblyTextRendererLines.cs | 38 + ...sassemblyTextRendererLowLevelILFunction.cs | 26 + ...semblyTextRendererMediumLevelILFunction.cs | 26 + .../BNGetDisassemblyTextRendererSettings.cs | 26 + ...extRendererStackVariableReferenceTokens.cs | 32 + ...NGetDisassemblyTextRendererSymbolTokens.cs | 41 + ...sassemblyTextRendererSymbolTokensStatic.cs | 62 + Function/BNGetDisassemblyWidth.cs | 24 + Function/BNGetDisplayStringForInteger.cs | 38 + Function/BNGetDownloadProviderByName.cs | 26 + Function/BNGetDownloadProviderList.cs | 26 + Function/BNGetDownloadProviderName.cs | 26 + Function/BNGetEarlyReturn.cs | 29 + Function/BNGetEmptyTypeContainer.cs | 20 + Function/BNGetEndOffset.cs | 26 + ...etEnterpriseServerAuthenticationMethods.cs | 29 + Function/BNGetEnterpriseServerBuildId.cs | 23 + Function/BNGetEnterpriseServerId.cs | 23 + Function/BNGetEnterpriseServerLastError.cs | 23 + .../BNGetEnterpriseServerLicenseDuration.cs | 23 + ...etEnterpriseServerLicenseExpirationTime.cs | 23 + Function/BNGetEnterpriseServerName.cs | 23 + ...GetEnterpriseServerReservationTimeLimit.cs | 23 + Function/BNGetEnterpriseServerToken.cs | 23 + Function/BNGetEnterpriseServerUrl.cs | 23 + Function/BNGetEnterpriseServerUsername.cs | 23 + Function/BNGetEnterpriseServerVersion.cs | 23 + Function/BNGetEntropy.cs | 36 + Function/BNGetEntryPoint.cs | 26 + Function/BNGetEnumerationBuilderMembers.cs | 27 + Function/BNGetEnumerationMembers.cs | 27 + Function/BNGetEnumerationTokensForValue.cs | 36 + Function/BNGetErrorForDownloadInstance.cs | 26 + Function/BNGetExistingViews.cs | 27 + Function/BNGetExprFolding.cs | 29 + Function/BNGetExpressionParserMagicValue.cs | 31 + Function/BNGetExternalNameSpace.cs | 20 + Function/BNGetFieldResolutionForVariableAt.cs | 32 + Function/BNGetFileExtension.cs | 26 + Function/BNGetFileForView.cs | 24 + Function/BNGetFileMetadataDatabase.cs | 24 + Function/BNGetFilePathsInDirectory.cs | 29 + Function/BNGetFileViewOfType.cs | 28 + Function/BNGetFilename.cs | 24 + Function/BNGetFirstLinearViewObjectChild.cs | 24 + .../BNGetFlagsReadByLiftedILInstruction.cs | 32 + .../BNGetFlagsWrittenByLiftedILInstruction.cs | 32 + Function/BNGetFloatArgumentRegisters.cs | 29 + Function/BNGetFloatReturnValueRegister.cs | 26 + Function/BNGetFlowGraphBasicBlock.cs | 24 + Function/BNGetFlowGraphHeight.cs | 24 + Function/BNGetFlowGraphHighLevelILFunction.cs | 24 + Function/BNGetFlowGraphLayoutByName.cs | 26 + Function/BNGetFlowGraphLayoutName.cs | 26 + Function/BNGetFlowGraphLayouts.cs | 26 + Function/BNGetFlowGraphLowLevelILFunction.cs | 24 + .../BNGetFlowGraphMediumLevelILFunction.cs | 24 + Function/BNGetFlowGraphNode.cs | 27 + Function/BNGetFlowGraphNodeCount.cs | 24 + Function/BNGetFlowGraphNodeHeight.cs | 24 + Function/BNGetFlowGraphNodeHighlight.cs | 24 + Function/BNGetFlowGraphNodeIncomingEdges.cs | 27 + Function/BNGetFlowGraphNodeLines.cs | 27 + Function/BNGetFlowGraphNodeOutgoingEdges.cs | 27 + Function/BNGetFlowGraphNodeOwner.cs | 26 + Function/BNGetFlowGraphNodeWidth.cs | 24 + Function/BNGetFlowGraphNodeX.cs | 24 + Function/BNGetFlowGraphNodeY.cs | 24 + Function/BNGetFlowGraphNodes.cs | 27 + Function/BNGetFlowGraphNodesInRegion.cs | 39 + Function/BNGetFlowGraphRenderLayers.cs | 27 + Function/BNGetFlowGraphWidth.cs | 24 + Function/BNGetFormInput.cs | 31 + Function/BNGetFullInfoUpdateChannels.cs | 29 + .../BNGetFullWidthArchitectureRegisters.cs | 27 + Function/BNGetFunctionAddressRanges.cs | 27 + Function/BNGetFunctionAllTagReferences.cs | 29 + .../BNGetFunctionAnalysisPerformanceInfo.cs | 29 + Function/BNGetFunctionAnalysisSkipOverride.cs | 26 + .../BNGetFunctionAnalysisUpdateDisabled.cs | 24 + Function/BNGetFunctionArchitecture.cs | 24 + Function/BNGetFunctionBasicBlockAtAddress.cs | 30 + Function/BNGetFunctionBasicBlockList.cs | 27 + Function/BNGetFunctionBlockAnnotations.cs | 35 + Function/BNGetFunctionCallSites.cs | 27 + Function/BNGetFunctionCallingConvention.cs | 24 + Function/BNGetFunctionClobberedRegisters.cs | 26 + Function/BNGetFunctionComment.cs | 24 + Function/BNGetFunctionData.cs | 24 + Function/BNGetFunctionForFlowGraph.cs | 24 + Function/BNGetFunctionGlobalPointerValue.cs | 26 + Function/BNGetFunctionHighLevelIL.cs | 24 + .../BNGetFunctionHighLevelILIfAvailable.cs | 24 + Function/BNGetFunctionHighestAddress.cs | 24 + .../BNGetFunctionLanguageRepresentation.cs | 28 + ...nctionLanguageRepresentationIfAvailable.cs | 28 + Function/BNGetFunctionLiftedIL.cs | 24 + Function/BNGetFunctionLiftedILIfAvailable.cs | 24 + Function/BNGetFunctionLowLevelIL.cs | 26 + .../BNGetFunctionLowLevelILIfAvailable.cs | 24 + Function/BNGetFunctionLowestAddress.cs | 24 + Function/BNGetFunctionMappedMediumLevelIL.cs | 26 + ...tFunctionMappedMediumLevelILIfAvailable.cs | 24 + Function/BNGetFunctionMediumLevelIL.cs | 24 + .../BNGetFunctionMediumLevelILIfAvailable.cs | 24 + Function/BNGetFunctionParameterVariables.cs | 24 + Function/BNGetFunctionParentComponents.cs | 30 + Function/BNGetFunctionPlatform.cs | 24 + .../BNGetFunctionRegisterStackAdjustments.cs | 29 + Function/BNGetFunctionRegisterValueAtExit.cs | 29 + Function/BNGetFunctionReturnRegisters.cs | 26 + Function/BNGetFunctionReturnType.cs | 24 + Function/BNGetFunctionStackAdjustment.cs | 26 + Function/BNGetFunctionStart.cs | 24 + Function/BNGetFunctionSymbol.cs | 26 + Function/BNGetFunctionTagReferences.cs | 29 + Function/BNGetFunctionTagReferencesOfType.cs | 32 + Function/BNGetFunctionTags.cs | 27 + Function/BNGetFunctionTagsOfType.cs | 31 + Function/BNGetFunctionType.cs | 24 + Function/BNGetFunctionTypeTokens.cs | 30 + ...GetFunctionVariableDeadStoreElimination.cs | 29 + Function/BNGetFunctionVariables.cs | 27 + Function/BNGetGlobalCommentForAddress.cs | 27 + Function/BNGetGlobalCommentedAddresses.cs | 27 + Function/BNGetGlobalPointerRegister.cs | 26 + Function/BNGetGlobalPointerValue.cs | 24 + Function/BNGetGotoLabelName.cs | 27 + .../BNGetGraphForFlowGraphLayoutRequest.cs | 24 + Function/BNGetGuidedSourceBlocks.cs | 29 + .../BNGetHighIntegerReturnValueRegister.cs | 26 + Function/BNGetHighLevelILAliasedVariables.cs | 27 + ...NGetHighLevelILBasicBlockForInstruction.cs | 27 + Function/BNGetHighLevelILBasicBlockList.cs | 27 + Function/BNGetHighLevelILByIndex.cs | 30 + Function/BNGetHighLevelILExprCount.cs | 26 + Function/BNGetHighLevelILExprIndex.cs | 27 + Function/BNGetHighLevelILExprIndexForLabel.cs | 27 + Function/BNGetHighLevelILExprIndexes.cs | 30 + Function/BNGetHighLevelILExprScopeType.cs | 29 + Function/BNGetHighLevelILExprText.cs | 36 + Function/BNGetHighLevelILExprType.cs | 27 + Function/BNGetHighLevelILForMediumLevelIL.cs | 24 + .../BNGetHighLevelILIndexForInstruction.cs | 27 + Function/BNGetHighLevelILInstructionCount.cs | 24 + .../BNGetHighLevelILInstructionForExpr.cs | 27 + Function/BNGetHighLevelILInstructionIndex.cs | 29 + Function/BNGetHighLevelILNonSSAExprIndex.cs | 27 + Function/BNGetHighLevelILNonSSAForm.cs | 24 + .../BNGetHighLevelILNonSSAInstructionIndex.cs | 27 + Function/BNGetHighLevelILOwnerFunction.cs | 24 + Function/BNGetHighLevelILRootExpr.cs | 24 + Function/BNGetHighLevelILSSAExprIndex.cs | 27 + Function/BNGetHighLevelILSSAForm.cs | 24 + .../BNGetHighLevelILSSAInstructionIndex.cs | 27 + .../BNGetHighLevelILSSAMemoryDefinition.cs | 27 + Function/BNGetHighLevelILSSAMemoryUses.cs | 30 + ...hLevelILSSAMemoryVersionAtILInstruction.cs | 27 + Function/BNGetHighLevelILSSAVarDefinition.cs | 30 + Function/BNGetHighLevelILSSAVarUses.cs | 33 + ...HighLevelILSSAVarVersionAtILInstruction.cs | 30 + Function/BNGetHighLevelILUsesForLabel.cs | 30 + .../BNGetHighLevelILVariableDefinitions.cs | 30 + .../BNGetHighLevelILVariableReferences.cs | 32 + .../BNGetHighLevelILVariableReferencesFrom.cs | 33 + ...evelILVariableReferencesFromIfAvailable.cs | 35 + ...ighLevelILVariableReferencesIfAvailable.cs | 32 + ...GetHighLevelILVariableReferencesInRange.cs | 38 + ...lILVariableReferencesInRangeIfAvailable.cs | 38 + .../BNGetHighLevelILVariableSSAVersions.cs | 30 + Function/BNGetHighLevelILVariableUses.cs | 30 + Function/BNGetHighLevelILVariables.cs | 27 + .../BNGetHorizontalFlowGraphNodeMargin.cs | 26 + Function/BNGetImageBase.cs | 26 + Function/BNGetImplicitlyDefinedRegisters.cs | 29 + Function/BNGetIncomingDirectTypeReferences.cs | 30 + Function/BNGetIncomingFlagValue.cs | 32 + .../BNGetIncomingRecursiveTypeReferences.cs | 33 + Function/BNGetIncomingRegisterValue.cs | 32 + ...GetIncomingVariableForParameterVariable.cs | 32 + Function/BNGetIndirectBranches.cs | 27 + Function/BNGetIndirectBranchesAt.cs | 35 + Function/BNGetInstallDirectory.cs | 30 + Function/BNGetInstructionContainingAddress.cs | 33 + Function/BNGetInstructionHighlight.cs | 32 + Function/BNGetInstructionInfo.cs | 36 + Function/BNGetInstructionLength.cs | 30 + Function/BNGetInstructionLowLevelIL.cs | 36 + Function/BNGetInstructionText.cs | 39 + Function/BNGetIntegerArgumentRegisters.cs | 29 + Function/BNGetIntegerConstantDisplayType.cs | 38 + ...tegerConstantDisplayTypeEnumerationType.cs | 38 + Function/BNGetIntegerInput.cs | 50 + Function/BNGetIntegerReturnValueRegister.cs | 26 + Function/BNGetIntegerTypeDisplayType.cs | 24 + Function/BNGetInternalNameSpace.cs | 20 + Function/BNGetKeyValueStoreBuffer.cs | 28 + Function/BNGetKeyValueStoreDataSize.cs | 24 + Function/BNGetKeyValueStoreKeys.cs | 27 + Function/BNGetKeyValueStoreNamespaceSize.cs | 24 + Function/BNGetKeyValueStoreSerializedData.cs | 26 + Function/BNGetKeyValueStoreValue.cs | 28 + Function/BNGetKeyValueStoreValueHash.cs | 29 + Function/BNGetKeyValueStoreValueSize.cs | 24 + .../BNGetKeyValueStoreValueStorageSize.cs | 24 + ...NGetLabelForLowLevelILSourceInstruction.cs | 27 + ...tLabelForMediumLevelILSourceInstruction.cs | 27 + ...BNGetLanguageRepresentationArchitecture.cs | 24 + ...presentationFunctionAnnotationEndString.cs | 26 + ...esentationFunctionAnnotationStartString.cs | 26 + ...anguageRepresentationFunctionBlockLines.cs | 33 + ...eRepresentationFunctionCommentEndString.cs | 24 + ...epresentationFunctionCommentStartString.cs | 24 + ...tLanguageRepresentationFunctionExprText.cs | 45 + ...LanguageRepresentationFunctionHighlight.cs | 27 + ...nguageRepresentationFunctionLinearLines.cs | 39 + ...anguageRepresentationFunctionTypeByName.cs | 26 + ...sentationFunctionTypeFunctionTypeTokens.cs | 35 + ...RepresentationFunctionTypeLineFormatter.cs | 26 + ...tLanguageRepresentationFunctionTypeList.cs | 24 + ...tLanguageRepresentationFunctionTypeName.cs | 26 + ...anguageRepresentationFunctionTypeParser.cs | 26 + ...nguageRepresentationFunctionTypePrinter.cs | 26 + .../BNGetLanguageRepresentationILFunction.cs | 24 + ...uageRepresentationLineFormatterSettings.cs | 29 + ...NGetLanguageRepresentationOwnerFunction.cs | 26 + Function/BNGetLanguageRepresentationType.cs | 26 + Function/BNGetLargeChoiceInput.cs | 62 + Function/BNGetLastLinearViewObjectChild.cs | 24 + Function/BNGetLastRedoEntry.cs | 26 + Function/BNGetLastRedoEntryTitle.cs | 26 + .../BNGetLastSeenVariableNameOrDefault.cs | 27 + Function/BNGetLastUndoEntry.cs | 26 + Function/BNGetLastUndoEntryTitle.cs | 26 + Function/BNGetLicenseCount.cs | 23 + Function/BNGetLicenseExpirationTime.cs | 23 + Function/BNGetLicensedUserEmail.cs | 23 + .../BNGetLiftedILFlagDefinitionsForUse.cs | 35 + .../BNGetLiftedILFlagUsesForDefinition.cs | 35 + Function/BNGetLineFormatterByName.cs | 26 + Function/BNGetLineFormatterList.cs | 26 + Function/BNGetLineFormatterName.cs | 26 + .../BNGetLinearViewCursorCurrentObject.cs | 26 + Function/BNGetLinearViewCursorLines.cs | 27 + .../BNGetLinearViewCursorOrderingIndex.cs | 24 + ...BNGetLinearViewCursorOrderingIndexTotal.cs | 24 + Function/BNGetLinearViewCursorPath.cs | 27 + Function/BNGetLinearViewCursorPathObjects.cs | 27 + Function/BNGetLinearViewCursorRenderLayers.cs | 27 + .../BNGetLinearViewObjectChildForAddress.cs | 27 + ...BNGetLinearViewObjectChildForIdentifier.cs | 27 + ...etLinearViewObjectChildForOrderingIndex.cs | 27 + Function/BNGetLinearViewObjectEnd.cs | 24 + Function/BNGetLinearViewObjectIdentifier.cs | 24 + Function/BNGetLinearViewObjectLines.cs | 33 + ...etLinearViewObjectOrderingIndexForChild.cs | 27 + ...BNGetLinearViewObjectOrderingIndexTotal.cs | 24 + Function/BNGetLinearViewObjectStart.cs | 24 + Function/BNGetLinesForData.cs | 56 + Function/BNGetLoggerIndent.cs | 24 + Function/BNGetLowLevelFlagSSAVersions.cs | 30 + Function/BNGetLowLevelFlags.cs | 27 + ...BNGetLowLevelILBasicBlockForInstruction.cs | 27 + Function/BNGetLowLevelILBasicBlockList.cs | 27 + Function/BNGetLowLevelILByIndex.cs | 28 + Function/BNGetLowLevelILExprCount.cs | 24 + Function/BNGetLowLevelILExprIndex.cs | 27 + Function/BNGetLowLevelILExprIndexes.cs | 30 + Function/BNGetLowLevelILExprText.cs | 39 + Function/BNGetLowLevelILExprValue.cs | 27 + ...NGetLowLevelILFlagValueAfterInstruction.cs | 30 + .../BNGetLowLevelILFlagValueAtInstruction.cs | 30 + Function/BNGetLowLevelILForMediumLevelIL.cs | 24 + .../BNGetLowLevelILIndexForInstruction.cs | 27 + Function/BNGetLowLevelILInstructionCount.cs | 24 + Function/BNGetLowLevelILInstructionForExpr.cs | 27 + Function/BNGetLowLevelILInstructionIndex.cs | 27 + Function/BNGetLowLevelILInstructionText.cs | 43 + Function/BNGetLowLevelILLabelForAddress.cs | 32 + Function/BNGetLowLevelILNonSSAExprIndex.cs | 27 + Function/BNGetLowLevelILNonSSAForm.cs | 26 + .../BNGetLowLevelILNonSSAInstructionIndex.cs | 27 + Function/BNGetLowLevelILOwnerFunction.cs | 24 + Function/BNGetLowLevelILPossibleExprValues.cs | 33 + ...velILPossibleFlagValuesAfterInstruction.cs | 36 + ...wLevelILPossibleFlagValuesAtInstruction.cs | 36 + ...LPossibleRegisterValuesAfterInstruction.cs | 36 + ...elILPossibleRegisterValuesAtInstruction.cs | 36 + ...ILPossibleStackContentsAfterInstruction.cs | 39 + ...velILPossibleStackContentsAtInstruction.cs | 39 + ...LowLevelILRegisterValueAfterInstruction.cs | 30 + ...GetLowLevelILRegisterValueAtInstruction.cs | 30 + Function/BNGetLowLevelILSSAExprIndex.cs | 27 + Function/BNGetLowLevelILSSAFlagDefinition.cs | 30 + Function/BNGetLowLevelILSSAFlagUses.cs | 33 + Function/BNGetLowLevelILSSAFlagValue.cs | 30 + Function/BNGetLowLevelILSSAForm.cs | 24 + .../BNGetLowLevelILSSAInstructionIndex.cs | 27 + .../BNGetLowLevelILSSAMemoryDefinition.cs | 27 + Function/BNGetLowLevelILSSAMemoryUses.cs | 30 + .../BNGetLowLevelILSSARegisterDefinition.cs | 30 + Function/BNGetLowLevelILSSARegisterUses.cs | 33 + Function/BNGetLowLevelILSSARegisterValue.cs | 30 + ...LowLevelILStackContentsAfterInstruction.cs | 33 + ...GetLowLevelILStackContentsAtInstruction.cs | 33 + Function/BNGetLowLevelILTemporaryFlagCount.cs | 24 + .../BNGetLowLevelILTemporaryRegisterCount.cs | 24 + Function/BNGetLowLevelMemoryVersions.cs | 27 + Function/BNGetLowLevelRegisterSSAVersions.cs | 30 + .../BNGetLowLevelRegisterStackSSAVersions.cs | 30 + Function/BNGetLowLevelRegisterStacks.cs | 27 + Function/BNGetLowLevelRegisters.cs | 27 + .../BNGetLowLevelSSAFlagsWithoutVersions.cs | 27 + ...owLevelSSARegisterStacksWithoutVersions.cs | 27 + ...NGetLowLevelSSARegistersWithoutVersions.cs | 27 + Function/BNGetMappedAddressRanges.cs | 27 + Function/BNGetMappedMediumLevelIL.cs | 24 + Function/BNGetMappedMediumLevelILExprIndex.cs | 27 + ...NGetMappedMediumLevelILInstructionIndex.cs | 27 + Function/BNGetMaskForSize.cs | 24 + Function/BNGetMaxFunctionSizeForAnalysis.cs | 24 + .../BNGetMediumLevelILAliasedVariables.cs | 27 + ...etMediumLevelILBasicBlockForInstruction.cs | 27 + Function/BNGetMediumLevelILBasicBlockList.cs | 27 + .../BNGetMediumLevelILBranchDependence.cs | 30 + Function/BNGetMediumLevelILByIndex.cs | 27 + Function/BNGetMediumLevelILExprCount.cs | 24 + Function/BNGetMediumLevelILExprIndex.cs | 27 + ...etMediumLevelILExprIndexFromHighLevelIL.cs | 27 + Function/BNGetMediumLevelILExprIndexes.cs | 30 + ...MediumLevelILExprIndexesFromHighLevelIL.cs | 30 + Function/BNGetMediumLevelILExprText.cs | 39 + Function/BNGetMediumLevelILExprType.cs | 27 + Function/BNGetMediumLevelILExprValue.cs | 27 + ...tMediumLevelILFlagValueAfterInstruction.cs | 30 + ...NGetMediumLevelILFlagValueAtInstruction.cs | 30 + ...NGetMediumLevelILForHighLevelILFunction.cs | 24 + Function/BNGetMediumLevelILForLowLevelIL.cs | 24 + .../BNGetMediumLevelILIndexForInstruction.cs | 27 + .../BNGetMediumLevelILInstructionCount.cs | 24 + .../BNGetMediumLevelILInstructionForExpr.cs | 27 + .../BNGetMediumLevelILInstructionIndex.cs | 27 + Function/BNGetMediumLevelILInstructionText.cs | 44 + ...ediumLevelILLiveInstructionsForVariable.cs | 33 + Function/BNGetMediumLevelILNonSSAExprIndex.cs | 27 + Function/BNGetMediumLevelILNonSSAForm.cs | 26 + ...NGetMediumLevelILNonSSAInstructionIndex.cs | 27 + Function/BNGetMediumLevelILOwnerFunction.cs | 24 + .../BNGetMediumLevelILPossibleExprValues.cs | 33 + ...velILPossibleFlagValuesAfterInstruction.cs | 36 + ...mLevelILPossibleFlagValuesAtInstruction.cs | 36 + ...LPossibleRegisterValuesAfterInstruction.cs | 36 + ...elILPossibleRegisterValuesAtInstruction.cs | 36 + .../BNGetMediumLevelILPossibleSSAVarValues.cs | 39 + ...ILPossibleStackContentsAfterInstruction.cs | 39 + ...velILPossibleStackContentsAtInstruction.cs | 39 + ...iumLevelILRegisterValueAfterInstruction.cs | 30 + ...MediumLevelILRegisterValueAtInstruction.cs | 30 + Function/BNGetMediumLevelILSSAExprIndex.cs | 27 + Function/BNGetMediumLevelILSSAForm.cs | 24 + .../BNGetMediumLevelILSSAInstructionIndex.cs | 27 + .../BNGetMediumLevelILSSAMemoryDefinition.cs | 27 + Function/BNGetMediumLevelILSSAMemoryUses.cs | 30 + ...velILSSAMemoryVersionAfterILInstruction.cs | 27 + ...mLevelILSSAMemoryVersionAtILInstruction.cs | 27 + .../BNGetMediumLevelILSSAVarDefinition.cs | 30 + Function/BNGetMediumLevelILSSAVarUses.cs | 33 + Function/BNGetMediumLevelILSSAVarValue.cs | 30 + ...mLevelILSSAVarVersionAfterILInstruction.cs | 30 + ...diumLevelILSSAVarVersionAtILInstruction.cs | 30 + ...iumLevelILStackContentsAfterInstruction.cs | 33 + ...MediumLevelILStackContentsAtInstruction.cs | 33 + .../BNGetMediumLevelILVariableDefinitions.cs | 30 + ...mLevelILVariableForFlagAfterInstruction.cs | 30 + ...diumLevelILVariableForFlagAtInstruction.cs | 30 + ...elILVariableForRegisterAfterInstruction.cs | 30 + ...LevelILVariableForRegisterAtInstruction.cs | 30 + ...ariableForStackLocationAfterInstruction.cs | 30 + ...ILVariableForStackLocationAtInstruction.cs | 30 + .../BNGetMediumLevelILVariableReferences.cs | 30 + ...NGetMediumLevelILVariableReferencesFrom.cs | 33 + ...evelILVariableReferencesFromIfAvailable.cs | 35 + ...iumLevelILVariableReferencesIfAvailable.cs | 32 + ...tMediumLevelILVariableReferencesInRange.cs | 38 + ...lILVariableReferencesInRangeIfAvailable.cs | 38 + .../BNGetMediumLevelILVariableSSAVersions.cs | 30 + Function/BNGetMediumLevelILVariableUses.cs | 30 + Function/BNGetMediumLevelILVariables.cs | 27 + .../BNGetMemberIncludingInheritedAtOffset.cs | 32 + Function/BNGetMemoryMapDescription.cs | 26 + Function/BNGetMemoryRegionFill.cs | 29 + Function/BNGetMemoryRegionFlags.cs | 28 + Function/BNGetMemoryUsageInfo.cs | 26 + Function/BNGetMergedVariables.cs | 29 + Function/BNGetMinimumCoreABIVersion.cs | 28 + Function/BNGetModification.cs | 27 + Function/BNGetModificationArray.cs | 33 + ...GetModifiedArchitectureRegistersOnWrite.cs | 30 + Function/BNGetNameSpaces.cs | 27 + Function/BNGetNameTypeString.cs | 37 + Function/BNGetNativeTypeParserArchitecture.cs | 20 + .../BNGetNewAutoFunctionAnalysisSuppressed.cs | 24 + .../BNGetNextBasicBlockStartAfterAddress.cs | 27 + Function/BNGetNextDataAfterAddress.cs | 27 + .../BNGetNextDataVariableStartAfterAddress.cs | 27 + .../BNGetNextFunctionStartAfterAddress.cs | 27 + Function/BNGetNextLinearViewObjectChild.cs | 27 + Function/BNGetNextValidOffset.cs | 27 + Function/BNGetOpenFileNameInput.cs | 53 + Function/BNGetOpenProjects.cs | 26 + Function/BNGetOriginalFilename.cs | 26 + Function/BNGetOriginalImageBase.cs | 26 + Function/BNGetOutgoingDirectTypeReferences.cs | 30 + .../BNGetOutgoingRecursiveTypeReferences.cs | 33 + .../BNGetParameterOrderingForVariables.cs | 38 + Function/BNGetParameterValueAtInstruction.cs | 36 + ...etParameterValueAtLowLevelILInstruction.cs | 33 + ...GetParameterVariableForIncomingVariable.cs | 32 + Function/BNGetParametersForAnalysis.cs | 24 + Function/BNGetParentPath.cs | 26 + Function/BNGetParentView.cs | 24 + ...GetPathRelativeToBundledPluginDirectory.cs | 26 + Function/BNGetPathRelativeToUserDirectory.cs | 26 + .../BNGetPathRelativeToUserPluginDirectory.cs | 26 + Function/BNGetPlatformAddressSize.cs | 24 + Function/BNGetPlatformArchitecture.cs | 26 + Function/BNGetPlatformByName.cs | 25 + Function/BNGetPlatformCallingConventions.cs | 27 + .../BNGetPlatformCdeclCallingConvention.cs | 24 + .../BNGetPlatformDefaultCallingConvention.cs | 24 + .../BNGetPlatformFastcallCallingConvention.cs | 24 + Function/BNGetPlatformForViewType.cs | 30 + Function/BNGetPlatformFunctionByName.cs | 30 + Function/BNGetPlatformFunctions.cs | 27 + Function/BNGetPlatformGlobalRegisterType.cs | 29 + Function/BNGetPlatformGlobalRegisters.cs | 27 + Function/BNGetPlatformList.cs | 24 + Function/BNGetPlatformListByArchitecture.cs | 29 + Function/BNGetPlatformListByOS.cs | 28 + .../BNGetPlatformListByOSAndArchitecture.cs | 32 + Function/BNGetPlatformName.cs | 24 + Function/BNGetPlatformOSList.cs | 24 + .../BNGetPlatformStdcallCallingConvention.cs | 24 + Function/BNGetPlatformSystemCallConvention.cs | 24 + Function/BNGetPlatformSystemCallName.cs | 27 + Function/BNGetPlatformSystemCallType.cs | 29 + Function/BNGetPlatformSystemCalls.cs | 27 + Function/BNGetPlatformTypeByName.cs | 27 + Function/BNGetPlatformTypeContainer.cs | 24 + Function/BNGetPlatformTypeLibraries.cs | 27 + Function/BNGetPlatformTypeLibrariesByName.cs | 32 + Function/BNGetPlatformTypes.cs | 27 + Function/BNGetPlatformVariableByName.cs | 27 + Function/BNGetPlatformVariables.cs | 27 + ...BNGetPreviousBasicBlockEndBeforeAddress.cs | 27 + ...GetPreviousBasicBlockStartBeforeAddress.cs | 27 + Function/BNGetPreviousDataBeforeAddress.cs | 27 + ...tPreviousDataVariableStartBeforeAddress.cs | 27 + ...BNGetPreviousFunctionStartBeforeAddress.cs | 27 + .../BNGetPreviousLinearViewObjectChild.cs | 27 + Function/BNGetProduct.cs | 23 + Function/BNGetProductType.cs | 23 + Function/BNGetProjectFile.cs | 24 + Function/BNGetProvenanceString.cs | 26 + Function/BNGetReaderPosition.cs | 24 + .../BNGetRecentAnalysisFunctionForAddress.cs | 27 + Function/BNGetRecentBasicBlockForAddress.cs | 27 + Function/BNGetRedoEntries.cs | 27 + Function/BNGetRegisterStackAdjustments.cs | 53 + .../BNGetRegisterValueAfterInstruction.cs | 33 + Function/BNGetRegisterValueAtInstruction.cs | 33 + Function/BNGetRegisteredTypeName.cs | 26 + Function/BNGetRegistersReadByInstruction.cs | 35 + .../BNGetRegistersWrittenByInstruction.cs | 35 + Function/BNGetRelatedPlatform.cs | 27 + Function/BNGetRelatedPlatforms.cs | 27 + Function/BNGetRelocationRanges.cs | 27 + Function/BNGetRelocationRangesAtAddress.cs | 30 + Function/BNGetRelocationRangesInRange.cs | 33 + Function/BNGetRelocationsAt.cs | 30 + Function/BNGetRenderLayerByName.cs | 26 + .../BNGetRenderLayerDefaultEnableState.cs | 26 + Function/BNGetRenderLayerList.cs | 26 + Function/BNGetRenderLayerName.cs | 24 + Function/BNGetReportCollectionCount.cs | 26 + Function/BNGetReportContents.cs | 27 + Function/BNGetReportFlowGraph.cs | 27 + Function/BNGetReportPlainText.cs | 27 + Function/BNGetReportTitle.cs | 27 + Function/BNGetReportType.cs | 27 + Function/BNGetReportView.cs | 27 + Function/BNGetRepositoriesDirectory.cs | 30 + Function/BNGetRepositoryManager.cs | 23 + Function/BNGetRootComponent.cs | 24 + Function/BNGetRunningBackgroundTasks.cs | 24 + Function/BNGetSaveFileNameInput.cs | 58 + Function/BNGetSaveSettingsName.cs | 24 + Function/BNGetScriptingInstanceDelimiters.cs | 26 + .../BNGetScriptingInstanceInputReadyState.cs | 26 + Function/BNGetScriptingProviderAPIName.cs | 26 + Function/BNGetScriptingProviderByAPIName.cs | 26 + Function/BNGetScriptingProviderByName.cs | 26 + Function/BNGetScriptingProviderList.cs | 26 + Function/BNGetScriptingProviderName.cs | 26 + Function/BNGetSecretsProviderByName.cs | 26 + Function/BNGetSecretsProviderData.cs | 29 + Function/BNGetSecretsProviderList.cs | 26 + Function/BNGetSecretsProviderName.cs | 26 + Function/BNGetSectionByName.cs | 29 + Function/BNGetSections.cs | 28 + Function/BNGetSectionsAt.cs | 30 + Function/BNGetSegmentAt.cs | 29 + Function/BNGetSegments.cs | 27 + Function/BNGetSerialNumber.cs | 30 + Function/BNGetSettingsFileName.cs | 30 + Function/BNGetSizesReferenced.cs | 33 + Function/BNGetSnapshotChildren.cs | 29 + Function/BNGetSnapshotData.cs | 36 + Function/BNGetSnapshotDatabase.cs | 26 + Function/BNGetSnapshotFileContents.cs | 26 + Function/BNGetSnapshotFileContentsHash.cs | 26 + Function/BNGetSnapshotFirstParent.cs | 26 + Function/BNGetSnapshotId.cs | 26 + Function/BNGetSnapshotName.cs | 26 + Function/BNGetSnapshotParents.cs | 29 + Function/BNGetSnapshotUndoData.cs | 26 + Function/BNGetSnapshotUndoEntries.cs | 29 + .../BNGetSnapshotUndoEntriesWithProgress.cs | 35 + Function/BNGetSplitVariables.cs | 29 + Function/BNGetStackAdjustmentForVariables.cs | 35 + .../BNGetStackContentsAfterInstruction.cs | 38 + Function/BNGetStackContentsAtInstruction.cs | 36 + Function/BNGetStackLayout.cs | 27 + Function/BNGetStackVariableAtFrameOffset.cs | 38 + ...ckVariableAtFrameOffsetAfterInstruction.cs | 38 + ...etStackVariablesReferencedByInstruction.cs | 35 + ...ablesReferencedByInstructionIfAvailable.cs | 35 + Function/BNGetStartOffset.cs | 26 + Function/BNGetStringAtAddress.cs | 31 + Function/BNGetStringLiteralPrefix.cs | 26 + Function/BNGetStringRefContents.cs | 26 + Function/BNGetStringRefSize.cs | 26 + Function/BNGetStrings.cs | 27 + Function/BNGetStringsInRange.cs | 33 + Function/BNGetStructureAlignment.cs | 24 + Function/BNGetStructureBuilderAlignment.cs | 24 + .../BNGetStructureBuilderMemberAtOffset.cs | 32 + Function/BNGetStructureBuilderMemberByName.cs | 28 + Function/BNGetStructureBuilderMembers.cs | 27 + .../BNGetStructureBuilderPointerOffset.cs | 24 + Function/BNGetStructureBuilderType.cs | 24 + Function/BNGetStructureBuilderWidth.cs | 24 + Function/BNGetStructureMemberAtOffset.cs | 30 + Function/BNGetStructureMemberByName.cs | 28 + Function/BNGetStructureMembers.cs | 27 + ...BNGetStructureMembersIncludingInherited.cs | 32 + Function/BNGetStructurePointerOffset.cs | 24 + Function/BNGetStructureType.cs | 24 + Function/BNGetStructureWidth.cs | 24 + Function/BNGetSwitchRecovery.cs | 29 + Function/BNGetSymbolAddress.cs | 24 + Function/BNGetSymbolBinding.cs | 24 + Function/BNGetSymbolByAddress.cs | 30 + Function/BNGetSymbolByRawName.cs | 31 + Function/BNGetSymbolFullName.cs | 24 + Function/BNGetSymbolFullNameRef.cs | 26 + Function/BNGetSymbolNameSpace.cs | 26 + Function/BNGetSymbolOrdinal.cs | 24 + Function/BNGetSymbolRawBytes.cs | 27 + Function/BNGetSymbolRawName.cs | 24 + Function/BNGetSymbolRawNameRef.cs | 26 + Function/BNGetSymbolShortName.cs | 24 + Function/BNGetSymbolShortNameRef.cs | 26 + Function/BNGetSymbolType.cs | 24 + Function/BNGetSymbols.cs | 30 + Function/BNGetSymbolsByName.cs | 34 + Function/BNGetSymbolsByRawName.cs | 34 + Function/BNGetSymbolsInRange.cs | 36 + Function/BNGetSymbolsOfType.cs | 33 + Function/BNGetSymbolsOfTypeInRange.cs | 39 + Function/BNGetSystemCacheDirectory.cs | 23 + Function/BNGetTag.cs | 29 + Function/BNGetTagReferencesOfType.cs | 32 + Function/BNGetTagReferencesOfTypeCount.cs | 29 + Function/BNGetTagType.cs | 28 + Function/BNGetTagTypeById.cs | 28 + Function/BNGetTagTypeByIdWithType.cs | 32 + Function/BNGetTagTypeWithType.cs | 32 + Function/BNGetTagTypes.cs | 27 + Function/BNGetTemporaryFileContents.cs | 24 + Function/BNGetTemporaryFilePath.cs | 24 + Function/BNGetTextLineInput.cs | 50 + Function/BNGetTimeSinceLastUpdateCheck.cs | 23 + Function/BNGetTransformByName.cs | 25 + Function/BNGetTransformCapabilities.cs | 26 + Function/BNGetTransformGroup.cs | 24 + Function/BNGetTransformLongName.cs | 24 + Function/BNGetTransformName.cs | 24 + Function/BNGetTransformParameterList.cs | 27 + Function/BNGetTransformType.cs | 24 + Function/BNGetTransformTypeList.cs | 24 + Function/BNGetTypeAlignment.cs | 24 + Function/BNGetTypeAlternateName.cs | 24 + Function/BNGetTypeAndName.cs | 32 + Function/BNGetTypeArchiveAllSnapshotIds.cs | 29 + Function/BNGetTypeArchiveCurrentSnapshotId.cs | 26 + Function/BNGetTypeArchiveId.cs | 26 + ...TypeArchiveIncomingDirectTypeReferences.cs | 35 + ...eArchiveIncomingRecursiveTypeReferences.cs | 35 + ...TypeArchiveOutgoingDirectTypeReferences.cs | 35 + ...eArchiveOutgoingRecursiveTypeReferences.cs | 35 + Function/BNGetTypeArchivePath.cs | 26 + Function/BNGetTypeArchivePlatform.cs | 26 + Function/BNGetTypeArchiveSnapshotChildIds.cs | 32 + Function/BNGetTypeArchiveSnapshotParentIds.cs | 32 + Function/BNGetTypeArchiveTypeById.cs | 32 + Function/BNGetTypeArchiveTypeByName.cs | 32 + Function/BNGetTypeArchiveTypeContainer.cs | 26 + Function/BNGetTypeArchiveTypeId.cs | 32 + Function/BNGetTypeArchiveTypeIds.cs | 32 + Function/BNGetTypeArchiveTypeName.cs | 32 + Function/BNGetTypeArchiveTypeNames.cs | 32 + Function/BNGetTypeArchiveTypeNamesAndIds.cs | 38 + Function/BNGetTypeArchiveTypes.cs | 32 + Function/BNGetTypeAttributeByName.cs | 29 + Function/BNGetTypeAttributes.cs | 29 + Function/BNGetTypeBuilderAlignment.cs | 24 + Function/BNGetTypeBuilderAlternateName.cs | 24 + Function/BNGetTypeBuilderAttributeByName.cs | 29 + Function/BNGetTypeBuilderAttributes.cs | 29 + Function/BNGetTypeBuilderCallingConvention.cs | 24 + .../BNGetTypeBuilderCallingConventionName.cs | 26 + Function/BNGetTypeBuilderChildType.cs | 24 + Function/BNGetTypeBuilderClass.cs | 24 + Function/BNGetTypeBuilderElementCount.cs | 26 + Function/BNGetTypeBuilderEnumeration.cs | 26 + Function/BNGetTypeBuilderNameType.cs | 26 + .../BNGetTypeBuilderNamedTypeReference.cs | 26 + Function/BNGetTypeBuilderOffset.cs | 24 + Function/BNGetTypeBuilderParameters.cs | 27 + Function/BNGetTypeBuilderPointerSuffix.cs | 27 + .../BNGetTypeBuilderPointerSuffixString.cs | 24 + .../BNGetTypeBuilderPointerSuffixTokens.cs | 30 + Function/BNGetTypeBuilderStackAdjustment.cs | 24 + Function/BNGetTypeBuilderString.cs | 29 + Function/BNGetTypeBuilderStringAfterName.cs | 29 + Function/BNGetTypeBuilderStringBeforeName.cs | 29 + Function/BNGetTypeBuilderStructure.cs | 26 + Function/BNGetTypeBuilderTokens.cs | 35 + Function/BNGetTypeBuilderTokensAfterName.cs | 35 + Function/BNGetTypeBuilderTokensBeforeName.cs | 35 + Function/BNGetTypeBuilderTypeAndName.cs | 29 + Function/BNGetTypeBuilderWidth.cs | 24 + Function/BNGetTypeCallingConvention.cs | 24 + Function/BNGetTypeCallingConventionName.cs | 26 + Function/BNGetTypeClass.cs | 26 + Function/BNGetTypeElementCount.cs | 24 + Function/BNGetTypeEnumeration.cs | 24 + Function/BNGetTypeLibraryAlternateNames.cs | 27 + Function/BNGetTypeLibraryArchitecture.cs | 24 + Function/BNGetTypeLibraryDependencyName.cs | 24 + Function/BNGetTypeLibraryGuid.cs | 24 + Function/BNGetTypeLibraryName.cs | 24 + Function/BNGetTypeLibraryNamedObject.cs | 27 + Function/BNGetTypeLibraryNamedObjects.cs | 27 + Function/BNGetTypeLibraryNamedType.cs | 27 + Function/BNGetTypeLibraryNamedTypes.cs | 27 + Function/BNGetTypeLibraryPlatforms.cs | 27 + Function/BNGetTypeLibraryTypeContainer.cs | 24 + Function/BNGetTypeLines.cs | 43 + Function/BNGetTypeNamedTypeReference.cs | 24 + Function/BNGetTypeOffset.cs | 24 + Function/BNGetTypeParameters.cs | 27 + Function/BNGetTypeParserByName.cs | 26 + Function/BNGetTypeParserList.cs | 26 + Function/BNGetTypeParserName.cs | 26 + Function/BNGetTypeParserOptionText.cs | 35 + Function/BNGetTypePointerSuffix.cs | 27 + Function/BNGetTypePointerSuffixString.cs | 26 + Function/BNGetTypePointerSuffixTokens.cs | 30 + Function/BNGetTypePrinterByName.cs | 26 + Function/BNGetTypePrinterList.cs | 26 + Function/BNGetTypePrinterName.cs | 26 + Function/BNGetTypePrinterTypeLines.cs | 50 + Function/BNGetTypePrinterTypeString.cs | 41 + .../BNGetTypePrinterTypeStringAfterName.cs | 38 + .../BNGetTypePrinterTypeStringBeforeName.cs | 38 + Function/BNGetTypePrinterTypeTokens.cs | 47 + .../BNGetTypePrinterTypeTokensAfterName.cs | 47 + .../BNGetTypePrinterTypeTokensBeforeName.cs | 47 + Function/BNGetTypeReferenceBuilderClass.cs | 24 + Function/BNGetTypeReferenceBuilderId.cs | 26 + Function/BNGetTypeReferenceBuilderName.cs | 24 + Function/BNGetTypeReferenceClass.cs | 24 + Function/BNGetTypeReferenceId.cs | 24 + Function/BNGetTypeReferenceName.cs | 24 + Function/BNGetTypeReferencesForType.cs | 36 + Function/BNGetTypeReferencesForTypeField.cs | 39 + Function/BNGetTypeStackAdjustment.cs | 24 + Function/BNGetTypeString.cs | 30 + Function/BNGetTypeStringAfterName.cs | 30 + Function/BNGetTypeStringBeforeName.cs | 30 + Function/BNGetTypeStructure.cs | 24 + Function/BNGetTypeTokens.cs | 36 + Function/BNGetTypeTokensAfterName.cs | 36 + Function/BNGetTypeTokensBeforeName.cs | 36 + Function/BNGetTypeWidth.cs | 24 + Function/BNGetTypesReferenced.cs | 33 + Function/BNGetUndoEntries.cs | 27 + Function/BNGetUniqueIdentifierString.cs | 30 + Function/BNGetUniqueSectionNames.cs | 31 + Function/BNGetUnresolvedIndirectBranches.cs | 27 + .../BNGetUnresolvedStackAdjustmentGraph.cs | 26 + Function/BNGetUpdateChannelVersions.cs | 32 + Function/BNGetUpdateChannels.cs | 29 + Function/BNGetUserAddressTagReferences.cs | 29 + Function/BNGetUserAddressTags.cs | 33 + Function/BNGetUserAddressTagsInRange.cs | 36 + Function/BNGetUserAddressTagsOfType.cs | 38 + Function/BNGetUserDataTagReferences.cs | 27 + Function/BNGetUserDataTags.cs | 30 + Function/BNGetUserDataTagsInRange.cs | 33 + Function/BNGetUserDataTagsOfType.cs | 35 + Function/BNGetUserDirectory.cs | 30 + Function/BNGetUserEmail.cs | 26 + Function/BNGetUserFunctionTagReferences.cs | 29 + Function/BNGetUserFunctionTags.cs | 27 + Function/BNGetUserFunctionTagsOfType.cs | 30 + Function/BNGetUserId.cs | 26 + Function/BNGetUserName.cs | 26 + Function/BNGetUserPluginDirectory.cs | 30 + Function/BNGetUsers.cs | 29 + Function/BNGetValidPluginCommands.cs | 27 + .../BNGetValidPluginCommandsForAddress.cs | 30 + .../BNGetValidPluginCommandsForFunction.cs | 30 + ...lidPluginCommandsForHighLevelILFunction.cs | 30 + ...PluginCommandsForHighLevelILInstruction.cs | 33 + ...alidPluginCommandsForLowLevelILFunction.cs | 30 + ...dPluginCommandsForLowLevelILInstruction.cs | 33 + ...dPluginCommandsForMediumLevelILFunction.cs | 30 + ...uginCommandsForMediumLevelILInstruction.cs | 33 + .../BNGetValidPluginCommandsForProject.cs | 27 + Function/BNGetValidPluginCommandsForRange.cs | 33 + Function/BNGetVariableName.cs | 29 + Function/BNGetVariableNameOrDefault.cs | 27 + Function/BNGetVariableType.cs | 29 + Function/BNGetVariablesForParameters.cs | 41 + ...iablesForParametersDefaultPermittedArgs.cs | 35 + Function/BNGetVersionInfo.cs | 30 + Function/BNGetVersionString.cs | 30 + Function/BNGetVerticalFlowGraphNodeMargin.cs | 24 + Function/BNGetViewAddressSize.cs | 26 + Function/BNGetViewForFlowGraph.cs | 24 + Function/BNGetViewLength.cs | 26 + Function/BNGetViewType.cs | 26 + Function/BNGetVirtualPath.cs | 24 + Function/BNGetVisibleSymbols.cs | 32 + Function/BNGetWebsocketProviderByName.cs | 26 + Function/BNGetWebsocketProviderList.cs | 26 + Function/BNGetWebsocketProviderName.cs | 26 + Function/BNGetWorkerThreadCount.cs | 23 + Function/BNGetWorkflowForBinaryView.cs | 24 + Function/BNGetWorkflowForFunction.cs | 24 + Function/BNGetWorkflowGraphForBinaryView.cs | 32 + Function/BNGetWorkflowGraphForFunction.cs | 32 + Function/BNGetWorkflowList.cs | 24 + Function/BNGetWorkflowName.cs | 26 + Function/BNGetWriterPosition.cs | 24 + Function/BNHasDataVariables.cs | 24 + Function/BNHasFunctions.cs | 24 + Function/BNHasGuidedSourceBlocks.cs | 26 + Function/BNHasInitialAnalysis.cs | 24 + Function/BNHasSymbols.cs | 24 + Function/BNHasUnresolvedIndirectBranches.cs | 24 + Function/BNHighLevelILAddExpr.cs | 46 + Function/BNHighLevelILAddExprWithLocation.cs | 51 + Function/BNHighLevelILAddOperandList.cs | 30 + Function/BNHighLevelILExprEqual.cs | 35 + Function/BNHighLevelILExprLessThan.cs | 33 + Function/BNHighLevelILFreeOperandList.cs | 26 + Function/BNHighLevelILGetCurrentAddress.cs | 24 + Function/BNHighLevelILGetOperandList.cs | 33 + Function/BNHighLevelILHasSideEffects.cs | 27 + Function/BNHighLevelILSetCurrentAddress.cs | 30 + Function/BNHighLevelILTokenEmitterAppend.cs | 28 + ...HighLevelILTokenEmitterAppendCloseBrace.cs | 24 + ...ghLevelILTokenEmitterAppendCloseBracket.cs | 24 + ...HighLevelILTokenEmitterAppendCloseParen.cs | 26 + ...NHighLevelILTokenEmitterAppendOpenBrace.cs | 24 + ...ighLevelILTokenEmitterAppendOpenBracket.cs | 24 + ...NHighLevelILTokenEmitterAppendOpenParen.cs | 24 + ...NHighLevelILTokenEmitterAppendSemicolon.cs | 24 + ...lILTokenEmitterBeginForceZeroConfidence.cs | 24 + .../BNHighLevelILTokenEmitterBeginScope.cs | 27 + ...BNHighLevelILTokenEmitterDecreaseIndent.cs | 24 + ...velILTokenEmitterEndForceZeroConfidence.cs | 24 + Function/BNHighLevelILTokenEmitterEndScope.cs | 27 + Function/BNHighLevelILTokenEmitterFinalize.cs | 26 + .../BNHighLevelILTokenEmitterFinalizeScope.cs | 24 + ...hLevelILTokenEmitterGetBraceRequirement.cs | 24 + ...HighLevelILTokenEmitterGetCurrentTokens.cs | 29 + ...LTokenEmitterGetDefaultBracesOnSameLine.cs | 26 + Function/BNHighLevelILTokenEmitterGetLines.cs | 29 + ...EmitterGetMaxTernarySimplficationTokens.cs | 26 + ...LTokenEmitterHasBracesAroundSwitchCases.cs | 26 + ...evelILTokenEmitterHasCollapsableRegions.cs | 24 + ...BNHighLevelILTokenEmitterIncreaseIndent.cs | 24 + Function/BNHighLevelILTokenEmitterInitLine.cs | 24 + ...LevelILTokenEmitterIsSimpleScopeAllowed.cs | 26 + Function/BNHighLevelILTokenEmitterNewLine.cs | 24 + ...hLevelILTokenEmitterNoIndentForThisLine.cs | 24 + ...ghLevelILTokenEmitterRestoreCurrentExpr.cs | 27 + ...ighLevelILTokenEmitterScopeContinuation.cs | 27 + ...BNHighLevelILTokenEmitterScopeSeparator.cs | 24 + ...hLevelILTokenEmitterSetBraceRequirement.cs | 29 + ...LTokenEmitterSetBracesAroundSwitchCases.cs | 29 + ...BNHighLevelILTokenEmitterSetCurrentExpr.cs | 27 + ...HighLevelILTokenEmitterSetCurrentTokens.cs | 32 + ...LTokenEmitterSetDefaultBracesOnSameLine.cs | 29 + ...lILTokenEmitterSetHasCollapsableRegions.cs | 27 + ...evelILTokenEmitterSetSimpleScopeAllowed.cs | 29 + ...velILTokenPrependCollapseBlankIndicator.cs | 24 + ...ighLevelILTokenPrependCollapseIndicator.cs | 30 + ...ImportedFunctionFromImportAddressSymbol.cs | 29 + Function/BNInitCorePlugins.cs | 23 + Function/BNInitDownloadInstance.cs | 29 + Function/BNInitPlugins.cs | 32 + Function/BNInitRepoPlugins.cs | 23 + Function/BNInitScriptingInstance.cs | 29 + Function/BNInitUserPlugins.cs | 23 + Function/BNInitWebsocketClient.cs | 29 + Function/BNInitializeEnterpriseServer.cs | 23 + Function/BNInsertViewBuffer.cs | 30 + Function/BNInsertViewData.cs | 33 + Function/BNInstallPendingUpdate.cs | 26 + Function/BNInstallScriptingProviderModules.cs | 29 + Function/BNInvertBranch.cs | 30 + Function/BNIsAlwaysBranchPatchAvailable.cs | 30 + Function/BNIsAnalysisChanged.cs | 24 + Function/BNIsAnalysisTypeAutoDefined.cs | 27 + Function/BNIsApplyingDebugInfo.cs | 26 + ...sArchitectureAlwaysBranchPatchAvailable.cs | 34 + Function/BNIsArchitectureGlobalRegister.cs | 27 + ...sArchitectureInvertBranchPatchAvailable.cs | 33 + ...IsArchitectureNeverBranchPatchAvailable.cs | 33 + ...tectureSkipAndReturnValuePatchAvailable.cs | 33 + ...itectureSkipAndReturnZeroPatchAvailable.cs | 33 + Function/BNIsArchitectureSystemRegister.cs | 27 + Function/BNIsBackedByDatabase.cs | 28 + Function/BNIsBackgroundTaskCancelled.cs | 24 + Function/BNIsBackgroundTaskFinished.cs | 24 + Function/BNIsBaseAddressDetectionAborted.cs | 26 + Function/BNIsBinaryViewTypeDeprecated.cs | 26 + Function/BNIsBinaryViewTypeForceLoadable.cs | 26 + Function/BNIsBinaryViewTypeValidForData.cs | 29 + Function/BNIsCallInstruction.cs | 32 + Function/BNIsConditionInverted.cs | 29 + Function/BNIsDatabase.cs | 33 + Function/BNIsDatabaseFromData.cs | 29 + Function/BNIsDebugInfoParserValidForView.cs | 29 + Function/BNIsDemanglerMangledName.cs | 29 + Function/BNIsDisassemblySettingsOptionSet.cs | 27 + Function/BNIsEligibleForHeuristics.cs | 26 + Function/BNIsEndOfFile.cs | 24 + Function/BNIsEnterpriseServerAuthenticated.cs | 23 + Function/BNIsEnterpriseServerConnected.cs | 23 + .../BNIsEnterpriseServerFloatingLicense.cs | 23 + Function/BNIsEnterpriseServerInitialized.cs | 23 + ...IsEnterpriseServerLicenseStillActivated.cs | 23 + Function/BNIsExecutableView.cs | 26 + Function/BNIsFileModified.cs | 24 + Function/BNIsFlowGraphLayoutComplete.cs | 24 + .../BNIsFlowGraphLayoutRequestComplete.cs | 24 + Function/BNIsFlowGraphOptionSet.cs | 27 + Function/BNIsFunctionAnalysisSkipped.cs | 24 + Function/BNIsFunctionInlinedDuringAnalysis.cs | 26 + Function/BNIsFunctionPure.cs | 24 + Function/BNIsFunctionTooLarge.cs | 24 + Function/BNIsFunctionUpdateNeeded.cs | 26 + Function/BNIsGNU3MangledString.cs | 26 + Function/BNIsGuidedSourceBlock.cs | 32 + Function/BNIsHighLevelILBasicBlock.cs | 24 + Function/BNIsHighLevelILFlowGraph.cs | 24 + Function/BNIsHighLevelILSSAVarLive.cs | 30 + Function/BNIsHighLevelILSSAVarLiveAt.cs | 33 + Function/BNIsHighLevelILVarLiveAt.cs | 30 + Function/BNIsILBasicBlock.cs | 24 + Function/BNIsILDisassemblyTextRenderer.cs | 26 + Function/BNIsILFlowGraph.cs | 24 + Function/BNIsIntegerToken.cs | 26 + Function/BNIsInvertBranchPatchAvailable.cs | 30 + Function/BNIsKeyValueStoreEmpty.cs | 24 + ...LanguageRepresentationFunctionTypeValid.cs | 27 + Function/BNIsLicenseValidated.cs | 28 + Function/BNIsLinearViewCursorAfterEnd.cs | 24 + Function/BNIsLinearViewCursorBeforeBegin.cs | 24 + Function/BNIsLowLevelILBasicBlock.cs | 24 + Function/BNIsLowLevelILFlowGraph.cs | 24 + Function/BNIsMainThread.cs | 23 + Function/BNIsMainThreadActionDone.cs | 26 + Function/BNIsMediumLevelILBasicBlock.cs | 24 + Function/BNIsMediumLevelILFlowGraph.cs | 24 + Function/BNIsMediumLevelILSSAVarLive.cs | 30 + Function/BNIsMediumLevelILSSAVarLiveAt.cs | 33 + Function/BNIsMediumLevelILVarLiveAt.cs | 30 + Function/BNIsMemoryMapActivated.cs | 24 + Function/BNIsMemoryRegionEnabled.cs | 28 + Function/BNIsMemoryRegionLocal.cs | 29 + Function/BNIsMemoryRegionRebaseable.cs | 28 + Function/BNIsNeverBranchPatchAvailable.cs | 30 + Function/BNIsNodeValidForFlowGraph.cs | 27 + Function/BNIsOffsetBackedByFile.cs | 27 + Function/BNIsOffsetCodeSemantics.cs | 27 + Function/BNIsOffsetExecutable.cs | 27 + Function/BNIsOffsetExternSemantics.cs | 27 + Function/BNIsOffsetReadable.cs | 27 + Function/BNIsOffsetWritable.cs | 27 + Function/BNIsOffsetWritableSemantics.cs | 27 + Function/BNIsPathDirectory.cs | 26 + Function/BNIsPathRegularFile.cs | 26 + Function/BNIsPluginsEnabled.cs | 28 + Function/BNIsRelocatable.cs | 26 + Function/BNIsSaveSettingsOptionSet.cs | 27 + Function/BNIsShutdownRequested.cs | 28 + .../BNIsSkipAndReturnValuePatchAvailable.cs | 30 + .../BNIsSkipAndReturnZeroPatchAvailable.cs | 30 + Function/BNIsSnapshotAutoSave.cs | 26 + .../BNIsSnapshotDataAppliedWithoutError.cs | 24 + Function/BNIsStackAdjustedOnReturn.cs | 26 + .../BNIsStackReservedForArgumentRegisters.cs | 26 + Function/BNIsStructureBuilderPacked.cs | 24 + Function/BNIsStructureBuilderUnion.cs | 24 + Function/BNIsStructurePacked.cs | 24 + Function/BNIsStructureUnion.cs | 24 + Function/BNIsSymbolAutoDefined.cs | 24 + Function/BNIsTypeArchive.cs | 26 + Function/BNIsTypeBuilderConst.cs | 24 + Function/BNIsTypeBuilderFloatingPoint.cs | 26 + Function/BNIsTypeBuilderPure.cs | 24 + Function/BNIsTypeBuilderSigned.cs | 26 + Function/BNIsTypeBuilderVolatile.cs | 26 + Function/BNIsTypeConst.cs | 24 + Function/BNIsTypeFloatingPoint.cs | 26 + Function/BNIsTypePure.cs | 26 + Function/BNIsTypeSigned.cs | 24 + Function/BNIsTypeVolatile.cs | 24 + Function/BNIsUIEnabled.cs | 29 + Function/BNIsUpdateInstallationPending.cs | 23 + Function/BNIsValidForData.cs | 41 + Function/BNIsValidOffset.cs | 27 + Function/BNIsVariableUserDefined.cs | 29 + Function/BNIsViewModified.cs | 24 + Function/BNKeyValueStoreHasValue.cs | 28 + Function/BNLinearViewCursorNext.cs | 24 + Function/BNLinearViewCursorPrevious.cs | 24 + Function/BNLlvmServicesAssemble.cs | 50 + Function/BNLlvmServicesAssembleFree.cs | 29 + Function/BNLlvmServicesDisasmInstruction.cs | 41 + Function/BNLlvmServicesInit.cs | 23 + Function/BNLoadBinaryView.cs | 37 + Function/BNLoadFilename.cs | 37 + Function/BNLoadProjectFile.cs | 38 + Function/BNLoadScriptingProviderModule.cs | 35 + Function/BNLoadSettingsFile.cs | 34 + Function/BNLoadTypeLibraryFromFile.cs | 25 + Function/BNLogAlertWithStackTrace.cs | 29 + Function/BNLogCreateLogger.cs | 28 + Function/BNLogGetLogger.cs | 28 + Function/BNLogGetLoggerNames.cs | 24 + Function/BNLogString.cs | 92 + Function/BNLogStringWithStackTrace.cs | 41 + Function/BNLogToFile.cs | 31 + Function/BNLogToStderr.cs | 24 + Function/BNLogToStdout.cs | 24 + Function/BNLoggerDedent.cs | 24 + Function/BNLoggerGetName.cs | 24 + Function/BNLoggerGetSessionId.cs | 24 + Function/BNLoggerIndent.cs | 24 + Function/BNLoggerLogString.cs | 31 + Function/BNLoggerLogStringWithStackTrace.cs | 35 + Function/BNLoggerResetIndent.cs | 24 + Function/BNLookupImportedTypePlatform.cs | 33 + Function/BNLookupTypeArchiveById.cs | 26 + Function/BNLookupTypeLibraryByGuid.cs | 28 + Function/BNLookupTypeLibraryByName.cs | 28 + Function/BNLowLevelILAddExpr.cs | 45 + Function/BNLowLevelILAddExprWithLocation.cs | 51 + Function/BNLowLevelILAddInstruction.cs | 27 + Function/BNLowLevelILAddLabelMap.cs | 33 + Function/BNLowLevelILAddOperandList.cs | 30 + Function/BNLowLevelILClearIndirectBranches.cs | 24 + Function/BNLowLevelILFreeOperandList.cs | 26 + Function/BNLowLevelILGetCurrentAddress.cs | 24 + .../BNLowLevelILGetExitsForInstruction.cs | 30 + Function/BNLowLevelILGetInstructionStart.cs | 30 + Function/BNLowLevelILGetInstructionsAt.cs | 33 + Function/BNLowLevelILGetOperandList.cs | 33 + Function/BNLowLevelILGoto.cs | 27 + Function/BNLowLevelILGotoWithLocation.cs | 33 + Function/BNLowLevelILIf.cs | 33 + Function/BNLowLevelILIfWithLocation.cs | 39 + Function/BNLowLevelILInitLabel.cs | 24 + Function/BNLowLevelILMarkLabel.cs | 27 + Function/BNLowLevelILSetCurrentAddress.cs | 30 + Function/BNLowLevelILSetCurrentSourceBlock.cs | 27 + Function/BNLowLevelILSetExprSourceOperand.cs | 30 + Function/BNLowLevelILSetIndirectBranches.cs | 30 + Function/BNLzma2Decompress.cs | 26 + Function/BNLzmaDecompress.cs | 26 + Function/BNMarkBasicBlockAsRecentlyUsed.cs | 26 + Function/BNMarkCallerUpdatesRequired.cs | 29 + Function/BNMarkFileModified.cs | 24 + Function/BNMarkFileSaved.cs | 24 + Function/BNMarkFunctionAsRecentlyUsed.cs | 24 + ...NMarkMediumLevelILInstructionForRemoval.cs | 29 + Function/BNMarkUpdatesRequired.cs | 29 + Function/BNMarkdownToHTML.cs | 35 + Function/BNMaskToSize.cs | 27 + Function/BNMediumLevelILAddExpr.cs | 45 + .../BNMediumLevelILAddExprWithLocation.cs | 51 + Function/BNMediumLevelILAddInstruction.cs | 27 + Function/BNMediumLevelILAddLabelMap.cs | 33 + Function/BNMediumLevelILAddOperandList.cs | 30 + Function/BNMediumLevelILFreeOperandList.cs | 24 + Function/BNMediumLevelILGetCurrentAddress.cs | 24 + .../BNMediumLevelILGetInstructionStart.cs | 30 + Function/BNMediumLevelILGetOperandList.cs | 33 + Function/BNMediumLevelILGoto.cs | 27 + Function/BNMediumLevelILGotoWithLocation.cs | 33 + Function/BNMediumLevelILIf.cs | 33 + Function/BNMediumLevelILIfWithLocation.cs | 39 + Function/BNMediumLevelILInitLabel.cs | 24 + Function/BNMediumLevelILMarkLabel.cs | 27 + Function/BNMediumLevelILSetCurrentAddress.cs | 30 + Function/BNMergeVariables.cs | 35 + Function/BNMetadataArrayAppend.cs | 27 + Function/BNMetadataGetArray.cs | 27 + Function/BNMetadataGetBoolean.cs | 26 + Function/BNMetadataGetBooleanList.cs | 27 + Function/BNMetadataGetDouble.cs | 24 + Function/BNMetadataGetDoubleList.cs | 27 + Function/BNMetadataGetForIndex.cs | 27 + Function/BNMetadataGetForKey.cs | 28 + Function/BNMetadataGetJsonString.cs | 26 + Function/BNMetadataGetRaw.cs | 27 + Function/BNMetadataGetSignedInteger.cs | 24 + Function/BNMetadataGetSignedIntegerList.cs | 27 + Function/BNMetadataGetString.cs | 24 + Function/BNMetadataGetStringList.cs | 27 + Function/BNMetadataGetType.cs | 26 + Function/BNMetadataGetUnsignedInteger.cs | 24 + Function/BNMetadataGetUnsignedIntegerList.cs | 27 + Function/BNMetadataGetValueStore.cs | 24 + Function/BNMetadataIsArray.cs | 24 + Function/BNMetadataIsBoolean.cs | 24 + Function/BNMetadataIsBooleanList.cs | 24 + Function/BNMetadataIsDouble.cs | 24 + Function/BNMetadataIsDoubleList.cs | 24 + Function/BNMetadataIsEqual.cs | 27 + Function/BNMetadataIsKeyValueStore.cs | 24 + Function/BNMetadataIsRaw.cs | 24 + Function/BNMetadataIsSignedInteger.cs | 24 + Function/BNMetadataIsSignedIntegerList.cs | 24 + Function/BNMetadataIsString.cs | 24 + Function/BNMetadataIsStringList.cs | 24 + Function/BNMetadataIsUnsignedInteger.cs | 24 + Function/BNMetadataIsUnsignedIntegerList.cs | 24 + Function/BNMetadataRemoveIndex.cs | 27 + Function/BNMetadataRemoveKey.cs | 28 + Function/BNMetadataSetValueForKey.cs | 32 + Function/BNMetadataSize.cs | 24 + Function/BNNavigate.cs | 31 + Function/BNNewActivityReference.cs | 24 + .../BNNewAnalysisCompletionEventReference.cs | 24 + Function/BNNewAnalysisContextReference.cs | 26 + .../BNNewAnalysisMergeConflictReference.cs | 26 + Function/BNNewBackgroundTaskReference.cs | 24 + Function/BNNewBasicBlockReference.cs | 24 + Function/BNNewCallingConventionReference.cs | 26 + .../BNNewCollaborationChangesetReference.cs | 26 + Function/BNNewCollaborationGroupReference.cs | 26 + .../BNNewCollaborationPermissionReference.cs | 26 + .../BNNewCollaborationSnapshotReference.cs | 26 + .../BNNewCollaborationUndoEntryReference.cs | 26 + Function/BNNewCollaborationUserReference.cs | 26 + Function/BNNewComponentReference.cs | 26 + Function/BNNewDataRendererReference.cs | 26 + Function/BNNewDatabaseReference.cs | 26 + Function/BNNewDebugInfoParserReference.cs | 26 + Function/BNNewDebugInfoReference.cs | 24 + Function/BNNewDisassemblySettingsReference.cs | 26 + .../BNNewDisassemblyTextRendererReference.cs | 26 + Function/BNNewDownloadInstanceReference.cs | 26 + Function/BNNewEnumerationReference.cs | 26 + Function/BNNewExternalLibraryReference.cs | 26 + Function/BNNewExternalLocationReference.cs | 26 + Function/BNNewFieldResolutionInfoReference.cs | 26 + Function/BNNewFileReference.cs | 26 + ...NNewFirmwareNinjaReferenceNodeReference.cs | 26 + ...BNNewFirmwareNinjaRelationshipReference.cs | 26 + .../BNNewFlowGraphLayoutRequestReference.cs | 24 + Function/BNNewFlowGraphNodeReference.cs | 26 + Function/BNNewFlowGraphReference.cs | 26 + Function/BNNewFunctionReference.cs | 26 + Function/BNNewHighLevelILFunctionReference.cs | 26 + .../BNNewHighLevelILTokenEmitterReference.cs | 26 + Function/BNNewKeyValueStoreReference.cs | 26 + ...LanguageRepresentationFunctionReference.cs | 26 + Function/BNNewLinearViewCursorReference.cs | 26 + Function/BNNewLinearViewObjectReference.cs | 24 + Function/BNNewLoggerReference.cs | 26 + Function/BNNewLowLevelILFunctionReference.cs | 26 + Function/BNNewMainThreadActionReference.cs | 26 + .../BNNewMediumLevelILFunctionReference.cs | 26 + Function/BNNewMetadataReference.cs | 26 + Function/BNNewNamedTypeReference.cs | 24 + Function/BNNewPlatformReference.cs | 24 + Function/BNNewPluginReference.cs | 26 + Function/BNNewProjectFileReference.cs | 26 + Function/BNNewProjectFolderReference.cs | 26 + Function/BNNewProjectReference.cs | 26 + Function/BNNewRelocationHandlerReference.cs | 26 + Function/BNNewRelocationReference.cs | 26 + Function/BNNewRemoteFileReference.cs | 26 + Function/BNNewRemoteFolderReference.cs | 26 + Function/BNNewRemoteProjectReference.cs | 26 + Function/BNNewRemoteReference.cs | 26 + Function/BNNewReportCollectionReference.cs | 26 + Function/BNNewRepositoryManagerReference.cs | 26 + Function/BNNewRepositoryReference.cs | 26 + Function/BNNewSaveSettingsReference.cs | 26 + Function/BNNewScriptingInstanceReference.cs | 26 + Function/BNNewSectionReference.cs | 26 + Function/BNNewSegmentReference.cs | 26 + Function/BNNewSettingsReference.cs | 26 + Function/BNNewSnapshotReference.cs | 26 + Function/BNNewStructureReference.cs | 26 + Function/BNNewSymbolReference.cs | 26 + Function/BNNewTagReference.cs | 26 + Function/BNNewTagTypeReference.cs | 26 + Function/BNNewTemporaryFileReference.cs | 26 + Function/BNNewTransformContextReference.cs | 26 + Function/BNNewTransformSessionReference.cs | 26 + .../BNNewTypeArchiveMergeConflictReference.cs | 26 + Function/BNNewTypeArchiveReference.cs | 25 + Function/BNNewTypeLibrary.cs | 28 + Function/BNNewTypeLibraryReference.cs | 26 + Function/BNNewTypeReference.cs | 24 + Function/BNNewUndoActionReference.cs | 24 + Function/BNNewUndoEntryReference.cs | 24 + Function/BNNewUserReference.cs | 26 + Function/BNNewViewReference.cs | 26 + Function/BNNewWebsocketClientReference.cs | 26 + Function/BNNewWorkflowReference.cs | 26 + Function/BNNotifyDataInserted.cs | 30 + Function/BNNotifyDataRemoved.cs | 30 + Function/BNNotifyDataWritten.cs | 30 + Function/BNNotifyErrorForScriptingInstance.cs | 29 + ...tifyInputReadyStateForScriptingInstance.cs | 29 + .../BNNotifyOutputForScriptingInstance.cs | 29 + .../BNNotifyProgressForDownloadInstance.cs | 32 + .../BNNotifyWarningForScriptingInstance.cs | 29 + Function/BNNotifyWebsocketClientConnect.cs | 26 + Function/BNNotifyWebsocketClientDisconnect.cs | 26 + Function/BNNotifyWebsocketClientError.cs | 29 + Function/BNNotifyWebsocketClientReadData.cs | 32 + Function/BNOpenDatabaseForConfiguration.cs | 28 + Function/BNOpenExistingDatabase.cs | 28 + .../BNOpenExistingDatabaseWithProgress.cs | 34 + Function/BNOpenProject.cs | 26 + Function/BNOpenTypeArchive.cs | 26 + Function/BNOpenUrl.cs | 33 + Function/BNParseBinaryViewOfType.cs | 29 + Function/BNParseDebugInfo.cs | 41 + Function/BNParseExpression.cs | 37 + Function/BNParsePossibleValueSet.cs | 40 + Function/BNParseTextFormat.cs | 26 + Function/BNParseTypeParserOptionsText.cs | 29 + Function/BNParseTypeString.cs | 40 + Function/BNParseTypesFromSource.cs | 47 + Function/BNParseTypesFromSourceFile.cs | 44 + Function/BNParseTypesString.cs | 52 + Function/BNParseVersionString.cs | 29 + Function/BNPathExists.cs | 26 + Function/BNPerformCustomRequest.cs | 47 + Function/BNPerformDownloadRequest.cs | 32 + Function/BNPerformSearch.cs | 37 + Function/BNPlatformAdjustTypeParserInput.cs | 59 + .../BNPluginAreDependenciesBeingInstalled.cs | 26 + Function/BNPluginDisable.cs | 26 + Function/BNPluginEnable.cs | 29 + Function/BNPluginGetApis.cs | 29 + Function/BNPluginGetAuthor.cs | 26 + Function/BNPluginGetAuthorUrl.cs | 26 + Function/BNPluginGetCommit.cs | 26 + Function/BNPluginGetDependencies.cs | 26 + Function/BNPluginGetDescription.cs | 26 + Function/BNPluginGetLastUpdate.cs | 26 + Function/BNPluginGetLicenseText.cs | 26 + Function/BNPluginGetLongdescription.cs | 26 + Function/BNPluginGetMaximumVersionInfo.cs | 26 + Function/BNPluginGetMinimumVersionInfo.cs | 26 + Function/BNPluginGetName.cs | 26 + Function/BNPluginGetPackageUrl.cs | 26 + Function/BNPluginGetPath.cs | 26 + Function/BNPluginGetPlatforms.cs | 29 + Function/BNPluginGetPluginStatus.cs | 26 + Function/BNPluginGetPluginTypes.cs | 29 + Function/BNPluginGetProjectData.cs | 26 + Function/BNPluginGetProjectUrl.cs | 26 + Function/BNPluginGetRepository.cs | 26 + Function/BNPluginGetSubdir.cs | 26 + Function/BNPluginGetVersion.cs | 26 + Function/BNPluginGetViewOnly.cs | 26 + Function/BNPluginInstall.cs | 26 + Function/BNPluginInstallDependencies.cs | 26 + Function/BNPluginIsBeingDeleted.cs | 26 + Function/BNPluginIsBeingUpdated.cs | 26 + Function/BNPluginIsDeletePending.cs | 26 + Function/BNPluginIsDisablePending.cs | 26 + Function/BNPluginIsEnabled.cs | 26 + Function/BNPluginIsInstalled.cs | 26 + Function/BNPluginIsRunning.cs | 26 + Function/BNPluginIsUpdateAvailable.cs | 26 + Function/BNPluginIsUpdatePending.cs | 26 + Function/BNPluginUninstall.cs | 26 + Function/BNPluginUpdate.cs | 26 + ...PostProcessDisassemblyTextRendererLines.cs | 44 + .../BNPostWorkflowRequestForBinaryView.cs | 29 + Function/BNPostWorkflowRequestForFunction.cs | 29 + .../BNPrepareToCopyLowLevelILBasicBlock.cs | 27 + Function/BNPrepareToCopyLowLevelILFunction.cs | 27 + .../BNPrepareToCopyMediumLevelILBasicBlock.cs | 27 + .../BNPrepareToCopyMediumLevelILFunction.cs | 27 + Function/BNPreprocessSource.cs | 41 + Function/BNProcessSymbolQueue.cs | 26 + Function/BNProjectBeginBulkOperation.cs | 26 + Function/BNProjectClose.cs | 26 + Function/BNProjectCreateFile.cs | 47 + Function/BNProjectCreateFileFromPath.cs | 44 + Function/BNProjectCreateFileFromPathUnsafe.cs | 50 + Function/BNProjectCreateFileUnsafe.cs | 53 + Function/BNProjectCreateFolder.cs | 35 + Function/BNProjectCreateFolderFromPath.cs | 41 + Function/BNProjectCreateFolderUnsafe.cs | 38 + Function/BNProjectDeleteFile.cs | 29 + Function/BNProjectDeleteFolder.cs | 35 + Function/BNProjectEndBulkOperation.cs | 26 + Function/BNProjectFileExistsOnDisk.cs | 26 + Function/BNProjectFileExport.cs | 29 + Function/BNProjectFileGetCreationTimestamp.cs | 26 + Function/BNProjectFileGetDescription.cs | 26 + Function/BNProjectFileGetFolder.cs | 26 + Function/BNProjectFileGetId.cs | 26 + Function/BNProjectFileGetName.cs | 26 + Function/BNProjectFileGetPathInProject.cs | 26 + Function/BNProjectFileGetPathOnDisk.cs | 26 + Function/BNProjectFileGetProject.cs | 26 + Function/BNProjectFileSetDescription.cs | 29 + Function/BNProjectFileSetFolder.cs | 29 + Function/BNProjectFileSetName.cs | 29 + Function/BNProjectFolderExport.cs | 35 + Function/BNProjectFolderGetDescription.cs | 26 + Function/BNProjectFolderGetId.cs | 26 + Function/BNProjectFolderGetName.cs | 26 + Function/BNProjectFolderGetParent.cs | 26 + Function/BNProjectFolderGetProject.cs | 26 + Function/BNProjectFolderSetDescription.cs | 29 + Function/BNProjectFolderSetName.cs | 29 + Function/BNProjectFolderSetParent.cs | 29 + Function/BNProjectGetDescription.cs | 26 + Function/BNProjectGetFileById.cs | 29 + Function/BNProjectGetFileByPathOnDisk.cs | 29 + Function/BNProjectGetFilePathInProject.cs | 29 + Function/BNProjectGetFiles.cs | 29 + Function/BNProjectGetFilesByPathInProject.cs | 32 + Function/BNProjectGetFolderById.cs | 29 + Function/BNProjectGetFolders.cs | 29 + Function/BNProjectGetId.cs | 26 + Function/BNProjectGetName.cs | 26 + Function/BNProjectGetPath.cs | 26 + Function/BNProjectGetRemoteProject.cs | 26 + Function/BNProjectIsOpen.cs | 26 + Function/BNProjectOpen.cs | 26 + Function/BNProjectPushFile.cs | 29 + Function/BNProjectPushFolder.cs | 29 + Function/BNProjectQueryMetadata.cs | 29 + Function/BNProjectRemoveMetadata.cs | 29 + Function/BNProjectSetDescription.cs | 29 + Function/BNProjectSetName.cs | 29 + Function/BNProjectStoreMetadata.cs | 32 + Function/BNPromoteDemangler.cs | 26 + Function/BNRangeContainsRelocation.cs | 30 + Function/BNRead16.cs | 27 + Function/BNRead32.cs | 27 + Function/BNRead64.cs | 27 + Function/BNRead8.cs | 27 + Function/BNReadBE16.cs | 27 + Function/BNReadBE32.cs | 27 + Function/BNReadBE64.cs | 27 + Function/BNReadData.cs | 30 + Function/BNReadDataForDownloadInstance.cs | 32 + Function/BNReadDatabaseAnalysisCache.cs | 26 + Function/BNReadDatabaseGlobal.cs | 29 + Function/BNReadDatabaseGlobalData.cs | 29 + Function/BNReadLE16.cs | 27 + Function/BNReadLE32.cs | 27 + Function/BNReadLE64.cs | 27 + Function/BNReadPointer.cs | 30 + Function/BNReadSnapshotData.cs | 26 + Function/BNReadSnapshotDataWithProgress.cs | 32 + Function/BNReadViewBuffer.cs | 30 + Function/BNReadViewData.cs | 33 + Function/BNReanalyzeAllFunctions.cs | 24 + Function/BNReanalyzeFunction.cs | 27 + Function/BNRebase.cs | 27 + Function/BNRebaseWithProgress.cs | 33 + Function/BNRecognizePlatformForViewType.cs | 36 + Function/BNRedo.cs | 24 + ...BNRegisterAnalysisMergeConflictSplitter.cs | 26 + Function/BNRegisterArchitecture.cs | 28 + Function/BNRegisterArchitectureExtension.cs | 32 + Function/BNRegisterArchitectureForViewType.cs | 33 + ...NRegisterArchitectureFunctionRecognizer.cs | 29 + Function/BNRegisterArchitectureHook.cs | 29 + Function/BNRegisterBinaryViewEvent.cs | 48 + Function/BNRegisterBinaryViewType.cs | 31 + Function/BNRegisterCallingConvention.cs | 29 + Function/BNRegisterDataNotification.cs | 29 + Function/BNRegisterDebugInfoParser.cs | 35 + .../BNRegisterDefaultPlatformForViewType.cs | 30 + Function/BNRegisterDemangler.cs | 29 + Function/BNRegisterDownloadProvider.cs | 29 + .../BNRegisterEnterpriseServerNotification.cs | 26 + Function/BNRegisterFlowGraphLayout.cs | 29 + Function/BNRegisterGenericDataRenderer.cs | 29 + .../BNRegisterGlobalFunctionRecognizer.cs | 26 + Function/BNRegisterInteractionHandler.cs | 26 + ...isterLanguageRepresentationFunctionType.cs | 29 + Function/BNRegisterLineFormatter.cs | 29 + Function/BNRegisterLogListener.cs | 24 + Function/BNRegisterMainThread.cs | 26 + .../BNRegisterObjectDestructionCallbacks.cs | 26 + Function/BNRegisterObjectRefDebugTrace.cs | 26 + Function/BNRegisterPlatform.cs | 28 + .../BNRegisterPlatformCallingConvention.cs | 27 + ...NRegisterPlatformCdeclCallingConvention.cs | 27 + ...egisterPlatformDefaultCallingConvention.cs | 27 + ...gisterPlatformFastcallCallingConvention.cs | 27 + Function/BNRegisterPlatformForViewType.cs | 35 + ...BNRegisterPlatformRecognizerForViewType.cs | 43 + ...egisterPlatformStdcallCallingConvention.cs | 27 + Function/BNRegisterPlatformTypes.cs | 27 + Function/BNRegisterPluginCommand.cs | 37 + Function/BNRegisterPluginCommandForAddress.cs | 37 + .../BNRegisterPluginCommandForFunction.cs | 38 + ...sterPluginCommandForHighLevelILFunction.cs | 38 + ...rPluginCommandForHighLevelILInstruction.cs | 38 + ...isterPluginCommandForLowLevelILFunction.cs | 38 + ...erPluginCommandForLowLevelILInstruction.cs | 38 + ...erPluginCommandForMediumLevelILFunction.cs | 38 + ...luginCommandForMediumLevelILInstruction.cs | 38 + Function/BNRegisterPluginCommandForProject.cs | 38 + Function/BNRegisterPluginCommandForRange.cs | 38 + Function/BNRegisterProjectNotification.cs | 29 + Function/BNRegisterRenderLayer.cs | 30 + ...RegisterScriptingInstanceOutputListener.cs | 29 + Function/BNRegisterScriptingProvider.cs | 32 + Function/BNRegisterSecretsProvider.cs | 29 + Function/BNRegisterTransformType.cs | 37 + ...BNRegisterTransformTypeWithCapabilities.cs | 40 + Function/BNRegisterTypeArchiveNotification.cs | 29 + Function/BNRegisterTypeParser.cs | 29 + Function/BNRegisterTypePrinter.cs | 29 + .../BNRegisterTypeSpecificDataRenderer.cs | 29 + Function/BNRegisterWebsocketProvider.cs | 29 + Function/BNRegisterWorkflow.cs | 28 + .../BNReleaseAdvancedFunctionAnalysisData.cs | 26 + ...aseAdvancedFunctionAnalysisDataMultiple.cs | 29 + Function/BNReleaseEnterpriseServerLicense.cs | 23 + Function/BNRelocationGetArchitecture.cs | 26 + Function/BNRelocationGetInfo.cs | 26 + Function/BNRelocationGetReloc.cs | 26 + Function/BNRelocationGetSymbol.cs | 26 + Function/BNRelocationGetTarget.cs | 26 + .../BNRelocationHandlerApplyRelocation.cs | 41 + ...RelocationHandlerDefaultApplyRelocation.cs | 41 + ...nHandlerGetOperandForExternalRelocation.cs | 41 + .../BNRelocationHandlerGetRelocationInfo.cs | 38 + Function/BNRemoteConnect.cs | 32 + Function/BNRemoteCreateGroup.cs | 35 + Function/BNRemoteCreateProject.cs | 32 + Function/BNRemoteCreateUser.cs | 50 + Function/BNRemoteDeleteGroup.cs | 29 + Function/BNRemoteDeleteProject.cs | 29 + Function/BNRemoteDisconnect.cs | 26 + Function/BNRemoteFileCreateSnapshot.cs | 59 + Function/BNRemoteFileDeleteSnapshot.cs | 29 + Function/BNRemoteFileDownload.cs | 38 + Function/BNRemoteFileGetChatLogUrl.cs | 26 + Function/BNRemoteFileGetCoreFile.cs | 26 + Function/BNRemoteFileGetCreated.cs | 26 + Function/BNRemoteFileGetCreatedBy.cs | 26 + Function/BNRemoteFileGetDescription.cs | 26 + Function/BNRemoteFileGetFolder.cs | 26 + Function/BNRemoteFileGetHash.cs | 26 + Function/BNRemoteFileGetId.cs | 26 + Function/BNRemoteFileGetLastModified.cs | 26 + Function/BNRemoteFileGetLastSnapshot.cs | 26 + Function/BNRemoteFileGetLastSnapshotBy.cs | 26 + Function/BNRemoteFileGetLastSnapshotName.cs | 26 + Function/BNRemoteFileGetMetadata.cs | 26 + Function/BNRemoteFileGetName.cs | 26 + Function/BNRemoteFileGetProject.cs | 26 + Function/BNRemoteFileGetRemote.cs | 26 + Function/BNRemoteFileGetSize.cs | 26 + Function/BNRemoteFileGetSnapshotById.cs | 29 + Function/BNRemoteFileGetSnapshots.cs | 29 + Function/BNRemoteFileGetType.cs | 26 + Function/BNRemoteFileGetUrl.cs | 26 + Function/BNRemoteFileGetUserPositionsUrl.cs | 26 + Function/BNRemoteFileHasPulledSnapshots.cs | 26 + Function/BNRemoteFilePullSnapshots.cs | 32 + Function/BNRemoteFileRequestChatLog.cs | 26 + Function/BNRemoteFileRequestUserPositions.cs | 26 + Function/BNRemoteFileSetDescription.cs | 29 + Function/BNRemoteFileSetFolder.cs | 29 + Function/BNRemoteFileSetMetadata.cs | 29 + Function/BNRemoteFileSetName.cs | 29 + Function/BNRemoteFolderGetCoreFolder.cs | 26 + Function/BNRemoteFolderGetDescription.cs | 26 + Function/BNRemoteFolderGetId.cs | 26 + Function/BNRemoteFolderGetName.cs | 26 + Function/BNRemoteFolderGetParent.cs | 29 + Function/BNRemoteFolderGetParentId.cs | 29 + Function/BNRemoteFolderGetProject.cs | 26 + Function/BNRemoteFolderGetRemote.cs | 26 + Function/BNRemoteFolderGetUrl.cs | 26 + Function/BNRemoteFolderSetDescription.cs | 29 + Function/BNRemoteFolderSetName.cs | 29 + Function/BNRemoteFolderSetParent.cs | 29 + Function/BNRemoteGetAddress.cs | 26 + Function/BNRemoteGetAuthBackends.cs | 35 + Function/BNRemoteGetCurrentUser.cs | 26 + Function/BNRemoteGetGroupById.cs | 29 + Function/BNRemoteGetGroupByName.cs | 29 + Function/BNRemoteGetGroups.cs | 29 + Function/BNRemoteGetName.cs | 26 + Function/BNRemoteGetProjectById.cs | 29 + Function/BNRemoteGetProjectByName.cs | 29 + Function/BNRemoteGetProjects.cs | 29 + Function/BNRemoteGetServerBuildId.cs | 26 + Function/BNRemoteGetServerBuildVersion.cs | 26 + Function/BNRemoteGetServerVersion.cs | 26 + Function/BNRemoteGetToken.cs | 26 + Function/BNRemoteGetUniqueId.cs | 26 + Function/BNRemoteGetUserById.cs | 29 + Function/BNRemoteGetUserByUsername.cs | 29 + Function/BNRemoteGetUsername.cs | 26 + Function/BNRemoteGetUsers.cs | 29 + Function/BNRemoteHasLoadedMetadata.cs | 26 + Function/BNRemoteHasPulledGroups.cs | 26 + Function/BNRemoteHasPulledProjects.cs | 26 + Function/BNRemoteHasPulledUsers.cs | 26 + Function/BNRemoteImportLocalProject.cs | 35 + Function/BNRemoteIsAdmin.cs | 26 + Function/BNRemoteIsConnected.cs | 26 + Function/BNRemoteIsEnterprise.cs | 26 + Function/BNRemoteLoadMetadata.cs | 26 + Function/BNRemoteProjectCanUserAdmin.cs | 29 + Function/BNRemoteProjectCanUserEdit.cs | 29 + Function/BNRemoteProjectCanUserView.cs | 29 + Function/BNRemoteProjectClose.cs | 26 + Function/BNRemoteProjectCreateFile.cs | 53 + Function/BNRemoteProjectCreateFolder.cs | 41 + .../BNRemoteProjectCreateGroupPermission.cs | 38 + .../BNRemoteProjectCreateUserPermission.cs | 38 + Function/BNRemoteProjectDeleteFile.cs | 29 + Function/BNRemoteProjectDeleteFolder.cs | 29 + Function/BNRemoteProjectDeletePermission.cs | 29 + Function/BNRemoteProjectGetCoreProject.cs | 26 + Function/BNRemoteProjectGetCreated.cs | 26 + Function/BNRemoteProjectGetDescription.cs | 26 + Function/BNRemoteProjectGetFileById.cs | 29 + Function/BNRemoteProjectGetFileByName.cs | 29 + Function/BNRemoteProjectGetFiles.cs | 29 + Function/BNRemoteProjectGetFolderById.cs | 29 + Function/BNRemoteProjectGetFolders.cs | 29 + .../BNRemoteProjectGetGroupPermissions.cs | 29 + Function/BNRemoteProjectGetId.cs | 26 + Function/BNRemoteProjectGetLastModified.cs | 26 + Function/BNRemoteProjectGetName.cs | 26 + Function/BNRemoteProjectGetPermissionById.cs | 29 + .../BNRemoteProjectGetReceivedFileCount.cs | 26 + .../BNRemoteProjectGetReceivedFolderCount.cs | 26 + Function/BNRemoteProjectGetRemote.cs | 26 + Function/BNRemoteProjectGetUrl.cs | 26 + Function/BNRemoteProjectGetUserPermissions.cs | 27 + Function/BNRemoteProjectHasPulledFiles.cs | 26 + Function/BNRemoteProjectHasPulledFolders.cs | 26 + ...NRemoteProjectHasPulledGroupPermissions.cs | 26 + ...BNRemoteProjectHasPulledUserPermissions.cs | 26 + Function/BNRemoteProjectIsAdmin.cs | 26 + Function/BNRemoteProjectIsOpen.cs | 26 + Function/BNRemoteProjectOpen.cs | 32 + Function/BNRemoteProjectPullFiles.cs | 32 + Function/BNRemoteProjectPullFolders.cs | 32 + .../BNRemoteProjectPullGroupPermissions.cs | 32 + .../BNRemoteProjectPullUserPermissions.cs | 32 + Function/BNRemoteProjectPushFile.cs | 38 + Function/BNRemoteProjectPushFolder.cs | 38 + Function/BNRemoteProjectPushPermission.cs | 38 + Function/BNRemoteProjectSetDescription.cs | 29 + Function/BNRemoteProjectSetName.cs | 29 + Function/BNRemotePullGroups.cs | 32 + Function/BNRemotePullProjects.cs | 32 + Function/BNRemotePullUsers.cs | 32 + Function/BNRemotePushGroup.cs | 38 + Function/BNRemotePushProject.cs | 38 + Function/BNRemotePushUser.cs | 38 + Function/BNRemoteRequest.cs | 32 + .../BNRemoteRequestAuthenticationToken.cs | 32 + Function/BNRemoteSearchGroups.cs | 38 + Function/BNRemoteSearchUsers.cs | 38 + Function/BNRemoveAnalysisFunction.cs | 30 + Function/BNRemoveAutoAddressTag.cs | 33 + Function/BNRemoveAutoAddressTagsOfType.cs | 33 + Function/BNRemoveAutoDataTag.cs | 30 + Function/BNRemoveAutoDataTagsOfType.cs | 30 + Function/BNRemoveAutoFunctionTag.cs | 29 + Function/BNRemoveAutoFunctionTagsOfType.cs | 29 + Function/BNRemoveAutoSection.cs | 29 + Function/BNRemoveAutoSegment.cs | 32 + Function/BNRemoveComponent.cs | 27 + Function/BNRemoveComponentByGuid.cs | 28 + Function/BNRemoveDataReference.cs | 30 + Function/BNRemoveDatabaseSnapshot.cs | 29 + .../BNRemoveDebugDataVariableByAddress.cs | 32 + Function/BNRemoveDebugFunctionByIndex.cs | 32 + Function/BNRemoveDebugParserDataVariables.cs | 29 + Function/BNRemoveDebugParserFunctions.cs | 29 + Function/BNRemoveDebugParserInfo.cs | 29 + Function/BNRemoveDebugParserTypes.cs | 29 + Function/BNRemoveDebugTypeByName.cs | 32 + Function/BNRemoveEnumerationBuilderMember.cs | 27 + .../BNRemoveExpressionParserMagicValue.cs | 28 + .../BNRemoveExpressionParserMagicValues.cs | 31 + Function/BNRemoveFlowGraphRenderLayer.cs | 27 + Function/BNRemoveGuidedSourceBlocks.cs | 32 + .../BNRemoveLinearViewCursorRenderLayer.cs | 27 + Function/BNRemoveMemoryRegion.cs | 28 + Function/BNRemoveStructureBuilderMember.cs | 27 + Function/BNRemoveTag.cs | 32 + Function/BNRemoveTagReference.cs | 29 + Function/BNRemoveTagType.cs | 27 + Function/BNRemoveTypeBuilderAttribute.cs | 29 + Function/BNRemoveUserAddressTag.cs | 33 + Function/BNRemoveUserAddressTagsOfType.cs | 33 + Function/BNRemoveUserCodeReference.cs | 33 + Function/BNRemoveUserDataReference.cs | 30 + Function/BNRemoveUserDataTag.cs | 30 + Function/BNRemoveUserDataTagsOfType.cs | 30 + Function/BNRemoveUserFunction.cs | 27 + Function/BNRemoveUserFunctionTag.cs | 27 + Function/BNRemoveUserFunctionTagsOfType.cs | 29 + Function/BNRemoveUserSection.cs | 29 + Function/BNRemoveUserSegment.cs | 32 + Function/BNRemoveUserTypeFieldReference.cs | 41 + Function/BNRemoveUserTypeReference.cs | 35 + Function/BNRemoveViewData.cs | 30 + Function/BNRenameAnalysisType.cs | 30 + Function/BNRenameFile.cs | 29 + Function/BNRenameTypeArchiveType.cs | 32 + Function/BNRenderLinesForData.cs | 53 + Function/BNReplaceEnumerationBuilderMember.cs | 34 + Function/BNReplaceFlowGraphNode.cs | 30 + Function/BNReplaceHighLevelILExpr.cs | 30 + Function/BNReplaceLowLevelILExpr.cs | 30 + Function/BNReplaceMediumLevelILExpr.cs | 30 + Function/BNReplaceMediumLevelILInstruction.cs | 32 + Function/BNReplaceStructureBuilderMember.cs | 37 + .../BNRepositoryFreePluginDirectoryList.cs | 29 + Function/BNRepositoryGetPluginByPath.cs | 29 + Function/BNRepositoryGetPlugins.cs | 29 + Function/BNRepositoryGetPluginsPath.cs | 26 + Function/BNRepositoryGetRepoPath.cs | 26 + Function/BNRepositoryGetRepositoryByPath.cs | 29 + Function/BNRepositoryGetUrl.cs | 26 + Function/BNRepositoryManagerAddRepository.cs | 32 + .../BNRepositoryManagerCheckForUpdates.cs | 26 + ...BNRepositoryManagerGetDefaultRepository.cs | 26 + .../BNRepositoryManagerGetRepositories.cs | 29 + .../BNRequestAdvancedFunctionAnalysisData.cs | 26 + Function/BNRequestFunctionDebugReport.cs | 29 + ...ssemblyTextRendererDeduplicatedComments.cs | 26 + Function/BNResetMemoryMap.cs | 24 + .../BNResolveStructureMemberOrBaseMember.cs | 47 + Function/BNRevertUndoActions.cs | 28 + Function/BNRunProgressDialog.cs | 35 + Function/BNRustSimplifyStrToFQN.cs | 32 + Function/BNRustSimplifyStrToStr.cs | 26 + Function/BNSaveAutoSnapshot.cs | 27 + Function/BNSaveAutoSnapshotWithProgress.cs | 33 + Function/BNSaveLastRun.cs | 28 + Function/BNSaveToFile.cs | 27 + Function/BNSaveToFilename.cs | 28 + Function/BNScriptingInstanceCompleteInput.cs | 32 + .../BNScriptingInstanceReleaseBinaryView.cs | 29 + Function/BNSearch.cs | 40 + Function/BNSecretsProviderHasData.cs | 29 + Function/BNSectionGetAlign.cs | 26 + Function/BNSectionGetEnd.cs | 26 + Function/BNSectionGetEntrySize.cs | 26 + Function/BNSectionGetInfoData.cs | 26 + Function/BNSectionGetInfoSection.cs | 26 + Function/BNSectionGetLength.cs | 26 + Function/BNSectionGetLinkedSection.cs | 26 + Function/BNSectionGetName.cs | 26 + Function/BNSectionGetSemantics.cs | 26 + Function/BNSectionGetStart.cs | 26 + Function/BNSectionGetType.cs | 26 + Function/BNSectionIsAutoDefined.cs | 26 + Function/BNSeekBinaryReader.cs | 27 + Function/BNSeekBinaryReaderRelative.cs | 29 + Function/BNSeekBinaryWriter.cs | 27 + Function/BNSeekBinaryWriterRelative.cs | 29 + Function/BNSeekLinearViewCursorToAddress.cs | 27 + Function/BNSeekLinearViewCursorToBegin.cs | 24 + .../BNSeekLinearViewCursorToCursorPath.cs | 29 + ...kLinearViewCursorToCursorPathAndAddress.cs | 32 + Function/BNSeekLinearViewCursorToEnd.cs | 24 + .../BNSeekLinearViewCursorToOrderingIndex.cs | 27 + Function/BNSeekLinearViewCursorToPath.cs | 30 + .../BNSeekLinearViewCursorToPathAndAddress.cs | 35 + Function/BNSegmentGetDataEnd.cs | 26 + Function/BNSegmentGetDataLength.cs | 26 + Function/BNSegmentGetDataOffset.cs | 26 + Function/BNSegmentGetEnd.cs | 26 + Function/BNSegmentGetFlags.cs | 26 + Function/BNSegmentGetLength.cs | 26 + Function/BNSegmentGetStart.cs | 26 + Function/BNSegmentIsAutoDefined.cs | 26 + Function/BNSerializeSettings.cs | 34 + Function/BNSetActiveUpdateChannel.cs | 26 + Function/BNSetAnalysisHold.cs | 27 + ...BNSetArchitectureCdeclCallingConvention.cs | 29 + ...SetArchitectureDefaultCallingConvention.cs | 29 + ...etArchitectureFastcallCallingConvention.cs | 29 + ...SetArchitectureStdcallCallingConvention.cs | 29 + Function/BNSetAutoBasicBlockHighlight.cs | 27 + .../BNSetAutoCallRegisterStackAdjustment.cs | 38 + ...RegisterStackAdjustmentForRegisterStack.cs | 41 + Function/BNSetAutoCallStackAdjustment.cs | 38 + Function/BNSetAutoCallTypeAdjustment.cs | 35 + .../BNSetAutoFunctionCallingConvention.cs | 29 + Function/BNSetAutoFunctionCanReturn.cs | 29 + .../BNSetAutoFunctionClobberedRegisters.cs | 29 + .../BNSetAutoFunctionHasVariableArguments.cs | 29 + .../BNSetAutoFunctionInlinedDuringAnalysis.cs | 29 + .../BNSetAutoFunctionParameterVariables.cs | 29 + Function/BNSetAutoFunctionPure.cs | 29 + ...SetAutoFunctionRegisterStackAdjustments.cs | 32 + Function/BNSetAutoFunctionReturnRegisters.cs | 29 + Function/BNSetAutoFunctionReturnType.cs | 29 + Function/BNSetAutoFunctionStackAdjustment.cs | 29 + Function/BNSetAutoIndirectBranches.cs | 38 + Function/BNSetAutoInstructionHighlight.cs | 35 + Function/BNSetAutoUpdatesEnabled.cs | 26 + Function/BNSetBackgroundTaskProgressText.cs | 28 + .../BNSetBaseStructuresForStructureBuilder.cs | 30 + Function/BNSetBasicBlockEnd.cs | 27 + Function/BNSetBasicBlockList.cs | 32 + Function/BNSetBinaryReaderEndianness.cs | 27 + Function/BNSetBinaryReaderVirtualBase.cs | 27 + Function/BNSetBinaryWriterEndianness.cs | 27 + Function/BNSetBundledPluginDirectory.cs | 33 + Function/BNSetCommentForAddress.cs | 31 + Function/BNSetConditionInverted.cs | 32 + Function/BNSetCurrentPluginLoadOrder.cs | 32 + Function/BNSetDataBufferByte.cs | 32 + Function/BNSetDataBufferContents.cs | 30 + Function/BNSetDataBufferLength.cs | 29 + Function/BNSetDatabaseCurrentSnapshot.cs | 29 + Function/BNSetDebugInfo.cs | 27 + Function/BNSetDefaultArchitecture.cs | 29 + Function/BNSetDefaultPlatform.cs | 29 + Function/BNSetDisassemblyAddressBaseOffset.cs | 29 + Function/BNSetDisassemblyAddressMode.cs | 29 + Function/BNSetDisassemblyBlockLabels.cs | 29 + .../BNSetDisassemblyCallParameterHints.cs | 29 + Function/BNSetDisassemblyGutterWidth.cs | 29 + .../BNSetDisassemblyMaximumSymbolWidth.cs | 29 + Function/BNSetDisassemblySettingsOption.cs | 32 + ...NSetDisassemblyTextRendererArchitecture.cs | 29 + .../BNSetDisassemblyTextRendererBasicBlock.cs | 29 + .../BNSetDisassemblyTextRendererSettings.cs | 29 + Function/BNSetDisassemblyWidth.cs | 27 + Function/BNSetEarlyReturn.cs | 32 + Function/BNSetEnterpriseServerUrl.cs | 26 + Function/BNSetErrorForDownloadInstance.cs | 29 + Function/BNSetExprFolding.cs | 32 + Function/BNSetFieldResolutionForVariableAt.cs | 35 + .../BNSetFileMetadataNavigationHandler.cs | 29 + Function/BNSetFilename.cs | 29 + Function/BNSetFlowGraphBasicBlock.cs | 27 + Function/BNSetFlowGraphHighLevelILFunction.cs | 27 + Function/BNSetFlowGraphLowLevelILFunction.cs | 27 + .../BNSetFlowGraphMediumLevelILFunction.cs | 27 + Function/BNSetFlowGraphNodeHighlight.cs | 27 + Function/BNSetFlowGraphNodeLines.cs | 30 + Function/BNSetFlowGraphNodeMargins.cs | 30 + Function/BNSetFlowGraphOption.cs | 30 + Function/BNSetFunctionAnalysisSkipOverride.cs | 29 + .../BNSetFunctionAnalysisUpdateDisabled.cs | 27 + Function/BNSetFunctionAutoType.cs | 27 + Function/BNSetFunctionComment.cs | 28 + Function/BNSetFunctionForFlowGraph.cs | 27 + Function/BNSetFunctionTypeBuilderCanReturn.cs | 27 + .../BNSetFunctionTypeBuilderParameters.cs | 31 + Function/BNSetFunctionUserType.cs | 29 + ...SetFunctionVariableDeadStoreElimination.cs | 32 + Function/BNSetGlobalCommentForAddress.cs | 31 + Function/BNSetGuidedSourceBlocks.cs | 32 + Function/BNSetHighLevelILExprAttributes.cs | 30 + Function/BNSetHighLevelILExprType.cs | 30 + Function/BNSetHighLevelILFunction.cs | 29 + Function/BNSetHighLevelILRootExpr.cs | 27 + Function/BNSetIntegerConstantDisplayType.cs | 44 + Function/BNSetIntegerTypeDisplayType.cs | 29 + Function/BNSetKeyValueStoreBuffer.cs | 31 + Function/BNSetKeyValueStoreValue.cs | 31 + Function/BNSetLicense.cs | 33 + Function/BNSetLiftedILFunction.cs | 29 + Function/BNSetLogicalMemoryMapEnabled.cs | 27 + Function/BNSetLowLevelILExprAttributes.cs | 30 + Function/BNSetLowLevelILFunction.cs | 29 + Function/BNSetMaxFunctionSizeForAnalysis.cs | 27 + Function/BNSetMediumLevelILExprAttributes.cs | 30 + Function/BNSetMediumLevelILExprType.cs | 30 + Function/BNSetMediumLevelILFunction.cs | 41 + Function/BNSetMemoryRegionEnabled.cs | 31 + Function/BNSetMemoryRegionFill.cs | 31 + Function/BNSetMemoryRegionFlags.cs | 32 + Function/BNSetMemoryRegionRebaseable.cs | 31 + .../BNSetNamedTypeReferenceBuilderName.cs | 29 + ...BNSetNamedTypeReferenceBuilderTypeClass.cs | 29 + .../BNSetNamedTypeReferenceBuilderTypeId.cs | 29 + .../BNSetNewAutoFunctionAnalysisSuppressed.cs | 27 + Function/BNSetOriginalFilename.cs | 29 + Function/BNSetOriginalImageBase.cs | 29 + Function/BNSetParametersForAnalysis.cs | 27 + Function/BNSetPlatformSystemCallConvention.cs | 27 + Function/BNSetProjectFile.cs | 27 + Function/BNSetSaveSettingsName.cs | 28 + Function/BNSetSaveSettingsOption.cs | 30 + .../BNSetScriptingInstanceCurrentAddress.cs | 29 + ...BNSetScriptingInstanceCurrentBasicBlock.cs | 29 + ...BNSetScriptingInstanceCurrentBinaryView.cs | 29 + .../BNSetScriptingInstanceCurrentFunction.cs | 29 + .../BNSetScriptingInstanceCurrentSelection.cs | 32 + Function/BNSetScriptingInstanceDelimiters.cs | 29 + Function/BNSetSnapshotName.cs | 29 + Function/BNSetStructureBuilderAlignment.cs | 27 + Function/BNSetStructureBuilderPacked.cs | 27 + .../BNSetStructureBuilderPointerOffset.cs | 27 + ...BuilderPropagatesDataVariableReferences.cs | 27 + Function/BNSetStructureBuilderType.cs | 27 + Function/BNSetStructureBuilderWidth.cs | 27 + Function/BNSetSwitchRecovery.cs | 32 + Function/BNSetThreadName.cs | 26 + Function/BNSetTypeArchiveCurrentSnapshot.cs | 29 + Function/BNSetTypeBuilderAttribute.cs | 32 + Function/BNSetTypeBuilderAttributeList.cs | 32 + .../BNSetTypeBuilderHasTemplateArguments.cs | 29 + Function/BNSetTypeBuilderNameType.cs | 29 + .../BNSetTypeBuilderNamedTypeReference.cs | 29 + Function/BNSetTypeBuilderOffset.cs | 27 + Function/BNSetTypeBuilderPointerBase.cs | 30 + Function/BNSetTypeBuilderPointerSuffix.cs | 30 + Function/BNSetTypeBuilderPure.cs | 27 + Function/BNSetTypeLibraryDependencyName.cs | 28 + Function/BNSetTypeLibraryGuid.cs | 28 + Function/BNSetTypeLibraryName.cs | 28 + Function/BNSetUserBasicBlockHighlight.cs | 28 + .../BNSetUserCallRegisterStackAdjustment.cs | 38 + ...RegisterStackAdjustmentForRegisterStack.cs | 41 + Function/BNSetUserCallStackAdjustment.cs | 38 + Function/BNSetUserCallTypeAdjustment.cs | 35 + .../BNSetUserFunctionCallingConvention.cs | 27 + Function/BNSetUserFunctionCanReturn.cs | 27 + .../BNSetUserFunctionClobberedRegisters.cs | 29 + .../BNSetUserFunctionHasVariableArguments.cs | 27 + .../BNSetUserFunctionInlinedDuringAnalysis.cs | 29 + .../BNSetUserFunctionParameterVariables.cs | 27 + Function/BNSetUserFunctionPure.cs | 27 + ...SetUserFunctionRegisterStackAdjustments.cs | 32 + Function/BNSetUserFunctionReturnRegisters.cs | 29 + Function/BNSetUserFunctionReturnType.cs | 27 + Function/BNSetUserFunctionStackAdjustment.cs | 29 + Function/BNSetUserGlobalPointerValue.cs | 27 + Function/BNSetUserGotoLabelName.cs | 31 + Function/BNSetUserIndirectBranches.cs | 38 + Function/BNSetUserInstructionHighlight.cs | 35 + Function/BNSetUserVariableValue.cs | 36 + Function/BNSetViewForFlowGraph.cs | 27 + Function/BNSetVirtualPath.cs | 29 + Function/BNSetWorkerThreadCount.cs | 26 + Function/BNSettingsContains.cs | 29 + Function/BNSettingsDeserializeSchema.cs | 34 + Function/BNSettingsGetBool.cs | 37 + Function/BNSettingsGetDouble.cs | 37 + Function/BNSettingsGetInt64.cs | 38 + Function/BNSettingsGetJson.cs | 37 + Function/BNSettingsGetString.cs | 37 + Function/BNSettingsGetStringList.cs | 40 + Function/BNSettingsGetUInt64.cs | 37 + Function/BNSettingsIsEmpty.cs | 34 + Function/BNSettingsKeysList.cs | 27 + Function/BNSettingsQueryPropertyString.cs | 31 + Function/BNSettingsQueryPropertyStringList.cs | 34 + Function/BNSettingsRegisterGroup.cs | 31 + Function/BNSettingsRegisterSetting.cs | 31 + Function/BNSettingsReset.cs | 37 + Function/BNSettingsResetAll.cs | 37 + Function/BNSettingsSerializeSchema.cs | 24 + Function/BNSettingsSetBool.cs | 40 + Function/BNSettingsSetDouble.cs | 41 + Function/BNSettingsSetInt64.cs | 41 + Function/BNSettingsSetJson.cs | 41 + Function/BNSettingsSetResourceId.cs | 28 + Function/BNSettingsSetString.cs | 40 + Function/BNSettingsSetStringList.cs | 43 + Function/BNSettingsSetUInt64.cs | 40 + Function/BNSettingsUpdateBoolProperty.cs | 35 + Function/BNSettingsUpdateDoubleProperty.cs | 35 + Function/BNSettingsUpdateInt64Property.cs | 35 + Function/BNSettingsUpdateProperty.cs | 31 + .../BNSettingsUpdateStringListProperty.cs | 38 + Function/BNSettingsUpdateStringProperty.cs | 35 + Function/BNSettingsUpdateUInt64Property.cs | 35 + Function/BNShouldSkipTargetAnalysis.cs | 36 + Function/BNShowGraphReport.cs | 31 + Function/BNShowHTMLReport.cs | 34 + Function/BNShowMarkdownReport.cs | 34 + Function/BNShowMessageBox.cs | 47 + Function/BNShowPlainTextReport.cs | 31 + Function/BNShowReportCollection.cs | 28 + Function/BNShowWorkflowReportForBinaryView.cs | 29 + Function/BNShowWorkflowReportForFunction.cs | 29 + Function/BNShutdown.cs | 28 + Function/BNSignExtend.cs | 30 + Function/BNSkipAndReturnValue.cs | 33 + Function/BNSnapshotHasAncestor.cs | 29 + Function/BNSnapshotHasContents.cs | 26 + Function/BNSnapshotHasData.cs | 29 + Function/BNSnapshotHasUndo.cs | 26 + Function/BNSnapshotStoreData.cs | 35 + Function/BNSplitVariable.cs | 29 + Function/BNStartFlowGraphLayout.cs | 32 + Function/BNStopScriptingInstance.cs | 26 + Function/BNStoreSecretsProviderData.cs | 32 + Function/BNStringifyUnicodeData.cs | 42 + ...BuilderPropagatesDataVariableReferences.cs | 24 + ...ructurePropagatesDataVariableReferences.cs | 24 + .../BNStructureWithReplacedEnumeration.cs | 32 + ...StructureWithReplacedNamedTypeReference.cs | 32 + Function/BNStructureWithReplacedStructure.cs | 32 + Function/BNTagGetData.cs | 24 + Function/BNTagGetId.cs | 24 + Function/BNTagGetType.cs | 24 + Function/BNTagSetData.cs | 28 + Function/BNTagTypeGetIcon.cs | 24 + Function/BNTagTypeGetId.cs | 24 + Function/BNTagTypeGetName.cs | 24 + Function/BNTagTypeGetType.cs | 24 + Function/BNTagTypeGetView.cs | 26 + Function/BNTagTypeGetVisible.cs | 26 + Function/BNTagTypeSetIcon.cs | 28 + Function/BNTagTypeSetName.cs | 28 + Function/BNTagTypeSetType.cs | 27 + Function/BNTagTypeSetVisible.cs | 27 + Function/BNToVariableIdentifier.cs | 24 + ...TransformContextClearTransformParameter.cs | 28 + .../BNTransformContextGetAvailableFiles.cs | 27 + Function/BNTransformContextGetChild.cs | 29 + Function/BNTransformContextGetChildCount.cs | 24 + Function/BNTransformContextGetChildren.cs | 27 + .../BNTransformContextGetExtractionMessage.cs | 26 + .../BNTransformContextGetExtractionResult.cs | 24 + Function/BNTransformContextGetFileName.cs | 24 + Function/BNTransformContextGetInput.cs | 24 + Function/BNTransformContextGetMetadata.cs | 24 + Function/BNTransformContextGetParent.cs | 24 + .../BNTransformContextGetRequestedFiles.cs | 29 + .../BNTransformContextGetTransformName.cs | 24 + .../BNTransformContextGetTransformResult.cs | 24 + .../BNTransformContextHasAvailableFiles.cs | 24 + .../BNTransformContextHasRequestedFiles.cs | 26 + ...BNTransformContextHasTransformParameter.cs | 28 + Function/BNTransformContextIsDatabase.cs | 26 + Function/BNTransformContextIsLeaf.cs | 24 + Function/BNTransformContextIsRoot.cs | 26 + .../BNTransformContextSetAvailableFiles.cs | 31 + Function/BNTransformContextSetChild.cs | 38 + .../BNTransformContextSetRequestedFiles.cs | 32 + ...BNTransformContextSetTransformParameter.cs | 31 + ...NTransformContextSetTransformParameters.cs | 30 + ...TransformSessionGetAvailableFileChoices.cs | 29 + .../BNTransformSessionGetCurrentContext.cs | 26 + Function/BNTransformSessionGetCurrentView.cs | 26 + Function/BNTransformSessionGetRootContext.cs | 26 + .../BNTransformSessionGetSelectedContexts.cs | 29 + Function/BNTransformSessionHasAnyStages.cs | 26 + ...NTransformSessionHasMultipleFileChoices.cs | 26 + Function/BNTransformSessionHasSinglePath.cs | 26 + Function/BNTransformSessionProcess.cs | 26 + Function/BNTransformSessionProcessFrom.cs | 29 + .../BNTransformSessionProcessWithUserInput.cs | 26 + .../BNTransformSessionRequiresUserInput.cs | 26 + Function/BNTransformSessionSelectFiles.cs | 32 + .../BNTransformSessionSetSelectedContexts.cs | 32 + Function/BNTransformSupportsContext.cs | 24 + Function/BNTransformSupportsDetection.cs | 24 + Function/BNTrimDatabaseSnapshot.cs | 29 + Function/BNTypeArchiveDeserializeSnapshot.cs | 29 + ...peArchiveMergeConflictGetBaseSnapshotId.cs | 26 + ...eArchiveMergeConflictGetFirstSnapshotId.cs | 26 + ...ArchiveMergeConflictGetSecondSnapshotId.cs | 26 + ...NTypeArchiveMergeConflictGetTypeArchive.cs | 26 + .../BNTypeArchiveMergeConflictGetTypeId.cs | 26 + Function/BNTypeArchiveMergeConflictSuccess.cs | 29 + Function/BNTypeArchiveMergeSnapshots.cs | 59 + .../BNTypeArchiveNewSnapshotTransaction.cs | 38 + Function/BNTypeArchiveQueryMetadata.cs | 29 + Function/BNTypeArchiveRemoveMetadata.cs | 29 + Function/BNTypeArchiveSerializeSnapshot.cs | 29 + Function/BNTypeArchiveStoreMetadata.cs | 32 + Function/BNTypeBuilderGetPointerBaseOffset.cs | 24 + Function/BNTypeBuilderGetPointerBaseType.cs | 24 + Function/BNTypeBuilderGetReferenceType.cs | 26 + Function/BNTypeBuilderGetStructureName.cs | 26 + Function/BNTypeBuilderGetSystemCallNumber.cs | 24 + Function/BNTypeBuilderGetTypeName.cs | 26 + Function/BNTypeBuilderHasTemplateArguments.cs | 26 + Function/BNTypeBuilderHasVariableArguments.cs | 24 + Function/BNTypeBuilderIsSystemCall.cs | 26 + Function/BNTypeBuilderSetAlignment.cs | 27 + Function/BNTypeBuilderSetAlternateName.cs | 28 + Function/BNTypeBuilderSetCallingConvention.cs | 27 + .../BNTypeBuilderSetCallingConventionName.cs | 29 + Function/BNTypeBuilderSetChildType.cs | 27 + Function/BNTypeBuilderSetConst.cs | 27 + Function/BNTypeBuilderSetSigned.cs | 27 + Function/BNTypeBuilderSetStackAdjustment.cs | 27 + Function/BNTypeBuilderSetSystemCallNumber.cs | 30 + Function/BNTypeBuilderSetTypeName.cs | 29 + Function/BNTypeBuilderSetVolatile.cs | 28 + Function/BNTypeBuilderSetWidth.cs | 27 + Function/BNTypeContainerAddTypes.cs | 48 + Function/BNTypeContainerDeleteType.cs | 28 + Function/BNTypeContainerGetId.cs | 24 + Function/BNTypeContainerGetName.cs | 24 + Function/BNTypeContainerGetPlatform.cs | 24 + Function/BNTypeContainerGetType.cs | 24 + Function/BNTypeContainerGetTypeById.cs | 31 + Function/BNTypeContainerGetTypeByName.cs | 30 + Function/BNTypeContainerGetTypeId.cs | 31 + Function/BNTypeContainerGetTypeIds.cs | 30 + Function/BNTypeContainerGetTypeName.cs | 31 + Function/BNTypeContainerGetTypeNames.cs | 30 + Function/BNTypeContainerGetTypeNamesAndIds.cs | 33 + Function/BNTypeContainerGetTypes.cs | 36 + Function/BNTypeContainerIsMutable.cs | 24 + Function/BNTypeContainerParseTypeString.cs | 40 + .../BNTypeContainerParseTypesFromSource.cs | 59 + Function/BNTypeContainerRenameType.cs | 31 + Function/BNTypeGetNameType.cs | 24 + Function/BNTypeGetPointerBaseOffset.cs | 24 + Function/BNTypeGetPointerBaseType.cs | 24 + Function/BNTypeGetReferenceType.cs | 26 + Function/BNTypeGetStructureName.cs | 24 + Function/BNTypeGetSystemCallNumber.cs | 24 + Function/BNTypeGetTypeName.cs | 24 + Function/BNTypeHasTemplateArguments.cs | 26 + Function/BNTypeHasVariableArguments.cs | 24 + Function/BNTypeIsSystemCall.cs | 24 + Function/BNTypeLibraryDecompressToFile.cs | 28 + Function/BNTypeLibraryGetMetadata.cs | 24 + Function/BNTypeLibraryQueryMetadata.cs | 28 + Function/BNTypeLibraryRemoveMetadata.cs | 28 + Function/BNTypeLibraryStoreMetadata.cs | 31 + Function/BNTypeParserParseTypeString.cs | 44 + Function/BNTypeParserParseTypesFromSource.cs | 62 + Function/BNTypeParserPreprocessSource.cs | 59 + Function/BNTypePrinterDefaultPrintAllTypes.cs | 47 + Function/BNTypePrinterPrintAllTypes.cs | 47 + Function/BNTypeShouldDisplayReturnType.cs | 24 + Function/BNTypeWithReplacedEnumeration.cs | 32 + .../BNTypeWithReplacedNamedTypeReference.cs | 32 + Function/BNTypeWithReplacedStructure.cs | 32 + Function/BNTypesEqual.cs | 29 + Function/BNTypesNotEqual.cs | 29 + Function/BNUndefineAnalysisType.cs | 28 + Function/BNUndefineAutoSymbol.cs | 27 + Function/BNUndefineDataVariable.cs | 30 + Function/BNUndefineUserAnalysisType.cs | 27 + Function/BNUndefineUserDataVariable.cs | 27 + Function/BNUndefineUserSymbol.cs | 27 + Function/BNUndo.cs | 24 + Function/BNUndoActionGetSummary.cs | 29 + Function/BNUndoActionGetSummaryText.cs | 24 + Function/BNUndoEntryGetActions.cs | 27 + Function/BNUndoEntryGetId.cs | 26 + Function/BNUndoEntryGetTimestamp.cs | 26 + Function/BNUnescapeTypeName.cs | 29 + Function/BNUnicodeGetBlockNames.cs | 29 + Function/BNUnicodeGetBlockRange.cs | 32 + Function/BNUnicodeGetBlockRanges.cs | 35 + Function/BNUnicodeGetBlocksForNames.cs | 41 + Function/BNUnicodeGetUTF8String.cs | 44 + Function/BNUnicodeToEscapedString.cs | 44 + Function/BNUnicodeUTF16ToUTF8.cs | 29 + Function/BNUnicodeUTF32ToUTF8.cs | 26 + Function/BNUnmergeVariables.cs | 35 + Function/BNUnregisterDataNotification.cs | 29 + Function/BNUnregisterDebugInfoParser.cs | 26 + ...NUnregisterEnterpriseServerNotification.cs | 26 + Function/BNUnregisterLogListener.cs | 24 + .../BNUnregisterObjectDestructionCallbacks.cs | 26 + Function/BNUnregisterObjectRefDebugTrace.cs | 29 + Function/BNUnregisterProjectNotification.cs | 29 + ...registerScriptingInstanceOutputListener.cs | 29 + .../BNUnregisterTypeArchiveNotification.cs | 29 + Function/BNUnregisterViewOfType.cs | 31 + Function/BNUnsplitVariable.cs | 29 + Function/BNUpdateAnalysis.cs | 24 + Function/BNUpdateAnalysisAndWait.cs | 24 + Function/BNUpdateEnterpriseServerLicense.cs | 26 + Function/BNUpdateFlowGraph.cs | 24 + Function/BNUpdateHighLevelILOperand.cs | 35 + Function/BNUpdateLogListeners.cs | 20 + Function/BNUpdateLowLevelILOperand.cs | 33 + Function/BNUpdateMediumLevelILOperand.cs | 35 + Function/BNUpdateReportFlowGraph.cs | 32 + Function/BNUpdateToLatestVersion.cs | 35 + Function/BNUpdateToVersion.cs | 38 + Function/BNUpdatesChecked.cs | 23 + Function/BNUserGlobalPointerValueSet.cs | 24 + Function/BNVersionLessThan.cs | 29 + Function/BNWaitForMainThreadAction.cs | 26 + .../BNWasFunctionAutomaticallyDiscovered.cs | 24 + Function/BNWorkerEnqueue.cs | 29 + Function/BNWorkerEnqueueNamed.cs | 32 + Function/BNWorkerInteractiveEnqueue.cs | 29 + Function/BNWorkerInteractiveEnqueueNamed.cs | 32 + Function/BNWorkerPriorityEnqueue.cs | 29 + Function/BNWorkerPriorityEnqueueNamed.cs | 32 + Function/BNWorkflowAssignSubactivities.cs | 35 + Function/BNWorkflowClear.cs | 26 + Function/BNWorkflowClone.cs | 31 + Function/BNWorkflowContains.cs | 29 + Function/BNWorkflowGet.cs | 26 + Function/BNWorkflowGetActivity.cs | 29 + Function/BNWorkflowGetActivityRoots.cs | 31 + Function/BNWorkflowGetConfiguration.cs | 29 + Function/BNWorkflowGetEligibilitySettings.cs | 29 + Function/BNWorkflowGetGraph.cs | 32 + Function/BNWorkflowGetOrCreate.cs | 25 + Function/BNWorkflowGetSubactivities.cs | 34 + Function/BNWorkflowInsert.cs | 34 + Function/BNWorkflowInsertAfter.cs | 35 + Function/BNWorkflowIsRegistered.cs | 24 + Function/BNWorkflowRegisterActivity.cs | 35 + Function/BNWorkflowRemove.cs | 29 + Function/BNWorkflowReplace.cs | 32 + Function/BNWorkflowShowReport.cs | 29 + Function/BNWorkflowSize.cs | 24 + Function/BNWrite16.cs | 27 + Function/BNWrite32.cs | 27 + Function/BNWrite64.cs | 27 + Function/BNWrite8.cs | 27 + Function/BNWriteBE16.cs | 27 + Function/BNWriteBE32.cs | 29 + Function/BNWriteBE64.cs | 29 + Function/BNWriteData.cs | 30 + Function/BNWriteDataForDownloadInstance.cs | 32 + Function/BNWriteDatabaseAnalysisCache.cs | 29 + Function/BNWriteDatabaseGlobal.cs | 32 + Function/BNWriteDatabaseGlobalData.cs | 32 + Function/BNWriteDatabaseSnapshotData.cs | 50 + Function/BNWriteLE16.cs | 27 + Function/BNWriteLE32.cs | 29 + Function/BNWriteLE64.cs | 29 + Function/BNWriteTypeLibraryToFile.cs | 28 + Function/BNWriteViewBuffer.cs | 30 + Function/BNWriteViewData.cs | 33 + Function/BNWriteWebsocketClientData.cs | 32 + Function/BNXzDecompress.cs | 26 + Function/BNZeroExtend.cs | 30 + Function/BNZlibCompress.cs | 26 + Function/BNZlibDecompress.cs | 26 + Handle/BNActivity.cs | 103 + Handle/BNAnalysisCompletionEvent.cs | 93 + Handle/BNAnalysisContext.cs | 94 + Handle/BNAnalysisMergeConflict.cs | 93 + Handle/BNAnalysisMergeConflictSplitter.cs | 37 + Handle/BNArchitecture.cs | 896 +++ Handle/BNBackgroundTask.cs | 170 + Handle/BNBaseAddressDetection.cs | 68 + Handle/BNBasicBlock.cs | 760 +++ Handle/BNBinaryReader.cs | 761 +++ Handle/BNBinaryView.cs | 5605 +++++++++++++++++ Handle/BNBinaryViewType.cs | 275 + Handle/BNBinaryWriter.cs | 236 + Handle/BNCallingConvention.cs | 89 + Handle/BNCollaborationChangeset.cs | 94 + Handle/BNCollaborationGroup.cs | 93 + Handle/BNCollaborationLazyT.cs | 17 + Handle/BNCollaborationPermission.cs | 94 + Handle/BNCollaborationSnapshot.cs | 94 + Handle/BNCollaborationUndoEntry.cs | 93 + Handle/BNCollaborationUser.cs | 93 + Handle/BNComponent.cs | 94 + Handle/BNDataBuffer.cs | 172 + Handle/BNDataRenderer.cs | 93 + Handle/BNDataRendererContainer.cs | 16 + Handle/BNDatabase.cs | 93 + Handle/BNDebugInfo.cs | 93 + Handle/BNDebugInfoParser.cs | 93 + Handle/BNDemangler.cs | 16 + Handle/BNDisassemblySettings.cs | 199 + Handle/BNDisassemblyTextRenderer.cs | 93 + Handle/BNDownloadInstance.cs | 93 + Handle/BNDownloadProvider.cs | 16 + Handle/BNEnumeration.cs | 200 + Handle/BNEnumerationBuilder.cs | 168 + Handle/BNExternalLibrary.cs | 106 + Handle/BNExternalLocation.cs | 93 + Handle/BNFieldResolutionInfo.cs | 93 + Handle/BNFileMetadata.cs | 424 ++ Handle/BNFirmwareNinja.cs | 67 + Handle/BNFirmwareNinjaReferenceNode.cs | 93 + Handle/BNFirmwareNinjaRelationship.cs | 93 + Handle/BNFlowGraph.cs | 503 ++ Handle/BNFlowGraphLayout.cs | 16 + Handle/BNFlowGraphLayoutRequest.cs | 40 + Handle/BNFlowGraphNode.cs | 162 + Handle/BNFunction.cs | 1638 +++++ Handle/BNHighLevelILFunction.cs | 1238 ++++ Handle/BNHighLevelILTokenEmitter.cs | 277 + Handle/BNKeyValueStore.cs | 204 + Handle/BNLanguageRepresentationFunction.cs | 300 + .../BNLanguageRepresentationFunctionType.cs | 17 + Handle/BNLineFormatter.cs | 16 + Handle/BNLinearViewCursor.cs | 420 ++ Handle/BNLinearViewObject.cs | 667 ++ Handle/BNLogger.cs | 189 + Handle/BNLowLevelILFunction.cs | 3269 ++++++++++ Handle/BNMainThreadAction.cs | 93 + Handle/BNMediumLevelILFunction.cs | 3212 ++++++++++ Handle/BNMetadata.cs | 764 +++ Handle/BNNamedTypeReference.cs | 121 + Handle/BNNamedTypeReferenceBuilder.cs | 67 + Handle/BNPlatform.cs | 511 ++ Handle/BNProject.cs | 111 + Handle/BNProjectFile.cs | 93 + Handle/BNProjectFolder.cs | 93 + Handle/BNRelocation.cs | 93 + Handle/BNRelocationHandler.cs | 93 + Handle/BNRemote.cs | 93 + Handle/BNRemoteFile.cs | 93 + Handle/BNRemoteFolder.cs | 93 + Handle/BNRemoteProject.cs | 93 + Handle/BNRenderLayer.cs | 72 + Handle/BNRepoPlugin.cs | 16 + Handle/BNReportCollection.cs | 206 + Handle/BNRepository.cs | 93 + Handle/BNRepositoryManager.cs | 93 + Handle/BNSaveSettings.cs | 124 + Handle/BNScriptingInstance.cs | 93 + Handle/BNScriptingProvider.cs | 16 + Handle/BNSecretsProvider.cs | 16 + Handle/BNSection.cs | 197 + Handle/BNSegment.cs | 207 + Handle/BNSettings.cs | 537 ++ Handle/BNSnapshot.cs | 93 + Handle/BNStringRef.cs | 67 + Handle/BNStructure.cs | 338 + Handle/BNStructureBuilder.cs | 350 + Handle/BNSymbol.cs | 188 + Handle/BNSymbolQueue.cs | 73 + Handle/BNTag.cs | 134 + Handle/BNTagType.cs | 168 + Handle/BNTemporaryFile.cs | 131 + Handle/BNTransform.cs | 242 + Handle/BNTransformContext.cs | 256 + Handle/BNTransformSession.cs | 93 + Handle/BNType.cs | 373 ++ Handle/BNTypeArchive.cs | 94 + Handle/BNTypeArchiveMergeConflict.cs | 93 + Handle/BNTypeBuilder.cs | 736 +++ Handle/BNTypeContainer.cs | 457 ++ Handle/BNTypeLibrary.cs | 396 ++ Handle/BNTypeLibraryMapping.cs | 16 + Handle/BNTypeParser.cs | 16 + Handle/BNTypePrinter.cs | 16 + Handle/BNUndoAction.cs | 103 + Handle/BNUndoEntry.cs | 93 + Handle/BNUser.cs | 93 + Handle/BNWebsocketClient.cs | 93 + Handle/BNWebsocketProvider.cs | 16 + Handle/BNWorkflow.cs | 263 + .../AbstractHighLevelILBinaryInstruction.cs | 30 + .../AbstractHighLevelILCarryInstruction.cs | 38 + .../AbstractHighLevelILConstInstruction.cs | 22 + .../AbstractHighLevelILUnaryInstruction.cs | 22 + HighLevelIL/HLILAdd.cs | 30 + HighLevelIL/HLILAddCarry.cs | 38 + HighLevelIL/HLILAddOverflow.cs | 30 + HighLevelIL/HLILAddressOf.cs | 22 + HighLevelIL/HLILAnd.cs | 30 + HighLevelIL/HLILArrayIndex.cs | 30 + HighLevelIL/HLILArrayIndexSSA.cs | 38 + HighLevelIL/HLILAssert.cs | 30 + HighLevelIL/HLILAssertSSA.cs | 30 + HighLevelIL/HLILAssign.cs | 30 + HighLevelIL/HLILAssignMemorySSA.cs | 47 + HighLevelIL/HLILAssignUnpack.cs | 30 + HighLevelIL/HLILAssignUnpackMemorySSA.cs | 47 + HighLevelIL/HLILBlock.cs | 22 + HighLevelIL/HLILBoolToInt.cs | 22 + HighLevelIL/HLILBreak.cs | 14 + HighLevelIL/HLILBreakpoint.cs | 14 + HighLevelIL/HLILCall.cs | 30 + HighLevelIL/HLILCallSSA.cs | 46 + HighLevelIL/HLILCase.cs | 31 + HighLevelIL/HLILCeil.cs | 22 + HighLevelIL/HLILConst.cs | 22 + HighLevelIL/HLILConstData.cs | 22 + HighLevelIL/HLILConstPointer.cs | 22 + HighLevelIL/HLILContinue.cs | 14 + HighLevelIL/HLILDeref.cs | 22 + HighLevelIL/HLILDerefField.cs | 38 + HighLevelIL/HLILDerefFieldSSA.cs | 46 + HighLevelIL/HLILDerefSSA.cs | 30 + HighLevelIL/HLILDivSigned.cs | 30 + HighLevelIL/HLILDivSignedDoublePrecision.cs | 30 + HighLevelIL/HLILDivUnsigned.cs | 30 + HighLevelIL/HLILDivUnsignedDoublePrecision.cs | 30 + HighLevelIL/HLILDoWhile.cs | 30 + HighLevelIL/HLILDoWhileSSA.cs | 38 + HighLevelIL/HLILEqual.cs | 30 + HighLevelIL/HLILExternPointer.cs | 30 + HighLevelIL/HLILFloatAbs.cs | 22 + HighLevelIL/HLILFloatAdd.cs | 30 + HighLevelIL/HLILFloatCompareOrdered.cs | 30 + HighLevelIL/HLILFloatCompareUnordered.cs | 30 + HighLevelIL/HLILFloatConst.cs | 22 + HighLevelIL/HLILFloatConvert.cs | 22 + HighLevelIL/HLILFloatDiv.cs | 30 + HighLevelIL/HLILFloatEqual.cs | 30 + HighLevelIL/HLILFloatGreaterEqual.cs | 30 + HighLevelIL/HLILFloatGreaterThan.cs | 30 + HighLevelIL/HLILFloatLessEqual.cs | 30 + HighLevelIL/HLILFloatLessThan.cs | 30 + HighLevelIL/HLILFloatMul.cs | 30 + HighLevelIL/HLILFloatNeg.cs | 22 + HighLevelIL/HLILFloatNotEqual.cs | 30 + HighLevelIL/HLILFloatSquareRoot.cs | 22 + HighLevelIL/HLILFloatSub.cs | 30 + HighLevelIL/HLILFloatToInt.cs | 22 + HighLevelIL/HLILFloatTrunc.cs | 22 + HighLevelIL/HLILFloor.cs | 22 + HighLevelIL/HLILFor.cs | 46 + HighLevelIL/HLILForSSA.cs | 54 + HighLevelIL/HLILForceVersion.cs | 30 + HighLevelIL/HLILForceVersionSSA.cs | 30 + HighLevelIL/HLILGoto.cs | 22 + HighLevelIL/HLILIf.cs | 38 + HighLevelIL/HLILImport.cs | 22 + HighLevelIL/HLILIntToFloat.cs | 22 + HighLevelIL/HLILIntrinsic.cs | 30 + HighLevelIL/HLILIntrinsicSSA.cs | 46 + HighLevelIL/HLILJump.cs | 22 + HighLevelIL/HLILLabel.cs | 22 + HighLevelIL/HLILLogicalShiftLef.cs | 30 + HighLevelIL/HLILLogicalShiftRight.cs | 30 + HighLevelIL/HLILLowPart.cs | 22 + HighLevelIL/HLILMemoryPhi.cs | 30 + HighLevelIL/HLILModSignedDoublePrecision.cs | 30 + HighLevelIL/HLILModUnsigned.cs | 30 + HighLevelIL/HLILModUnsignedDoublePrecision.cs | 30 + HighLevelIL/HLILMul.cs | 31 + HighLevelIL/HLILMulSignedDoublePrecision.cs | 30 + HighLevelIL/HLILMulUnsignedDoublePrecision.cs | 30 + HighLevelIL/HLILNeg.cs | 22 + HighLevelIL/HLILNoReturn.cs | 14 + HighLevelIL/HLILNop.cs | 14 + HighLevelIL/HLILNot.cs | 22 + HighLevelIL/HLILNotEqual.cs | 30 + HighLevelIL/HLILOr.cs | 30 + HighLevelIL/HLILReturn.cs | 22 + HighLevelIL/HLILRotateLeft.cs | 30 + HighLevelIL/HLILRotateLeftCarry.cs | 38 + HighLevelIL/HLILRotateRight.cs | 38 + HighLevelIL/HLILRotateRightCarry.cs | 38 + HighLevelIL/HLILRoundToInt.cs | 22 + HighLevelIL/HLILSignExtend.cs | 22 + HighLevelIL/HLILSignedGreaterEqual.cs | 30 + HighLevelIL/HLILSignedGreaterThan.cs | 30 + HighLevelIL/HLILSignedLessEqual.cs | 30 + HighLevelIL/HLILSignedLessThan.cs | 30 + HighLevelIL/HLILSplit.cs | 30 + HighLevelIL/HLILStructField.cs | 38 + HighLevelIL/HLILSub.cs | 30 + HighLevelIL/HLILSubBorrow.cs | 38 + HighLevelIL/HLILSwitch.cs | 38 + HighLevelIL/HLILSysCall.cs | 22 + HighLevelIL/HLILSysCallSSA.cs | 38 + HighLevelIL/HLILTailCall.cs | 30 + HighLevelIL/HLILTestBit.cs | 30 + HighLevelIL/HLILTrap.cs | 22 + HighLevelIL/HLILUndefined.cs | 14 + HighLevelIL/HLILUnimplemented.cs | 14 + HighLevelIL/HLILUnimplementedMemory.cs | 22 + HighLevelIL/HLILUnreachable.cs | 14 + HighLevelIL/HLILUnsignedGreaterEqual.cs | 30 + HighLevelIL/HLILUnsignedGreaterThan.cs | 30 + HighLevelIL/HLILUnsignedLessEqual.cs | 30 + HighLevelIL/HLILUnsignedLessThan.cs | 30 + HighLevelIL/HLILVariable.cs | 22 + HighLevelIL/HLILVariableDeclare.cs | 24 + HighLevelIL/HLILVariableInit.cs | 30 + HighLevelIL/HLILVariableInitSSA.cs | 30 + HighLevelIL/HLILVariablePhi.cs | 30 + HighLevelIL/HLILVariableSSA.cs | 22 + HighLevelIL/HLILWhile.cs | 30 + HighLevelIL/HLILWhileSSA.cs | 38 + HighLevelIL/HLILXor.cs | 30 + HighLevelIL/HLILZeroExtend.cs | 22 + HighLevelIL/HighLevelILBasicBlock.cs | 329 + HighLevelIL/HighLevelILBasicBlockEdge.cs | 45 + HighLevelIL/HighLevelILFlowGraph.cs | 159 + HighLevelIL/HighLevelILFlowGraphEdge.cs | 26 + .../HighLevelILFlowGraphLayoutRequest.cs | 119 + HighLevelIL/HighLevelILFlowGraphNode.cs | 170 + HighLevelIL/HighLevelILLabel.cs | 80 + HighLevelIL/HighLevelILSSAVariable.cs | 80 + HighLevelIL/HighLevelILVariable.cs | 121 + HighLevelIL/HlilArithmeticShiftRight.cs | 30 + HighLevelIL/HlilModSigned.cs | 30 + IL/AbstractSSAVariable.cs | 87 + IL/Alias.cs | 88 + IL/FlagOrRegister.cs | 141 + IL/ILFlag.cs | 96 + IL/ILLabel.cs | 105 + IL/ILRegister.cs | 132 + IL/Intrinsic.cs | 148 + IL/RegisterStack.cs | 100 + IL/SSAFlagOrRegister.cs | 86 + IL/SSARegisterStack.cs | 85 + IL/SemanticFlagClass.cs | 99 + IL/SemanticFlagGroup.cs | 99 + IL/SourceLocation.cs | 85 + IL/Variable.cs | 113 + LibraryResolver.cs | 136 + LowLevelIL/LLILAdd.cs | 30 + LowLevelIL/LLILAddCarry.cs | 38 + LowLevelIL/LLILAddOverflow.cs | 30 + LowLevelIL/LLILAnd.cs | 30 + LowLevelIL/LLILArithmeticShiftRight.cs | 30 + LowLevelIL/LLILAssert.cs | 30 + LowLevelIL/LLILAssertSSA.cs | 30 + LowLevelIL/LLILBoolToInt.cs | 22 + LowLevelIL/LLILBreakpoint.cs | 14 + LowLevelIL/LLILCall.cs | 22 + LowLevelIL/LLILCallOutputSSA.cs | 30 + LowLevelIL/LLILCallParameter.cs | 22 + LowLevelIL/LLILCallSSA.cs | 60 + LowLevelIL/LLILCallStackAdjust.cs | 40 + LowLevelIL/LLILCallStackSSA.cs | 30 + LowLevelIL/LLILCeil.cs | 22 + LowLevelIL/LLILConst.cs | 22 + LowLevelIL/LLILConstPointer.cs | 22 + LowLevelIL/LLILDivSigned.cs | 30 + LowLevelIL/LLILDivSignedDoublePrecision.cs | 30 + LowLevelIL/LLILDivUnsigned.cs | 30 + LowLevelIL/LLILDivUnsignedDoublePrecision.cs | 30 + LowLevelIL/LLILEqual.cs | 30 + LowLevelIL/LLILExternPointer.cs | 30 + LowLevelIL/LLILFlag.cs | 22 + LowLevelIL/LLILFlagBit.cs | 30 + LowLevelIL/LLILFlagBitSSA.cs | 30 + LowLevelIL/LLILFlagCond.cs | 30 + LowLevelIL/LLILFlagGroup.cs | 22 + LowLevelIL/LLILFlagPhi.cs | 30 + LowLevelIL/LLILFlagSSA.cs | 22 + LowLevelIL/LLILFloatAbs.cs | 22 + LowLevelIL/LLILFloatAdd.cs | 30 + LowLevelIL/LLILFloatCompareOrdered.cs | 30 + LowLevelIL/LLILFloatCompareUnordered.cs | 30 + LowLevelIL/LLILFloatConst.cs | 26 + LowLevelIL/LLILFloatConvert.cs | 22 + LowLevelIL/LLILFloatDiv.cs | 30 + LowLevelIL/LLILFloatEqual.cs | 30 + LowLevelIL/LLILFloatGreaterEqual.cs | 30 + LowLevelIL/LLILFloatGreaterThan.cs | 30 + LowLevelIL/LLILFloatLessEqual.cs | 30 + LowLevelIL/LLILFloatLessThan.cs | 30 + LowLevelIL/LLILFloatMul.cs | 30 + LowLevelIL/LLILFloatNeg.cs | 22 + LowLevelIL/LLILFloatNotEqual.cs | 30 + LowLevelIL/LLILFloatSquareRoot.cs | 22 + LowLevelIL/LLILFloatSub.cs | 30 + LowLevelIL/LLILFloatToInt.cs | 22 + LowLevelIL/LLILFloatTrunc.cs | 22 + LowLevelIL/LLILFloor.cs | 22 + LowLevelIL/LLILForceVersion.cs | 22 + LowLevelIL/LLILForceVersionSSA.cs | 30 + LowLevelIL/LLILGoto.cs | 22 + LowLevelIL/LLILIf.cs | 42 + LowLevelIL/LLILIntToFloat.cs | 22 + LowLevelIL/LLILIntrinsic.cs | 51 + LowLevelIL/LLILIntrinsicSSA.cs | 51 + LowLevelIL/LLILJump.cs | 22 + LowLevelIL/LLILJumpTo.cs | 32 + LowLevelIL/LLILLoad.cs | 22 + LowLevelIL/LLILLoadSSA.cs | 30 + LowLevelIL/LLILLogicalShiftLeft.cs | 30 + LowLevelIL/LLILLogicalShiftRight.cs | 30 + LowLevelIL/LLILLowPart.cs | 22 + LowLevelIL/LLILMemoryIntrinsicOutputSSA.cs | 32 + LowLevelIL/LLILMemoryIntrinsicSSA.cs | 72 + LowLevelIL/LLILMemoryPhi.cs | 30 + LowLevelIL/LLILModSigned.cs | 30 + LowLevelIL/LLILModSignedDoublePrecision.cs | 30 + LowLevelIL/LLILModUnsigned.cs | 30 + LowLevelIL/LLILModUnsignedDoublePrecision.cs | 30 + LowLevelIL/LLILMul.cs | 30 + LowLevelIL/LLILMulSignedDoublePrecision.cs | 30 + LowLevelIL/LLILMulUnsignedDoublePrecision.cs | 30 + LowLevelIL/LLILNeg.cs | 22 + LowLevelIL/LLILNoReturn.cs | 14 + LowLevelIL/LLILNop.cs | 14 + LowLevelIL/LLILNot.cs | 22 + LowLevelIL/LLILNotEqual.cs | 30 + LowLevelIL/LLILOr.cs | 30 + LowLevelIL/LLILPop.cs | 14 + LowLevelIL/LLILPush.cs | 22 + LowLevelIL/LLILRegister.cs | 22 + LowLevelIL/LLILRegisterPhi.cs | 30 + LowLevelIL/LLILRegisterSSA.cs | 22 + LowLevelIL/LLILRegisterSSAPartial.cs | 30 + LowLevelIL/LLILRegisterSplit.cs | 30 + LowLevelIL/LLILRegisterSplitDestinationSSA.cs | 22 + LowLevelIL/LLILRegisterSplitSSA.cs | 30 + LowLevelIL/LLILRegisterStackAbsSSA.cs | 30 + LowLevelIL/LLILRegisterStackDestinationSSA.cs | 30 + LowLevelIL/LLILRegisterStackFreeAbsSSA.cs | 30 + LowLevelIL/LLILRegisterStackFreeRegister.cs | 22 + LowLevelIL/LLILRegisterStackFreeRel.cs | 30 + .../LLILRegisterStackFreeRelativeSSA.cs | 38 + LowLevelIL/LLILRegisterStackPhi.cs | 30 + LowLevelIL/LLILRegisterStackPop.cs | 22 + LowLevelIL/LLILRegisterStackPush.cs | 30 + LowLevelIL/LLILRegisterStackRelative.cs | 30 + LowLevelIL/LLILRegisterStackRelativeSSA.cs | 38 + LowLevelIL/LLILReturn.cs | 22 + LowLevelIL/LLILRotateLeft.cs | 30 + LowLevelIL/LLILRotateLeftCarry.cs | 38 + LowLevelIL/LLILRotateRight.cs | 30 + LowLevelIL/LLILRotateRightCarry.cs | 38 + LowLevelIL/LLILRoundToInt.cs | 22 + LowLevelIL/LLILSeparateParamListSSA.cs | 22 + LowLevelIL/LLILSetFlag.cs | 30 + LowLevelIL/LLILSetFlagSSA.cs | 30 + LowLevelIL/LLILSetRegister.cs | 30 + LowLevelIL/LLILSetRegisterSSA.cs | 30 + LowLevelIL/LLILSetRegisterSSAPartial.cs | 38 + LowLevelIL/LLILSetRegisterSplit.cs | 38 + LowLevelIL/LLILSetRegisterSplitSSA.cs | 38 + LowLevelIL/LLILSetRegisterStackAbsSSA.cs | 38 + LowLevelIL/LLILSetRegisterStackRel.cs | 38 + LowLevelIL/LLILSetRegisterStackRelativeSSA.cs | 46 + LowLevelIL/LLILSharedParamSlotSSA.cs | 22 + LowLevelIL/LLILSignExtend.cs | 22 + LowLevelIL/LLILSignedGreaterEqual.cs | 30 + LowLevelIL/LLILSignedGreaterThan.cs | 30 + LowLevelIL/LLILSignedLessEqual.cs | 30 + LowLevelIL/LLILSignedLessThan.cs | 30 + LowLevelIL/LLILStore.cs | 30 + LowLevelIL/LLILStoreSSA.cs | 46 + LowLevelIL/LLILSub.cs | 30 + LowLevelIL/LLILSubBorrow.cs | 38 + LowLevelIL/LLILSysCall.cs | 14 + LowLevelIL/LLILSysCallSSA.cs | 70 + LowLevelIL/LLILTailCall.cs | 22 + LowLevelIL/LLILTailCallSSA.cs | 60 + LowLevelIL/LLILTestBit.cs | 30 + LowLevelIL/LLILTrap.cs | 22 + LowLevelIL/LLILUndefined.cs | 14 + LowLevelIL/LLILUnimplemented.cs | 14 + LowLevelIL/LLILUnimplementedMemory.cs | 22 + LowLevelIL/LLILUnsignedGreaterEqual.cs | 30 + LowLevelIL/LLILUnsignedGreaterThan.cs | 30 + LowLevelIL/LLILUnsignedLessEqual.cs | 30 + LowLevelIL/LLILUnsignedLessThan.cs | 30 + LowLevelIL/LLILXor.cs | 30 + LowLevelIL/LLILZeroExtend.cs | 22 + LowLevelIL/LowLevelILBasicBlock.cs | 326 + LowLevelIL/LowLevelILBasicBlockEdge.cs | 45 + LowLevelIL/LowLevelILFlag.cs | 27 + LowLevelIL/LowLevelILFlowGraph.cs | 158 + LowLevelIL/LowLevelILFlowGraphEdge.cs | 24 + LowLevelIL/LowLevelILFlowGraphNode.cs | 170 + LowLevelIL/LowLevelILSSAFlag.cs | 95 + LowLevelIL/LowLevelILSSARegister.cs | 102 + LowLevelIL/LowLevelILSSAVariable.cs | 11 + LowLevelIL/LowLevelILVariable.cs | 56 + MediumLevelIL/MLILAdd.cs | 30 + MediumLevelIL/MLILAddCarry.cs | 38 + MediumLevelIL/MLILAddOverflow.cs | 30 + MediumLevelIL/MLILAddressOf.cs | 22 + MediumLevelIL/MLILAddressOfField.cs | 30 + MediumLevelIL/MLILAnd.cs | 30 + MediumLevelIL/MLILArithmeticShiftRight.cs | 30 + MediumLevelIL/MLILAssert.cs | 30 + MediumLevelIL/MLILAssertSSA.cs | 30 + MediumLevelIL/MLILBoolToInt.cs | 22 + MediumLevelIL/MLILBreakpoint.cs | 14 + MediumLevelIL/MLILCall.cs | 38 + MediumLevelIL/MLILCallOutput.cs | 22 + MediumLevelIL/MLILCallOutputSSA.cs | 30 + MediumLevelIL/MLILCallParam.cs | 22 + MediumLevelIL/MLILCallParamSSA.cs | 30 + MediumLevelIL/MLILCallSSA.cs | 70 + MediumLevelIL/MLILCallUntyped.cs | 62 + MediumLevelIL/MLILCallUntypedSSA.cs | 92 + MediumLevelIL/MLILCeil.cs | 22 + MediumLevelIL/MLILConst.cs | 22 + MediumLevelIL/MLILConstData.cs | 22 + MediumLevelIL/MLILConstPointer.cs | 22 + MediumLevelIL/MLILDivSigned.cs | 30 + MediumLevelIL/MLILDivSignedDoublePrecision.cs | 30 + MediumLevelIL/MLILDivUnsigned.cs | 30 + .../MLILDivUnsignedDoublePrecision.cs | 30 + MediumLevelIL/MLILEqual.cs | 30 + MediumLevelIL/MLILExternPointer.cs | 30 + MediumLevelIL/MLILFloatAbs.cs | 22 + MediumLevelIL/MLILFloatAdd.cs | 30 + MediumLevelIL/MLILFloatCompareOrdered.cs | 30 + MediumLevelIL/MLILFloatCompareUnordered.cs | 30 + MediumLevelIL/MLILFloatConst.cs | 26 + MediumLevelIL/MLILFloatConvert.cs | 22 + MediumLevelIL/MLILFloatDiv.cs | 30 + MediumLevelIL/MLILFloatEqual.cs | 30 + MediumLevelIL/MLILFloatGreaterOrEqual.cs | 30 + MediumLevelIL/MLILFloatGreaterThan.cs | 30 + MediumLevelIL/MLILFloatLessThan.cs | 30 + MediumLevelIL/MLILFloatLessThanOrEqual.cs | 30 + MediumLevelIL/MLILFloatMul.cs | 30 + MediumLevelIL/MLILFloatNeg.cs | 22 + MediumLevelIL/MLILFloatNotEqual.cs | 30 + MediumLevelIL/MLILFloatSquareRoot.cs | 22 + MediumLevelIL/MLILFloatSub.cs | 30 + MediumLevelIL/MLILFloatToInt.cs | 22 + MediumLevelIL/MLILFloatTruncate.cs | 22 + MediumLevelIL/MLILFloor.cs | 22 + MediumLevelIL/MLILForceVersion.cs | 30 + MediumLevelIL/MLILForceVersionSSA.cs | 30 + MediumLevelIL/MLILFreeVariableSlot.cs | 22 + MediumLevelIL/MLILFreeVariableSlotSSA.cs | 30 + MediumLevelIL/MLILGoto.cs | 22 + MediumLevelIL/MLILIf.cs | 40 + MediumLevelIL/MLILImport.cs | 22 + MediumLevelIL/MLILIntToFloat.cs | 22 + MediumLevelIL/MLILIntrinsic.cs | 38 + MediumLevelIL/MLILIntrinsicSSA.cs | 70 + MediumLevelIL/MLILJump.cs | 22 + MediumLevelIL/MLILJumpTo.cs | 32 + MediumLevelIL/MLILLoad.cs | 22 + MediumLevelIL/MLILLoadSSA.cs | 30 + MediumLevelIL/MLILLoadStruct.cs | 30 + MediumLevelIL/MLILLoadStructSSA.cs | 38 + MediumLevelIL/MLILLogicalShiftLeft.cs | 30 + MediumLevelIL/MLILLogicalShiftRight.cs | 30 + MediumLevelIL/MLILLowPart.cs | 22 + MediumLevelIL/MLILMemoryIntrinsicOutputSSA.cs | 30 + MediumLevelIL/MLILMemoryIntrinsicSSA.cs | 71 + MediumLevelIL/MLILMemoryPhi.cs | 30 + MediumLevelIL/MLILModSigned.cs | 30 + MediumLevelIL/MLILModSignedDoublePrecision.cs | 30 + MediumLevelIL/MLILModUnsigned.cs | 30 + .../MLILModUnsignedDoublePrecision.cs | 30 + MediumLevelIL/MLILMul.cs | 30 + MediumLevelIL/MLILMulSignedDoublePrecision.cs | 30 + .../MLILMulUnsignedDoublePrecision.cs | 30 + MediumLevelIL/MLILNeg.cs | 22 + MediumLevelIL/MLILNoReturn.cs | 14 + MediumLevelIL/MLILNop.cs | 14 + MediumLevelIL/MLILNot.cs | 22 + MediumLevelIL/MLILNotEqual.cs | 30 + MediumLevelIL/MLILOr.cs | 30 + MediumLevelIL/MLILReturn.cs | 22 + MediumLevelIL/MLILReturnHint.cs | 22 + MediumLevelIL/MLILRotateLeft.cs | 30 + MediumLevelIL/MLILRotateLeftCarry.cs | 38 + MediumLevelIL/MLILRotateRight.cs | 30 + MediumLevelIL/MLILRotateRightCarry.cs | 38 + MediumLevelIL/MLILRoundToInt.cs | 22 + MediumLevelIL/MLILSeparateParamList.cs | 22 + MediumLevelIL/MLILSetVariable.cs | 30 + MediumLevelIL/MLILSetVariableAliased.cs | 38 + MediumLevelIL/MLILSetVariableAliasedField.cs | 62 + MediumLevelIL/MLILSetVariableField.cs | 38 + MediumLevelIL/MLILSetVariableSSA.cs | 30 + MediumLevelIL/MLILSetVariableSSAField.cs | 73 + MediumLevelIL/MLILSetVariableSplit.cs | 50 + MediumLevelIL/MLILSetVariableSplitSSA.cs | 58 + MediumLevelIL/MLILSharedParamSlot.cs | 22 + MediumLevelIL/MLILSignExtend.cs | 22 + MediumLevelIL/MLILSignedGreaterOrEqual.cs | 30 + MediumLevelIL/MLILSignedGreaterThan.cs | 30 + MediumLevelIL/MLILSignedLessOrEqual.cs | 30 + MediumLevelIL/MLILSignedLessThan.cs | 30 + MediumLevelIL/MLILStore.cs | 30 + MediumLevelIL/MLILStoreSSA.cs | 46 + MediumLevelIL/MLILStoreStruct.cs | 38 + MediumLevelIL/MLILStoreStructSSA.cs | 54 + MediumLevelIL/MLILSub.cs | 30 + MediumLevelIL/MLILSubBorrow.cs | 38 + MediumLevelIL/MLILSysCall.cs | 30 + MediumLevelIL/MLILSysCallSSA.cs | 62 + MediumLevelIL/MLILSysCallUntyped.cs | 54 + MediumLevelIL/MLILSysCallUntypedSSA.cs | 84 + MediumLevelIL/MLILTailCall.cs | 38 + MediumLevelIL/MLILTailCallSSA.cs | 70 + MediumLevelIL/MLILTailCallUntyped.cs | 46 + MediumLevelIL/MLILTailCallUntypedSSA.cs | 77 + MediumLevelIL/MLILTestBit.cs | 30 + MediumLevelIL/MLILTrap.cs | 22 + MediumLevelIL/MLILUndefine.cs | 14 + MediumLevelIL/MLILUnimplemented.cs | 14 + MediumLevelIL/MLILUnimplementedMemory.cs | 22 + MediumLevelIL/MLILUnsignedGreaterOrEqual.cs | 30 + MediumLevelIL/MLILUnsignedGreaterThan.cs | 30 + MediumLevelIL/MLILUnsignedLessOrEqual.cs | 30 + MediumLevelIL/MLILUnsignedLessThan.cs | 30 + MediumLevelIL/MLILVariable.cs | 22 + MediumLevelIL/MLILVariableAliased.cs | 22 + MediumLevelIL/MLILVariableAliasedField.cs | 30 + MediumLevelIL/MLILVariableField.cs | 30 + MediumLevelIL/MLILVariablePhi.cs | 38 + MediumLevelIL/MLILVariableSSA.cs | 22 + MediumLevelIL/MLILVariableSSAField.cs | 30 + MediumLevelIL/MLILVariableSplit.cs | 30 + MediumLevelIL/MLILVariableSplitSSA.cs | 30 + MediumLevelIL/MLILXor.cs | 30 + MediumLevelIL/MLILZeroExtend.cs | 22 + MediumLevelIL/MediumLevelILBasicBlock.cs | 323 + MediumLevelIL/MediumLevelILBasicBlockEdge.cs | 45 + MediumLevelIL/MediumLevelILFlowGraph.cs | 158 + MediumLevelIL/MediumLevelILFlowGraphEdge.cs | 28 + MediumLevelIL/MediumLevelILFlowGraphNode.cs | 174 + MediumLevelIL/MediumLevelILSSAVariable.cs | 99 + MediumLevelIL/MediumLevelILVariable.cs | 139 + Misc/AbstractBinaryView.cs | 150 + Misc/AbstractSafeHandle.cs | 94 + Misc/BinaryViewStream.cs | 233 + Misc/NativeWrapper.cs | 15 + README.md | 2 + Report/AbstractReport.cs | 53 + Report/FlowGraphReport.cs | 25 + Report/HTMLReport.cs | 37 + Report/IReport.cs | 20 + Report/MarkdownReport.cs | 37 + Report/PlainTextReport.cs | 24 + ScopedAllocator.cs | 212 + Struct/BNActiveAnalysisInfo.cs | 63 + Struct/BNAddressRange.cs | 47 + Struct/BNAllTypeFieldReferences.cs | 67 + Struct/BNAllTypeReferences.cs | 55 + Struct/BNAnalysisInfo.cs | 77 + ...NAnalysisMergeConflictSplitterCallbacks.cs | 65 + Struct/BNAnalysisParameters.cs | 114 + Struct/BNAnalysisProgress.cs | 56 + Struct/BNArchitectureAndAddress.cs | 50 + Struct/BNBaseAddressDetectionReason.cs | 41 + Struct/BNBaseAddressDetectionScore.cs | 33 + Struct/BNBaseAddressDetectionSettings.cs | 76 + Struct/BNBaseStructure.cs | 63 + Struct/BNBasicBlockAnalysisContext.cs | 231 + Struct/BNBasicBlockEdge.cs | 201 + Struct/BNBinaryDataNotification.cs | 289 + Struct/BNBinaryViewEvent.cs | 35 + Struct/BNBoolWithConfidence.cs | 73 + Struct/BNCallingConventionWithConfidence.cs | 61 + Struct/BNChangelogEntry.cs | 40 + Struct/BNConstantReference.cs | 58 + Struct/BNCustomArchitecture.cs | 1570 +++++ Struct/BNCustomBinaryView.cs | 706 +++ Struct/BNCustomBinaryViewType.cs | 271 + Struct/BNCustomCallingConvention.cs | 126 + Struct/BNCustomDataRenderer.cs | 44 + Struct/BNCustomFlowGraph.cs | 59 + Struct/BNCustomFlowGraphLayout.cs | 29 + .../BNCustomLanguageRepresentationFunction.cs | 79 + ...ustomLanguageRepresentationFunctionType.cs | 60 + Struct/BNCustomLineFormatter.cs | 34 + Struct/BNCustomPlatform.cs | 69 + Struct/BNCustomRelocationHandler.cs | 44 + Struct/BNCustomTransform.cs | 336 + Struct/BNDataVariable.cs | 75 + Struct/BNDataVariableAndName.cs | 90 + Struct/BNDataVariableAndNameAndDebugParser.cs | 62 + Struct/BNDebugFunctionInfo.cs | 85 + Struct/BNDemanglerCallbacks.cs | 39 + Struct/BNDisassemblyTextLine.cs | 222 + Struct/BNDisassemblyTextLineTypeInfo.cs | 73 + Struct/BNDownloadInstanceCallbacks.cs | 44 + .../BNDownloadInstanceInputOutputCallbacks.cs | 49 + Struct/BNDownloadInstanceOutputCallbacks.cs | 39 + Struct/BNDownloadInstanceResponse.cs | 47 + Struct/BNDownloadProviderCallbacks.cs | 29 + Struct/BNEdgeStyle.cs | 60 + Struct/BNEnterpriseServerCallbacks.cs | 29 + Struct/BNEnumerationMember.cs | 67 + Struct/BNExprMapInfo.cs | 61 + Struct/BNFileAccessor.cs | 319 + Struct/BNFirmwareNinjaDevice.cs | 47 + Struct/BNFirmwareNinjaDeviceAccesses.cs | 40 + .../BNFirmwareNinjaFunctionMemoryAccesses.cs | 40 + Struct/BNFirmwareNinjaMemoryAccess.cs | 54 + Struct/BNFirmwareNinjaSection.cs | 47 + Struct/BNFlagConditionForSemanticClass.cs | 48 + Struct/BNFlowGraphEdge.cs | 89 + Struct/BNFormInputField.cs | 143 + Struct/BNFunctionParameter.cs | 82 + Struct/BNFunctionRecognizer.cs | 34 + Struct/BNFunctionViewType.cs | 57 + Struct/BNHighLevelILInstruction.cs | 1533 +++++ Struct/BNHighlightColor.cs | 105 + Struct/BNILBranchInstructionAndDependence.cs | 51 + Struct/BNILIndexRange.cs | 41 + Struct/BNILReferenceSource.cs | 78 + Struct/BNIndirectBranchInfo.cs | 75 + Struct/BNInheritedStructureMember.cs | 60 + Struct/BNInstructionInfo.cs | 148 + Struct/BNInstructionTextLine.cs | 49 + Struct/BNInstructionTextToken.cs | 322 + Struct/BNInteractionHandlerCallbacks.cs | 114 + Struct/BNLineFormatterSettings.cs | 96 + Struct/BNLinearDisassemblyLine.cs | 168 + Struct/BNLinearViewObjectIdentifier.cs | 89 + Struct/BNLogListener.cs | 416 ++ Struct/BNLookupTableEntry.cs | 64 + Struct/BNLowLevelILInstruction.cs | 2070 ++++++ Struct/BNLowLevelILLabel.cs | 85 + Struct/BNMainThreadCallbacks.cs | 29 + Struct/BNMediumLevelILInstruction.cs | 1411 +++++ Struct/BNMediumLevelILLabel.cs | 78 + Struct/BNMemoryUsageInfo.cs | 33 + Struct/BNMergedVariable.cs | 38 + Struct/BNMetadataValueStore.cs | 90 + Struct/BNNameAndType.cs | 60 + Struct/BNNameList.cs | 38 + Struct/BNNameSpace.cs | 91 + Struct/BNNavigationHandler.cs | 39 + Struct/BNObjectDestructionCallbacks.cs | 39 + Struct/BNOffsetWithConfidence.cs | 53 + Struct/BNParameterVariablesWithConfidence.cs | 59 + Struct/BNParsedType.cs | 60 + Struct/BNPendingBasicBlockEdge.cs | 61 + Struct/BNPerformanceInfo.cs | 43 + Struct/BNPluginCommand.cs | 2573 ++++++++ Struct/BNPoint.cs | 52 + Struct/BNPossibleValueSet.cs | 140 + Struct/BNProjectNotification.cs | 114 + Struct/BNQualifiedName.cs | 124 + Struct/BNQualifiedNameAndType.cs | 85 + Struct/BNQualifiedNameList.cs | 52 + Struct/BNQualifiedNameTypeAndId.cs | 61 + Struct/BNRange.cs | 42 + Struct/BNReferenceSource.cs | 60 + Struct/BNRegisterInfo.cs | 73 + Struct/BNRegisterOrConstant.cs | 60 + Struct/BNRegisterSetWithConfidence.cs | 61 + Struct/BNRegisterStackAdjustment.cs | 41 + Struct/BNRegisterStackInfo.cs | 78 + Struct/BNRegisterValue.cs | 69 + Struct/BNRegisterValueWithConfidence.cs | 51 + Struct/BNRelocationInfo.cs | 152 + Struct/BNRenderLayerCallbacks.cs | 39 + Struct/BNScriptingInstanceCallbacks.cs | 94 + Struct/BNScriptingOutputListener.cs | 44 + Struct/BNScriptingProviderCallbacks.cs | 39 + Struct/BNSecretsProviderCallbacks.cs | 44 + Struct/BNSegmentInfo.cs | 78 + Struct/BNStackVariableReference.cs | 68 + Struct/BNStringReference.cs | 60 + Struct/BNStructureMember.cs | 148 + Struct/BNSystemCallInfo.cs | 60 + Struct/BNTagReference.cs | 84 + Struct/BNTokenEmitterExpr.cs | 58 + Struct/BNTransformParameter.cs | 57 + Struct/BNTransformParameterInfo.cs | 82 + Struct/BNTypeArchiveNotification.cs | 45 + Struct/BNTypeAttribute.cs | 33 + Struct/BNTypeContext.cs | 33 + Struct/BNTypeDefinitionLine.cs | 138 + Struct/BNTypeField.cs | 33 + Struct/BNTypeFieldReference.cs | 58 + Struct/BNTypeFieldReferenceSizeInfo.cs | 48 + Struct/BNTypeFieldReferenceTypeInfo.cs | 51 + Struct/BNTypeParserCallbacks.cs | 59 + Struct/BNTypeParserError.cs | 66 + Struct/BNTypeParserResult.cs | 86 + Struct/BNTypePrinterCallbacks.cs | 80 + Struct/BNTypeReferenceSource.cs | 60 + Struct/BNTypeWithConfidence.cs | 61 + Struct/BNUpdateChannel.cs | 40 + Struct/BNUpdateChannelFullInfo.cs | 64 + Struct/BNUpdateVersion.cs | 40 + Struct/BNUpdateVersionNew.cs | 40 + Struct/BNUserVariableValue.cs | 50 + Struct/BNValueRange.cs | 60 + Struct/BNVariable.cs | 165 + Struct/BNVariableFieldResolutionInfo.cs | 43 + Struct/BNVariableNameAndType.cs | 80 + Struct/BNVariableReferenceSource.cs | 40 + Struct/BNVersionInfo.cs | 85 + Struct/BNWebsocketClientCallbacks.cs | 44 + Struct/BNWebsocketClientOutputCallbacks.cs | 44 + Struct/BNWebsocketProviderCallbacks.cs | 29 + Type/ArrayType.cs | 53 + Type/BoolType.cs | 23 + Type/CharType.cs | 24 + Type/EnumerationType.cs | 28 + Type/FloatType.cs | 24 + Type/FunctionType.cs | 218 + Type/IntegerType.cs | 52 + Type/NamedTypeReferenceType.cs | 73 + Type/PointerType.cs | 120 + Type/StructureType.cs | 51 + Type/VoidType.cs | 23 + Type/WideCharType.cs | 24 + UnsafeUtils.cs | 632 ++ Utils.cs | 23 + 4265 files changed, 180195 insertions(+), 54 deletions(-) create mode 100644 .github/workflows/ci.yaml create mode 100644 .globalconfig create mode 100644 BinaryNinja.csproj create mode 100644 Constant.cs create mode 100644 Delegate/BNProgressFunction.cs create mode 100644 Delegate/MatchConstantDelegate.cs create mode 100644 Delegate/MatchDataDelegate.cs create mode 100644 Delegate/MatchTextDelegate.cs create mode 100644 Enumeration/BNActionType.cs create mode 100644 Enumeration/BNAnalysisMode.cs create mode 100644 Enumeration/BNAnalysisSkipReason.cs create mode 100644 Enumeration/BNAnalysisState.cs create mode 100644 Enumeration/BNAnalysisWarningActionType.cs create mode 100644 Enumeration/BNBaseAddressDetectionConfidence.cs create mode 100644 Enumeration/BNBaseAddressDetectionPOISetting.cs create mode 100644 Enumeration/BNBaseAddressDetectionPOIType.cs create mode 100644 Enumeration/BNBinaryViewEventType.cs create mode 100644 Enumeration/BNBraceRequirement.cs create mode 100644 Enumeration/BNBranchType.cs create mode 100644 Enumeration/BNBuiltinType.cs create mode 100644 Enumeration/BNCallingConventionName.cs create mode 100644 Enumeration/BNCollaborationPermissionLevel.cs create mode 100644 Enumeration/BNDataFlowQueryOption.cs create mode 100644 Enumeration/BNDeadStoreElimination.cs create mode 100644 Enumeration/BNDisassemblyAddressMode.cs create mode 100644 Enumeration/BNDisassemblyBlockLabels.cs create mode 100644 Enumeration/BNDisassemblyCallParameterHints.cs create mode 100644 Enumeration/BNDisassemblyOption.cs create mode 100644 Enumeration/BNEarlyReturn.cs create mode 100644 Enumeration/BNEdgePenStyle.cs create mode 100644 Enumeration/BNEndianness.cs create mode 100644 Enumeration/BNExprFolding.cs create mode 100644 Enumeration/BNFindFlag.cs create mode 100644 Enumeration/BNFindRangeType.cs create mode 100644 Enumeration/BNFindType.cs create mode 100644 Enumeration/BNFirmwareNinjaMemoryAccessType.cs create mode 100644 Enumeration/BNFirmwareNinjaMemoryHeuristic.cs create mode 100644 Enumeration/BNFirmwareNinjaSectionAnalysisMode.cs create mode 100644 Enumeration/BNFirmwareNinjaSectionType.cs create mode 100644 Enumeration/BNFlagRole.cs create mode 100644 Enumeration/BNFlowGraphOption.cs create mode 100644 Enumeration/BNFormInputFieldType.cs create mode 100644 Enumeration/BNFunctionAnalysisSkipOverride.cs create mode 100644 Enumeration/BNFunctionGraphType.cs create mode 100644 Enumeration/BNFunctionUpdateType.cs create mode 100644 Enumeration/BNHighLevelILOperation.cs create mode 100644 Enumeration/BNHighlightColorStyle.cs create mode 100644 Enumeration/BNHighlightStandardColor.cs create mode 100644 Enumeration/BNILBranchDependence.cs create mode 100644 Enumeration/BNILInstructionAttribute.cs create mode 100644 Enumeration/BNImplicitRegisterExtend.cs create mode 100644 Enumeration/BNInstructionTextTokenContext.cs create mode 100644 Enumeration/BNInstructionTextTokenType.cs create mode 100644 Enumeration/BNIntegerDisplayType.cs create mode 100644 Enumeration/BNIntrinsicClass.cs create mode 100644 Enumeration/BNLinearDisassemblyLineType.cs create mode 100644 Enumeration/BNLinearViewObjectIdentifierType.cs create mode 100644 Enumeration/BNLogLevel.cs create mode 100644 Enumeration/BNLowLevelILFlagCondition.cs create mode 100644 Enumeration/BNLowLevelILOperation.cs create mode 100644 Enumeration/BNMediumLevelILOperation.cs create mode 100644 Enumeration/BNMemberAccess.cs create mode 100644 Enumeration/BNMemberScope.cs create mode 100644 Enumeration/BNMergeConflictDataType.cs create mode 100644 Enumeration/BNMessageBoxButtonResult.cs create mode 100644 Enumeration/BNMessageBoxButtonSet.cs create mode 100644 Enumeration/BNMessageBoxIcon.cs create mode 100644 Enumeration/BNMetadataType.cs create mode 100644 Enumeration/BNModificationStatus.cs create mode 100644 Enumeration/BNNameType.cs create mode 100644 Enumeration/BNNamedTypeReferenceClass.cs create mode 100644 Enumeration/BNOperatorPrecedence.cs create mode 100644 Enumeration/BNPluginCommandType.cs create mode 100644 Enumeration/BNPluginLoadOrder.cs create mode 100644 Enumeration/BNPluginOrigin.cs create mode 100644 Enumeration/BNPluginStatus.cs create mode 100644 Enumeration/BNPluginType.cs create mode 100644 Enumeration/BNPointerBaseType.cs create mode 100644 Enumeration/BNPointerSuffix.cs create mode 100644 Enumeration/BNReferenceType.cs create mode 100644 Enumeration/BNRegisterValueType.cs create mode 100644 Enumeration/BNRelocationType.cs create mode 100644 Enumeration/BNRemoteFileType.cs create mode 100644 Enumeration/BNRenderLayerDefaultEnableState.cs create mode 100644 Enumeration/BNReportType.cs create mode 100644 Enumeration/BNSaveOption.cs create mode 100644 Enumeration/BNScopeType.cs create mode 100644 Enumeration/BNScriptingProviderExecuteResult.cs create mode 100644 Enumeration/BNScriptingProviderInputReadyState.cs create mode 100644 Enumeration/BNSectionSemantics.cs create mode 100644 Enumeration/BNSegmentFlag.cs create mode 100644 Enumeration/BNSettingsScope.cs create mode 100644 Enumeration/BNStringType.cs create mode 100644 Enumeration/BNStructureVariant.cs create mode 100644 Enumeration/BNSwitchRecovery.cs create mode 100644 Enumeration/BNSymbolBinding.cs create mode 100644 Enumeration/BNSymbolDisplayResult.cs create mode 100644 Enumeration/BNSymbolDisplayType.cs create mode 100644 Enumeration/BNSymbolType.cs create mode 100644 Enumeration/BNSyncStatus.cs create mode 100644 Enumeration/BNTagReferenceType.cs create mode 100644 Enumeration/BNTagTypeType.cs create mode 100644 Enumeration/BNThemeColor.cs create mode 100644 Enumeration/BNTokenEscapingType.cs create mode 100644 Enumeration/BNTransformCapabilities.cs create mode 100644 Enumeration/BNTransformResult.cs create mode 100644 Enumeration/BNTransformSessionMode.cs create mode 100644 Enumeration/BNTransformType.cs create mode 100644 Enumeration/BNTypeClass.cs create mode 100644 Enumeration/BNTypeContainerType.cs create mode 100644 Enumeration/BNTypeDefinitionLineType.cs create mode 100644 Enumeration/BNTypeParserErrorSeverity.cs create mode 100644 Enumeration/BNTypeParserOption.cs create mode 100644 Enumeration/BNTypeReferenceType.cs create mode 100644 Enumeration/BNUpdateResult.cs create mode 100644 Enumeration/BNVariableSourceType.cs create mode 100644 Enumeration/PluginLoadStatus.cs create mode 100644 Form/LabelField.cs create mode 100644 Form/SeparatorField.cs create mode 100644 Form/TextLineField.cs create mode 100644 Function/BNAbortAnalysis.cs create mode 100644 Function/BNAbortBaseAddressDetection.cs create mode 100644 Function/BNAbortFlowGraphLayoutRequest.cs create mode 100644 Function/BNActivityGetName.cs create mode 100644 Function/BNAddAnalysisCompletionEvent.cs create mode 100644 Function/BNAddAnalysisOption.cs create mode 100644 Function/BNAddArchitectureRedirection.cs create mode 100644 Function/BNAddAutoAddressTag.cs create mode 100644 Function/BNAddAutoDataTag.cs create mode 100644 Function/BNAddAutoFunctionTag.cs create mode 100644 Function/BNAddAutoSection.cs create mode 100644 Function/BNAddAutoSegment.cs create mode 100644 Function/BNAddAutoSegments.cs create mode 100644 Function/BNAddBinaryMemoryRegion.cs create mode 100644 Function/BNAddBinaryViewTypeLibrary.cs create mode 100644 Function/BNAddDataMemoryRegion.cs create mode 100644 Function/BNAddDataReference.cs create mode 100644 Function/BNAddDebugDataVariable.cs create mode 100644 Function/BNAddDebugDataVariableInfo.cs create mode 100644 Function/BNAddDebugFunction.cs create mode 100644 Function/BNAddDebugType.cs create mode 100644 Function/BNAddEntryPointForAnalysis.cs create mode 100644 Function/BNAddEnumerationBuilderMember.cs create mode 100644 Function/BNAddEnumerationBuilderMemberWithValue.cs create mode 100644 Function/BNAddExpressionParserMagicValue.cs create mode 100644 Function/BNAddExpressionParserMagicValues.cs create mode 100644 Function/BNAddFlowGraphNode.cs create mode 100644 Function/BNAddFlowGraphNodeOutgoingEdge.cs create mode 100644 Function/BNAddFlowGraphRenderLayer.cs create mode 100644 Function/BNAddFunctionForAnalysis.cs create mode 100644 Function/BNAddGraphReportToCollection.cs create mode 100644 Function/BNAddGuidedSourceBlocks.cs create mode 100644 Function/BNAddHTMLReportToCollection.cs create mode 100644 Function/BNAddHighLevelILArrayIndexToken.cs create mode 100644 Function/BNAddHighLevelILConstantTextToken.cs create mode 100644 Function/BNAddHighLevelILFloatSizeToken.cs create mode 100644 Function/BNAddHighLevelILIntegerTextToken.cs create mode 100644 Function/BNAddHighLevelILPointerTextToken.cs create mode 100644 Function/BNAddHighLevelILSizeToken.cs create mode 100644 Function/BNAddHighLevelILVarTextToken.cs create mode 100644 Function/BNAddLinearViewCursorRenderLayer.cs create mode 100644 Function/BNAddLowLevelILLabelForAddress.cs create mode 100644 Function/BNAddMarkdownReportToCollection.cs create mode 100644 Function/BNAddNamesForOuterStructureMembers.cs create mode 100644 Function/BNAddOptionalPluginDependency.cs create mode 100644 Function/BNAddPlainTextReportToCollection.cs create mode 100644 Function/BNAddRelatedPlatform.cs create mode 100644 Function/BNAddRemoteMemoryRegion.cs create mode 100644 Function/BNAddRequiredPluginDependency.cs create mode 100644 Function/BNAddStructureBuilderMember.cs create mode 100644 Function/BNAddStructureBuilderMemberAtOffset.cs create mode 100644 Function/BNAddTag.cs create mode 100644 Function/BNAddTagType.cs create mode 100644 Function/BNAddToEntryFunctions.cs create mode 100644 Function/BNAddTypeArchiveTypes.cs create mode 100644 Function/BNAddTypeBuilderPointerSuffix.cs create mode 100644 Function/BNAddTypeLibraryAlternateName.cs create mode 100644 Function/BNAddTypeLibraryNamedObject.cs create mode 100644 Function/BNAddTypeLibraryNamedType.cs create mode 100644 Function/BNAddTypeLibraryNamedTypeSource.cs create mode 100644 Function/BNAddTypeLibraryPlatform.cs create mode 100644 Function/BNAddTypeMemberTokens.cs create mode 100644 Function/BNAddUnbackedMemoryRegion.cs create mode 100644 Function/BNAddUserAddressTag.cs create mode 100644 Function/BNAddUserCodeReference.cs create mode 100644 Function/BNAddUserDataReference.cs create mode 100644 Function/BNAddUserDataTag.cs create mode 100644 Function/BNAddUserFunctionTag.cs create mode 100644 Function/BNAddUserSection.cs create mode 100644 Function/BNAddUserSegment.cs create mode 100644 Function/BNAddUserSegments.cs create mode 100644 Function/BNAddUserTypeFieldReference.cs create mode 100644 Function/BNAddUserTypeReference.cs create mode 100644 Function/BNAllocString.cs create mode 100644 Function/BNAllocStringList.cs create mode 100644 Function/BNAllocStringWithLength.cs create mode 100644 Function/BNAlwaysBranch.cs create mode 100644 Function/BNAnalysisContextGetBinaryView.cs create mode 100644 Function/BNAnalysisContextGetFunction.cs create mode 100644 Function/BNAnalysisContextGetHighLevelILFunction.cs create mode 100644 Function/BNAnalysisContextGetLiftedILFunction.cs create mode 100644 Function/BNAnalysisContextGetLowLevelILFunction.cs create mode 100644 Function/BNAnalysisContextGetMediumLevelILFunction.cs create mode 100644 Function/BNAnalysisContextInform.cs create mode 100644 Function/BNAnalysisIsAborted.cs create mode 100644 Function/BNAnalysisMergeConflictGetBase.cs create mode 100644 Function/BNAnalysisMergeConflictGetBaseFile.cs create mode 100644 Function/BNAnalysisMergeConflictGetBaseSnapshot.cs create mode 100644 Function/BNAnalysisMergeConflictGetDataType.cs create mode 100644 Function/BNAnalysisMergeConflictGetDatabase.cs create mode 100644 Function/BNAnalysisMergeConflictGetFirst.cs create mode 100644 Function/BNAnalysisMergeConflictGetFirstFile.cs create mode 100644 Function/BNAnalysisMergeConflictGetFirstSnapshot.cs create mode 100644 Function/BNAnalysisMergeConflictGetKey.cs create mode 100644 Function/BNAnalysisMergeConflictGetPathItem.cs create mode 100644 Function/BNAnalysisMergeConflictGetPathItemSerialized.cs create mode 100644 Function/BNAnalysisMergeConflictGetPathItemString.cs create mode 100644 Function/BNAnalysisMergeConflictGetSecond.cs create mode 100644 Function/BNAnalysisMergeConflictGetSecondFile.cs create mode 100644 Function/BNAnalysisMergeConflictGetSecondSnapshot.cs create mode 100644 Function/BNAnalysisMergeConflictGetType.cs create mode 100644 Function/BNAnalysisMergeConflictSplitterCanSplit.cs create mode 100644 Function/BNAnalysisMergeConflictSplitterGetName.cs create mode 100644 Function/BNAnalysisMergeConflictSplitterSplit.cs create mode 100644 Function/BNAnalysisMergeConflictSuccess.cs create mode 100644 Function/BNAnalyzeBasicBlocksContextAddBasicBlockToFunction.cs create mode 100644 Function/BNAnalyzeBasicBlocksContextAddTempReference.cs create mode 100644 Function/BNAnalyzeBasicBlocksContextCreateBasicBlock.cs create mode 100644 Function/BNAnalyzeBasicBlocksContextFinalize.cs create mode 100644 Function/BNAnalyzeBasicBlocksContextSetContextualFunctionReturns.cs create mode 100644 Function/BNAnalyzeBasicBlocksContextSetDirectCodeReferences.cs create mode 100644 Function/BNAnalyzeBasicBlocksContextSetDirectNoReturnCalls.cs create mode 100644 Function/BNAnalyzeBasicBlocksContextSetHaltedDisassemblyAddresses.cs create mode 100644 Function/BNAnalyzeBasicBlocksContextSetInlinedUnresolvedIndirectBranches.cs create mode 100644 Function/BNAnalyzeFunction.cs create mode 100644 Function/BNAppendDataBuffer.cs create mode 100644 Function/BNAppendDataBufferContents.cs create mode 100644 Function/BNAppendPath.cs create mode 100644 Function/BNAppendSymbolQueue.cs create mode 100644 Function/BNApplyAutoDiscoveredFunctionType.cs create mode 100644 Function/BNApplyDebugInfo.cs create mode 100644 Function/BNApplyImportedTypes.cs create mode 100644 Function/BNApplyRenderLayerToFlowGraph.cs create mode 100644 Function/BNApplyRenderLayerToLinearViewObject.cs create mode 100644 Function/BNApplySnapshotData.cs create mode 100644 Function/BNArchitectureAlwaysBranch.cs create mode 100644 Function/BNArchitectureAnalyzeBasicBlocks.cs create mode 100644 Function/BNArchitectureConvertToNop.cs create mode 100644 Function/BNArchitectureDefaultAnalyzeBasicBlocks.cs create mode 100644 Function/BNArchitectureGetRelocationHandler.cs create mode 100644 Function/BNArchitectureInvertBranch.cs create mode 100644 Function/BNArchitectureRegisterRelocationHandler.cs create mode 100644 Function/BNArchitectureSetDefaultAnalyzeBasicBlocksCallback.cs create mode 100644 Function/BNArchitectureSkipAndReturnValue.cs create mode 100644 Function/BNAreArgumentRegistersSharedIndex.cs create mode 100644 Function/BNAreArgumentRegistersUsedForVarArgs.cs create mode 100644 Function/BNAreAutoUpdatesEnabled.cs create mode 100644 Function/BNAreUpdatesAvailable.cs create mode 100644 Function/BNAssemble.cs create mode 100644 Function/BNAssignDataBuffer.cs create mode 100644 Function/BNAuthenticateEnterpriseServerWithCredentials.cs create mode 100644 Function/BNAuthenticateEnterpriseServerWithMethod.cs create mode 100644 Function/BNBasicBlockAddInstructionData.cs create mode 100644 Function/BNBasicBlockAddPendingOutgoingEdge.cs create mode 100644 Function/BNBasicBlockCanExit.cs create mode 100644 Function/BNBasicBlockGetInstructionData.cs create mode 100644 Function/BNBasicBlockHasInvalidInstructions.cs create mode 100644 Function/BNBasicBlockHasUndeterminedOutgoingEdges.cs create mode 100644 Function/BNBasicBlockIsFallThroughToFunction.cs create mode 100644 Function/BNBasicBlockSetCanExit.cs create mode 100644 Function/BNBasicBlockSetFallThroughToFunction.cs create mode 100644 Function/BNBasicBlockSetHasInvalidInstructions.cs create mode 100644 Function/BNBasicBlockSetUndeterminedOutgoingEdges.cs create mode 100644 Function/BNBeginBackgroundTask.cs create mode 100644 Function/BNBeginBulkAddSegments.cs create mode 100644 Function/BNBeginBulkModifySymbols.cs create mode 100644 Function/BNBeginKeyValueStoreNamespace.cs create mode 100644 Function/BNBeginUndoActions.cs create mode 100644 Function/BNBinaryViewAddExternalLibrary.cs create mode 100644 Function/BNBinaryViewAddExternalLocation.cs create mode 100644 Function/BNBinaryViewAttachTypeArchive.cs create mode 100644 Function/BNBinaryViewDetachTypeArchive.cs create mode 100644 Function/BNBinaryViewDisassociateTypeArchiveType.cs create mode 100644 Function/BNBinaryViewExportObjectToTypeLibrary.cs create mode 100644 Function/BNBinaryViewExportTypeToTypeLibrary.cs create mode 100644 Function/BNBinaryViewFinalizeNewSegments.cs create mode 100644 Function/BNBinaryViewGetAssociatedTypeArchiveTypeSource.cs create mode 100644 Function/BNBinaryViewGetAssociatedTypeArchiveTypeTarget.cs create mode 100644 Function/BNBinaryViewGetAssociatedTypeArchiveTypes.cs create mode 100644 Function/BNBinaryViewGetAssociatedTypesFromArchive.cs create mode 100644 Function/BNBinaryViewGetAutoMetadata.cs create mode 100644 Function/BNBinaryViewGetExternalLibraries.cs create mode 100644 Function/BNBinaryViewGetExternalLibrary.cs create mode 100644 Function/BNBinaryViewGetExternalLocation.cs create mode 100644 Function/BNBinaryViewGetExternalLocations.cs create mode 100644 Function/BNBinaryViewGetLoadSettings.cs create mode 100644 Function/BNBinaryViewGetLoadSettingsTypeNames.cs create mode 100644 Function/BNBinaryViewGetMetadata.cs create mode 100644 Function/BNBinaryViewGetTypeArchive.cs create mode 100644 Function/BNBinaryViewGetTypeArchivePath.cs create mode 100644 Function/BNBinaryViewGetTypeArchiveSyncStatus.cs create mode 100644 Function/BNBinaryViewGetTypeArchiveTypeNameList.cs create mode 100644 Function/BNBinaryViewGetTypeArchiveTypeNames.cs create mode 100644 Function/BNBinaryViewGetTypeArchives.cs create mode 100644 Function/BNBinaryViewGetTypeNameByGuid.cs create mode 100644 Function/BNBinaryViewImportTypeLibraryObject.cs create mode 100644 Function/BNBinaryViewImportTypeLibraryType.cs create mode 100644 Function/BNBinaryViewImportTypeLibraryTypeByGuid.cs create mode 100644 Function/BNBinaryViewLookupImportedObjectLibrary.cs create mode 100644 Function/BNBinaryViewLookupImportedTypeLibrary.cs create mode 100644 Function/BNBinaryViewPullTypeArchiveTypes.cs create mode 100644 Function/BNBinaryViewPushTypeArchiveTypes.cs create mode 100644 Function/BNBinaryViewQueryMetadata.cs create mode 100644 Function/BNBinaryViewRecordImportedObjectLibrary.cs create mode 100644 Function/BNBinaryViewRemoveExternalLibrary.cs create mode 100644 Function/BNBinaryViewRemoveExternalLocation.cs create mode 100644 Function/BNBinaryViewRemoveMetadata.cs create mode 100644 Function/BNBinaryViewSetLoadSettings.cs create mode 100644 Function/BNBinaryViewSetManualDependencies.cs create mode 100644 Function/BNBinaryViewStoreMetadata.cs create mode 100644 Function/BNCacheHighLevelILPossibleValueSet.cs create mode 100644 Function/BNCacheLowLevelILPossibleValueSet.cs create mode 100644 Function/BNCacheMediumLevelILPossibleValueSet.cs create mode 100644 Function/BNCanArchitectureAssemble.cs create mode 100644 Function/BNCanAssemble.cs create mode 100644 Function/BNCanCancelBackgroundTask.cs create mode 100644 Function/BNCanDecode.cs create mode 100644 Function/BNCanFunctionReturn.cs create mode 100644 Function/BNCanRedo.cs create mode 100644 Function/BNCanUndo.cs create mode 100644 Function/BNCancelAnalysisCompletionEvent.cs create mode 100644 Function/BNCancelBackgroundTask.cs create mode 100644 Function/BNCancelBulkAddSegments.cs create mode 100644 Function/BNCancelEnterpriseServerAuthentication.cs create mode 100644 Function/BNCancelScriptInput.cs create mode 100644 Function/BNCheckForStringAnnotationType.cs create mode 100644 Function/BNClearBasicBlockPendingOutgoingEdges.cs create mode 100644 Function/BNClearDataBuffer.cs create mode 100644 Function/BNClearFieldResolutionForVariableAt.cs create mode 100644 Function/BNClearFlowGraphNodes.cs create mode 100644 Function/BNClearForcedVariableVersion.cs create mode 100644 Function/BNClearTypeLibraryPlatforms.cs create mode 100644 Function/BNClearUndoEntries.cs create mode 100644 Function/BNClearUserGlobalPointerValue.cs create mode 100644 Function/BNClearUserVariableValue.cs create mode 100644 Function/BNCloseFile.cs create mode 100644 Function/BNCloseLogs.cs create mode 100644 Function/BNCloseTypeArchive.cs create mode 100644 Function/BNCollaborationAssignSnapshotMap.cs create mode 100644 Function/BNCollaborationChangesetGetAuthor.cs create mode 100644 Function/BNCollaborationChangesetGetDatabase.cs create mode 100644 Function/BNCollaborationChangesetGetFile.cs create mode 100644 Function/BNCollaborationChangesetGetName.cs create mode 100644 Function/BNCollaborationChangesetGetSnapshotIds.cs create mode 100644 Function/BNCollaborationChangesetSetName.cs create mode 100644 Function/BNCollaborationCreateRemote.cs create mode 100644 Function/BNCollaborationDefaultFilePath.cs create mode 100644 Function/BNCollaborationDefaultProjectPath.cs create mode 100644 Function/BNCollaborationDeleteDataFromKeychain.cs create mode 100644 Function/BNCollaborationDownloadDatabaseForFile.cs create mode 100644 Function/BNCollaborationDownloadFile.cs create mode 100644 Function/BNCollaborationDownloadTypeArchive.cs create mode 100644 Function/BNCollaborationDumpDatabase.cs create mode 100644 Function/BNCollaborationFreeIdList.cs create mode 100644 Function/BNCollaborationFreeLazyT.cs create mode 100644 Function/BNCollaborationFreeSnapshotIdList.cs create mode 100644 Function/BNCollaborationGetActiveRemote.cs create mode 100644 Function/BNCollaborationGetDataFromKeychain.cs create mode 100644 Function/BNCollaborationGetLocalSnapshotFromRemote.cs create mode 100644 Function/BNCollaborationGetLocalSnapshotFromRemoteTypeArchive.cs create mode 100644 Function/BNCollaborationGetRemoteByAddress.cs create mode 100644 Function/BNCollaborationGetRemoteById.cs create mode 100644 Function/BNCollaborationGetRemoteByName.cs create mode 100644 Function/BNCollaborationGetRemoteFileForLocalDatabase.cs create mode 100644 Function/BNCollaborationGetRemoteFileForLocalTypeArchive.cs create mode 100644 Function/BNCollaborationGetRemoteForLocalDatabase.cs create mode 100644 Function/BNCollaborationGetRemoteForLocalTypeArchive.cs create mode 100644 Function/BNCollaborationGetRemoteProjectForLocalDatabase.cs create mode 100644 Function/BNCollaborationGetRemoteProjectForLocalTypeArchive.cs create mode 100644 Function/BNCollaborationGetRemoteSnapshotFromLocal.cs create mode 100644 Function/BNCollaborationGetRemoteSnapshotFromLocalTypeArchive.cs create mode 100644 Function/BNCollaborationGetRemotes.cs create mode 100644 Function/BNCollaborationGetSnapshotAuthor.cs create mode 100644 Function/BNCollaborationGroupContainsUser.cs create mode 100644 Function/BNCollaborationGroupGetId.cs create mode 100644 Function/BNCollaborationGroupGetName.cs create mode 100644 Function/BNCollaborationGroupGetRemote.cs create mode 100644 Function/BNCollaborationGroupGetUrl.cs create mode 100644 Function/BNCollaborationGroupGetUsers.cs create mode 100644 Function/BNCollaborationGroupSetName.cs create mode 100644 Function/BNCollaborationGroupSetUsernames.cs create mode 100644 Function/BNCollaborationHasDataInKeychain.cs create mode 100644 Function/BNCollaborationIgnoreSnapshot.cs create mode 100644 Function/BNCollaborationIsCollaborationDatabase.cs create mode 100644 Function/BNCollaborationIsCollaborationTypeArchive.cs create mode 100644 Function/BNCollaborationIsSnapshotIgnored.cs create mode 100644 Function/BNCollaborationIsTypeArchiveSnapshotIgnored.cs create mode 100644 Function/BNCollaborationLazyTCreate.cs create mode 100644 Function/BNCollaborationLazyTDereference.cs create mode 100644 Function/BNCollaborationLoadRemotes.cs create mode 100644 Function/BNCollaborationMergeDatabase.cs create mode 100644 Function/BNCollaborationMergeSnapshots.cs create mode 100644 Function/BNCollaborationPermissionCanAdmin.cs create mode 100644 Function/BNCollaborationPermissionCanEdit.cs create mode 100644 Function/BNCollaborationPermissionCanView.cs create mode 100644 Function/BNCollaborationPermissionGetGroupId.cs create mode 100644 Function/BNCollaborationPermissionGetGroupName.cs create mode 100644 Function/BNCollaborationPermissionGetId.cs create mode 100644 Function/BNCollaborationPermissionGetLevel.cs create mode 100644 Function/BNCollaborationPermissionGetProject.cs create mode 100644 Function/BNCollaborationPermissionGetRemote.cs create mode 100644 Function/BNCollaborationPermissionGetUrl.cs create mode 100644 Function/BNCollaborationPermissionGetUserId.cs create mode 100644 Function/BNCollaborationPermissionGetUsername.cs create mode 100644 Function/BNCollaborationPermissionSetLevel.cs create mode 100644 Function/BNCollaborationPullDatabase.cs create mode 100644 Function/BNCollaborationPullTypeArchive.cs create mode 100644 Function/BNCollaborationPushDatabase.cs create mode 100644 Function/BNCollaborationPushTypeArchive.cs create mode 100644 Function/BNCollaborationRemoveRemote.cs create mode 100644 Function/BNCollaborationSaveRemotes.cs create mode 100644 Function/BNCollaborationSetActiveRemote.cs create mode 100644 Function/BNCollaborationSetSnapshotAuthor.cs create mode 100644 Function/BNCollaborationSnapshotCreateUndoEntry.cs create mode 100644 Function/BNCollaborationSnapshotDownload.cs create mode 100644 Function/BNCollaborationSnapshotDownloadAnalysisCache.cs create mode 100644 Function/BNCollaborationSnapshotDownloadSnapshotFile.cs create mode 100644 Function/BNCollaborationSnapshotFinalize.cs create mode 100644 Function/BNCollaborationSnapshotGetAnalysisCacheBuildId.cs create mode 100644 Function/BNCollaborationSnapshotGetAuthor.cs create mode 100644 Function/BNCollaborationSnapshotGetAuthorUsername.cs create mode 100644 Function/BNCollaborationSnapshotGetChildIds.cs create mode 100644 Function/BNCollaborationSnapshotGetChildren.cs create mode 100644 Function/BNCollaborationSnapshotGetCreated.cs create mode 100644 Function/BNCollaborationSnapshotGetDescription.cs create mode 100644 Function/BNCollaborationSnapshotGetFile.cs create mode 100644 Function/BNCollaborationSnapshotGetHash.cs create mode 100644 Function/BNCollaborationSnapshotGetId.cs create mode 100644 Function/BNCollaborationSnapshotGetLastModified.cs create mode 100644 Function/BNCollaborationSnapshotGetName.cs create mode 100644 Function/BNCollaborationSnapshotGetParentIds.cs create mode 100644 Function/BNCollaborationSnapshotGetParents.cs create mode 100644 Function/BNCollaborationSnapshotGetProject.cs create mode 100644 Function/BNCollaborationSnapshotGetRemote.cs create mode 100644 Function/BNCollaborationSnapshotGetSnapshotFileHash.cs create mode 100644 Function/BNCollaborationSnapshotGetTitle.cs create mode 100644 Function/BNCollaborationSnapshotGetUndoEntries.cs create mode 100644 Function/BNCollaborationSnapshotGetUndoEntryById.cs create mode 100644 Function/BNCollaborationSnapshotGetUrl.cs create mode 100644 Function/BNCollaborationSnapshotHasPulledUndoEntries.cs create mode 100644 Function/BNCollaborationSnapshotIsFinalized.cs create mode 100644 Function/BNCollaborationSnapshotPullUndoEntries.cs create mode 100644 Function/BNCollaborationStoreDataInKeychain.cs create mode 100644 Function/BNCollaborationSyncDatabase.cs create mode 100644 Function/BNCollaborationSyncTypeArchive.cs create mode 100644 Function/BNCollaborationUndoEntryGetData.cs create mode 100644 Function/BNCollaborationUndoEntryGetFile.cs create mode 100644 Function/BNCollaborationUndoEntryGetId.cs create mode 100644 Function/BNCollaborationUndoEntryGetParent.cs create mode 100644 Function/BNCollaborationUndoEntryGetParentId.cs create mode 100644 Function/BNCollaborationUndoEntryGetProject.cs create mode 100644 Function/BNCollaborationUndoEntryGetRemote.cs create mode 100644 Function/BNCollaborationUndoEntryGetSnapshot.cs create mode 100644 Function/BNCollaborationUndoEntryGetUrl.cs create mode 100644 Function/BNCollaborationUploadDatabase.cs create mode 100644 Function/BNCollaborationUploadTypeArchive.cs create mode 100644 Function/BNCollaborationUserGetEmail.cs create mode 100644 Function/BNCollaborationUserGetId.cs create mode 100644 Function/BNCollaborationUserGetLastLogin.cs create mode 100644 Function/BNCollaborationUserGetRemote.cs create mode 100644 Function/BNCollaborationUserGetUrl.cs create mode 100644 Function/BNCollaborationUserGetUsername.cs create mode 100644 Function/BNCollaborationUserIsActive.cs create mode 100644 Function/BNCollaborationUserSetEmail.cs create mode 100644 Function/BNCollaborationUserSetIsActive.cs create mode 100644 Function/BNCollaborationUserSetUsername.cs create mode 100644 Function/BNCommitUndoActions.cs create mode 100644 Function/BNCompareLinearViewCursors.cs create mode 100644 Function/BNCompareLinearViewObjectChildren.cs create mode 100644 Function/BNComponentAddAllMembersFromComponent.cs create mode 100644 Function/BNComponentAddComponent.cs create mode 100644 Function/BNComponentAddDataVariable.cs create mode 100644 Function/BNComponentAddFunctionReference.cs create mode 100644 Function/BNComponentContainsComponent.cs create mode 100644 Function/BNComponentContainsDataVariable.cs create mode 100644 Function/BNComponentContainsFunction.cs create mode 100644 Function/BNComponentFreeReferencedTypes.cs create mode 100644 Function/BNComponentGetContainedComponents.cs create mode 100644 Function/BNComponentGetContainedDataVariables.cs create mode 100644 Function/BNComponentGetContainedFunctions.cs create mode 100644 Function/BNComponentGetDisplayName.cs create mode 100644 Function/BNComponentGetGuid.cs create mode 100644 Function/BNComponentGetOriginalName.cs create mode 100644 Function/BNComponentGetParent.cs create mode 100644 Function/BNComponentGetReferencedDataVariables.cs create mode 100644 Function/BNComponentGetReferencedDataVariablesRecursive.cs create mode 100644 Function/BNComponentGetReferencedTypes.cs create mode 100644 Function/BNComponentGetReferencedTypesRecursive.cs create mode 100644 Function/BNComponentGetView.cs create mode 100644 Function/BNComponentRemoveAllFunctions.cs create mode 100644 Function/BNComponentRemoveComponent.cs create mode 100644 Function/BNComponentRemoveDataVariable.cs create mode 100644 Function/BNComponentRemoveFunctionReference.cs create mode 100644 Function/BNComponentSetName.cs create mode 100644 Function/BNComponentsEqual.cs create mode 100644 Function/BNComponentsNotEqual.cs create mode 100644 Function/BNConnectEnterpriseServer.cs create mode 100644 Function/BNConnectWebsocketClient.cs create mode 100644 Function/BNConvertToNop.cs create mode 100644 Function/BNCopyFile.cs create mode 100644 Function/BNCoreEnumFromString.cs create mode 100644 Function/BNCoreEnumToString.cs create mode 100644 Function/BNCreateActivity.cs create mode 100644 Function/BNCreateActivityWithEligibility.cs create mode 100644 Function/BNCreateAnalysisContext.cs create mode 100644 Function/BNCreateArrayType.cs create mode 100644 Function/BNCreateArrayTypeBuilder.cs create mode 100644 Function/BNCreateAutoStackVariable.cs create mode 100644 Function/BNCreateAutoVariable.cs create mode 100644 Function/BNCreateBaseAddressDetection.cs create mode 100644 Function/BNCreateBinaryDataView.cs create mode 100644 Function/BNCreateBinaryDataViewFromBuffer.cs create mode 100644 Function/BNCreateBinaryDataViewFromData.cs create mode 100644 Function/BNCreateBinaryDataViewFromFile.cs create mode 100644 Function/BNCreateBinaryDataViewFromFilename.cs create mode 100644 Function/BNCreateBinaryReader.cs create mode 100644 Function/BNCreateBinaryViewOfType.cs create mode 100644 Function/BNCreateBinaryWriter.cs create mode 100644 Function/BNCreateBoolType.cs create mode 100644 Function/BNCreateBoolTypeBuilder.cs create mode 100644 Function/BNCreateCallingConvention.cs create mode 100644 Function/BNCreateComponent.cs create mode 100644 Function/BNCreateComponentWithName.cs create mode 100644 Function/BNCreateComponentWithParent.cs create mode 100644 Function/BNCreateComponentWithParentAndName.cs create mode 100644 Function/BNCreateCustomBinaryView.cs create mode 100644 Function/BNCreateCustomFlowGraph.cs create mode 100644 Function/BNCreateCustomLanguageRepresentationFunction.cs create mode 100644 Function/BNCreateCustomPlatform.cs create mode 100644 Function/BNCreateCustomPlatformWithTypes.cs create mode 100644 Function/BNCreateDataBuffer.cs create mode 100644 Function/BNCreateDataRenderer.cs create mode 100644 Function/BNCreateDatabase.cs create mode 100644 Function/BNCreateDatabaseWithProgress.cs create mode 100644 Function/BNCreateDirectory.cs create mode 100644 Function/BNCreateDisassemblySettings.cs create mode 100644 Function/BNCreateDisassemblyTextRenderer.cs create mode 100644 Function/BNCreateDownloadProviderInstance.cs create mode 100644 Function/BNCreateEnumerationBuilder.cs create mode 100644 Function/BNCreateEnumerationBuilderFromEnumeration.cs create mode 100644 Function/BNCreateEnumerationType.cs create mode 100644 Function/BNCreateEnumerationTypeBuilder.cs create mode 100644 Function/BNCreateEnumerationTypeBuilderWithBuilder.cs create mode 100644 Function/BNCreateEnumerationTypeOfWidth.cs create mode 100644 Function/BNCreateFileMetadata.cs create mode 100644 Function/BNCreateFirmwareNinja.cs create mode 100644 Function/BNCreateFirmwareNinjaRelationship.cs create mode 100644 Function/BNCreateFloatType.cs create mode 100644 Function/BNCreateFloatTypeBuilder.cs create mode 100644 Function/BNCreateFlowGraph.cs create mode 100644 Function/BNCreateFlowGraphNode.cs create mode 100644 Function/BNCreateForcedVariableVersion.cs create mode 100644 Function/BNCreateFunctionGraph.cs create mode 100644 Function/BNCreateFunctionType.cs create mode 100644 Function/BNCreateFunctionTypeBuilder.cs create mode 100644 Function/BNCreateHighLevelILDisassemblyTextRenderer.cs create mode 100644 Function/BNCreateHighLevelILFunction.cs create mode 100644 Function/BNCreateHighLevelILFunctionGraph.cs create mode 100644 Function/BNCreateHighLevelILImmediateFunctionGraph.cs create mode 100644 Function/BNCreateImmediateFunctionGraph.cs create mode 100644 Function/BNCreateIntegerType.cs create mode 100644 Function/BNCreateIntegerTypeBuilder.cs create mode 100644 Function/BNCreateKeyValueStore.cs create mode 100644 Function/BNCreateKeyValueStoreFromDataBuffer.cs create mode 100644 Function/BNCreateLanguageRepresentationFunction.cs create mode 100644 Function/BNCreateLinearViewCursor.cs create mode 100644 Function/BNCreateLinearViewDataOnly.cs create mode 100644 Function/BNCreateLinearViewDisassembly.cs create mode 100644 Function/BNCreateLinearViewHighLevelIL.cs create mode 100644 Function/BNCreateLinearViewHighLevelILSSAForm.cs create mode 100644 Function/BNCreateLinearViewLanguageRepresentation.cs create mode 100644 Function/BNCreateLinearViewLiftedIL.cs create mode 100644 Function/BNCreateLinearViewLowLevelIL.cs create mode 100644 Function/BNCreateLinearViewLowLevelILSSAForm.cs create mode 100644 Function/BNCreateLinearViewMappedMediumLevelIL.cs create mode 100644 Function/BNCreateLinearViewMappedMediumLevelILSSAForm.cs create mode 100644 Function/BNCreateLinearViewMediumLevelIL.cs create mode 100644 Function/BNCreateLinearViewMediumLevelILSSAForm.cs create mode 100644 Function/BNCreateLinearViewSingleFunctionDisassembly.cs create mode 100644 Function/BNCreateLinearViewSingleFunctionHighLevelIL.cs create mode 100644 Function/BNCreateLinearViewSingleFunctionHighLevelILSSAForm.cs create mode 100644 Function/BNCreateLinearViewSingleFunctionLanguageRepresentation.cs create mode 100644 Function/BNCreateLinearViewSingleFunctionLiftedIL.cs create mode 100644 Function/BNCreateLinearViewSingleFunctionLowLevelIL.cs create mode 100644 Function/BNCreateLinearViewSingleFunctionLowLevelILSSAForm.cs create mode 100644 Function/BNCreateLinearViewSingleFunctionMappedMediumLevelIL.cs create mode 100644 Function/BNCreateLinearViewSingleFunctionMappedMediumLevelILSSAForm.cs create mode 100644 Function/BNCreateLinearViewSingleFunctionMediumLevelIL.cs create mode 100644 Function/BNCreateLinearViewSingleFunctionMediumLevelILSSAForm.cs create mode 100644 Function/BNCreateLowLevelILDisassemblyTextRenderer.cs create mode 100644 Function/BNCreateLowLevelILFunction.cs create mode 100644 Function/BNCreateLowLevelILFunctionGraph.cs create mode 100644 Function/BNCreateLowLevelILImmediateFunctionGraph.cs create mode 100644 Function/BNCreateMediumLevelILDisassemblyTextRenderer.cs create mode 100644 Function/BNCreateMediumLevelILFunction.cs create mode 100644 Function/BNCreateMediumLevelILFunctionGraph.cs create mode 100644 Function/BNCreateMediumLevelILImmediateFunctionGraph.cs create mode 100644 Function/BNCreateMetadataArray.cs create mode 100644 Function/BNCreateMetadataBooleanData.cs create mode 100644 Function/BNCreateMetadataBooleanListData.cs create mode 100644 Function/BNCreateMetadataDoubleData.cs create mode 100644 Function/BNCreateMetadataDoubleListData.cs create mode 100644 Function/BNCreateMetadataOfType.cs create mode 100644 Function/BNCreateMetadataRawData.cs create mode 100644 Function/BNCreateMetadataSignedIntegerData.cs create mode 100644 Function/BNCreateMetadataSignedIntegerListData.cs create mode 100644 Function/BNCreateMetadataStringData.cs create mode 100644 Function/BNCreateMetadataStringListData.cs create mode 100644 Function/BNCreateMetadataUnsignedIntegerData.cs create mode 100644 Function/BNCreateMetadataUnsignedIntegerListData.cs create mode 100644 Function/BNCreateMetadataValueStore.cs create mode 100644 Function/BNCreateNamedType.cs create mode 100644 Function/BNCreateNamedTypeBuilder.cs create mode 100644 Function/BNCreateNamedTypeReference.cs create mode 100644 Function/BNCreateNamedTypeReferenceBuilder.cs create mode 100644 Function/BNCreateNamedTypeReferenceBuilderFromType.cs create mode 100644 Function/BNCreateNamedTypeReferenceBuilderFromTypeAndId.cs create mode 100644 Function/BNCreateNamedTypeReferenceBuilderWithBuilder.cs create mode 100644 Function/BNCreateNamedTypeReferenceFromType.cs create mode 100644 Function/BNCreateNamedTypeReferenceFromTypeAndId.cs create mode 100644 Function/BNCreatePlatform.cs create mode 100644 Function/BNCreatePlatformWithTypes.cs create mode 100644 Function/BNCreatePointerType.cs create mode 100644 Function/BNCreatePointerTypeBuilder.cs create mode 100644 Function/BNCreatePointerTypeBuilderOfWidth.cs create mode 100644 Function/BNCreatePointerTypeOfWidth.cs create mode 100644 Function/BNCreateProject.cs create mode 100644 Function/BNCreateRelocationHandler.cs create mode 100644 Function/BNCreateReportCollection.cs create mode 100644 Function/BNCreateRepositoryManager.cs create mode 100644 Function/BNCreateSaveSettings.cs create mode 100644 Function/BNCreateScriptingProviderInstance.cs create mode 100644 Function/BNCreateSegment.cs create mode 100644 Function/BNCreateSettings.cs create mode 100644 Function/BNCreateSnapshotedView.cs create mode 100644 Function/BNCreateSnapshotedViewWithProgress.cs create mode 100644 Function/BNCreateStructureBuilder.cs create mode 100644 Function/BNCreateStructureBuilderFromStructure.cs create mode 100644 Function/BNCreateStructureBuilderWithOptions.cs create mode 100644 Function/BNCreateStructureFromOffsetAccess.cs create mode 100644 Function/BNCreateStructureMemberFromAccess.cs create mode 100644 Function/BNCreateStructureType.cs create mode 100644 Function/BNCreateStructureTypeBuilder.cs create mode 100644 Function/BNCreateStructureTypeBuilderWithBuilder.cs create mode 100644 Function/BNCreateSymbol.cs create mode 100644 Function/BNCreateSymbolQueue.cs create mode 100644 Function/BNCreateTag.cs create mode 100644 Function/BNCreateTagType.cs create mode 100644 Function/BNCreateTemporaryFile.cs create mode 100644 Function/BNCreateTemporaryFileWithContents.cs create mode 100644 Function/BNCreateTransformSession.cs create mode 100644 Function/BNCreateTransformSessionFromBinaryView.cs create mode 100644 Function/BNCreateTransformSessionFromBinaryViewWithMode.cs create mode 100644 Function/BNCreateTransformSessionWithMode.cs create mode 100644 Function/BNCreateTypeArchive.cs create mode 100644 Function/BNCreateTypeArchiveWithId.cs create mode 100644 Function/BNCreateTypeBuilderFromType.cs create mode 100644 Function/BNCreateUserFunction.cs create mode 100644 Function/BNCreateUserStackVariable.cs create mode 100644 Function/BNCreateUserVariable.cs create mode 100644 Function/BNCreateValueType.cs create mode 100644 Function/BNCreateValueTypeBuilder.cs create mode 100644 Function/BNCreateVarArgsType.cs create mode 100644 Function/BNCreateVarArgsTypeBuilder.cs create mode 100644 Function/BNCreateVoidType.cs create mode 100644 Function/BNCreateVoidTypeBuilder.cs create mode 100644 Function/BNCreateWebsocketProviderClient.cs create mode 100644 Function/BNCreateWideCharType.cs create mode 100644 Function/BNCreateWideCharTypeBuilder.cs create mode 100644 Function/BNCreateWorkflow.cs create mode 100644 Function/BNDataBufferToBase64.cs create mode 100644 Function/BNDataBufferToEscapedString.cs create mode 100644 Function/BNDatabaseHasGlobal.cs create mode 100644 Function/BNDatabaseReloadConnection.cs create mode 100644 Function/BNDeauthenticateEnterpriseServer.cs create mode 100644 Function/BNDecode.cs create mode 100644 Function/BNDecodeBase64.cs create mode 100644 Function/BNDecodeEscapedString.cs create mode 100644 Function/BNDecodeWithContext.cs create mode 100644 Function/BNDefaultDisassemblySettings.cs create mode 100644 Function/BNDefaultGraphDisassemblySettings.cs create mode 100644 Function/BNDefaultLinearDisassemblySettings.cs create mode 100644 Function/BNDefineAnalysisType.cs create mode 100644 Function/BNDefineAnalysisTypes.cs create mode 100644 Function/BNDefineAutoSymbol.cs create mode 100644 Function/BNDefineAutoSymbolAndVariableOrFunction.cs create mode 100644 Function/BNDefineDataVariable.cs create mode 100644 Function/BNDefineImportedFunction.cs create mode 100644 Function/BNDefineRelocation.cs create mode 100644 Function/BNDefineSymbolRelocation.cs create mode 100644 Function/BNDefineUserAnalysisType.cs create mode 100644 Function/BNDefineUserAnalysisTypes.cs create mode 100644 Function/BNDefineUserDataVariable.cs create mode 100644 Function/BNDefineUserSymbol.cs create mode 100644 Function/BNDeleteAutoStackVariable.cs create mode 100644 Function/BNDeleteDirectory.cs create mode 100644 Function/BNDeleteFile.cs create mode 100644 Function/BNDeleteSecretsProviderData.cs create mode 100644 Function/BNDeleteTypeArchiveType.cs create mode 100644 Function/BNDeleteUserStackVariable.cs create mode 100644 Function/BNDeleteUserVariable.cs create mode 100644 Function/BNDemangleGNU3.cs create mode 100644 Function/BNDemangleGNU3WithOptions.cs create mode 100644 Function/BNDemangleGeneric.cs create mode 100644 Function/BNDemangleLLVM.cs create mode 100644 Function/BNDemangleLLVMWithOptions.cs create mode 100644 Function/BNDemangleMS.cs create mode 100644 Function/BNDemangleMSPlatform.cs create mode 100644 Function/BNDemangleMSWithOptions.cs create mode 100644 Function/BNDemanglerDemangle.cs create mode 100644 Function/BNDeserializeSettings.cs create mode 100644 Function/BNDestroySymbolQueue.cs create mode 100644 Function/BNDetectBaseAddress.cs create mode 100644 Function/BNDetectSearchMode.cs create mode 100644 Function/BNDisablePlugins.cs create mode 100644 Function/BNDisassemblyTextRendererHasDataFlow.cs create mode 100644 Function/BNDisassemblyTextRendererWrapComment.cs create mode 100644 Function/BNDisconnectWebsocketClient.cs create mode 100644 Function/BNDuplicateDataBuffer.cs create mode 100644 Function/BNDuplicateDisassemblySettings.cs create mode 100644 Function/BNDuplicateEnumerationBuilder.cs create mode 100644 Function/BNDuplicateLinearViewCursor.cs create mode 100644 Function/BNDuplicateStringRef.cs create mode 100644 Function/BNDuplicateStructureBuilder.cs create mode 100644 Function/BNDuplicateType.cs create mode 100644 Function/BNDuplicateTypeBuilder.cs create mode 100644 Function/BNDuplicateTypeContainer.cs create mode 100644 Function/BNDuplicateTypeLibrary.cs create mode 100644 Function/BNEncode.cs create mode 100644 Function/BNEndBulkAddSegments.cs create mode 100644 Function/BNEndBulkModifySymbols.cs create mode 100644 Function/BNEndKeyValueStoreNamespace.cs create mode 100644 Function/BNEnumerateTypesForAccess.cs create mode 100644 Function/BNEscapeTypeName.cs create mode 100644 Function/BNExecuteMainThreadAction.cs create mode 100644 Function/BNExecuteOnMainThread.cs create mode 100644 Function/BNExecuteOnMainThreadAndWait.cs create mode 100644 Function/BNExecuteScriptInput.cs create mode 100644 Function/BNExecuteScriptInputFromFilename.cs create mode 100644 Function/BNExecuteWorkerProcess.cs create mode 100644 Function/BNExternalLibraryGetBackingFile.cs create mode 100644 Function/BNExternalLibraryGetName.cs create mode 100644 Function/BNExternalLibrarySetBackingFile.cs create mode 100644 Function/BNExternalLocationGetExternalLibrary.cs create mode 100644 Function/BNExternalLocationGetSourceSymbol.cs create mode 100644 Function/BNExternalLocationGetTargetAddress.cs create mode 100644 Function/BNExternalLocationGetTargetSymbol.cs create mode 100644 Function/BNExternalLocationHasTargetAddress.cs create mode 100644 Function/BNExternalLocationHasTargetSymbol.cs create mode 100644 Function/BNExternalLocationSetExternalLibrary.cs create mode 100644 Function/BNExternalLocationSetTargetAddress.cs create mode 100644 Function/BNExternalLocationSetTargetSymbol.cs create mode 100644 Function/BNFileMetadataGetSessionId.cs create mode 100644 Function/BNFileSize.cs create mode 100644 Function/BNFinalizeArchitectureHook.cs create mode 100644 Function/BNFinalizeEnumerationBuilder.cs create mode 100644 Function/BNFinalizeHighLevelILFunction.cs create mode 100644 Function/BNFinalizeLowLevelILFunction.cs create mode 100644 Function/BNFinalizeMediumLevelILFunction.cs create mode 100644 Function/BNFinalizeNamedTypeReferenceBuilder.cs create mode 100644 Function/BNFinalizeStructureBuilder.cs create mode 100644 Function/BNFinalizeTypeBuilder.cs create mode 100644 Function/BNFinalizeTypeLibrary.cs create mode 100644 Function/BNFindAllConstantWithProgress.cs create mode 100644 Function/BNFindAllDataWithProgress.cs create mode 100644 Function/BNFindAllTextWithProgress.cs create mode 100644 Function/BNFindNextConstant.cs create mode 100644 Function/BNFindNextConstantWithProgress.cs create mode 100644 Function/BNFindNextData.cs create mode 100644 Function/BNFindNextDataWithProgress.cs create mode 100644 Function/BNFindNextText.cs create mode 100644 Function/BNFindNextTextWithProgress.cs create mode 100644 Function/BNFinishBackgroundTask.cs create mode 100644 Function/BNFinishPrepareForLayout.cs create mode 100644 Function/BNFirmwareNinjaAddRelationship.cs create mode 100644 Function/BNFirmwareNinjaFindSectionsWithEntropy.cs create mode 100644 Function/BNFirmwareNinjaFreeBoardDeviceAccesses.cs create mode 100644 Function/BNFirmwareNinjaFreeBoardNames.cs create mode 100644 Function/BNFirmwareNinjaFreeDevices.cs create mode 100644 Function/BNFirmwareNinjaFreeFunctionMemoryAccesses.cs create mode 100644 Function/BNFirmwareNinjaFreeRelationships.cs create mode 100644 Function/BNFirmwareNinjaFreeSections.cs create mode 100644 Function/BNFirmwareNinjaGetAddressReferenceTree.cs create mode 100644 Function/BNFirmwareNinjaGetBoardDeviceAccesses.cs create mode 100644 Function/BNFirmwareNinjaGetFunctionMemoryAccesses.cs create mode 100644 Function/BNFirmwareNinjaGetMemoryRegionReferenceTree.cs create mode 100644 Function/BNFirmwareNinjaGetRelationshipByGuid.cs create mode 100644 Function/BNFirmwareNinjaQueryBoardDevices.cs create mode 100644 Function/BNFirmwareNinjaQueryBoardNamesForArchitecture.cs create mode 100644 Function/BNFirmwareNinjaQueryCustomDevices.cs create mode 100644 Function/BNFirmwareNinjaQueryFunctionMemoryAccessesFromMetadata.cs create mode 100644 Function/BNFirmwareNinjaQueryRelationships.cs create mode 100644 Function/BNFirmwareNinjaReferenceNodeGetChildren.cs create mode 100644 Function/BNFirmwareNinjaReferenceNodeGetDataVariable.cs create mode 100644 Function/BNFirmwareNinjaReferenceNodeGetFunction.cs create mode 100644 Function/BNFirmwareNinjaReferenceNodeHasChildren.cs create mode 100644 Function/BNFirmwareNinjaReferenceNodeIsDataVariable.cs create mode 100644 Function/BNFirmwareNinjaReferenceNodeIsFunction.cs create mode 100644 Function/BNFirmwareNinjaRelationshipGetDescription.cs create mode 100644 Function/BNFirmwareNinjaRelationshipGetGuid.cs create mode 100644 Function/BNFirmwareNinjaRelationshipGetPrimaryAddress.cs create mode 100644 Function/BNFirmwareNinjaRelationshipGetPrimaryDataVariable.cs create mode 100644 Function/BNFirmwareNinjaRelationshipGetPrimaryFunction.cs create mode 100644 Function/BNFirmwareNinjaRelationshipGetProvenance.cs create mode 100644 Function/BNFirmwareNinjaRelationshipGetSecondaryAddress.cs create mode 100644 Function/BNFirmwareNinjaRelationshipGetSecondaryDataVariable.cs create mode 100644 Function/BNFirmwareNinjaRelationshipGetSecondaryExternalProjectFile.cs create mode 100644 Function/BNFirmwareNinjaRelationshipGetSecondaryExternalSymbol.cs create mode 100644 Function/BNFirmwareNinjaRelationshipGetSecondaryFunction.cs create mode 100644 Function/BNFirmwareNinjaRelationshipPrimaryIsAddress.cs create mode 100644 Function/BNFirmwareNinjaRelationshipPrimaryIsDataVariable.cs create mode 100644 Function/BNFirmwareNinjaRelationshipPrimaryIsFunction.cs create mode 100644 Function/BNFirmwareNinjaRelationshipSecondaryIsAddress.cs create mode 100644 Function/BNFirmwareNinjaRelationshipSecondaryIsDataVariable.cs create mode 100644 Function/BNFirmwareNinjaRelationshipSecondaryIsExternalAddress.cs create mode 100644 Function/BNFirmwareNinjaRelationshipSecondaryIsExternalSymbol.cs create mode 100644 Function/BNFirmwareNinjaRelationshipSecondaryIsFunction.cs create mode 100644 Function/BNFirmwareNinjaRelationshipSetDescription.cs create mode 100644 Function/BNFirmwareNinjaRelationshipSetPrimaryAddress.cs create mode 100644 Function/BNFirmwareNinjaRelationshipSetPrimaryDataVariable.cs create mode 100644 Function/BNFirmwareNinjaRelationshipSetPrimaryFunction.cs create mode 100644 Function/BNFirmwareNinjaRelationshipSetProvenance.cs create mode 100644 Function/BNFirmwareNinjaRelationshipSetSecondaryAddress.cs create mode 100644 Function/BNFirmwareNinjaRelationshipSetSecondaryDataVariable.cs create mode 100644 Function/BNFirmwareNinjaRelationshipSetSecondaryExternalAddress.cs create mode 100644 Function/BNFirmwareNinjaRelationshipSetSecondaryExternalSymbol.cs create mode 100644 Function/BNFirmwareNinjaRelationshipSetSecondaryFunction.cs create mode 100644 Function/BNFirmwareNinjaRemoveCustomDevice.cs create mode 100644 Function/BNFirmwareNinjaRemoveRelationshipByGuid.cs create mode 100644 Function/BNFirmwareNinjaStoreCustomDevice.cs create mode 100644 Function/BNFirmwareNinjaStoreFunctionMemoryAccessesToMetadata.cs create mode 100644 Function/BNFlowGraphHasNodes.cs create mode 100644 Function/BNFlowGraphHasUpdates.cs create mode 100644 Function/BNFlowGraphLayoutLayout.cs create mode 100644 Function/BNFlowGraphNodeSetOutgoingEdgePoints.cs create mode 100644 Function/BNFlowGraphNodeSetVisibilityRegion.cs create mode 100644 Function/BNFlowGraphNodeSetX.cs create mode 100644 Function/BNFlowGraphNodeSetY.cs create mode 100644 Function/BNFlowGraphSetHeight.cs create mode 100644 Function/BNFlowGraphSetWidth.cs create mode 100644 Function/BNFlowGraphUpdateQueryMode.cs create mode 100644 Function/BNForgetUndoActions.cs create mode 100644 Function/BNFormatLines.cs create mode 100644 Function/BNFormatTypeParserParseErrors.cs create mode 100644 Function/BNFreeActivity.cs create mode 100644 Function/BNFreeAddressList.cs create mode 100644 Function/BNFreeAddressRanges.cs create mode 100644 Function/BNFreeAllTypeFieldReferences.cs create mode 100644 Function/BNFreeAllTypeReferences.cs create mode 100644 Function/BNFreeAnalysisCompletionEvent.cs create mode 100644 Function/BNFreeAnalysisContext.cs create mode 100644 Function/BNFreeAnalysisInfo.cs create mode 100644 Function/BNFreeAnalysisMergeConflict.cs create mode 100644 Function/BNFreeAnalysisMergeConflictList.cs create mode 100644 Function/BNFreeAnalysisMergeConflictSplitterList.cs create mode 100644 Function/BNFreeAnalysisPerformanceInfo.cs create mode 100644 Function/BNFreeArchitectureAndAddressList.cs create mode 100644 Function/BNFreeArchitectureList.cs create mode 100644 Function/BNFreeBackgroundTask.cs create mode 100644 Function/BNFreeBackgroundTaskList.cs create mode 100644 Function/BNFreeBaseAddressDetection.cs create mode 100644 Function/BNFreeBaseAddressDetectionReasons.cs create mode 100644 Function/BNFreeBaseStructureList.cs create mode 100644 Function/BNFreeBasicBlock.cs create mode 100644 Function/BNFreeBasicBlockEdgeList.cs create mode 100644 Function/BNFreeBasicBlockList.cs create mode 100644 Function/BNFreeBinaryReader.cs create mode 100644 Function/BNFreeBinaryView.cs create mode 100644 Function/BNFreeBinaryViewTypeList.cs create mode 100644 Function/BNFreeBinaryWriter.cs create mode 100644 Function/BNFreeCallingConvention.cs create mode 100644 Function/BNFreeCallingConventionList.cs create mode 100644 Function/BNFreeCodeReferences.cs create mode 100644 Function/BNFreeCollaborationChangeset.cs create mode 100644 Function/BNFreeCollaborationChangesetList.cs create mode 100644 Function/BNFreeCollaborationGroup.cs create mode 100644 Function/BNFreeCollaborationGroupList.cs create mode 100644 Function/BNFreeCollaborationPermission.cs create mode 100644 Function/BNFreeCollaborationPermissionList.cs create mode 100644 Function/BNFreeCollaborationSnapshot.cs create mode 100644 Function/BNFreeCollaborationSnapshotList.cs create mode 100644 Function/BNFreeCollaborationUndoEntry.cs create mode 100644 Function/BNFreeCollaborationUndoEntryList.cs create mode 100644 Function/BNFreeCollaborationUser.cs create mode 100644 Function/BNFreeCollaborationUserList.cs create mode 100644 Function/BNFreeComponent.cs create mode 100644 Function/BNFreeComponents.cs create mode 100644 Function/BNFreeConstantReferenceList.cs create mode 100644 Function/BNFreeDataBuffer.cs create mode 100644 Function/BNFreeDataReferences.cs create mode 100644 Function/BNFreeDataRenderer.cs create mode 100644 Function/BNFreeDataVariable.cs create mode 100644 Function/BNFreeDataVariableAndName.cs create mode 100644 Function/BNFreeDataVariableAndNameAndDebugParserList.cs create mode 100644 Function/BNFreeDataVariables.cs create mode 100644 Function/BNFreeDataVariablesAndName.cs create mode 100644 Function/BNFreeDatabase.cs create mode 100644 Function/BNFreeDebugFunctions.cs create mode 100644 Function/BNFreeDebugInfoParserList.cs create mode 100644 Function/BNFreeDebugInfoParserReference.cs create mode 100644 Function/BNFreeDebugInfoReference.cs create mode 100644 Function/BNFreeDebugTypes.cs create mode 100644 Function/BNFreeDemangledName.cs create mode 100644 Function/BNFreeDemanglerList.cs create mode 100644 Function/BNFreeDisassemblySettings.cs create mode 100644 Function/BNFreeDisassemblyTextLines.cs create mode 100644 Function/BNFreeDisassemblyTextRenderer.cs create mode 100644 Function/BNFreeDownloadInstance.cs create mode 100644 Function/BNFreeDownloadInstanceResponse.cs create mode 100644 Function/BNFreeDownloadProviderList.cs create mode 100644 Function/BNFreeEnumeration.cs create mode 100644 Function/BNFreeEnumerationBuilder.cs create mode 100644 Function/BNFreeEnumerationMemberList.cs create mode 100644 Function/BNFreeExternalLibrary.cs create mode 100644 Function/BNFreeExternalLibraryList.cs create mode 100644 Function/BNFreeExternalLocation.cs create mode 100644 Function/BNFreeExternalLocationList.cs create mode 100644 Function/BNFreeFieldResolutionInfo.cs create mode 100644 Function/BNFreeFileMetadata.cs create mode 100644 Function/BNFreeFirmwareNinja.cs create mode 100644 Function/BNFreeFirmwareNinjaReferenceNode.cs create mode 100644 Function/BNFreeFirmwareNinjaReferenceNodes.cs create mode 100644 Function/BNFreeFirmwareNinjaRelationship.cs create mode 100644 Function/BNFreeFlagConditionsForSemanticFlagGroup.cs create mode 100644 Function/BNFreeFlowGraph.cs create mode 100644 Function/BNFreeFlowGraphLayoutList.cs create mode 100644 Function/BNFreeFlowGraphLayoutRequest.cs create mode 100644 Function/BNFreeFlowGraphNode.cs create mode 100644 Function/BNFreeFlowGraphNodeEdgeList.cs create mode 100644 Function/BNFreeFlowGraphNodeList.cs create mode 100644 Function/BNFreeFormInputResults.cs create mode 100644 Function/BNFreeFullInfoUpdateChannels.cs create mode 100644 Function/BNFreeFunction.cs create mode 100644 Function/BNFreeFunctionList.cs create mode 100644 Function/BNFreeHighLevelILFunction.cs create mode 100644 Function/BNFreeHighLevelILTokenEmitter.cs create mode 100644 Function/BNFreeILBranchDependenceList.cs create mode 100644 Function/BNFreeILInstructionList.cs create mode 100644 Function/BNFreeILReferences.cs create mode 100644 Function/BNFreeIndirectBranchList.cs create mode 100644 Function/BNFreeInheritedStructureMember.cs create mode 100644 Function/BNFreeInheritedStructureMemberList.cs create mode 100644 Function/BNFreeInstructionText.cs create mode 100644 Function/BNFreeInstructionTextLines.cs create mode 100644 Function/BNFreeKeyValueStore.cs create mode 100644 Function/BNFreeLLILVariableVersionList.cs create mode 100644 Function/BNFreeLLILVariablesList.cs create mode 100644 Function/BNFreeLanguageRepresentationFunction.cs create mode 100644 Function/BNFreeLanguageRepresentationFunctionTypeList.cs create mode 100644 Function/BNFreeLineFormatterList.cs create mode 100644 Function/BNFreeLineFormatterSettings.cs create mode 100644 Function/BNFreeLinearDisassemblyLines.cs create mode 100644 Function/BNFreeLinearViewCursor.cs create mode 100644 Function/BNFreeLinearViewCursorPath.cs create mode 100644 Function/BNFreeLinearViewCursorPathObjects.cs create mode 100644 Function/BNFreeLinearViewObject.cs create mode 100644 Function/BNFreeLinearViewObjectIdentifier.cs create mode 100644 Function/BNFreeLogger.cs create mode 100644 Function/BNFreeLowLevelILFunction.cs create mode 100644 Function/BNFreeMainThreadAction.cs create mode 100644 Function/BNFreeMediumLevelILFunction.cs create mode 100644 Function/BNFreeMemoryUsageInfo.cs create mode 100644 Function/BNFreeMergedVariableList.cs create mode 100644 Function/BNFreeMetadata.cs create mode 100644 Function/BNFreeMetadataArray.cs create mode 100644 Function/BNFreeMetadataBooleanList.cs create mode 100644 Function/BNFreeMetadataDoubleList.cs create mode 100644 Function/BNFreeMetadataRaw.cs create mode 100644 Function/BNFreeMetadataSignedIntegerList.cs create mode 100644 Function/BNFreeMetadataStringList.cs create mode 100644 Function/BNFreeMetadataUnsignedIntegerList.cs create mode 100644 Function/BNFreeMetadataValueStore.cs create mode 100644 Function/BNFreeNameAndTypeList.cs create mode 100644 Function/BNFreeNameSpace.cs create mode 100644 Function/BNFreeNameSpaceList.cs create mode 100644 Function/BNFreeNamedTypeReference.cs create mode 100644 Function/BNFreeNamedTypeReferenceBuilder.cs create mode 100644 Function/BNFreeOutputTypeList.cs create mode 100644 Function/BNFreeParameterVariables.cs create mode 100644 Function/BNFreeParseError.cs create mode 100644 Function/BNFreePath.cs create mode 100644 Function/BNFreePendingBasicBlockEdgeList.cs create mode 100644 Function/BNFreePlatform.cs create mode 100644 Function/BNFreePlatformList.cs create mode 100644 Function/BNFreePlatformOSList.cs create mode 100644 Function/BNFreePlugin.cs create mode 100644 Function/BNFreePluginCommandList.cs create mode 100644 Function/BNFreePluginPlatforms.cs create mode 100644 Function/BNFreePluginTypes.cs create mode 100644 Function/BNFreePointerSuffixList.cs create mode 100644 Function/BNFreePossibleValueSet.cs create mode 100644 Function/BNFreeProject.cs create mode 100644 Function/BNFreeProjectFile.cs create mode 100644 Function/BNFreeProjectFileList.cs create mode 100644 Function/BNFreeProjectFolder.cs create mode 100644 Function/BNFreeProjectFolderList.cs create mode 100644 Function/BNFreeProjectList.cs create mode 100644 Function/BNFreeQualifiedName.cs create mode 100644 Function/BNFreeQualifiedNameAndType.cs create mode 100644 Function/BNFreeQualifiedNameAndTypeArray.cs create mode 100644 Function/BNFreeQualifiedNameArray.cs create mode 100644 Function/BNFreeQualifiedNameTypeAndId.cs create mode 100644 Function/BNFreeRegisterList.cs create mode 100644 Function/BNFreeRegisterSet.cs create mode 100644 Function/BNFreeRegisterStackAdjustments.cs create mode 100644 Function/BNFreeRelocation.cs create mode 100644 Function/BNFreeRelocationHandler.cs create mode 100644 Function/BNFreeRelocationList.cs create mode 100644 Function/BNFreeRelocationRanges.cs create mode 100644 Function/BNFreeRemote.cs create mode 100644 Function/BNFreeRemoteFile.cs create mode 100644 Function/BNFreeRemoteFileList.cs create mode 100644 Function/BNFreeRemoteFolder.cs create mode 100644 Function/BNFreeRemoteFolderList.cs create mode 100644 Function/BNFreeRemoteList.cs create mode 100644 Function/BNFreeRemoteProject.cs create mode 100644 Function/BNFreeRemoteProjectList.cs create mode 100644 Function/BNFreeRenderLayerList.cs create mode 100644 Function/BNFreeReportCollection.cs create mode 100644 Function/BNFreeRepository.cs create mode 100644 Function/BNFreeRepositoryManager.cs create mode 100644 Function/BNFreeRepositoryManagerRepositoriesList.cs create mode 100644 Function/BNFreeRepositoryPluginList.cs create mode 100644 Function/BNFreeSaveSettings.cs create mode 100644 Function/BNFreeScriptingInstance.cs create mode 100644 Function/BNFreeScriptingProviderList.cs create mode 100644 Function/BNFreeSecretsProviderList.cs create mode 100644 Function/BNFreeSection.cs create mode 100644 Function/BNFreeSectionList.cs create mode 100644 Function/BNFreeSegment.cs create mode 100644 Function/BNFreeSegmentList.cs create mode 100644 Function/BNFreeSettings.cs create mode 100644 Function/BNFreeSnapshot.cs create mode 100644 Function/BNFreeSnapshotList.cs create mode 100644 Function/BNFreeStackVariableReferenceList.cs create mode 100644 Function/BNFreeString.cs create mode 100644 Function/BNFreeStringList.cs create mode 100644 Function/BNFreeStringRef.cs create mode 100644 Function/BNFreeStringReferenceList.cs create mode 100644 Function/BNFreeStructure.cs create mode 100644 Function/BNFreeStructureBuilder.cs create mode 100644 Function/BNFreeStructureMember.cs create mode 100644 Function/BNFreeStructureMemberList.cs create mode 100644 Function/BNFreeSymbol.cs create mode 100644 Function/BNFreeSymbolList.cs create mode 100644 Function/BNFreeSymbolRawBytes.cs create mode 100644 Function/BNFreeSystemCallList.cs create mode 100644 Function/BNFreeTag.cs create mode 100644 Function/BNFreeTagList.cs create mode 100644 Function/BNFreeTagReferenceTypeCounts.cs create mode 100644 Function/BNFreeTagReferences.cs create mode 100644 Function/BNFreeTagType.cs create mode 100644 Function/BNFreeTagTypeList.cs create mode 100644 Function/BNFreeTemporaryFile.cs create mode 100644 Function/BNFreeTransformContext.cs create mode 100644 Function/BNFreeTransformContextList.cs create mode 100644 Function/BNFreeTransformParameterList.cs create mode 100644 Function/BNFreeTransformSession.cs create mode 100644 Function/BNFreeTransformTypeList.cs create mode 100644 Function/BNFreeType.cs create mode 100644 Function/BNFreeTypeAndNameList.cs create mode 100644 Function/BNFreeTypeArchiveList.cs create mode 100644 Function/BNFreeTypeArchiveMergeConflict.cs create mode 100644 Function/BNFreeTypeArchiveMergeConflictList.cs create mode 100644 Function/BNFreeTypeArchiveReference.cs create mode 100644 Function/BNFreeTypeAttributeList.cs create mode 100644 Function/BNFreeTypeBuilder.cs create mode 100644 Function/BNFreeTypeContainer.cs create mode 100644 Function/BNFreeTypeDefinitionLineList.cs create mode 100644 Function/BNFreeTypeFieldReferenceSizeInfo.cs create mode 100644 Function/BNFreeTypeFieldReferenceSizes.cs create mode 100644 Function/BNFreeTypeFieldReferenceTypeInfo.cs create mode 100644 Function/BNFreeTypeFieldReferenceTypes.cs create mode 100644 Function/BNFreeTypeFieldReferences.cs create mode 100644 Function/BNFreeTypeIdList.cs create mode 100644 Function/BNFreeTypeLibrary.cs create mode 100644 Function/BNFreeTypeLibraryList.cs create mode 100644 Function/BNFreeTypeList.cs create mode 100644 Function/BNFreeTypeNameList.cs create mode 100644 Function/BNFreeTypeParameterList.cs create mode 100644 Function/BNFreeTypeParserErrors.cs create mode 100644 Function/BNFreeTypeParserList.cs create mode 100644 Function/BNFreeTypeParserResult.cs create mode 100644 Function/BNFreeTypePrinterList.cs create mode 100644 Function/BNFreeTypeReferences.cs create mode 100644 Function/BNFreeUndoAction.cs create mode 100644 Function/BNFreeUndoActionList.cs create mode 100644 Function/BNFreeUndoEntries.cs create mode 100644 Function/BNFreeUndoEntry.cs create mode 100644 Function/BNFreeUndoEntryList.cs create mode 100644 Function/BNFreeUnicodeBlockList.cs create mode 100644 Function/BNFreeUnicodeRangeList.cs create mode 100644 Function/BNFreeUpdateChannelList.cs create mode 100644 Function/BNFreeUpdateChannelVersionList.cs create mode 100644 Function/BNFreeUser.cs create mode 100644 Function/BNFreeUserList.cs create mode 100644 Function/BNFreeUserVariableValues.cs create mode 100644 Function/BNFreeVariableFieldResolutions.cs create mode 100644 Function/BNFreeVariableList.cs create mode 100644 Function/BNFreeVariableNameAndType.cs create mode 100644 Function/BNFreeVariableNameAndTypeList.cs create mode 100644 Function/BNFreeVariableReferenceSourceList.cs create mode 100644 Function/BNFreeWebsocketClient.cs create mode 100644 Function/BNFreeWebsocketProviderList.cs create mode 100644 Function/BNFreeWorkflow.cs create mode 100644 Function/BNFreeWorkflowList.cs create mode 100644 Function/BNFromVariableIdentifier.cs create mode 100644 Function/BNFunctionCheckForDebugReport.cs create mode 100644 Function/BNFunctionCollapseRegion.cs create mode 100644 Function/BNFunctionExpandAll.cs create mode 100644 Function/BNFunctionExpandRegion.cs create mode 100644 Function/BNFunctionGetAutoMetadata.cs create mode 100644 Function/BNFunctionGetMetadata.cs create mode 100644 Function/BNFunctionHasExplicitlyDefinedType.cs create mode 100644 Function/BNFunctionHasUserAnnotations.cs create mode 100644 Function/BNFunctionHasUserType.cs create mode 100644 Function/BNFunctionHasVariableArguments.cs create mode 100644 Function/BNFunctionIsRegionCollapsed.cs create mode 100644 Function/BNFunctionQueryMetadata.cs create mode 100644 Function/BNFunctionRemoveMetadata.cs create mode 100644 Function/BNFunctionStoreMetadata.cs create mode 100644 Function/BNFunctionToggleRegion.cs create mode 100644 Function/BNFunctionTypeBuilderCanReturn.cs create mode 100644 Function/BNFunctionTypeCanReturn.cs create mode 100644 Function/BNFunctionUsesIncomingGlobalPointer.cs create mode 100644 Function/BNFuzzyMatchSingle.cs create mode 100644 Function/BNGenerateAutoDebugTypeId.cs create mode 100644 Function/BNGenerateAutoDemangledTypeId.cs create mode 100644 Function/BNGenerateAutoPlatformTypeId.cs create mode 100644 Function/BNGenerateAutoTypeId.cs create mode 100644 Function/BNGenerateHighLevelILSSAForm.cs create mode 100644 Function/BNGenerateLowLevelILSSAForm.cs create mode 100644 Function/BNGenerateMediumLevelILSSAForm.cs create mode 100644 Function/BNGetActiveMemoryRegionAt.cs create mode 100644 Function/BNGetActiveUpdateChannel.cs create mode 100644 Function/BNGetAddressForDataOffset.cs create mode 100644 Function/BNGetAddressInput.cs create mode 100644 Function/BNGetAddressRenderedWidth.cs create mode 100644 Function/BNGetAddressTagReferences.cs create mode 100644 Function/BNGetAddressTags.cs create mode 100644 Function/BNGetAddressTagsInRange.cs create mode 100644 Function/BNGetAddressTagsOfType.cs create mode 100644 Function/BNGetAllAddressTagReferences.cs create mode 100644 Function/BNGetAllArchitectureFlagWriteTypes.cs create mode 100644 Function/BNGetAllArchitectureFlags.cs create mode 100644 Function/BNGetAllArchitectureIntrinsics.cs create mode 100644 Function/BNGetAllArchitectureRegisterStacks.cs create mode 100644 Function/BNGetAllArchitectureRegisters.cs create mode 100644 Function/BNGetAllArchitectureSemanticFlagClasses.cs create mode 100644 Function/BNGetAllArchitectureSemanticFlagGroups.cs create mode 100644 Function/BNGetAllEntryFunctions.cs create mode 100644 Function/BNGetAllFieldsReferenced.cs create mode 100644 Function/BNGetAllFunctionTagReferences.cs create mode 100644 Function/BNGetAllMediumLevelILBranchDependence.cs create mode 100644 Function/BNGetAllPluginCommands.cs create mode 100644 Function/BNGetAllReferencesForType.cs create mode 100644 Function/BNGetAllReferencesForTypeField.cs create mode 100644 Function/BNGetAllSizesReferenced.cs create mode 100644 Function/BNGetAllTagReferenceTypeCounts.cs create mode 100644 Function/BNGetAllTagReferences.cs create mode 100644 Function/BNGetAllTagReferencesOfType.cs create mode 100644 Function/BNGetAllTagReferencesOfTypeCount.cs create mode 100644 Function/BNGetAllTypesReferenced.cs create mode 100644 Function/BNGetAllUserVariableValues.cs create mode 100644 Function/BNGetAllVariableFieldResolutions.cs create mode 100644 Function/BNGetAllocatedRanges.cs create mode 100644 Function/BNGetAnalysisAutoTypeContainer.cs create mode 100644 Function/BNGetAnalysisDependencySortedTypeList.cs create mode 100644 Function/BNGetAnalysisEntryPoint.cs create mode 100644 Function/BNGetAnalysisFunction.cs create mode 100644 Function/BNGetAnalysisFunctionList.cs create mode 100644 Function/BNGetAnalysisFunctionsContainingAddress.cs create mode 100644 Function/BNGetAnalysisFunctionsForAddress.cs create mode 100644 Function/BNGetAnalysisInfo.cs create mode 100644 Function/BNGetAnalysisMergeConflictSplitterList.cs create mode 100644 Function/BNGetAnalysisProgress.cs create mode 100644 Function/BNGetAnalysisSkipReason.cs create mode 100644 Function/BNGetAnalysisState.cs create mode 100644 Function/BNGetAnalysisSystemCallName.cs create mode 100644 Function/BNGetAnalysisSystemCallType.cs create mode 100644 Function/BNGetAnalysisTypeById.cs create mode 100644 Function/BNGetAnalysisTypeByName.cs create mode 100644 Function/BNGetAnalysisTypeByRef.cs create mode 100644 Function/BNGetAnalysisTypeContainer.cs create mode 100644 Function/BNGetAnalysisTypeId.cs create mode 100644 Function/BNGetAnalysisTypeList.cs create mode 100644 Function/BNGetAnalysisTypeNameById.cs create mode 100644 Function/BNGetAnalysisTypeNames.cs create mode 100644 Function/BNGetAnalysisUserTypeContainer.cs create mode 100644 Function/BNGetArchitectureAddressSize.cs create mode 100644 Function/BNGetArchitectureByName.cs create mode 100644 Function/BNGetArchitectureCallingConventionByName.cs create mode 100644 Function/BNGetArchitectureCallingConventions.cs create mode 100644 Function/BNGetArchitectureCdeclCallingConvention.cs create mode 100644 Function/BNGetArchitectureDefaultCallingConvention.cs create mode 100644 Function/BNGetArchitectureDefaultIntegerSize.cs create mode 100644 Function/BNGetArchitectureEndianness.cs create mode 100644 Function/BNGetArchitectureFastcallCallingConvention.cs create mode 100644 Function/BNGetArchitectureFlagConditionLowLevelIL.cs create mode 100644 Function/BNGetArchitectureFlagConditionsForSemanticFlagGroup.cs create mode 100644 Function/BNGetArchitectureFlagName.cs create mode 100644 Function/BNGetArchitectureFlagRole.cs create mode 100644 Function/BNGetArchitectureFlagWriteLowLevelIL.cs create mode 100644 Function/BNGetArchitectureFlagWriteTypeName.cs create mode 100644 Function/BNGetArchitectureFlagsRequiredForFlagCondition.cs create mode 100644 Function/BNGetArchitectureFlagsRequiredForSemanticFlagGroup.cs create mode 100644 Function/BNGetArchitectureFlagsWrittenByFlagWriteType.cs create mode 100644 Function/BNGetArchitectureForViewType.cs create mode 100644 Function/BNGetArchitectureGlobalRegisters.cs create mode 100644 Function/BNGetArchitectureInstructionAlignment.cs create mode 100644 Function/BNGetArchitectureIntrinsicClass.cs create mode 100644 Function/BNGetArchitectureIntrinsicInputs.cs create mode 100644 Function/BNGetArchitectureIntrinsicName.cs create mode 100644 Function/BNGetArchitectureIntrinsicOutputs.cs create mode 100644 Function/BNGetArchitectureLinkRegister.cs create mode 100644 Function/BNGetArchitectureList.cs create mode 100644 Function/BNGetArchitectureMaxInstructionLength.cs create mode 100644 Function/BNGetArchitectureName.cs create mode 100644 Function/BNGetArchitectureOpcodeDisplayLength.cs create mode 100644 Function/BNGetArchitectureRegisterByName.cs create mode 100644 Function/BNGetArchitectureRegisterInfo.cs create mode 100644 Function/BNGetArchitectureRegisterName.cs create mode 100644 Function/BNGetArchitectureRegisterStackForRegister.cs create mode 100644 Function/BNGetArchitectureRegisterStackInfo.cs create mode 100644 Function/BNGetArchitectureRegisterStackName.cs create mode 100644 Function/BNGetArchitectureSemanticClassForFlagWriteType.cs create mode 100644 Function/BNGetArchitectureSemanticFlagClassName.cs create mode 100644 Function/BNGetArchitectureSemanticFlagGroupLowLevelIL.cs create mode 100644 Function/BNGetArchitectureSemanticFlagGroupName.cs create mode 100644 Function/BNGetArchitectureStackPointerRegister.cs create mode 100644 Function/BNGetArchitectureStandalonePlatform.cs create mode 100644 Function/BNGetArchitectureStdcallCallingConvention.cs create mode 100644 Function/BNGetArchitectureSystemRegisters.cs create mode 100644 Function/BNGetArchitectureTypeLibraries.cs create mode 100644 Function/BNGetAssociatedArchitectureByAddress.cs create mode 100644 Function/BNGetAssociatedPlatformByAddress.cs create mode 100644 Function/BNGetAutoAddressTagReferences.cs create mode 100644 Function/BNGetAutoAddressTags.cs create mode 100644 Function/BNGetAutoAddressTagsInRange.cs create mode 100644 Function/BNGetAutoAddressTagsOfType.cs create mode 100644 Function/BNGetAutoDataTagReferences.cs create mode 100644 Function/BNGetAutoDataTags.cs create mode 100644 Function/BNGetAutoDataTagsInRange.cs create mode 100644 Function/BNGetAutoDataTagsOfType.cs create mode 100644 Function/BNGetAutoDebugTypeIdSource.cs create mode 100644 Function/BNGetAutoDemangledTypeIdSource.cs create mode 100644 Function/BNGetAutoFunctionTagReferences.cs create mode 100644 Function/BNGetAutoFunctionTags.cs create mode 100644 Function/BNGetAutoFunctionTagsOfType.cs create mode 100644 Function/BNGetAutoPlatformTypeIdSource.cs create mode 100644 Function/BNGetBackedAddressRanges.cs create mode 100644 Function/BNGetBackgroundAnalysisTask.cs create mode 100644 Function/BNGetBackgroundTaskProgressText.cs create mode 100644 Function/BNGetBackgroundTaskRuntimeSeconds.cs create mode 100644 Function/BNGetBaseAddressDetectionReasons.cs create mode 100644 Function/BNGetBaseAddressDetectionScores.cs create mode 100644 Function/BNGetBaseMemoryMapDescription.cs create mode 100644 Function/BNGetBaseStructuresForStructure.cs create mode 100644 Function/BNGetBaseStructuresForStructureBuilder.cs create mode 100644 Function/BNGetBasicBlockArchitecture.cs create mode 100644 Function/BNGetBasicBlockDisassemblyText.cs create mode 100644 Function/BNGetBasicBlockDominanceFrontier.cs create mode 100644 Function/BNGetBasicBlockDominatorTreeChildren.cs create mode 100644 Function/BNGetBasicBlockDominators.cs create mode 100644 Function/BNGetBasicBlockEnd.cs create mode 100644 Function/BNGetBasicBlockFunction.cs create mode 100644 Function/BNGetBasicBlockFunctionGraphType.cs create mode 100644 Function/BNGetBasicBlockHighLevelILFunction.cs create mode 100644 Function/BNGetBasicBlockHighlight.cs create mode 100644 Function/BNGetBasicBlockImmediateDominator.cs create mode 100644 Function/BNGetBasicBlockIncomingEdges.cs create mode 100644 Function/BNGetBasicBlockIndex.cs create mode 100644 Function/BNGetBasicBlockInstructionContainingAddress.cs create mode 100644 Function/BNGetBasicBlockIteratedDominanceFrontier.cs create mode 100644 Function/BNGetBasicBlockLength.cs create mode 100644 Function/BNGetBasicBlockLowLevelILFunction.cs create mode 100644 Function/BNGetBasicBlockMediumLevelILFunction.cs create mode 100644 Function/BNGetBasicBlockOutgoingEdges.cs create mode 100644 Function/BNGetBasicBlockPendingOutgoingEdges.cs create mode 100644 Function/BNGetBasicBlockSource.cs create mode 100644 Function/BNGetBasicBlockSourceBlock.cs create mode 100644 Function/BNGetBasicBlockStart.cs create mode 100644 Function/BNGetBasicBlockStrictDominators.cs create mode 100644 Function/BNGetBasicBlocksForAddress.cs create mode 100644 Function/BNGetBasicBlocksStartingAtAddress.cs create mode 100644 Function/BNGetBinaryReaderEndianness.cs create mode 100644 Function/BNGetBinaryReaderVirtualBase.cs create mode 100644 Function/BNGetBinaryViewDefaultLoadSettingsForData.cs create mode 100644 Function/BNGetBinaryViewLoadSettingsForData.cs create mode 100644 Function/BNGetBinaryViewTypeByName.cs create mode 100644 Function/BNGetBinaryViewTypeLibraries.cs create mode 100644 Function/BNGetBinaryViewTypeLibrary.cs create mode 100644 Function/BNGetBinaryViewTypeLongName.cs create mode 100644 Function/BNGetBinaryViewTypeName.cs create mode 100644 Function/BNGetBinaryViewTypes.cs create mode 100644 Function/BNGetBinaryViewTypesForData.cs create mode 100644 Function/BNGetBinaryWriterEndianness.cs create mode 100644 Function/BNGetBuildId.cs create mode 100644 Function/BNGetBundledPluginDirectory.cs create mode 100644 Function/BNGetCachedHighLevelILPossibleValueSet.cs create mode 100644 Function/BNGetCachedLowLevelILPossibleValueSet.cs create mode 100644 Function/BNGetCachedMediumLevelILPossibleValueSet.cs create mode 100644 Function/BNGetCallRegisterStackAdjustment.cs create mode 100644 Function/BNGetCallRegisterStackAdjustmentForRegisterStack.cs create mode 100644 Function/BNGetCallStackAdjustment.cs create mode 100644 Function/BNGetCallTypeAdjustment.cs create mode 100644 Function/BNGetCalleeForAnalysis.cs create mode 100644 Function/BNGetCalleeSavedRegisters.cs create mode 100644 Function/BNGetCallees.cs create mode 100644 Function/BNGetCallerSavedRegisters.cs create mode 100644 Function/BNGetCallers.cs create mode 100644 Function/BNGetCallingConventionArchitecture.cs create mode 100644 Function/BNGetCallingConventionName.cs create mode 100644 Function/BNGetCheckboxInput.cs create mode 100644 Function/BNGetChildType.cs create mode 100644 Function/BNGetChoiceInput.cs create mode 100644 Function/BNGetCodeReferences.cs create mode 100644 Function/BNGetCodeReferencesForType.cs create mode 100644 Function/BNGetCodeReferencesForTypeField.cs create mode 100644 Function/BNGetCodeReferencesForTypeFieldsFrom.cs create mode 100644 Function/BNGetCodeReferencesForTypeFieldsFromInRange.cs create mode 100644 Function/BNGetCodeReferencesForTypeFrom.cs create mode 100644 Function/BNGetCodeReferencesForTypeFromInRange.cs create mode 100644 Function/BNGetCodeReferencesFrom.cs create mode 100644 Function/BNGetCodeReferencesFromInRange.cs create mode 100644 Function/BNGetCodeReferencesInRange.cs create mode 100644 Function/BNGetCommentForAddress.cs create mode 100644 Function/BNGetCommentedAddresses.cs create mode 100644 Function/BNGetComponentByGuid.cs create mode 100644 Function/BNGetComponentByPath.cs create mode 100644 Function/BNGetConstantData.cs create mode 100644 Function/BNGetConstantsReferencedByInstruction.cs create mode 100644 Function/BNGetConstantsReferencedByInstructionIfAvailable.cs create mode 100644 Function/BNGetCurrentCoreABIVersion.cs create mode 100644 Function/BNGetCurrentOffset.cs create mode 100644 Function/BNGetCurrentStackTraceString.cs create mode 100644 Function/BNGetCurrentView.cs create mode 100644 Function/BNGetDataBufferByte.cs create mode 100644 Function/BNGetDataBufferContents.cs create mode 100644 Function/BNGetDataBufferContentsAt.cs create mode 100644 Function/BNGetDataBufferLength.cs create mode 100644 Function/BNGetDataBufferSlice.cs create mode 100644 Function/BNGetDataReferences.cs create mode 100644 Function/BNGetDataReferencesForType.cs create mode 100644 Function/BNGetDataReferencesForTypeField.cs create mode 100644 Function/BNGetDataReferencesFrom.cs create mode 100644 Function/BNGetDataReferencesFromForTypeField.cs create mode 100644 Function/BNGetDataReferencesFromInRange.cs create mode 100644 Function/BNGetDataReferencesInRange.cs create mode 100644 Function/BNGetDataRendererContainer.cs create mode 100644 Function/BNGetDataTagReferences.cs create mode 100644 Function/BNGetDataTags.cs create mode 100644 Function/BNGetDataTagsInRange.cs create mode 100644 Function/BNGetDataTagsOfType.cs create mode 100644 Function/BNGetDataVariableAtAddress.cs create mode 100644 Function/BNGetDataVariableParentComponents.cs create mode 100644 Function/BNGetDataVariables.cs create mode 100644 Function/BNGetDatabaseCurrentSnapshot.cs create mode 100644 Function/BNGetDatabaseFile.cs create mode 100644 Function/BNGetDatabaseGlobalKeys.cs create mode 100644 Function/BNGetDatabaseSnapshot.cs create mode 100644 Function/BNGetDatabaseSnapshots.cs create mode 100644 Function/BNGetDebugDataVariableByAddress.cs create mode 100644 Function/BNGetDebugDataVariableByName.cs create mode 100644 Function/BNGetDebugDataVariables.cs create mode 100644 Function/BNGetDebugDataVariablesByAddress.cs create mode 100644 Function/BNGetDebugDataVariablesByName.cs create mode 100644 Function/BNGetDebugFunctions.cs create mode 100644 Function/BNGetDebugInfo.cs create mode 100644 Function/BNGetDebugInfoParserByName.cs create mode 100644 Function/BNGetDebugInfoParserName.cs create mode 100644 Function/BNGetDebugInfoParsers.cs create mode 100644 Function/BNGetDebugInfoParsersForView.cs create mode 100644 Function/BNGetDebugInfoTypeContainer.cs create mode 100644 Function/BNGetDebugParserNames.cs create mode 100644 Function/BNGetDebugTypeByName.cs create mode 100644 Function/BNGetDebugTypes.cs create mode 100644 Function/BNGetDebugTypesByName.cs create mode 100644 Function/BNGetDefaultArchitecture.cs create mode 100644 Function/BNGetDefaultArchitectureFlagConditionLowLevelIL.cs create mode 100644 Function/BNGetDefaultArchitectureFlagWriteLowLevelIL.cs create mode 100644 Function/BNGetDefaultEndianness.cs create mode 100644 Function/BNGetDefaultIncomingVariableForParameterVariable.cs create mode 100644 Function/BNGetDefaultIndexForMediumLevelILVariableDefinition.cs create mode 100644 Function/BNGetDefaultLineFormatter.cs create mode 100644 Function/BNGetDefaultLineFormatterSettings.cs create mode 100644 Function/BNGetDefaultParameterVariableForIncomingVariable.cs create mode 100644 Function/BNGetDefaultPlatform.cs create mode 100644 Function/BNGetDefaultTypeParser.cs create mode 100644 Function/BNGetDemanglerByName.cs create mode 100644 Function/BNGetDemanglerList.cs create mode 100644 Function/BNGetDemanglerName.cs create mode 100644 Function/BNGetDirectoryNameInput.cs create mode 100644 Function/BNGetDisassemblyAddressBaseOffset.cs create mode 100644 Function/BNGetDisassemblyAddressMode.cs create mode 100644 Function/BNGetDisassemblyBlockLabels.cs create mode 100644 Function/BNGetDisassemblyCallParameterHints.cs create mode 100644 Function/BNGetDisassemblyGutterWidth.cs create mode 100644 Function/BNGetDisassemblyMaximumSymbolWidth.cs create mode 100644 Function/BNGetDisassemblyTextRendererArchitecture.cs create mode 100644 Function/BNGetDisassemblyTextRendererBasicBlock.cs create mode 100644 Function/BNGetDisassemblyTextRendererFunction.cs create mode 100644 Function/BNGetDisassemblyTextRendererHighLevelILFunction.cs create mode 100644 Function/BNGetDisassemblyTextRendererInstructionAnnotations.cs create mode 100644 Function/BNGetDisassemblyTextRendererInstructionText.cs create mode 100644 Function/BNGetDisassemblyTextRendererIntegerTokens.cs create mode 100644 Function/BNGetDisassemblyTextRendererLines.cs create mode 100644 Function/BNGetDisassemblyTextRendererLowLevelILFunction.cs create mode 100644 Function/BNGetDisassemblyTextRendererMediumLevelILFunction.cs create mode 100644 Function/BNGetDisassemblyTextRendererSettings.cs create mode 100644 Function/BNGetDisassemblyTextRendererStackVariableReferenceTokens.cs create mode 100644 Function/BNGetDisassemblyTextRendererSymbolTokens.cs create mode 100644 Function/BNGetDisassemblyTextRendererSymbolTokensStatic.cs create mode 100644 Function/BNGetDisassemblyWidth.cs create mode 100644 Function/BNGetDisplayStringForInteger.cs create mode 100644 Function/BNGetDownloadProviderByName.cs create mode 100644 Function/BNGetDownloadProviderList.cs create mode 100644 Function/BNGetDownloadProviderName.cs create mode 100644 Function/BNGetEarlyReturn.cs create mode 100644 Function/BNGetEmptyTypeContainer.cs create mode 100644 Function/BNGetEndOffset.cs create mode 100644 Function/BNGetEnterpriseServerAuthenticationMethods.cs create mode 100644 Function/BNGetEnterpriseServerBuildId.cs create mode 100644 Function/BNGetEnterpriseServerId.cs create mode 100644 Function/BNGetEnterpriseServerLastError.cs create mode 100644 Function/BNGetEnterpriseServerLicenseDuration.cs create mode 100644 Function/BNGetEnterpriseServerLicenseExpirationTime.cs create mode 100644 Function/BNGetEnterpriseServerName.cs create mode 100644 Function/BNGetEnterpriseServerReservationTimeLimit.cs create mode 100644 Function/BNGetEnterpriseServerToken.cs create mode 100644 Function/BNGetEnterpriseServerUrl.cs create mode 100644 Function/BNGetEnterpriseServerUsername.cs create mode 100644 Function/BNGetEnterpriseServerVersion.cs create mode 100644 Function/BNGetEntropy.cs create mode 100644 Function/BNGetEntryPoint.cs create mode 100644 Function/BNGetEnumerationBuilderMembers.cs create mode 100644 Function/BNGetEnumerationMembers.cs create mode 100644 Function/BNGetEnumerationTokensForValue.cs create mode 100644 Function/BNGetErrorForDownloadInstance.cs create mode 100644 Function/BNGetExistingViews.cs create mode 100644 Function/BNGetExprFolding.cs create mode 100644 Function/BNGetExpressionParserMagicValue.cs create mode 100644 Function/BNGetExternalNameSpace.cs create mode 100644 Function/BNGetFieldResolutionForVariableAt.cs create mode 100644 Function/BNGetFileExtension.cs create mode 100644 Function/BNGetFileForView.cs create mode 100644 Function/BNGetFileMetadataDatabase.cs create mode 100644 Function/BNGetFilePathsInDirectory.cs create mode 100644 Function/BNGetFileViewOfType.cs create mode 100644 Function/BNGetFilename.cs create mode 100644 Function/BNGetFirstLinearViewObjectChild.cs create mode 100644 Function/BNGetFlagsReadByLiftedILInstruction.cs create mode 100644 Function/BNGetFlagsWrittenByLiftedILInstruction.cs create mode 100644 Function/BNGetFloatArgumentRegisters.cs create mode 100644 Function/BNGetFloatReturnValueRegister.cs create mode 100644 Function/BNGetFlowGraphBasicBlock.cs create mode 100644 Function/BNGetFlowGraphHeight.cs create mode 100644 Function/BNGetFlowGraphHighLevelILFunction.cs create mode 100644 Function/BNGetFlowGraphLayoutByName.cs create mode 100644 Function/BNGetFlowGraphLayoutName.cs create mode 100644 Function/BNGetFlowGraphLayouts.cs create mode 100644 Function/BNGetFlowGraphLowLevelILFunction.cs create mode 100644 Function/BNGetFlowGraphMediumLevelILFunction.cs create mode 100644 Function/BNGetFlowGraphNode.cs create mode 100644 Function/BNGetFlowGraphNodeCount.cs create mode 100644 Function/BNGetFlowGraphNodeHeight.cs create mode 100644 Function/BNGetFlowGraphNodeHighlight.cs create mode 100644 Function/BNGetFlowGraphNodeIncomingEdges.cs create mode 100644 Function/BNGetFlowGraphNodeLines.cs create mode 100644 Function/BNGetFlowGraphNodeOutgoingEdges.cs create mode 100644 Function/BNGetFlowGraphNodeOwner.cs create mode 100644 Function/BNGetFlowGraphNodeWidth.cs create mode 100644 Function/BNGetFlowGraphNodeX.cs create mode 100644 Function/BNGetFlowGraphNodeY.cs create mode 100644 Function/BNGetFlowGraphNodes.cs create mode 100644 Function/BNGetFlowGraphNodesInRegion.cs create mode 100644 Function/BNGetFlowGraphRenderLayers.cs create mode 100644 Function/BNGetFlowGraphWidth.cs create mode 100644 Function/BNGetFormInput.cs create mode 100644 Function/BNGetFullInfoUpdateChannels.cs create mode 100644 Function/BNGetFullWidthArchitectureRegisters.cs create mode 100644 Function/BNGetFunctionAddressRanges.cs create mode 100644 Function/BNGetFunctionAllTagReferences.cs create mode 100644 Function/BNGetFunctionAnalysisPerformanceInfo.cs create mode 100644 Function/BNGetFunctionAnalysisSkipOverride.cs create mode 100644 Function/BNGetFunctionAnalysisUpdateDisabled.cs create mode 100644 Function/BNGetFunctionArchitecture.cs create mode 100644 Function/BNGetFunctionBasicBlockAtAddress.cs create mode 100644 Function/BNGetFunctionBasicBlockList.cs create mode 100644 Function/BNGetFunctionBlockAnnotations.cs create mode 100644 Function/BNGetFunctionCallSites.cs create mode 100644 Function/BNGetFunctionCallingConvention.cs create mode 100644 Function/BNGetFunctionClobberedRegisters.cs create mode 100644 Function/BNGetFunctionComment.cs create mode 100644 Function/BNGetFunctionData.cs create mode 100644 Function/BNGetFunctionForFlowGraph.cs create mode 100644 Function/BNGetFunctionGlobalPointerValue.cs create mode 100644 Function/BNGetFunctionHighLevelIL.cs create mode 100644 Function/BNGetFunctionHighLevelILIfAvailable.cs create mode 100644 Function/BNGetFunctionHighestAddress.cs create mode 100644 Function/BNGetFunctionLanguageRepresentation.cs create mode 100644 Function/BNGetFunctionLanguageRepresentationIfAvailable.cs create mode 100644 Function/BNGetFunctionLiftedIL.cs create mode 100644 Function/BNGetFunctionLiftedILIfAvailable.cs create mode 100644 Function/BNGetFunctionLowLevelIL.cs create mode 100644 Function/BNGetFunctionLowLevelILIfAvailable.cs create mode 100644 Function/BNGetFunctionLowestAddress.cs create mode 100644 Function/BNGetFunctionMappedMediumLevelIL.cs create mode 100644 Function/BNGetFunctionMappedMediumLevelILIfAvailable.cs create mode 100644 Function/BNGetFunctionMediumLevelIL.cs create mode 100644 Function/BNGetFunctionMediumLevelILIfAvailable.cs create mode 100644 Function/BNGetFunctionParameterVariables.cs create mode 100644 Function/BNGetFunctionParentComponents.cs create mode 100644 Function/BNGetFunctionPlatform.cs create mode 100644 Function/BNGetFunctionRegisterStackAdjustments.cs create mode 100644 Function/BNGetFunctionRegisterValueAtExit.cs create mode 100644 Function/BNGetFunctionReturnRegisters.cs create mode 100644 Function/BNGetFunctionReturnType.cs create mode 100644 Function/BNGetFunctionStackAdjustment.cs create mode 100644 Function/BNGetFunctionStart.cs create mode 100644 Function/BNGetFunctionSymbol.cs create mode 100644 Function/BNGetFunctionTagReferences.cs create mode 100644 Function/BNGetFunctionTagReferencesOfType.cs create mode 100644 Function/BNGetFunctionTags.cs create mode 100644 Function/BNGetFunctionTagsOfType.cs create mode 100644 Function/BNGetFunctionType.cs create mode 100644 Function/BNGetFunctionTypeTokens.cs create mode 100644 Function/BNGetFunctionVariableDeadStoreElimination.cs create mode 100644 Function/BNGetFunctionVariables.cs create mode 100644 Function/BNGetGlobalCommentForAddress.cs create mode 100644 Function/BNGetGlobalCommentedAddresses.cs create mode 100644 Function/BNGetGlobalPointerRegister.cs create mode 100644 Function/BNGetGlobalPointerValue.cs create mode 100644 Function/BNGetGotoLabelName.cs create mode 100644 Function/BNGetGraphForFlowGraphLayoutRequest.cs create mode 100644 Function/BNGetGuidedSourceBlocks.cs create mode 100644 Function/BNGetHighIntegerReturnValueRegister.cs create mode 100644 Function/BNGetHighLevelILAliasedVariables.cs create mode 100644 Function/BNGetHighLevelILBasicBlockForInstruction.cs create mode 100644 Function/BNGetHighLevelILBasicBlockList.cs create mode 100644 Function/BNGetHighLevelILByIndex.cs create mode 100644 Function/BNGetHighLevelILExprCount.cs create mode 100644 Function/BNGetHighLevelILExprIndex.cs create mode 100644 Function/BNGetHighLevelILExprIndexForLabel.cs create mode 100644 Function/BNGetHighLevelILExprIndexes.cs create mode 100644 Function/BNGetHighLevelILExprScopeType.cs create mode 100644 Function/BNGetHighLevelILExprText.cs create mode 100644 Function/BNGetHighLevelILExprType.cs create mode 100644 Function/BNGetHighLevelILForMediumLevelIL.cs create mode 100644 Function/BNGetHighLevelILIndexForInstruction.cs create mode 100644 Function/BNGetHighLevelILInstructionCount.cs create mode 100644 Function/BNGetHighLevelILInstructionForExpr.cs create mode 100644 Function/BNGetHighLevelILInstructionIndex.cs create mode 100644 Function/BNGetHighLevelILNonSSAExprIndex.cs create mode 100644 Function/BNGetHighLevelILNonSSAForm.cs create mode 100644 Function/BNGetHighLevelILNonSSAInstructionIndex.cs create mode 100644 Function/BNGetHighLevelILOwnerFunction.cs create mode 100644 Function/BNGetHighLevelILRootExpr.cs create mode 100644 Function/BNGetHighLevelILSSAExprIndex.cs create mode 100644 Function/BNGetHighLevelILSSAForm.cs create mode 100644 Function/BNGetHighLevelILSSAInstructionIndex.cs create mode 100644 Function/BNGetHighLevelILSSAMemoryDefinition.cs create mode 100644 Function/BNGetHighLevelILSSAMemoryUses.cs create mode 100644 Function/BNGetHighLevelILSSAMemoryVersionAtILInstruction.cs create mode 100644 Function/BNGetHighLevelILSSAVarDefinition.cs create mode 100644 Function/BNGetHighLevelILSSAVarUses.cs create mode 100644 Function/BNGetHighLevelILSSAVarVersionAtILInstruction.cs create mode 100644 Function/BNGetHighLevelILUsesForLabel.cs create mode 100644 Function/BNGetHighLevelILVariableDefinitions.cs create mode 100644 Function/BNGetHighLevelILVariableReferences.cs create mode 100644 Function/BNGetHighLevelILVariableReferencesFrom.cs create mode 100644 Function/BNGetHighLevelILVariableReferencesFromIfAvailable.cs create mode 100644 Function/BNGetHighLevelILVariableReferencesIfAvailable.cs create mode 100644 Function/BNGetHighLevelILVariableReferencesInRange.cs create mode 100644 Function/BNGetHighLevelILVariableReferencesInRangeIfAvailable.cs create mode 100644 Function/BNGetHighLevelILVariableSSAVersions.cs create mode 100644 Function/BNGetHighLevelILVariableUses.cs create mode 100644 Function/BNGetHighLevelILVariables.cs create mode 100644 Function/BNGetHorizontalFlowGraphNodeMargin.cs create mode 100644 Function/BNGetImageBase.cs create mode 100644 Function/BNGetImplicitlyDefinedRegisters.cs create mode 100644 Function/BNGetIncomingDirectTypeReferences.cs create mode 100644 Function/BNGetIncomingFlagValue.cs create mode 100644 Function/BNGetIncomingRecursiveTypeReferences.cs create mode 100644 Function/BNGetIncomingRegisterValue.cs create mode 100644 Function/BNGetIncomingVariableForParameterVariable.cs create mode 100644 Function/BNGetIndirectBranches.cs create mode 100644 Function/BNGetIndirectBranchesAt.cs create mode 100644 Function/BNGetInstallDirectory.cs create mode 100644 Function/BNGetInstructionContainingAddress.cs create mode 100644 Function/BNGetInstructionHighlight.cs create mode 100644 Function/BNGetInstructionInfo.cs create mode 100644 Function/BNGetInstructionLength.cs create mode 100644 Function/BNGetInstructionLowLevelIL.cs create mode 100644 Function/BNGetInstructionText.cs create mode 100644 Function/BNGetIntegerArgumentRegisters.cs create mode 100644 Function/BNGetIntegerConstantDisplayType.cs create mode 100644 Function/BNGetIntegerConstantDisplayTypeEnumerationType.cs create mode 100644 Function/BNGetIntegerInput.cs create mode 100644 Function/BNGetIntegerReturnValueRegister.cs create mode 100644 Function/BNGetIntegerTypeDisplayType.cs create mode 100644 Function/BNGetInternalNameSpace.cs create mode 100644 Function/BNGetKeyValueStoreBuffer.cs create mode 100644 Function/BNGetKeyValueStoreDataSize.cs create mode 100644 Function/BNGetKeyValueStoreKeys.cs create mode 100644 Function/BNGetKeyValueStoreNamespaceSize.cs create mode 100644 Function/BNGetKeyValueStoreSerializedData.cs create mode 100644 Function/BNGetKeyValueStoreValue.cs create mode 100644 Function/BNGetKeyValueStoreValueHash.cs create mode 100644 Function/BNGetKeyValueStoreValueSize.cs create mode 100644 Function/BNGetKeyValueStoreValueStorageSize.cs create mode 100644 Function/BNGetLabelForLowLevelILSourceInstruction.cs create mode 100644 Function/BNGetLabelForMediumLevelILSourceInstruction.cs create mode 100644 Function/BNGetLanguageRepresentationArchitecture.cs create mode 100644 Function/BNGetLanguageRepresentationFunctionAnnotationEndString.cs create mode 100644 Function/BNGetLanguageRepresentationFunctionAnnotationStartString.cs create mode 100644 Function/BNGetLanguageRepresentationFunctionBlockLines.cs create mode 100644 Function/BNGetLanguageRepresentationFunctionCommentEndString.cs create mode 100644 Function/BNGetLanguageRepresentationFunctionCommentStartString.cs create mode 100644 Function/BNGetLanguageRepresentationFunctionExprText.cs create mode 100644 Function/BNGetLanguageRepresentationFunctionHighlight.cs create mode 100644 Function/BNGetLanguageRepresentationFunctionLinearLines.cs create mode 100644 Function/BNGetLanguageRepresentationFunctionTypeByName.cs create mode 100644 Function/BNGetLanguageRepresentationFunctionTypeFunctionTypeTokens.cs create mode 100644 Function/BNGetLanguageRepresentationFunctionTypeLineFormatter.cs create mode 100644 Function/BNGetLanguageRepresentationFunctionTypeList.cs create mode 100644 Function/BNGetLanguageRepresentationFunctionTypeName.cs create mode 100644 Function/BNGetLanguageRepresentationFunctionTypeParser.cs create mode 100644 Function/BNGetLanguageRepresentationFunctionTypePrinter.cs create mode 100644 Function/BNGetLanguageRepresentationILFunction.cs create mode 100644 Function/BNGetLanguageRepresentationLineFormatterSettings.cs create mode 100644 Function/BNGetLanguageRepresentationOwnerFunction.cs create mode 100644 Function/BNGetLanguageRepresentationType.cs create mode 100644 Function/BNGetLargeChoiceInput.cs create mode 100644 Function/BNGetLastLinearViewObjectChild.cs create mode 100644 Function/BNGetLastRedoEntry.cs create mode 100644 Function/BNGetLastRedoEntryTitle.cs create mode 100644 Function/BNGetLastSeenVariableNameOrDefault.cs create mode 100644 Function/BNGetLastUndoEntry.cs create mode 100644 Function/BNGetLastUndoEntryTitle.cs create mode 100644 Function/BNGetLicenseCount.cs create mode 100644 Function/BNGetLicenseExpirationTime.cs create mode 100644 Function/BNGetLicensedUserEmail.cs create mode 100644 Function/BNGetLiftedILFlagDefinitionsForUse.cs create mode 100644 Function/BNGetLiftedILFlagUsesForDefinition.cs create mode 100644 Function/BNGetLineFormatterByName.cs create mode 100644 Function/BNGetLineFormatterList.cs create mode 100644 Function/BNGetLineFormatterName.cs create mode 100644 Function/BNGetLinearViewCursorCurrentObject.cs create mode 100644 Function/BNGetLinearViewCursorLines.cs create mode 100644 Function/BNGetLinearViewCursorOrderingIndex.cs create mode 100644 Function/BNGetLinearViewCursorOrderingIndexTotal.cs create mode 100644 Function/BNGetLinearViewCursorPath.cs create mode 100644 Function/BNGetLinearViewCursorPathObjects.cs create mode 100644 Function/BNGetLinearViewCursorRenderLayers.cs create mode 100644 Function/BNGetLinearViewObjectChildForAddress.cs create mode 100644 Function/BNGetLinearViewObjectChildForIdentifier.cs create mode 100644 Function/BNGetLinearViewObjectChildForOrderingIndex.cs create mode 100644 Function/BNGetLinearViewObjectEnd.cs create mode 100644 Function/BNGetLinearViewObjectIdentifier.cs create mode 100644 Function/BNGetLinearViewObjectLines.cs create mode 100644 Function/BNGetLinearViewObjectOrderingIndexForChild.cs create mode 100644 Function/BNGetLinearViewObjectOrderingIndexTotal.cs create mode 100644 Function/BNGetLinearViewObjectStart.cs create mode 100644 Function/BNGetLinesForData.cs create mode 100644 Function/BNGetLoggerIndent.cs create mode 100644 Function/BNGetLowLevelFlagSSAVersions.cs create mode 100644 Function/BNGetLowLevelFlags.cs create mode 100644 Function/BNGetLowLevelILBasicBlockForInstruction.cs create mode 100644 Function/BNGetLowLevelILBasicBlockList.cs create mode 100644 Function/BNGetLowLevelILByIndex.cs create mode 100644 Function/BNGetLowLevelILExprCount.cs create mode 100644 Function/BNGetLowLevelILExprIndex.cs create mode 100644 Function/BNGetLowLevelILExprIndexes.cs create mode 100644 Function/BNGetLowLevelILExprText.cs create mode 100644 Function/BNGetLowLevelILExprValue.cs create mode 100644 Function/BNGetLowLevelILFlagValueAfterInstruction.cs create mode 100644 Function/BNGetLowLevelILFlagValueAtInstruction.cs create mode 100644 Function/BNGetLowLevelILForMediumLevelIL.cs create mode 100644 Function/BNGetLowLevelILIndexForInstruction.cs create mode 100644 Function/BNGetLowLevelILInstructionCount.cs create mode 100644 Function/BNGetLowLevelILInstructionForExpr.cs create mode 100644 Function/BNGetLowLevelILInstructionIndex.cs create mode 100644 Function/BNGetLowLevelILInstructionText.cs create mode 100644 Function/BNGetLowLevelILLabelForAddress.cs create mode 100644 Function/BNGetLowLevelILNonSSAExprIndex.cs create mode 100644 Function/BNGetLowLevelILNonSSAForm.cs create mode 100644 Function/BNGetLowLevelILNonSSAInstructionIndex.cs create mode 100644 Function/BNGetLowLevelILOwnerFunction.cs create mode 100644 Function/BNGetLowLevelILPossibleExprValues.cs create mode 100644 Function/BNGetLowLevelILPossibleFlagValuesAfterInstruction.cs create mode 100644 Function/BNGetLowLevelILPossibleFlagValuesAtInstruction.cs create mode 100644 Function/BNGetLowLevelILPossibleRegisterValuesAfterInstruction.cs create mode 100644 Function/BNGetLowLevelILPossibleRegisterValuesAtInstruction.cs create mode 100644 Function/BNGetLowLevelILPossibleStackContentsAfterInstruction.cs create mode 100644 Function/BNGetLowLevelILPossibleStackContentsAtInstruction.cs create mode 100644 Function/BNGetLowLevelILRegisterValueAfterInstruction.cs create mode 100644 Function/BNGetLowLevelILRegisterValueAtInstruction.cs create mode 100644 Function/BNGetLowLevelILSSAExprIndex.cs create mode 100644 Function/BNGetLowLevelILSSAFlagDefinition.cs create mode 100644 Function/BNGetLowLevelILSSAFlagUses.cs create mode 100644 Function/BNGetLowLevelILSSAFlagValue.cs create mode 100644 Function/BNGetLowLevelILSSAForm.cs create mode 100644 Function/BNGetLowLevelILSSAInstructionIndex.cs create mode 100644 Function/BNGetLowLevelILSSAMemoryDefinition.cs create mode 100644 Function/BNGetLowLevelILSSAMemoryUses.cs create mode 100644 Function/BNGetLowLevelILSSARegisterDefinition.cs create mode 100644 Function/BNGetLowLevelILSSARegisterUses.cs create mode 100644 Function/BNGetLowLevelILSSARegisterValue.cs create mode 100644 Function/BNGetLowLevelILStackContentsAfterInstruction.cs create mode 100644 Function/BNGetLowLevelILStackContentsAtInstruction.cs create mode 100644 Function/BNGetLowLevelILTemporaryFlagCount.cs create mode 100644 Function/BNGetLowLevelILTemporaryRegisterCount.cs create mode 100644 Function/BNGetLowLevelMemoryVersions.cs create mode 100644 Function/BNGetLowLevelRegisterSSAVersions.cs create mode 100644 Function/BNGetLowLevelRegisterStackSSAVersions.cs create mode 100644 Function/BNGetLowLevelRegisterStacks.cs create mode 100644 Function/BNGetLowLevelRegisters.cs create mode 100644 Function/BNGetLowLevelSSAFlagsWithoutVersions.cs create mode 100644 Function/BNGetLowLevelSSARegisterStacksWithoutVersions.cs create mode 100644 Function/BNGetLowLevelSSARegistersWithoutVersions.cs create mode 100644 Function/BNGetMappedAddressRanges.cs create mode 100644 Function/BNGetMappedMediumLevelIL.cs create mode 100644 Function/BNGetMappedMediumLevelILExprIndex.cs create mode 100644 Function/BNGetMappedMediumLevelILInstructionIndex.cs create mode 100644 Function/BNGetMaskForSize.cs create mode 100644 Function/BNGetMaxFunctionSizeForAnalysis.cs create mode 100644 Function/BNGetMediumLevelILAliasedVariables.cs create mode 100644 Function/BNGetMediumLevelILBasicBlockForInstruction.cs create mode 100644 Function/BNGetMediumLevelILBasicBlockList.cs create mode 100644 Function/BNGetMediumLevelILBranchDependence.cs create mode 100644 Function/BNGetMediumLevelILByIndex.cs create mode 100644 Function/BNGetMediumLevelILExprCount.cs create mode 100644 Function/BNGetMediumLevelILExprIndex.cs create mode 100644 Function/BNGetMediumLevelILExprIndexFromHighLevelIL.cs create mode 100644 Function/BNGetMediumLevelILExprIndexes.cs create mode 100644 Function/BNGetMediumLevelILExprIndexesFromHighLevelIL.cs create mode 100644 Function/BNGetMediumLevelILExprText.cs create mode 100644 Function/BNGetMediumLevelILExprType.cs create mode 100644 Function/BNGetMediumLevelILExprValue.cs create mode 100644 Function/BNGetMediumLevelILFlagValueAfterInstruction.cs create mode 100644 Function/BNGetMediumLevelILFlagValueAtInstruction.cs create mode 100644 Function/BNGetMediumLevelILForHighLevelILFunction.cs create mode 100644 Function/BNGetMediumLevelILForLowLevelIL.cs create mode 100644 Function/BNGetMediumLevelILIndexForInstruction.cs create mode 100644 Function/BNGetMediumLevelILInstructionCount.cs create mode 100644 Function/BNGetMediumLevelILInstructionForExpr.cs create mode 100644 Function/BNGetMediumLevelILInstructionIndex.cs create mode 100644 Function/BNGetMediumLevelILInstructionText.cs create mode 100644 Function/BNGetMediumLevelILLiveInstructionsForVariable.cs create mode 100644 Function/BNGetMediumLevelILNonSSAExprIndex.cs create mode 100644 Function/BNGetMediumLevelILNonSSAForm.cs create mode 100644 Function/BNGetMediumLevelILNonSSAInstructionIndex.cs create mode 100644 Function/BNGetMediumLevelILOwnerFunction.cs create mode 100644 Function/BNGetMediumLevelILPossibleExprValues.cs create mode 100644 Function/BNGetMediumLevelILPossibleFlagValuesAfterInstruction.cs create mode 100644 Function/BNGetMediumLevelILPossibleFlagValuesAtInstruction.cs create mode 100644 Function/BNGetMediumLevelILPossibleRegisterValuesAfterInstruction.cs create mode 100644 Function/BNGetMediumLevelILPossibleRegisterValuesAtInstruction.cs create mode 100644 Function/BNGetMediumLevelILPossibleSSAVarValues.cs create mode 100644 Function/BNGetMediumLevelILPossibleStackContentsAfterInstruction.cs create mode 100644 Function/BNGetMediumLevelILPossibleStackContentsAtInstruction.cs create mode 100644 Function/BNGetMediumLevelILRegisterValueAfterInstruction.cs create mode 100644 Function/BNGetMediumLevelILRegisterValueAtInstruction.cs create mode 100644 Function/BNGetMediumLevelILSSAExprIndex.cs create mode 100644 Function/BNGetMediumLevelILSSAForm.cs create mode 100644 Function/BNGetMediumLevelILSSAInstructionIndex.cs create mode 100644 Function/BNGetMediumLevelILSSAMemoryDefinition.cs create mode 100644 Function/BNGetMediumLevelILSSAMemoryUses.cs create mode 100644 Function/BNGetMediumLevelILSSAMemoryVersionAfterILInstruction.cs create mode 100644 Function/BNGetMediumLevelILSSAMemoryVersionAtILInstruction.cs create mode 100644 Function/BNGetMediumLevelILSSAVarDefinition.cs create mode 100644 Function/BNGetMediumLevelILSSAVarUses.cs create mode 100644 Function/BNGetMediumLevelILSSAVarValue.cs create mode 100644 Function/BNGetMediumLevelILSSAVarVersionAfterILInstruction.cs create mode 100644 Function/BNGetMediumLevelILSSAVarVersionAtILInstruction.cs create mode 100644 Function/BNGetMediumLevelILStackContentsAfterInstruction.cs create mode 100644 Function/BNGetMediumLevelILStackContentsAtInstruction.cs create mode 100644 Function/BNGetMediumLevelILVariableDefinitions.cs create mode 100644 Function/BNGetMediumLevelILVariableForFlagAfterInstruction.cs create mode 100644 Function/BNGetMediumLevelILVariableForFlagAtInstruction.cs create mode 100644 Function/BNGetMediumLevelILVariableForRegisterAfterInstruction.cs create mode 100644 Function/BNGetMediumLevelILVariableForRegisterAtInstruction.cs create mode 100644 Function/BNGetMediumLevelILVariableForStackLocationAfterInstruction.cs create mode 100644 Function/BNGetMediumLevelILVariableForStackLocationAtInstruction.cs create mode 100644 Function/BNGetMediumLevelILVariableReferences.cs create mode 100644 Function/BNGetMediumLevelILVariableReferencesFrom.cs create mode 100644 Function/BNGetMediumLevelILVariableReferencesFromIfAvailable.cs create mode 100644 Function/BNGetMediumLevelILVariableReferencesIfAvailable.cs create mode 100644 Function/BNGetMediumLevelILVariableReferencesInRange.cs create mode 100644 Function/BNGetMediumLevelILVariableReferencesInRangeIfAvailable.cs create mode 100644 Function/BNGetMediumLevelILVariableSSAVersions.cs create mode 100644 Function/BNGetMediumLevelILVariableUses.cs create mode 100644 Function/BNGetMediumLevelILVariables.cs create mode 100644 Function/BNGetMemberIncludingInheritedAtOffset.cs create mode 100644 Function/BNGetMemoryMapDescription.cs create mode 100644 Function/BNGetMemoryRegionFill.cs create mode 100644 Function/BNGetMemoryRegionFlags.cs create mode 100644 Function/BNGetMemoryUsageInfo.cs create mode 100644 Function/BNGetMergedVariables.cs create mode 100644 Function/BNGetMinimumCoreABIVersion.cs create mode 100644 Function/BNGetModification.cs create mode 100644 Function/BNGetModificationArray.cs create mode 100644 Function/BNGetModifiedArchitectureRegistersOnWrite.cs create mode 100644 Function/BNGetNameSpaces.cs create mode 100644 Function/BNGetNameTypeString.cs create mode 100644 Function/BNGetNativeTypeParserArchitecture.cs create mode 100644 Function/BNGetNewAutoFunctionAnalysisSuppressed.cs create mode 100644 Function/BNGetNextBasicBlockStartAfterAddress.cs create mode 100644 Function/BNGetNextDataAfterAddress.cs create mode 100644 Function/BNGetNextDataVariableStartAfterAddress.cs create mode 100644 Function/BNGetNextFunctionStartAfterAddress.cs create mode 100644 Function/BNGetNextLinearViewObjectChild.cs create mode 100644 Function/BNGetNextValidOffset.cs create mode 100644 Function/BNGetOpenFileNameInput.cs create mode 100644 Function/BNGetOpenProjects.cs create mode 100644 Function/BNGetOriginalFilename.cs create mode 100644 Function/BNGetOriginalImageBase.cs create mode 100644 Function/BNGetOutgoingDirectTypeReferences.cs create mode 100644 Function/BNGetOutgoingRecursiveTypeReferences.cs create mode 100644 Function/BNGetParameterOrderingForVariables.cs create mode 100644 Function/BNGetParameterValueAtInstruction.cs create mode 100644 Function/BNGetParameterValueAtLowLevelILInstruction.cs create mode 100644 Function/BNGetParameterVariableForIncomingVariable.cs create mode 100644 Function/BNGetParametersForAnalysis.cs create mode 100644 Function/BNGetParentPath.cs create mode 100644 Function/BNGetParentView.cs create mode 100644 Function/BNGetPathRelativeToBundledPluginDirectory.cs create mode 100644 Function/BNGetPathRelativeToUserDirectory.cs create mode 100644 Function/BNGetPathRelativeToUserPluginDirectory.cs create mode 100644 Function/BNGetPlatformAddressSize.cs create mode 100644 Function/BNGetPlatformArchitecture.cs create mode 100644 Function/BNGetPlatformByName.cs create mode 100644 Function/BNGetPlatformCallingConventions.cs create mode 100644 Function/BNGetPlatformCdeclCallingConvention.cs create mode 100644 Function/BNGetPlatformDefaultCallingConvention.cs create mode 100644 Function/BNGetPlatformFastcallCallingConvention.cs create mode 100644 Function/BNGetPlatformForViewType.cs create mode 100644 Function/BNGetPlatformFunctionByName.cs create mode 100644 Function/BNGetPlatformFunctions.cs create mode 100644 Function/BNGetPlatformGlobalRegisterType.cs create mode 100644 Function/BNGetPlatformGlobalRegisters.cs create mode 100644 Function/BNGetPlatformList.cs create mode 100644 Function/BNGetPlatformListByArchitecture.cs create mode 100644 Function/BNGetPlatformListByOS.cs create mode 100644 Function/BNGetPlatformListByOSAndArchitecture.cs create mode 100644 Function/BNGetPlatformName.cs create mode 100644 Function/BNGetPlatformOSList.cs create mode 100644 Function/BNGetPlatformStdcallCallingConvention.cs create mode 100644 Function/BNGetPlatformSystemCallConvention.cs create mode 100644 Function/BNGetPlatformSystemCallName.cs create mode 100644 Function/BNGetPlatformSystemCallType.cs create mode 100644 Function/BNGetPlatformSystemCalls.cs create mode 100644 Function/BNGetPlatformTypeByName.cs create mode 100644 Function/BNGetPlatformTypeContainer.cs create mode 100644 Function/BNGetPlatformTypeLibraries.cs create mode 100644 Function/BNGetPlatformTypeLibrariesByName.cs create mode 100644 Function/BNGetPlatformTypes.cs create mode 100644 Function/BNGetPlatformVariableByName.cs create mode 100644 Function/BNGetPlatformVariables.cs create mode 100644 Function/BNGetPreviousBasicBlockEndBeforeAddress.cs create mode 100644 Function/BNGetPreviousBasicBlockStartBeforeAddress.cs create mode 100644 Function/BNGetPreviousDataBeforeAddress.cs create mode 100644 Function/BNGetPreviousDataVariableStartBeforeAddress.cs create mode 100644 Function/BNGetPreviousFunctionStartBeforeAddress.cs create mode 100644 Function/BNGetPreviousLinearViewObjectChild.cs create mode 100644 Function/BNGetProduct.cs create mode 100644 Function/BNGetProductType.cs create mode 100644 Function/BNGetProjectFile.cs create mode 100644 Function/BNGetProvenanceString.cs create mode 100644 Function/BNGetReaderPosition.cs create mode 100644 Function/BNGetRecentAnalysisFunctionForAddress.cs create mode 100644 Function/BNGetRecentBasicBlockForAddress.cs create mode 100644 Function/BNGetRedoEntries.cs create mode 100644 Function/BNGetRegisterStackAdjustments.cs create mode 100644 Function/BNGetRegisterValueAfterInstruction.cs create mode 100644 Function/BNGetRegisterValueAtInstruction.cs create mode 100644 Function/BNGetRegisteredTypeName.cs create mode 100644 Function/BNGetRegistersReadByInstruction.cs create mode 100644 Function/BNGetRegistersWrittenByInstruction.cs create mode 100644 Function/BNGetRelatedPlatform.cs create mode 100644 Function/BNGetRelatedPlatforms.cs create mode 100644 Function/BNGetRelocationRanges.cs create mode 100644 Function/BNGetRelocationRangesAtAddress.cs create mode 100644 Function/BNGetRelocationRangesInRange.cs create mode 100644 Function/BNGetRelocationsAt.cs create mode 100644 Function/BNGetRenderLayerByName.cs create mode 100644 Function/BNGetRenderLayerDefaultEnableState.cs create mode 100644 Function/BNGetRenderLayerList.cs create mode 100644 Function/BNGetRenderLayerName.cs create mode 100644 Function/BNGetReportCollectionCount.cs create mode 100644 Function/BNGetReportContents.cs create mode 100644 Function/BNGetReportFlowGraph.cs create mode 100644 Function/BNGetReportPlainText.cs create mode 100644 Function/BNGetReportTitle.cs create mode 100644 Function/BNGetReportType.cs create mode 100644 Function/BNGetReportView.cs create mode 100644 Function/BNGetRepositoriesDirectory.cs create mode 100644 Function/BNGetRepositoryManager.cs create mode 100644 Function/BNGetRootComponent.cs create mode 100644 Function/BNGetRunningBackgroundTasks.cs create mode 100644 Function/BNGetSaveFileNameInput.cs create mode 100644 Function/BNGetSaveSettingsName.cs create mode 100644 Function/BNGetScriptingInstanceDelimiters.cs create mode 100644 Function/BNGetScriptingInstanceInputReadyState.cs create mode 100644 Function/BNGetScriptingProviderAPIName.cs create mode 100644 Function/BNGetScriptingProviderByAPIName.cs create mode 100644 Function/BNGetScriptingProviderByName.cs create mode 100644 Function/BNGetScriptingProviderList.cs create mode 100644 Function/BNGetScriptingProviderName.cs create mode 100644 Function/BNGetSecretsProviderByName.cs create mode 100644 Function/BNGetSecretsProviderData.cs create mode 100644 Function/BNGetSecretsProviderList.cs create mode 100644 Function/BNGetSecretsProviderName.cs create mode 100644 Function/BNGetSectionByName.cs create mode 100644 Function/BNGetSections.cs create mode 100644 Function/BNGetSectionsAt.cs create mode 100644 Function/BNGetSegmentAt.cs create mode 100644 Function/BNGetSegments.cs create mode 100644 Function/BNGetSerialNumber.cs create mode 100644 Function/BNGetSettingsFileName.cs create mode 100644 Function/BNGetSizesReferenced.cs create mode 100644 Function/BNGetSnapshotChildren.cs create mode 100644 Function/BNGetSnapshotData.cs create mode 100644 Function/BNGetSnapshotDatabase.cs create mode 100644 Function/BNGetSnapshotFileContents.cs create mode 100644 Function/BNGetSnapshotFileContentsHash.cs create mode 100644 Function/BNGetSnapshotFirstParent.cs create mode 100644 Function/BNGetSnapshotId.cs create mode 100644 Function/BNGetSnapshotName.cs create mode 100644 Function/BNGetSnapshotParents.cs create mode 100644 Function/BNGetSnapshotUndoData.cs create mode 100644 Function/BNGetSnapshotUndoEntries.cs create mode 100644 Function/BNGetSnapshotUndoEntriesWithProgress.cs create mode 100644 Function/BNGetSplitVariables.cs create mode 100644 Function/BNGetStackAdjustmentForVariables.cs create mode 100644 Function/BNGetStackContentsAfterInstruction.cs create mode 100644 Function/BNGetStackContentsAtInstruction.cs create mode 100644 Function/BNGetStackLayout.cs create mode 100644 Function/BNGetStackVariableAtFrameOffset.cs create mode 100644 Function/BNGetStackVariableAtFrameOffsetAfterInstruction.cs create mode 100644 Function/BNGetStackVariablesReferencedByInstruction.cs create mode 100644 Function/BNGetStackVariablesReferencedByInstructionIfAvailable.cs create mode 100644 Function/BNGetStartOffset.cs create mode 100644 Function/BNGetStringAtAddress.cs create mode 100644 Function/BNGetStringLiteralPrefix.cs create mode 100644 Function/BNGetStringRefContents.cs create mode 100644 Function/BNGetStringRefSize.cs create mode 100644 Function/BNGetStrings.cs create mode 100644 Function/BNGetStringsInRange.cs create mode 100644 Function/BNGetStructureAlignment.cs create mode 100644 Function/BNGetStructureBuilderAlignment.cs create mode 100644 Function/BNGetStructureBuilderMemberAtOffset.cs create mode 100644 Function/BNGetStructureBuilderMemberByName.cs create mode 100644 Function/BNGetStructureBuilderMembers.cs create mode 100644 Function/BNGetStructureBuilderPointerOffset.cs create mode 100644 Function/BNGetStructureBuilderType.cs create mode 100644 Function/BNGetStructureBuilderWidth.cs create mode 100644 Function/BNGetStructureMemberAtOffset.cs create mode 100644 Function/BNGetStructureMemberByName.cs create mode 100644 Function/BNGetStructureMembers.cs create mode 100644 Function/BNGetStructureMembersIncludingInherited.cs create mode 100644 Function/BNGetStructurePointerOffset.cs create mode 100644 Function/BNGetStructureType.cs create mode 100644 Function/BNGetStructureWidth.cs create mode 100644 Function/BNGetSwitchRecovery.cs create mode 100644 Function/BNGetSymbolAddress.cs create mode 100644 Function/BNGetSymbolBinding.cs create mode 100644 Function/BNGetSymbolByAddress.cs create mode 100644 Function/BNGetSymbolByRawName.cs create mode 100644 Function/BNGetSymbolFullName.cs create mode 100644 Function/BNGetSymbolFullNameRef.cs create mode 100644 Function/BNGetSymbolNameSpace.cs create mode 100644 Function/BNGetSymbolOrdinal.cs create mode 100644 Function/BNGetSymbolRawBytes.cs create mode 100644 Function/BNGetSymbolRawName.cs create mode 100644 Function/BNGetSymbolRawNameRef.cs create mode 100644 Function/BNGetSymbolShortName.cs create mode 100644 Function/BNGetSymbolShortNameRef.cs create mode 100644 Function/BNGetSymbolType.cs create mode 100644 Function/BNGetSymbols.cs create mode 100644 Function/BNGetSymbolsByName.cs create mode 100644 Function/BNGetSymbolsByRawName.cs create mode 100644 Function/BNGetSymbolsInRange.cs create mode 100644 Function/BNGetSymbolsOfType.cs create mode 100644 Function/BNGetSymbolsOfTypeInRange.cs create mode 100644 Function/BNGetSystemCacheDirectory.cs create mode 100644 Function/BNGetTag.cs create mode 100644 Function/BNGetTagReferencesOfType.cs create mode 100644 Function/BNGetTagReferencesOfTypeCount.cs create mode 100644 Function/BNGetTagType.cs create mode 100644 Function/BNGetTagTypeById.cs create mode 100644 Function/BNGetTagTypeByIdWithType.cs create mode 100644 Function/BNGetTagTypeWithType.cs create mode 100644 Function/BNGetTagTypes.cs create mode 100644 Function/BNGetTemporaryFileContents.cs create mode 100644 Function/BNGetTemporaryFilePath.cs create mode 100644 Function/BNGetTextLineInput.cs create mode 100644 Function/BNGetTimeSinceLastUpdateCheck.cs create mode 100644 Function/BNGetTransformByName.cs create mode 100644 Function/BNGetTransformCapabilities.cs create mode 100644 Function/BNGetTransformGroup.cs create mode 100644 Function/BNGetTransformLongName.cs create mode 100644 Function/BNGetTransformName.cs create mode 100644 Function/BNGetTransformParameterList.cs create mode 100644 Function/BNGetTransformType.cs create mode 100644 Function/BNGetTransformTypeList.cs create mode 100644 Function/BNGetTypeAlignment.cs create mode 100644 Function/BNGetTypeAlternateName.cs create mode 100644 Function/BNGetTypeAndName.cs create mode 100644 Function/BNGetTypeArchiveAllSnapshotIds.cs create mode 100644 Function/BNGetTypeArchiveCurrentSnapshotId.cs create mode 100644 Function/BNGetTypeArchiveId.cs create mode 100644 Function/BNGetTypeArchiveIncomingDirectTypeReferences.cs create mode 100644 Function/BNGetTypeArchiveIncomingRecursiveTypeReferences.cs create mode 100644 Function/BNGetTypeArchiveOutgoingDirectTypeReferences.cs create mode 100644 Function/BNGetTypeArchiveOutgoingRecursiveTypeReferences.cs create mode 100644 Function/BNGetTypeArchivePath.cs create mode 100644 Function/BNGetTypeArchivePlatform.cs create mode 100644 Function/BNGetTypeArchiveSnapshotChildIds.cs create mode 100644 Function/BNGetTypeArchiveSnapshotParentIds.cs create mode 100644 Function/BNGetTypeArchiveTypeById.cs create mode 100644 Function/BNGetTypeArchiveTypeByName.cs create mode 100644 Function/BNGetTypeArchiveTypeContainer.cs create mode 100644 Function/BNGetTypeArchiveTypeId.cs create mode 100644 Function/BNGetTypeArchiveTypeIds.cs create mode 100644 Function/BNGetTypeArchiveTypeName.cs create mode 100644 Function/BNGetTypeArchiveTypeNames.cs create mode 100644 Function/BNGetTypeArchiveTypeNamesAndIds.cs create mode 100644 Function/BNGetTypeArchiveTypes.cs create mode 100644 Function/BNGetTypeAttributeByName.cs create mode 100644 Function/BNGetTypeAttributes.cs create mode 100644 Function/BNGetTypeBuilderAlignment.cs create mode 100644 Function/BNGetTypeBuilderAlternateName.cs create mode 100644 Function/BNGetTypeBuilderAttributeByName.cs create mode 100644 Function/BNGetTypeBuilderAttributes.cs create mode 100644 Function/BNGetTypeBuilderCallingConvention.cs create mode 100644 Function/BNGetTypeBuilderCallingConventionName.cs create mode 100644 Function/BNGetTypeBuilderChildType.cs create mode 100644 Function/BNGetTypeBuilderClass.cs create mode 100644 Function/BNGetTypeBuilderElementCount.cs create mode 100644 Function/BNGetTypeBuilderEnumeration.cs create mode 100644 Function/BNGetTypeBuilderNameType.cs create mode 100644 Function/BNGetTypeBuilderNamedTypeReference.cs create mode 100644 Function/BNGetTypeBuilderOffset.cs create mode 100644 Function/BNGetTypeBuilderParameters.cs create mode 100644 Function/BNGetTypeBuilderPointerSuffix.cs create mode 100644 Function/BNGetTypeBuilderPointerSuffixString.cs create mode 100644 Function/BNGetTypeBuilderPointerSuffixTokens.cs create mode 100644 Function/BNGetTypeBuilderStackAdjustment.cs create mode 100644 Function/BNGetTypeBuilderString.cs create mode 100644 Function/BNGetTypeBuilderStringAfterName.cs create mode 100644 Function/BNGetTypeBuilderStringBeforeName.cs create mode 100644 Function/BNGetTypeBuilderStructure.cs create mode 100644 Function/BNGetTypeBuilderTokens.cs create mode 100644 Function/BNGetTypeBuilderTokensAfterName.cs create mode 100644 Function/BNGetTypeBuilderTokensBeforeName.cs create mode 100644 Function/BNGetTypeBuilderTypeAndName.cs create mode 100644 Function/BNGetTypeBuilderWidth.cs create mode 100644 Function/BNGetTypeCallingConvention.cs create mode 100644 Function/BNGetTypeCallingConventionName.cs create mode 100644 Function/BNGetTypeClass.cs create mode 100644 Function/BNGetTypeElementCount.cs create mode 100644 Function/BNGetTypeEnumeration.cs create mode 100644 Function/BNGetTypeLibraryAlternateNames.cs create mode 100644 Function/BNGetTypeLibraryArchitecture.cs create mode 100644 Function/BNGetTypeLibraryDependencyName.cs create mode 100644 Function/BNGetTypeLibraryGuid.cs create mode 100644 Function/BNGetTypeLibraryName.cs create mode 100644 Function/BNGetTypeLibraryNamedObject.cs create mode 100644 Function/BNGetTypeLibraryNamedObjects.cs create mode 100644 Function/BNGetTypeLibraryNamedType.cs create mode 100644 Function/BNGetTypeLibraryNamedTypes.cs create mode 100644 Function/BNGetTypeLibraryPlatforms.cs create mode 100644 Function/BNGetTypeLibraryTypeContainer.cs create mode 100644 Function/BNGetTypeLines.cs create mode 100644 Function/BNGetTypeNamedTypeReference.cs create mode 100644 Function/BNGetTypeOffset.cs create mode 100644 Function/BNGetTypeParameters.cs create mode 100644 Function/BNGetTypeParserByName.cs create mode 100644 Function/BNGetTypeParserList.cs create mode 100644 Function/BNGetTypeParserName.cs create mode 100644 Function/BNGetTypeParserOptionText.cs create mode 100644 Function/BNGetTypePointerSuffix.cs create mode 100644 Function/BNGetTypePointerSuffixString.cs create mode 100644 Function/BNGetTypePointerSuffixTokens.cs create mode 100644 Function/BNGetTypePrinterByName.cs create mode 100644 Function/BNGetTypePrinterList.cs create mode 100644 Function/BNGetTypePrinterName.cs create mode 100644 Function/BNGetTypePrinterTypeLines.cs create mode 100644 Function/BNGetTypePrinterTypeString.cs create mode 100644 Function/BNGetTypePrinterTypeStringAfterName.cs create mode 100644 Function/BNGetTypePrinterTypeStringBeforeName.cs create mode 100644 Function/BNGetTypePrinterTypeTokens.cs create mode 100644 Function/BNGetTypePrinterTypeTokensAfterName.cs create mode 100644 Function/BNGetTypePrinterTypeTokensBeforeName.cs create mode 100644 Function/BNGetTypeReferenceBuilderClass.cs create mode 100644 Function/BNGetTypeReferenceBuilderId.cs create mode 100644 Function/BNGetTypeReferenceBuilderName.cs create mode 100644 Function/BNGetTypeReferenceClass.cs create mode 100644 Function/BNGetTypeReferenceId.cs create mode 100644 Function/BNGetTypeReferenceName.cs create mode 100644 Function/BNGetTypeReferencesForType.cs create mode 100644 Function/BNGetTypeReferencesForTypeField.cs create mode 100644 Function/BNGetTypeStackAdjustment.cs create mode 100644 Function/BNGetTypeString.cs create mode 100644 Function/BNGetTypeStringAfterName.cs create mode 100644 Function/BNGetTypeStringBeforeName.cs create mode 100644 Function/BNGetTypeStructure.cs create mode 100644 Function/BNGetTypeTokens.cs create mode 100644 Function/BNGetTypeTokensAfterName.cs create mode 100644 Function/BNGetTypeTokensBeforeName.cs create mode 100644 Function/BNGetTypeWidth.cs create mode 100644 Function/BNGetTypesReferenced.cs create mode 100644 Function/BNGetUndoEntries.cs create mode 100644 Function/BNGetUniqueIdentifierString.cs create mode 100644 Function/BNGetUniqueSectionNames.cs create mode 100644 Function/BNGetUnresolvedIndirectBranches.cs create mode 100644 Function/BNGetUnresolvedStackAdjustmentGraph.cs create mode 100644 Function/BNGetUpdateChannelVersions.cs create mode 100644 Function/BNGetUpdateChannels.cs create mode 100644 Function/BNGetUserAddressTagReferences.cs create mode 100644 Function/BNGetUserAddressTags.cs create mode 100644 Function/BNGetUserAddressTagsInRange.cs create mode 100644 Function/BNGetUserAddressTagsOfType.cs create mode 100644 Function/BNGetUserDataTagReferences.cs create mode 100644 Function/BNGetUserDataTags.cs create mode 100644 Function/BNGetUserDataTagsInRange.cs create mode 100644 Function/BNGetUserDataTagsOfType.cs create mode 100644 Function/BNGetUserDirectory.cs create mode 100644 Function/BNGetUserEmail.cs create mode 100644 Function/BNGetUserFunctionTagReferences.cs create mode 100644 Function/BNGetUserFunctionTags.cs create mode 100644 Function/BNGetUserFunctionTagsOfType.cs create mode 100644 Function/BNGetUserId.cs create mode 100644 Function/BNGetUserName.cs create mode 100644 Function/BNGetUserPluginDirectory.cs create mode 100644 Function/BNGetUsers.cs create mode 100644 Function/BNGetValidPluginCommands.cs create mode 100644 Function/BNGetValidPluginCommandsForAddress.cs create mode 100644 Function/BNGetValidPluginCommandsForFunction.cs create mode 100644 Function/BNGetValidPluginCommandsForHighLevelILFunction.cs create mode 100644 Function/BNGetValidPluginCommandsForHighLevelILInstruction.cs create mode 100644 Function/BNGetValidPluginCommandsForLowLevelILFunction.cs create mode 100644 Function/BNGetValidPluginCommandsForLowLevelILInstruction.cs create mode 100644 Function/BNGetValidPluginCommandsForMediumLevelILFunction.cs create mode 100644 Function/BNGetValidPluginCommandsForMediumLevelILInstruction.cs create mode 100644 Function/BNGetValidPluginCommandsForProject.cs create mode 100644 Function/BNGetValidPluginCommandsForRange.cs create mode 100644 Function/BNGetVariableName.cs create mode 100644 Function/BNGetVariableNameOrDefault.cs create mode 100644 Function/BNGetVariableType.cs create mode 100644 Function/BNGetVariablesForParameters.cs create mode 100644 Function/BNGetVariablesForParametersDefaultPermittedArgs.cs create mode 100644 Function/BNGetVersionInfo.cs create mode 100644 Function/BNGetVersionString.cs create mode 100644 Function/BNGetVerticalFlowGraphNodeMargin.cs create mode 100644 Function/BNGetViewAddressSize.cs create mode 100644 Function/BNGetViewForFlowGraph.cs create mode 100644 Function/BNGetViewLength.cs create mode 100644 Function/BNGetViewType.cs create mode 100644 Function/BNGetVirtualPath.cs create mode 100644 Function/BNGetVisibleSymbols.cs create mode 100644 Function/BNGetWebsocketProviderByName.cs create mode 100644 Function/BNGetWebsocketProviderList.cs create mode 100644 Function/BNGetWebsocketProviderName.cs create mode 100644 Function/BNGetWorkerThreadCount.cs create mode 100644 Function/BNGetWorkflowForBinaryView.cs create mode 100644 Function/BNGetWorkflowForFunction.cs create mode 100644 Function/BNGetWorkflowGraphForBinaryView.cs create mode 100644 Function/BNGetWorkflowGraphForFunction.cs create mode 100644 Function/BNGetWorkflowList.cs create mode 100644 Function/BNGetWorkflowName.cs create mode 100644 Function/BNGetWriterPosition.cs create mode 100644 Function/BNHasDataVariables.cs create mode 100644 Function/BNHasFunctions.cs create mode 100644 Function/BNHasGuidedSourceBlocks.cs create mode 100644 Function/BNHasInitialAnalysis.cs create mode 100644 Function/BNHasSymbols.cs create mode 100644 Function/BNHasUnresolvedIndirectBranches.cs create mode 100644 Function/BNHighLevelILAddExpr.cs create mode 100644 Function/BNHighLevelILAddExprWithLocation.cs create mode 100644 Function/BNHighLevelILAddOperandList.cs create mode 100644 Function/BNHighLevelILExprEqual.cs create mode 100644 Function/BNHighLevelILExprLessThan.cs create mode 100644 Function/BNHighLevelILFreeOperandList.cs create mode 100644 Function/BNHighLevelILGetCurrentAddress.cs create mode 100644 Function/BNHighLevelILGetOperandList.cs create mode 100644 Function/BNHighLevelILHasSideEffects.cs create mode 100644 Function/BNHighLevelILSetCurrentAddress.cs create mode 100644 Function/BNHighLevelILTokenEmitterAppend.cs create mode 100644 Function/BNHighLevelILTokenEmitterAppendCloseBrace.cs create mode 100644 Function/BNHighLevelILTokenEmitterAppendCloseBracket.cs create mode 100644 Function/BNHighLevelILTokenEmitterAppendCloseParen.cs create mode 100644 Function/BNHighLevelILTokenEmitterAppendOpenBrace.cs create mode 100644 Function/BNHighLevelILTokenEmitterAppendOpenBracket.cs create mode 100644 Function/BNHighLevelILTokenEmitterAppendOpenParen.cs create mode 100644 Function/BNHighLevelILTokenEmitterAppendSemicolon.cs create mode 100644 Function/BNHighLevelILTokenEmitterBeginForceZeroConfidence.cs create mode 100644 Function/BNHighLevelILTokenEmitterBeginScope.cs create mode 100644 Function/BNHighLevelILTokenEmitterDecreaseIndent.cs create mode 100644 Function/BNHighLevelILTokenEmitterEndForceZeroConfidence.cs create mode 100644 Function/BNHighLevelILTokenEmitterEndScope.cs create mode 100644 Function/BNHighLevelILTokenEmitterFinalize.cs create mode 100644 Function/BNHighLevelILTokenEmitterFinalizeScope.cs create mode 100644 Function/BNHighLevelILTokenEmitterGetBraceRequirement.cs create mode 100644 Function/BNHighLevelILTokenEmitterGetCurrentTokens.cs create mode 100644 Function/BNHighLevelILTokenEmitterGetDefaultBracesOnSameLine.cs create mode 100644 Function/BNHighLevelILTokenEmitterGetLines.cs create mode 100644 Function/BNHighLevelILTokenEmitterGetMaxTernarySimplficationTokens.cs create mode 100644 Function/BNHighLevelILTokenEmitterHasBracesAroundSwitchCases.cs create mode 100644 Function/BNHighLevelILTokenEmitterHasCollapsableRegions.cs create mode 100644 Function/BNHighLevelILTokenEmitterIncreaseIndent.cs create mode 100644 Function/BNHighLevelILTokenEmitterInitLine.cs create mode 100644 Function/BNHighLevelILTokenEmitterIsSimpleScopeAllowed.cs create mode 100644 Function/BNHighLevelILTokenEmitterNewLine.cs create mode 100644 Function/BNHighLevelILTokenEmitterNoIndentForThisLine.cs create mode 100644 Function/BNHighLevelILTokenEmitterRestoreCurrentExpr.cs create mode 100644 Function/BNHighLevelILTokenEmitterScopeContinuation.cs create mode 100644 Function/BNHighLevelILTokenEmitterScopeSeparator.cs create mode 100644 Function/BNHighLevelILTokenEmitterSetBraceRequirement.cs create mode 100644 Function/BNHighLevelILTokenEmitterSetBracesAroundSwitchCases.cs create mode 100644 Function/BNHighLevelILTokenEmitterSetCurrentExpr.cs create mode 100644 Function/BNHighLevelILTokenEmitterSetCurrentTokens.cs create mode 100644 Function/BNHighLevelILTokenEmitterSetDefaultBracesOnSameLine.cs create mode 100644 Function/BNHighLevelILTokenEmitterSetHasCollapsableRegions.cs create mode 100644 Function/BNHighLevelILTokenEmitterSetSimpleScopeAllowed.cs create mode 100644 Function/BNHighLevelILTokenPrependCollapseBlankIndicator.cs create mode 100644 Function/BNHighLevelILTokenPrependCollapseIndicator.cs create mode 100644 Function/BNImportedFunctionFromImportAddressSymbol.cs create mode 100644 Function/BNInitCorePlugins.cs create mode 100644 Function/BNInitDownloadInstance.cs create mode 100644 Function/BNInitPlugins.cs create mode 100644 Function/BNInitRepoPlugins.cs create mode 100644 Function/BNInitScriptingInstance.cs create mode 100644 Function/BNInitUserPlugins.cs create mode 100644 Function/BNInitWebsocketClient.cs create mode 100644 Function/BNInitializeEnterpriseServer.cs create mode 100644 Function/BNInsertViewBuffer.cs create mode 100644 Function/BNInsertViewData.cs create mode 100644 Function/BNInstallPendingUpdate.cs create mode 100644 Function/BNInstallScriptingProviderModules.cs create mode 100644 Function/BNInvertBranch.cs create mode 100644 Function/BNIsAlwaysBranchPatchAvailable.cs create mode 100644 Function/BNIsAnalysisChanged.cs create mode 100644 Function/BNIsAnalysisTypeAutoDefined.cs create mode 100644 Function/BNIsApplyingDebugInfo.cs create mode 100644 Function/BNIsArchitectureAlwaysBranchPatchAvailable.cs create mode 100644 Function/BNIsArchitectureGlobalRegister.cs create mode 100644 Function/BNIsArchitectureInvertBranchPatchAvailable.cs create mode 100644 Function/BNIsArchitectureNeverBranchPatchAvailable.cs create mode 100644 Function/BNIsArchitectureSkipAndReturnValuePatchAvailable.cs create mode 100644 Function/BNIsArchitectureSkipAndReturnZeroPatchAvailable.cs create mode 100644 Function/BNIsArchitectureSystemRegister.cs create mode 100644 Function/BNIsBackedByDatabase.cs create mode 100644 Function/BNIsBackgroundTaskCancelled.cs create mode 100644 Function/BNIsBackgroundTaskFinished.cs create mode 100644 Function/BNIsBaseAddressDetectionAborted.cs create mode 100644 Function/BNIsBinaryViewTypeDeprecated.cs create mode 100644 Function/BNIsBinaryViewTypeForceLoadable.cs create mode 100644 Function/BNIsBinaryViewTypeValidForData.cs create mode 100644 Function/BNIsCallInstruction.cs create mode 100644 Function/BNIsConditionInverted.cs create mode 100644 Function/BNIsDatabase.cs create mode 100644 Function/BNIsDatabaseFromData.cs create mode 100644 Function/BNIsDebugInfoParserValidForView.cs create mode 100644 Function/BNIsDemanglerMangledName.cs create mode 100644 Function/BNIsDisassemblySettingsOptionSet.cs create mode 100644 Function/BNIsEligibleForHeuristics.cs create mode 100644 Function/BNIsEndOfFile.cs create mode 100644 Function/BNIsEnterpriseServerAuthenticated.cs create mode 100644 Function/BNIsEnterpriseServerConnected.cs create mode 100644 Function/BNIsEnterpriseServerFloatingLicense.cs create mode 100644 Function/BNIsEnterpriseServerInitialized.cs create mode 100644 Function/BNIsEnterpriseServerLicenseStillActivated.cs create mode 100644 Function/BNIsExecutableView.cs create mode 100644 Function/BNIsFileModified.cs create mode 100644 Function/BNIsFlowGraphLayoutComplete.cs create mode 100644 Function/BNIsFlowGraphLayoutRequestComplete.cs create mode 100644 Function/BNIsFlowGraphOptionSet.cs create mode 100644 Function/BNIsFunctionAnalysisSkipped.cs create mode 100644 Function/BNIsFunctionInlinedDuringAnalysis.cs create mode 100644 Function/BNIsFunctionPure.cs create mode 100644 Function/BNIsFunctionTooLarge.cs create mode 100644 Function/BNIsFunctionUpdateNeeded.cs create mode 100644 Function/BNIsGNU3MangledString.cs create mode 100644 Function/BNIsGuidedSourceBlock.cs create mode 100644 Function/BNIsHighLevelILBasicBlock.cs create mode 100644 Function/BNIsHighLevelILFlowGraph.cs create mode 100644 Function/BNIsHighLevelILSSAVarLive.cs create mode 100644 Function/BNIsHighLevelILSSAVarLiveAt.cs create mode 100644 Function/BNIsHighLevelILVarLiveAt.cs create mode 100644 Function/BNIsILBasicBlock.cs create mode 100644 Function/BNIsILDisassemblyTextRenderer.cs create mode 100644 Function/BNIsILFlowGraph.cs create mode 100644 Function/BNIsIntegerToken.cs create mode 100644 Function/BNIsInvertBranchPatchAvailable.cs create mode 100644 Function/BNIsKeyValueStoreEmpty.cs create mode 100644 Function/BNIsLanguageRepresentationFunctionTypeValid.cs create mode 100644 Function/BNIsLicenseValidated.cs create mode 100644 Function/BNIsLinearViewCursorAfterEnd.cs create mode 100644 Function/BNIsLinearViewCursorBeforeBegin.cs create mode 100644 Function/BNIsLowLevelILBasicBlock.cs create mode 100644 Function/BNIsLowLevelILFlowGraph.cs create mode 100644 Function/BNIsMainThread.cs create mode 100644 Function/BNIsMainThreadActionDone.cs create mode 100644 Function/BNIsMediumLevelILBasicBlock.cs create mode 100644 Function/BNIsMediumLevelILFlowGraph.cs create mode 100644 Function/BNIsMediumLevelILSSAVarLive.cs create mode 100644 Function/BNIsMediumLevelILSSAVarLiveAt.cs create mode 100644 Function/BNIsMediumLevelILVarLiveAt.cs create mode 100644 Function/BNIsMemoryMapActivated.cs create mode 100644 Function/BNIsMemoryRegionEnabled.cs create mode 100644 Function/BNIsMemoryRegionLocal.cs create mode 100644 Function/BNIsMemoryRegionRebaseable.cs create mode 100644 Function/BNIsNeverBranchPatchAvailable.cs create mode 100644 Function/BNIsNodeValidForFlowGraph.cs create mode 100644 Function/BNIsOffsetBackedByFile.cs create mode 100644 Function/BNIsOffsetCodeSemantics.cs create mode 100644 Function/BNIsOffsetExecutable.cs create mode 100644 Function/BNIsOffsetExternSemantics.cs create mode 100644 Function/BNIsOffsetReadable.cs create mode 100644 Function/BNIsOffsetWritable.cs create mode 100644 Function/BNIsOffsetWritableSemantics.cs create mode 100644 Function/BNIsPathDirectory.cs create mode 100644 Function/BNIsPathRegularFile.cs create mode 100644 Function/BNIsPluginsEnabled.cs create mode 100644 Function/BNIsRelocatable.cs create mode 100644 Function/BNIsSaveSettingsOptionSet.cs create mode 100644 Function/BNIsShutdownRequested.cs create mode 100644 Function/BNIsSkipAndReturnValuePatchAvailable.cs create mode 100644 Function/BNIsSkipAndReturnZeroPatchAvailable.cs create mode 100644 Function/BNIsSnapshotAutoSave.cs create mode 100644 Function/BNIsSnapshotDataAppliedWithoutError.cs create mode 100644 Function/BNIsStackAdjustedOnReturn.cs create mode 100644 Function/BNIsStackReservedForArgumentRegisters.cs create mode 100644 Function/BNIsStructureBuilderPacked.cs create mode 100644 Function/BNIsStructureBuilderUnion.cs create mode 100644 Function/BNIsStructurePacked.cs create mode 100644 Function/BNIsStructureUnion.cs create mode 100644 Function/BNIsSymbolAutoDefined.cs create mode 100644 Function/BNIsTypeArchive.cs create mode 100644 Function/BNIsTypeBuilderConst.cs create mode 100644 Function/BNIsTypeBuilderFloatingPoint.cs create mode 100644 Function/BNIsTypeBuilderPure.cs create mode 100644 Function/BNIsTypeBuilderSigned.cs create mode 100644 Function/BNIsTypeBuilderVolatile.cs create mode 100644 Function/BNIsTypeConst.cs create mode 100644 Function/BNIsTypeFloatingPoint.cs create mode 100644 Function/BNIsTypePure.cs create mode 100644 Function/BNIsTypeSigned.cs create mode 100644 Function/BNIsTypeVolatile.cs create mode 100644 Function/BNIsUIEnabled.cs create mode 100644 Function/BNIsUpdateInstallationPending.cs create mode 100644 Function/BNIsValidForData.cs create mode 100644 Function/BNIsValidOffset.cs create mode 100644 Function/BNIsVariableUserDefined.cs create mode 100644 Function/BNIsViewModified.cs create mode 100644 Function/BNKeyValueStoreHasValue.cs create mode 100644 Function/BNLinearViewCursorNext.cs create mode 100644 Function/BNLinearViewCursorPrevious.cs create mode 100644 Function/BNLlvmServicesAssemble.cs create mode 100644 Function/BNLlvmServicesAssembleFree.cs create mode 100644 Function/BNLlvmServicesDisasmInstruction.cs create mode 100644 Function/BNLlvmServicesInit.cs create mode 100644 Function/BNLoadBinaryView.cs create mode 100644 Function/BNLoadFilename.cs create mode 100644 Function/BNLoadProjectFile.cs create mode 100644 Function/BNLoadScriptingProviderModule.cs create mode 100644 Function/BNLoadSettingsFile.cs create mode 100644 Function/BNLoadTypeLibraryFromFile.cs create mode 100644 Function/BNLogAlertWithStackTrace.cs create mode 100644 Function/BNLogCreateLogger.cs create mode 100644 Function/BNLogGetLogger.cs create mode 100644 Function/BNLogGetLoggerNames.cs create mode 100644 Function/BNLogString.cs create mode 100644 Function/BNLogStringWithStackTrace.cs create mode 100644 Function/BNLogToFile.cs create mode 100644 Function/BNLogToStderr.cs create mode 100644 Function/BNLogToStdout.cs create mode 100644 Function/BNLoggerDedent.cs create mode 100644 Function/BNLoggerGetName.cs create mode 100644 Function/BNLoggerGetSessionId.cs create mode 100644 Function/BNLoggerIndent.cs create mode 100644 Function/BNLoggerLogString.cs create mode 100644 Function/BNLoggerLogStringWithStackTrace.cs create mode 100644 Function/BNLoggerResetIndent.cs create mode 100644 Function/BNLookupImportedTypePlatform.cs create mode 100644 Function/BNLookupTypeArchiveById.cs create mode 100644 Function/BNLookupTypeLibraryByGuid.cs create mode 100644 Function/BNLookupTypeLibraryByName.cs create mode 100644 Function/BNLowLevelILAddExpr.cs create mode 100644 Function/BNLowLevelILAddExprWithLocation.cs create mode 100644 Function/BNLowLevelILAddInstruction.cs create mode 100644 Function/BNLowLevelILAddLabelMap.cs create mode 100644 Function/BNLowLevelILAddOperandList.cs create mode 100644 Function/BNLowLevelILClearIndirectBranches.cs create mode 100644 Function/BNLowLevelILFreeOperandList.cs create mode 100644 Function/BNLowLevelILGetCurrentAddress.cs create mode 100644 Function/BNLowLevelILGetExitsForInstruction.cs create mode 100644 Function/BNLowLevelILGetInstructionStart.cs create mode 100644 Function/BNLowLevelILGetInstructionsAt.cs create mode 100644 Function/BNLowLevelILGetOperandList.cs create mode 100644 Function/BNLowLevelILGoto.cs create mode 100644 Function/BNLowLevelILGotoWithLocation.cs create mode 100644 Function/BNLowLevelILIf.cs create mode 100644 Function/BNLowLevelILIfWithLocation.cs create mode 100644 Function/BNLowLevelILInitLabel.cs create mode 100644 Function/BNLowLevelILMarkLabel.cs create mode 100644 Function/BNLowLevelILSetCurrentAddress.cs create mode 100644 Function/BNLowLevelILSetCurrentSourceBlock.cs create mode 100644 Function/BNLowLevelILSetExprSourceOperand.cs create mode 100644 Function/BNLowLevelILSetIndirectBranches.cs create mode 100644 Function/BNLzma2Decompress.cs create mode 100644 Function/BNLzmaDecompress.cs create mode 100644 Function/BNMarkBasicBlockAsRecentlyUsed.cs create mode 100644 Function/BNMarkCallerUpdatesRequired.cs create mode 100644 Function/BNMarkFileModified.cs create mode 100644 Function/BNMarkFileSaved.cs create mode 100644 Function/BNMarkFunctionAsRecentlyUsed.cs create mode 100644 Function/BNMarkMediumLevelILInstructionForRemoval.cs create mode 100644 Function/BNMarkUpdatesRequired.cs create mode 100644 Function/BNMarkdownToHTML.cs create mode 100644 Function/BNMaskToSize.cs create mode 100644 Function/BNMediumLevelILAddExpr.cs create mode 100644 Function/BNMediumLevelILAddExprWithLocation.cs create mode 100644 Function/BNMediumLevelILAddInstruction.cs create mode 100644 Function/BNMediumLevelILAddLabelMap.cs create mode 100644 Function/BNMediumLevelILAddOperandList.cs create mode 100644 Function/BNMediumLevelILFreeOperandList.cs create mode 100644 Function/BNMediumLevelILGetCurrentAddress.cs create mode 100644 Function/BNMediumLevelILGetInstructionStart.cs create mode 100644 Function/BNMediumLevelILGetOperandList.cs create mode 100644 Function/BNMediumLevelILGoto.cs create mode 100644 Function/BNMediumLevelILGotoWithLocation.cs create mode 100644 Function/BNMediumLevelILIf.cs create mode 100644 Function/BNMediumLevelILIfWithLocation.cs create mode 100644 Function/BNMediumLevelILInitLabel.cs create mode 100644 Function/BNMediumLevelILMarkLabel.cs create mode 100644 Function/BNMediumLevelILSetCurrentAddress.cs create mode 100644 Function/BNMergeVariables.cs create mode 100644 Function/BNMetadataArrayAppend.cs create mode 100644 Function/BNMetadataGetArray.cs create mode 100644 Function/BNMetadataGetBoolean.cs create mode 100644 Function/BNMetadataGetBooleanList.cs create mode 100644 Function/BNMetadataGetDouble.cs create mode 100644 Function/BNMetadataGetDoubleList.cs create mode 100644 Function/BNMetadataGetForIndex.cs create mode 100644 Function/BNMetadataGetForKey.cs create mode 100644 Function/BNMetadataGetJsonString.cs create mode 100644 Function/BNMetadataGetRaw.cs create mode 100644 Function/BNMetadataGetSignedInteger.cs create mode 100644 Function/BNMetadataGetSignedIntegerList.cs create mode 100644 Function/BNMetadataGetString.cs create mode 100644 Function/BNMetadataGetStringList.cs create mode 100644 Function/BNMetadataGetType.cs create mode 100644 Function/BNMetadataGetUnsignedInteger.cs create mode 100644 Function/BNMetadataGetUnsignedIntegerList.cs create mode 100644 Function/BNMetadataGetValueStore.cs create mode 100644 Function/BNMetadataIsArray.cs create mode 100644 Function/BNMetadataIsBoolean.cs create mode 100644 Function/BNMetadataIsBooleanList.cs create mode 100644 Function/BNMetadataIsDouble.cs create mode 100644 Function/BNMetadataIsDoubleList.cs create mode 100644 Function/BNMetadataIsEqual.cs create mode 100644 Function/BNMetadataIsKeyValueStore.cs create mode 100644 Function/BNMetadataIsRaw.cs create mode 100644 Function/BNMetadataIsSignedInteger.cs create mode 100644 Function/BNMetadataIsSignedIntegerList.cs create mode 100644 Function/BNMetadataIsString.cs create mode 100644 Function/BNMetadataIsStringList.cs create mode 100644 Function/BNMetadataIsUnsignedInteger.cs create mode 100644 Function/BNMetadataIsUnsignedIntegerList.cs create mode 100644 Function/BNMetadataRemoveIndex.cs create mode 100644 Function/BNMetadataRemoveKey.cs create mode 100644 Function/BNMetadataSetValueForKey.cs create mode 100644 Function/BNMetadataSize.cs create mode 100644 Function/BNNavigate.cs create mode 100644 Function/BNNewActivityReference.cs create mode 100644 Function/BNNewAnalysisCompletionEventReference.cs create mode 100644 Function/BNNewAnalysisContextReference.cs create mode 100644 Function/BNNewAnalysisMergeConflictReference.cs create mode 100644 Function/BNNewBackgroundTaskReference.cs create mode 100644 Function/BNNewBasicBlockReference.cs create mode 100644 Function/BNNewCallingConventionReference.cs create mode 100644 Function/BNNewCollaborationChangesetReference.cs create mode 100644 Function/BNNewCollaborationGroupReference.cs create mode 100644 Function/BNNewCollaborationPermissionReference.cs create mode 100644 Function/BNNewCollaborationSnapshotReference.cs create mode 100644 Function/BNNewCollaborationUndoEntryReference.cs create mode 100644 Function/BNNewCollaborationUserReference.cs create mode 100644 Function/BNNewComponentReference.cs create mode 100644 Function/BNNewDataRendererReference.cs create mode 100644 Function/BNNewDatabaseReference.cs create mode 100644 Function/BNNewDebugInfoParserReference.cs create mode 100644 Function/BNNewDebugInfoReference.cs create mode 100644 Function/BNNewDisassemblySettingsReference.cs create mode 100644 Function/BNNewDisassemblyTextRendererReference.cs create mode 100644 Function/BNNewDownloadInstanceReference.cs create mode 100644 Function/BNNewEnumerationReference.cs create mode 100644 Function/BNNewExternalLibraryReference.cs create mode 100644 Function/BNNewExternalLocationReference.cs create mode 100644 Function/BNNewFieldResolutionInfoReference.cs create mode 100644 Function/BNNewFileReference.cs create mode 100644 Function/BNNewFirmwareNinjaReferenceNodeReference.cs create mode 100644 Function/BNNewFirmwareNinjaRelationshipReference.cs create mode 100644 Function/BNNewFlowGraphLayoutRequestReference.cs create mode 100644 Function/BNNewFlowGraphNodeReference.cs create mode 100644 Function/BNNewFlowGraphReference.cs create mode 100644 Function/BNNewFunctionReference.cs create mode 100644 Function/BNNewHighLevelILFunctionReference.cs create mode 100644 Function/BNNewHighLevelILTokenEmitterReference.cs create mode 100644 Function/BNNewKeyValueStoreReference.cs create mode 100644 Function/BNNewLanguageRepresentationFunctionReference.cs create mode 100644 Function/BNNewLinearViewCursorReference.cs create mode 100644 Function/BNNewLinearViewObjectReference.cs create mode 100644 Function/BNNewLoggerReference.cs create mode 100644 Function/BNNewLowLevelILFunctionReference.cs create mode 100644 Function/BNNewMainThreadActionReference.cs create mode 100644 Function/BNNewMediumLevelILFunctionReference.cs create mode 100644 Function/BNNewMetadataReference.cs create mode 100644 Function/BNNewNamedTypeReference.cs create mode 100644 Function/BNNewPlatformReference.cs create mode 100644 Function/BNNewPluginReference.cs create mode 100644 Function/BNNewProjectFileReference.cs create mode 100644 Function/BNNewProjectFolderReference.cs create mode 100644 Function/BNNewProjectReference.cs create mode 100644 Function/BNNewRelocationHandlerReference.cs create mode 100644 Function/BNNewRelocationReference.cs create mode 100644 Function/BNNewRemoteFileReference.cs create mode 100644 Function/BNNewRemoteFolderReference.cs create mode 100644 Function/BNNewRemoteProjectReference.cs create mode 100644 Function/BNNewRemoteReference.cs create mode 100644 Function/BNNewReportCollectionReference.cs create mode 100644 Function/BNNewRepositoryManagerReference.cs create mode 100644 Function/BNNewRepositoryReference.cs create mode 100644 Function/BNNewSaveSettingsReference.cs create mode 100644 Function/BNNewScriptingInstanceReference.cs create mode 100644 Function/BNNewSectionReference.cs create mode 100644 Function/BNNewSegmentReference.cs create mode 100644 Function/BNNewSettingsReference.cs create mode 100644 Function/BNNewSnapshotReference.cs create mode 100644 Function/BNNewStructureReference.cs create mode 100644 Function/BNNewSymbolReference.cs create mode 100644 Function/BNNewTagReference.cs create mode 100644 Function/BNNewTagTypeReference.cs create mode 100644 Function/BNNewTemporaryFileReference.cs create mode 100644 Function/BNNewTransformContextReference.cs create mode 100644 Function/BNNewTransformSessionReference.cs create mode 100644 Function/BNNewTypeArchiveMergeConflictReference.cs create mode 100644 Function/BNNewTypeArchiveReference.cs create mode 100644 Function/BNNewTypeLibrary.cs create mode 100644 Function/BNNewTypeLibraryReference.cs create mode 100644 Function/BNNewTypeReference.cs create mode 100644 Function/BNNewUndoActionReference.cs create mode 100644 Function/BNNewUndoEntryReference.cs create mode 100644 Function/BNNewUserReference.cs create mode 100644 Function/BNNewViewReference.cs create mode 100644 Function/BNNewWebsocketClientReference.cs create mode 100644 Function/BNNewWorkflowReference.cs create mode 100644 Function/BNNotifyDataInserted.cs create mode 100644 Function/BNNotifyDataRemoved.cs create mode 100644 Function/BNNotifyDataWritten.cs create mode 100644 Function/BNNotifyErrorForScriptingInstance.cs create mode 100644 Function/BNNotifyInputReadyStateForScriptingInstance.cs create mode 100644 Function/BNNotifyOutputForScriptingInstance.cs create mode 100644 Function/BNNotifyProgressForDownloadInstance.cs create mode 100644 Function/BNNotifyWarningForScriptingInstance.cs create mode 100644 Function/BNNotifyWebsocketClientConnect.cs create mode 100644 Function/BNNotifyWebsocketClientDisconnect.cs create mode 100644 Function/BNNotifyWebsocketClientError.cs create mode 100644 Function/BNNotifyWebsocketClientReadData.cs create mode 100644 Function/BNOpenDatabaseForConfiguration.cs create mode 100644 Function/BNOpenExistingDatabase.cs create mode 100644 Function/BNOpenExistingDatabaseWithProgress.cs create mode 100644 Function/BNOpenProject.cs create mode 100644 Function/BNOpenTypeArchive.cs create mode 100644 Function/BNOpenUrl.cs create mode 100644 Function/BNParseBinaryViewOfType.cs create mode 100644 Function/BNParseDebugInfo.cs create mode 100644 Function/BNParseExpression.cs create mode 100644 Function/BNParsePossibleValueSet.cs create mode 100644 Function/BNParseTextFormat.cs create mode 100644 Function/BNParseTypeParserOptionsText.cs create mode 100644 Function/BNParseTypeString.cs create mode 100644 Function/BNParseTypesFromSource.cs create mode 100644 Function/BNParseTypesFromSourceFile.cs create mode 100644 Function/BNParseTypesString.cs create mode 100644 Function/BNParseVersionString.cs create mode 100644 Function/BNPathExists.cs create mode 100644 Function/BNPerformCustomRequest.cs create mode 100644 Function/BNPerformDownloadRequest.cs create mode 100644 Function/BNPerformSearch.cs create mode 100644 Function/BNPlatformAdjustTypeParserInput.cs create mode 100644 Function/BNPluginAreDependenciesBeingInstalled.cs create mode 100644 Function/BNPluginDisable.cs create mode 100644 Function/BNPluginEnable.cs create mode 100644 Function/BNPluginGetApis.cs create mode 100644 Function/BNPluginGetAuthor.cs create mode 100644 Function/BNPluginGetAuthorUrl.cs create mode 100644 Function/BNPluginGetCommit.cs create mode 100644 Function/BNPluginGetDependencies.cs create mode 100644 Function/BNPluginGetDescription.cs create mode 100644 Function/BNPluginGetLastUpdate.cs create mode 100644 Function/BNPluginGetLicenseText.cs create mode 100644 Function/BNPluginGetLongdescription.cs create mode 100644 Function/BNPluginGetMaximumVersionInfo.cs create mode 100644 Function/BNPluginGetMinimumVersionInfo.cs create mode 100644 Function/BNPluginGetName.cs create mode 100644 Function/BNPluginGetPackageUrl.cs create mode 100644 Function/BNPluginGetPath.cs create mode 100644 Function/BNPluginGetPlatforms.cs create mode 100644 Function/BNPluginGetPluginStatus.cs create mode 100644 Function/BNPluginGetPluginTypes.cs create mode 100644 Function/BNPluginGetProjectData.cs create mode 100644 Function/BNPluginGetProjectUrl.cs create mode 100644 Function/BNPluginGetRepository.cs create mode 100644 Function/BNPluginGetSubdir.cs create mode 100644 Function/BNPluginGetVersion.cs create mode 100644 Function/BNPluginGetViewOnly.cs create mode 100644 Function/BNPluginInstall.cs create mode 100644 Function/BNPluginInstallDependencies.cs create mode 100644 Function/BNPluginIsBeingDeleted.cs create mode 100644 Function/BNPluginIsBeingUpdated.cs create mode 100644 Function/BNPluginIsDeletePending.cs create mode 100644 Function/BNPluginIsDisablePending.cs create mode 100644 Function/BNPluginIsEnabled.cs create mode 100644 Function/BNPluginIsInstalled.cs create mode 100644 Function/BNPluginIsRunning.cs create mode 100644 Function/BNPluginIsUpdateAvailable.cs create mode 100644 Function/BNPluginIsUpdatePending.cs create mode 100644 Function/BNPluginUninstall.cs create mode 100644 Function/BNPluginUpdate.cs create mode 100644 Function/BNPostProcessDisassemblyTextRendererLines.cs create mode 100644 Function/BNPostWorkflowRequestForBinaryView.cs create mode 100644 Function/BNPostWorkflowRequestForFunction.cs create mode 100644 Function/BNPrepareToCopyLowLevelILBasicBlock.cs create mode 100644 Function/BNPrepareToCopyLowLevelILFunction.cs create mode 100644 Function/BNPrepareToCopyMediumLevelILBasicBlock.cs create mode 100644 Function/BNPrepareToCopyMediumLevelILFunction.cs create mode 100644 Function/BNPreprocessSource.cs create mode 100644 Function/BNProcessSymbolQueue.cs create mode 100644 Function/BNProjectBeginBulkOperation.cs create mode 100644 Function/BNProjectClose.cs create mode 100644 Function/BNProjectCreateFile.cs create mode 100644 Function/BNProjectCreateFileFromPath.cs create mode 100644 Function/BNProjectCreateFileFromPathUnsafe.cs create mode 100644 Function/BNProjectCreateFileUnsafe.cs create mode 100644 Function/BNProjectCreateFolder.cs create mode 100644 Function/BNProjectCreateFolderFromPath.cs create mode 100644 Function/BNProjectCreateFolderUnsafe.cs create mode 100644 Function/BNProjectDeleteFile.cs create mode 100644 Function/BNProjectDeleteFolder.cs create mode 100644 Function/BNProjectEndBulkOperation.cs create mode 100644 Function/BNProjectFileExistsOnDisk.cs create mode 100644 Function/BNProjectFileExport.cs create mode 100644 Function/BNProjectFileGetCreationTimestamp.cs create mode 100644 Function/BNProjectFileGetDescription.cs create mode 100644 Function/BNProjectFileGetFolder.cs create mode 100644 Function/BNProjectFileGetId.cs create mode 100644 Function/BNProjectFileGetName.cs create mode 100644 Function/BNProjectFileGetPathInProject.cs create mode 100644 Function/BNProjectFileGetPathOnDisk.cs create mode 100644 Function/BNProjectFileGetProject.cs create mode 100644 Function/BNProjectFileSetDescription.cs create mode 100644 Function/BNProjectFileSetFolder.cs create mode 100644 Function/BNProjectFileSetName.cs create mode 100644 Function/BNProjectFolderExport.cs create mode 100644 Function/BNProjectFolderGetDescription.cs create mode 100644 Function/BNProjectFolderGetId.cs create mode 100644 Function/BNProjectFolderGetName.cs create mode 100644 Function/BNProjectFolderGetParent.cs create mode 100644 Function/BNProjectFolderGetProject.cs create mode 100644 Function/BNProjectFolderSetDescription.cs create mode 100644 Function/BNProjectFolderSetName.cs create mode 100644 Function/BNProjectFolderSetParent.cs create mode 100644 Function/BNProjectGetDescription.cs create mode 100644 Function/BNProjectGetFileById.cs create mode 100644 Function/BNProjectGetFileByPathOnDisk.cs create mode 100644 Function/BNProjectGetFilePathInProject.cs create mode 100644 Function/BNProjectGetFiles.cs create mode 100644 Function/BNProjectGetFilesByPathInProject.cs create mode 100644 Function/BNProjectGetFolderById.cs create mode 100644 Function/BNProjectGetFolders.cs create mode 100644 Function/BNProjectGetId.cs create mode 100644 Function/BNProjectGetName.cs create mode 100644 Function/BNProjectGetPath.cs create mode 100644 Function/BNProjectGetRemoteProject.cs create mode 100644 Function/BNProjectIsOpen.cs create mode 100644 Function/BNProjectOpen.cs create mode 100644 Function/BNProjectPushFile.cs create mode 100644 Function/BNProjectPushFolder.cs create mode 100644 Function/BNProjectQueryMetadata.cs create mode 100644 Function/BNProjectRemoveMetadata.cs create mode 100644 Function/BNProjectSetDescription.cs create mode 100644 Function/BNProjectSetName.cs create mode 100644 Function/BNProjectStoreMetadata.cs create mode 100644 Function/BNPromoteDemangler.cs create mode 100644 Function/BNRangeContainsRelocation.cs create mode 100644 Function/BNRead16.cs create mode 100644 Function/BNRead32.cs create mode 100644 Function/BNRead64.cs create mode 100644 Function/BNRead8.cs create mode 100644 Function/BNReadBE16.cs create mode 100644 Function/BNReadBE32.cs create mode 100644 Function/BNReadBE64.cs create mode 100644 Function/BNReadData.cs create mode 100644 Function/BNReadDataForDownloadInstance.cs create mode 100644 Function/BNReadDatabaseAnalysisCache.cs create mode 100644 Function/BNReadDatabaseGlobal.cs create mode 100644 Function/BNReadDatabaseGlobalData.cs create mode 100644 Function/BNReadLE16.cs create mode 100644 Function/BNReadLE32.cs create mode 100644 Function/BNReadLE64.cs create mode 100644 Function/BNReadPointer.cs create mode 100644 Function/BNReadSnapshotData.cs create mode 100644 Function/BNReadSnapshotDataWithProgress.cs create mode 100644 Function/BNReadViewBuffer.cs create mode 100644 Function/BNReadViewData.cs create mode 100644 Function/BNReanalyzeAllFunctions.cs create mode 100644 Function/BNReanalyzeFunction.cs create mode 100644 Function/BNRebase.cs create mode 100644 Function/BNRebaseWithProgress.cs create mode 100644 Function/BNRecognizePlatformForViewType.cs create mode 100644 Function/BNRedo.cs create mode 100644 Function/BNRegisterAnalysisMergeConflictSplitter.cs create mode 100644 Function/BNRegisterArchitecture.cs create mode 100644 Function/BNRegisterArchitectureExtension.cs create mode 100644 Function/BNRegisterArchitectureForViewType.cs create mode 100644 Function/BNRegisterArchitectureFunctionRecognizer.cs create mode 100644 Function/BNRegisterArchitectureHook.cs create mode 100644 Function/BNRegisterBinaryViewEvent.cs create mode 100644 Function/BNRegisterBinaryViewType.cs create mode 100644 Function/BNRegisterCallingConvention.cs create mode 100644 Function/BNRegisterDataNotification.cs create mode 100644 Function/BNRegisterDebugInfoParser.cs create mode 100644 Function/BNRegisterDefaultPlatformForViewType.cs create mode 100644 Function/BNRegisterDemangler.cs create mode 100644 Function/BNRegisterDownloadProvider.cs create mode 100644 Function/BNRegisterEnterpriseServerNotification.cs create mode 100644 Function/BNRegisterFlowGraphLayout.cs create mode 100644 Function/BNRegisterGenericDataRenderer.cs create mode 100644 Function/BNRegisterGlobalFunctionRecognizer.cs create mode 100644 Function/BNRegisterInteractionHandler.cs create mode 100644 Function/BNRegisterLanguageRepresentationFunctionType.cs create mode 100644 Function/BNRegisterLineFormatter.cs create mode 100644 Function/BNRegisterLogListener.cs create mode 100644 Function/BNRegisterMainThread.cs create mode 100644 Function/BNRegisterObjectDestructionCallbacks.cs create mode 100644 Function/BNRegisterObjectRefDebugTrace.cs create mode 100644 Function/BNRegisterPlatform.cs create mode 100644 Function/BNRegisterPlatformCallingConvention.cs create mode 100644 Function/BNRegisterPlatformCdeclCallingConvention.cs create mode 100644 Function/BNRegisterPlatformDefaultCallingConvention.cs create mode 100644 Function/BNRegisterPlatformFastcallCallingConvention.cs create mode 100644 Function/BNRegisterPlatformForViewType.cs create mode 100644 Function/BNRegisterPlatformRecognizerForViewType.cs create mode 100644 Function/BNRegisterPlatformStdcallCallingConvention.cs create mode 100644 Function/BNRegisterPlatformTypes.cs create mode 100644 Function/BNRegisterPluginCommand.cs create mode 100644 Function/BNRegisterPluginCommandForAddress.cs create mode 100644 Function/BNRegisterPluginCommandForFunction.cs create mode 100644 Function/BNRegisterPluginCommandForHighLevelILFunction.cs create mode 100644 Function/BNRegisterPluginCommandForHighLevelILInstruction.cs create mode 100644 Function/BNRegisterPluginCommandForLowLevelILFunction.cs create mode 100644 Function/BNRegisterPluginCommandForLowLevelILInstruction.cs create mode 100644 Function/BNRegisterPluginCommandForMediumLevelILFunction.cs create mode 100644 Function/BNRegisterPluginCommandForMediumLevelILInstruction.cs create mode 100644 Function/BNRegisterPluginCommandForProject.cs create mode 100644 Function/BNRegisterPluginCommandForRange.cs create mode 100644 Function/BNRegisterProjectNotification.cs create mode 100644 Function/BNRegisterRenderLayer.cs create mode 100644 Function/BNRegisterScriptingInstanceOutputListener.cs create mode 100644 Function/BNRegisterScriptingProvider.cs create mode 100644 Function/BNRegisterSecretsProvider.cs create mode 100644 Function/BNRegisterTransformType.cs create mode 100644 Function/BNRegisterTransformTypeWithCapabilities.cs create mode 100644 Function/BNRegisterTypeArchiveNotification.cs create mode 100644 Function/BNRegisterTypeParser.cs create mode 100644 Function/BNRegisterTypePrinter.cs create mode 100644 Function/BNRegisterTypeSpecificDataRenderer.cs create mode 100644 Function/BNRegisterWebsocketProvider.cs create mode 100644 Function/BNRegisterWorkflow.cs create mode 100644 Function/BNReleaseAdvancedFunctionAnalysisData.cs create mode 100644 Function/BNReleaseAdvancedFunctionAnalysisDataMultiple.cs create mode 100644 Function/BNReleaseEnterpriseServerLicense.cs create mode 100644 Function/BNRelocationGetArchitecture.cs create mode 100644 Function/BNRelocationGetInfo.cs create mode 100644 Function/BNRelocationGetReloc.cs create mode 100644 Function/BNRelocationGetSymbol.cs create mode 100644 Function/BNRelocationGetTarget.cs create mode 100644 Function/BNRelocationHandlerApplyRelocation.cs create mode 100644 Function/BNRelocationHandlerDefaultApplyRelocation.cs create mode 100644 Function/BNRelocationHandlerGetOperandForExternalRelocation.cs create mode 100644 Function/BNRelocationHandlerGetRelocationInfo.cs create mode 100644 Function/BNRemoteConnect.cs create mode 100644 Function/BNRemoteCreateGroup.cs create mode 100644 Function/BNRemoteCreateProject.cs create mode 100644 Function/BNRemoteCreateUser.cs create mode 100644 Function/BNRemoteDeleteGroup.cs create mode 100644 Function/BNRemoteDeleteProject.cs create mode 100644 Function/BNRemoteDisconnect.cs create mode 100644 Function/BNRemoteFileCreateSnapshot.cs create mode 100644 Function/BNRemoteFileDeleteSnapshot.cs create mode 100644 Function/BNRemoteFileDownload.cs create mode 100644 Function/BNRemoteFileGetChatLogUrl.cs create mode 100644 Function/BNRemoteFileGetCoreFile.cs create mode 100644 Function/BNRemoteFileGetCreated.cs create mode 100644 Function/BNRemoteFileGetCreatedBy.cs create mode 100644 Function/BNRemoteFileGetDescription.cs create mode 100644 Function/BNRemoteFileGetFolder.cs create mode 100644 Function/BNRemoteFileGetHash.cs create mode 100644 Function/BNRemoteFileGetId.cs create mode 100644 Function/BNRemoteFileGetLastModified.cs create mode 100644 Function/BNRemoteFileGetLastSnapshot.cs create mode 100644 Function/BNRemoteFileGetLastSnapshotBy.cs create mode 100644 Function/BNRemoteFileGetLastSnapshotName.cs create mode 100644 Function/BNRemoteFileGetMetadata.cs create mode 100644 Function/BNRemoteFileGetName.cs create mode 100644 Function/BNRemoteFileGetProject.cs create mode 100644 Function/BNRemoteFileGetRemote.cs create mode 100644 Function/BNRemoteFileGetSize.cs create mode 100644 Function/BNRemoteFileGetSnapshotById.cs create mode 100644 Function/BNRemoteFileGetSnapshots.cs create mode 100644 Function/BNRemoteFileGetType.cs create mode 100644 Function/BNRemoteFileGetUrl.cs create mode 100644 Function/BNRemoteFileGetUserPositionsUrl.cs create mode 100644 Function/BNRemoteFileHasPulledSnapshots.cs create mode 100644 Function/BNRemoteFilePullSnapshots.cs create mode 100644 Function/BNRemoteFileRequestChatLog.cs create mode 100644 Function/BNRemoteFileRequestUserPositions.cs create mode 100644 Function/BNRemoteFileSetDescription.cs create mode 100644 Function/BNRemoteFileSetFolder.cs create mode 100644 Function/BNRemoteFileSetMetadata.cs create mode 100644 Function/BNRemoteFileSetName.cs create mode 100644 Function/BNRemoteFolderGetCoreFolder.cs create mode 100644 Function/BNRemoteFolderGetDescription.cs create mode 100644 Function/BNRemoteFolderGetId.cs create mode 100644 Function/BNRemoteFolderGetName.cs create mode 100644 Function/BNRemoteFolderGetParent.cs create mode 100644 Function/BNRemoteFolderGetParentId.cs create mode 100644 Function/BNRemoteFolderGetProject.cs create mode 100644 Function/BNRemoteFolderGetRemote.cs create mode 100644 Function/BNRemoteFolderGetUrl.cs create mode 100644 Function/BNRemoteFolderSetDescription.cs create mode 100644 Function/BNRemoteFolderSetName.cs create mode 100644 Function/BNRemoteFolderSetParent.cs create mode 100644 Function/BNRemoteGetAddress.cs create mode 100644 Function/BNRemoteGetAuthBackends.cs create mode 100644 Function/BNRemoteGetCurrentUser.cs create mode 100644 Function/BNRemoteGetGroupById.cs create mode 100644 Function/BNRemoteGetGroupByName.cs create mode 100644 Function/BNRemoteGetGroups.cs create mode 100644 Function/BNRemoteGetName.cs create mode 100644 Function/BNRemoteGetProjectById.cs create mode 100644 Function/BNRemoteGetProjectByName.cs create mode 100644 Function/BNRemoteGetProjects.cs create mode 100644 Function/BNRemoteGetServerBuildId.cs create mode 100644 Function/BNRemoteGetServerBuildVersion.cs create mode 100644 Function/BNRemoteGetServerVersion.cs create mode 100644 Function/BNRemoteGetToken.cs create mode 100644 Function/BNRemoteGetUniqueId.cs create mode 100644 Function/BNRemoteGetUserById.cs create mode 100644 Function/BNRemoteGetUserByUsername.cs create mode 100644 Function/BNRemoteGetUsername.cs create mode 100644 Function/BNRemoteGetUsers.cs create mode 100644 Function/BNRemoteHasLoadedMetadata.cs create mode 100644 Function/BNRemoteHasPulledGroups.cs create mode 100644 Function/BNRemoteHasPulledProjects.cs create mode 100644 Function/BNRemoteHasPulledUsers.cs create mode 100644 Function/BNRemoteImportLocalProject.cs create mode 100644 Function/BNRemoteIsAdmin.cs create mode 100644 Function/BNRemoteIsConnected.cs create mode 100644 Function/BNRemoteIsEnterprise.cs create mode 100644 Function/BNRemoteLoadMetadata.cs create mode 100644 Function/BNRemoteProjectCanUserAdmin.cs create mode 100644 Function/BNRemoteProjectCanUserEdit.cs create mode 100644 Function/BNRemoteProjectCanUserView.cs create mode 100644 Function/BNRemoteProjectClose.cs create mode 100644 Function/BNRemoteProjectCreateFile.cs create mode 100644 Function/BNRemoteProjectCreateFolder.cs create mode 100644 Function/BNRemoteProjectCreateGroupPermission.cs create mode 100644 Function/BNRemoteProjectCreateUserPermission.cs create mode 100644 Function/BNRemoteProjectDeleteFile.cs create mode 100644 Function/BNRemoteProjectDeleteFolder.cs create mode 100644 Function/BNRemoteProjectDeletePermission.cs create mode 100644 Function/BNRemoteProjectGetCoreProject.cs create mode 100644 Function/BNRemoteProjectGetCreated.cs create mode 100644 Function/BNRemoteProjectGetDescription.cs create mode 100644 Function/BNRemoteProjectGetFileById.cs create mode 100644 Function/BNRemoteProjectGetFileByName.cs create mode 100644 Function/BNRemoteProjectGetFiles.cs create mode 100644 Function/BNRemoteProjectGetFolderById.cs create mode 100644 Function/BNRemoteProjectGetFolders.cs create mode 100644 Function/BNRemoteProjectGetGroupPermissions.cs create mode 100644 Function/BNRemoteProjectGetId.cs create mode 100644 Function/BNRemoteProjectGetLastModified.cs create mode 100644 Function/BNRemoteProjectGetName.cs create mode 100644 Function/BNRemoteProjectGetPermissionById.cs create mode 100644 Function/BNRemoteProjectGetReceivedFileCount.cs create mode 100644 Function/BNRemoteProjectGetReceivedFolderCount.cs create mode 100644 Function/BNRemoteProjectGetRemote.cs create mode 100644 Function/BNRemoteProjectGetUrl.cs create mode 100644 Function/BNRemoteProjectGetUserPermissions.cs create mode 100644 Function/BNRemoteProjectHasPulledFiles.cs create mode 100644 Function/BNRemoteProjectHasPulledFolders.cs create mode 100644 Function/BNRemoteProjectHasPulledGroupPermissions.cs create mode 100644 Function/BNRemoteProjectHasPulledUserPermissions.cs create mode 100644 Function/BNRemoteProjectIsAdmin.cs create mode 100644 Function/BNRemoteProjectIsOpen.cs create mode 100644 Function/BNRemoteProjectOpen.cs create mode 100644 Function/BNRemoteProjectPullFiles.cs create mode 100644 Function/BNRemoteProjectPullFolders.cs create mode 100644 Function/BNRemoteProjectPullGroupPermissions.cs create mode 100644 Function/BNRemoteProjectPullUserPermissions.cs create mode 100644 Function/BNRemoteProjectPushFile.cs create mode 100644 Function/BNRemoteProjectPushFolder.cs create mode 100644 Function/BNRemoteProjectPushPermission.cs create mode 100644 Function/BNRemoteProjectSetDescription.cs create mode 100644 Function/BNRemoteProjectSetName.cs create mode 100644 Function/BNRemotePullGroups.cs create mode 100644 Function/BNRemotePullProjects.cs create mode 100644 Function/BNRemotePullUsers.cs create mode 100644 Function/BNRemotePushGroup.cs create mode 100644 Function/BNRemotePushProject.cs create mode 100644 Function/BNRemotePushUser.cs create mode 100644 Function/BNRemoteRequest.cs create mode 100644 Function/BNRemoteRequestAuthenticationToken.cs create mode 100644 Function/BNRemoteSearchGroups.cs create mode 100644 Function/BNRemoteSearchUsers.cs create mode 100644 Function/BNRemoveAnalysisFunction.cs create mode 100644 Function/BNRemoveAutoAddressTag.cs create mode 100644 Function/BNRemoveAutoAddressTagsOfType.cs create mode 100644 Function/BNRemoveAutoDataTag.cs create mode 100644 Function/BNRemoveAutoDataTagsOfType.cs create mode 100644 Function/BNRemoveAutoFunctionTag.cs create mode 100644 Function/BNRemoveAutoFunctionTagsOfType.cs create mode 100644 Function/BNRemoveAutoSection.cs create mode 100644 Function/BNRemoveAutoSegment.cs create mode 100644 Function/BNRemoveComponent.cs create mode 100644 Function/BNRemoveComponentByGuid.cs create mode 100644 Function/BNRemoveDataReference.cs create mode 100644 Function/BNRemoveDatabaseSnapshot.cs create mode 100644 Function/BNRemoveDebugDataVariableByAddress.cs create mode 100644 Function/BNRemoveDebugFunctionByIndex.cs create mode 100644 Function/BNRemoveDebugParserDataVariables.cs create mode 100644 Function/BNRemoveDebugParserFunctions.cs create mode 100644 Function/BNRemoveDebugParserInfo.cs create mode 100644 Function/BNRemoveDebugParserTypes.cs create mode 100644 Function/BNRemoveDebugTypeByName.cs create mode 100644 Function/BNRemoveEnumerationBuilderMember.cs create mode 100644 Function/BNRemoveExpressionParserMagicValue.cs create mode 100644 Function/BNRemoveExpressionParserMagicValues.cs create mode 100644 Function/BNRemoveFlowGraphRenderLayer.cs create mode 100644 Function/BNRemoveGuidedSourceBlocks.cs create mode 100644 Function/BNRemoveLinearViewCursorRenderLayer.cs create mode 100644 Function/BNRemoveMemoryRegion.cs create mode 100644 Function/BNRemoveStructureBuilderMember.cs create mode 100644 Function/BNRemoveTag.cs create mode 100644 Function/BNRemoveTagReference.cs create mode 100644 Function/BNRemoveTagType.cs create mode 100644 Function/BNRemoveTypeBuilderAttribute.cs create mode 100644 Function/BNRemoveUserAddressTag.cs create mode 100644 Function/BNRemoveUserAddressTagsOfType.cs create mode 100644 Function/BNRemoveUserCodeReference.cs create mode 100644 Function/BNRemoveUserDataReference.cs create mode 100644 Function/BNRemoveUserDataTag.cs create mode 100644 Function/BNRemoveUserDataTagsOfType.cs create mode 100644 Function/BNRemoveUserFunction.cs create mode 100644 Function/BNRemoveUserFunctionTag.cs create mode 100644 Function/BNRemoveUserFunctionTagsOfType.cs create mode 100644 Function/BNRemoveUserSection.cs create mode 100644 Function/BNRemoveUserSegment.cs create mode 100644 Function/BNRemoveUserTypeFieldReference.cs create mode 100644 Function/BNRemoveUserTypeReference.cs create mode 100644 Function/BNRemoveViewData.cs create mode 100644 Function/BNRenameAnalysisType.cs create mode 100644 Function/BNRenameFile.cs create mode 100644 Function/BNRenameTypeArchiveType.cs create mode 100644 Function/BNRenderLinesForData.cs create mode 100644 Function/BNReplaceEnumerationBuilderMember.cs create mode 100644 Function/BNReplaceFlowGraphNode.cs create mode 100644 Function/BNReplaceHighLevelILExpr.cs create mode 100644 Function/BNReplaceLowLevelILExpr.cs create mode 100644 Function/BNReplaceMediumLevelILExpr.cs create mode 100644 Function/BNReplaceMediumLevelILInstruction.cs create mode 100644 Function/BNReplaceStructureBuilderMember.cs create mode 100644 Function/BNRepositoryFreePluginDirectoryList.cs create mode 100644 Function/BNRepositoryGetPluginByPath.cs create mode 100644 Function/BNRepositoryGetPlugins.cs create mode 100644 Function/BNRepositoryGetPluginsPath.cs create mode 100644 Function/BNRepositoryGetRepoPath.cs create mode 100644 Function/BNRepositoryGetRepositoryByPath.cs create mode 100644 Function/BNRepositoryGetUrl.cs create mode 100644 Function/BNRepositoryManagerAddRepository.cs create mode 100644 Function/BNRepositoryManagerCheckForUpdates.cs create mode 100644 Function/BNRepositoryManagerGetDefaultRepository.cs create mode 100644 Function/BNRepositoryManagerGetRepositories.cs create mode 100644 Function/BNRequestAdvancedFunctionAnalysisData.cs create mode 100644 Function/BNRequestFunctionDebugReport.cs create mode 100644 Function/BNResetDisassemblyTextRendererDeduplicatedComments.cs create mode 100644 Function/BNResetMemoryMap.cs create mode 100644 Function/BNResolveStructureMemberOrBaseMember.cs create mode 100644 Function/BNRevertUndoActions.cs create mode 100644 Function/BNRunProgressDialog.cs create mode 100644 Function/BNRustSimplifyStrToFQN.cs create mode 100644 Function/BNRustSimplifyStrToStr.cs create mode 100644 Function/BNSaveAutoSnapshot.cs create mode 100644 Function/BNSaveAutoSnapshotWithProgress.cs create mode 100644 Function/BNSaveLastRun.cs create mode 100644 Function/BNSaveToFile.cs create mode 100644 Function/BNSaveToFilename.cs create mode 100644 Function/BNScriptingInstanceCompleteInput.cs create mode 100644 Function/BNScriptingInstanceReleaseBinaryView.cs create mode 100644 Function/BNSearch.cs create mode 100644 Function/BNSecretsProviderHasData.cs create mode 100644 Function/BNSectionGetAlign.cs create mode 100644 Function/BNSectionGetEnd.cs create mode 100644 Function/BNSectionGetEntrySize.cs create mode 100644 Function/BNSectionGetInfoData.cs create mode 100644 Function/BNSectionGetInfoSection.cs create mode 100644 Function/BNSectionGetLength.cs create mode 100644 Function/BNSectionGetLinkedSection.cs create mode 100644 Function/BNSectionGetName.cs create mode 100644 Function/BNSectionGetSemantics.cs create mode 100644 Function/BNSectionGetStart.cs create mode 100644 Function/BNSectionGetType.cs create mode 100644 Function/BNSectionIsAutoDefined.cs create mode 100644 Function/BNSeekBinaryReader.cs create mode 100644 Function/BNSeekBinaryReaderRelative.cs create mode 100644 Function/BNSeekBinaryWriter.cs create mode 100644 Function/BNSeekBinaryWriterRelative.cs create mode 100644 Function/BNSeekLinearViewCursorToAddress.cs create mode 100644 Function/BNSeekLinearViewCursorToBegin.cs create mode 100644 Function/BNSeekLinearViewCursorToCursorPath.cs create mode 100644 Function/BNSeekLinearViewCursorToCursorPathAndAddress.cs create mode 100644 Function/BNSeekLinearViewCursorToEnd.cs create mode 100644 Function/BNSeekLinearViewCursorToOrderingIndex.cs create mode 100644 Function/BNSeekLinearViewCursorToPath.cs create mode 100644 Function/BNSeekLinearViewCursorToPathAndAddress.cs create mode 100644 Function/BNSegmentGetDataEnd.cs create mode 100644 Function/BNSegmentGetDataLength.cs create mode 100644 Function/BNSegmentGetDataOffset.cs create mode 100644 Function/BNSegmentGetEnd.cs create mode 100644 Function/BNSegmentGetFlags.cs create mode 100644 Function/BNSegmentGetLength.cs create mode 100644 Function/BNSegmentGetStart.cs create mode 100644 Function/BNSegmentIsAutoDefined.cs create mode 100644 Function/BNSerializeSettings.cs create mode 100644 Function/BNSetActiveUpdateChannel.cs create mode 100644 Function/BNSetAnalysisHold.cs create mode 100644 Function/BNSetArchitectureCdeclCallingConvention.cs create mode 100644 Function/BNSetArchitectureDefaultCallingConvention.cs create mode 100644 Function/BNSetArchitectureFastcallCallingConvention.cs create mode 100644 Function/BNSetArchitectureStdcallCallingConvention.cs create mode 100644 Function/BNSetAutoBasicBlockHighlight.cs create mode 100644 Function/BNSetAutoCallRegisterStackAdjustment.cs create mode 100644 Function/BNSetAutoCallRegisterStackAdjustmentForRegisterStack.cs create mode 100644 Function/BNSetAutoCallStackAdjustment.cs create mode 100644 Function/BNSetAutoCallTypeAdjustment.cs create mode 100644 Function/BNSetAutoFunctionCallingConvention.cs create mode 100644 Function/BNSetAutoFunctionCanReturn.cs create mode 100644 Function/BNSetAutoFunctionClobberedRegisters.cs create mode 100644 Function/BNSetAutoFunctionHasVariableArguments.cs create mode 100644 Function/BNSetAutoFunctionInlinedDuringAnalysis.cs create mode 100644 Function/BNSetAutoFunctionParameterVariables.cs create mode 100644 Function/BNSetAutoFunctionPure.cs create mode 100644 Function/BNSetAutoFunctionRegisterStackAdjustments.cs create mode 100644 Function/BNSetAutoFunctionReturnRegisters.cs create mode 100644 Function/BNSetAutoFunctionReturnType.cs create mode 100644 Function/BNSetAutoFunctionStackAdjustment.cs create mode 100644 Function/BNSetAutoIndirectBranches.cs create mode 100644 Function/BNSetAutoInstructionHighlight.cs create mode 100644 Function/BNSetAutoUpdatesEnabled.cs create mode 100644 Function/BNSetBackgroundTaskProgressText.cs create mode 100644 Function/BNSetBaseStructuresForStructureBuilder.cs create mode 100644 Function/BNSetBasicBlockEnd.cs create mode 100644 Function/BNSetBasicBlockList.cs create mode 100644 Function/BNSetBinaryReaderEndianness.cs create mode 100644 Function/BNSetBinaryReaderVirtualBase.cs create mode 100644 Function/BNSetBinaryWriterEndianness.cs create mode 100644 Function/BNSetBundledPluginDirectory.cs create mode 100644 Function/BNSetCommentForAddress.cs create mode 100644 Function/BNSetConditionInverted.cs create mode 100644 Function/BNSetCurrentPluginLoadOrder.cs create mode 100644 Function/BNSetDataBufferByte.cs create mode 100644 Function/BNSetDataBufferContents.cs create mode 100644 Function/BNSetDataBufferLength.cs create mode 100644 Function/BNSetDatabaseCurrentSnapshot.cs create mode 100644 Function/BNSetDebugInfo.cs create mode 100644 Function/BNSetDefaultArchitecture.cs create mode 100644 Function/BNSetDefaultPlatform.cs create mode 100644 Function/BNSetDisassemblyAddressBaseOffset.cs create mode 100644 Function/BNSetDisassemblyAddressMode.cs create mode 100644 Function/BNSetDisassemblyBlockLabels.cs create mode 100644 Function/BNSetDisassemblyCallParameterHints.cs create mode 100644 Function/BNSetDisassemblyGutterWidth.cs create mode 100644 Function/BNSetDisassemblyMaximumSymbolWidth.cs create mode 100644 Function/BNSetDisassemblySettingsOption.cs create mode 100644 Function/BNSetDisassemblyTextRendererArchitecture.cs create mode 100644 Function/BNSetDisassemblyTextRendererBasicBlock.cs create mode 100644 Function/BNSetDisassemblyTextRendererSettings.cs create mode 100644 Function/BNSetDisassemblyWidth.cs create mode 100644 Function/BNSetEarlyReturn.cs create mode 100644 Function/BNSetEnterpriseServerUrl.cs create mode 100644 Function/BNSetErrorForDownloadInstance.cs create mode 100644 Function/BNSetExprFolding.cs create mode 100644 Function/BNSetFieldResolutionForVariableAt.cs create mode 100644 Function/BNSetFileMetadataNavigationHandler.cs create mode 100644 Function/BNSetFilename.cs create mode 100644 Function/BNSetFlowGraphBasicBlock.cs create mode 100644 Function/BNSetFlowGraphHighLevelILFunction.cs create mode 100644 Function/BNSetFlowGraphLowLevelILFunction.cs create mode 100644 Function/BNSetFlowGraphMediumLevelILFunction.cs create mode 100644 Function/BNSetFlowGraphNodeHighlight.cs create mode 100644 Function/BNSetFlowGraphNodeLines.cs create mode 100644 Function/BNSetFlowGraphNodeMargins.cs create mode 100644 Function/BNSetFlowGraphOption.cs create mode 100644 Function/BNSetFunctionAnalysisSkipOverride.cs create mode 100644 Function/BNSetFunctionAnalysisUpdateDisabled.cs create mode 100644 Function/BNSetFunctionAutoType.cs create mode 100644 Function/BNSetFunctionComment.cs create mode 100644 Function/BNSetFunctionForFlowGraph.cs create mode 100644 Function/BNSetFunctionTypeBuilderCanReturn.cs create mode 100644 Function/BNSetFunctionTypeBuilderParameters.cs create mode 100644 Function/BNSetFunctionUserType.cs create mode 100644 Function/BNSetFunctionVariableDeadStoreElimination.cs create mode 100644 Function/BNSetGlobalCommentForAddress.cs create mode 100644 Function/BNSetGuidedSourceBlocks.cs create mode 100644 Function/BNSetHighLevelILExprAttributes.cs create mode 100644 Function/BNSetHighLevelILExprType.cs create mode 100644 Function/BNSetHighLevelILFunction.cs create mode 100644 Function/BNSetHighLevelILRootExpr.cs create mode 100644 Function/BNSetIntegerConstantDisplayType.cs create mode 100644 Function/BNSetIntegerTypeDisplayType.cs create mode 100644 Function/BNSetKeyValueStoreBuffer.cs create mode 100644 Function/BNSetKeyValueStoreValue.cs create mode 100644 Function/BNSetLicense.cs create mode 100644 Function/BNSetLiftedILFunction.cs create mode 100644 Function/BNSetLogicalMemoryMapEnabled.cs create mode 100644 Function/BNSetLowLevelILExprAttributes.cs create mode 100644 Function/BNSetLowLevelILFunction.cs create mode 100644 Function/BNSetMaxFunctionSizeForAnalysis.cs create mode 100644 Function/BNSetMediumLevelILExprAttributes.cs create mode 100644 Function/BNSetMediumLevelILExprType.cs create mode 100644 Function/BNSetMediumLevelILFunction.cs create mode 100644 Function/BNSetMemoryRegionEnabled.cs create mode 100644 Function/BNSetMemoryRegionFill.cs create mode 100644 Function/BNSetMemoryRegionFlags.cs create mode 100644 Function/BNSetMemoryRegionRebaseable.cs create mode 100644 Function/BNSetNamedTypeReferenceBuilderName.cs create mode 100644 Function/BNSetNamedTypeReferenceBuilderTypeClass.cs create mode 100644 Function/BNSetNamedTypeReferenceBuilderTypeId.cs create mode 100644 Function/BNSetNewAutoFunctionAnalysisSuppressed.cs create mode 100644 Function/BNSetOriginalFilename.cs create mode 100644 Function/BNSetOriginalImageBase.cs create mode 100644 Function/BNSetParametersForAnalysis.cs create mode 100644 Function/BNSetPlatformSystemCallConvention.cs create mode 100644 Function/BNSetProjectFile.cs create mode 100644 Function/BNSetSaveSettingsName.cs create mode 100644 Function/BNSetSaveSettingsOption.cs create mode 100644 Function/BNSetScriptingInstanceCurrentAddress.cs create mode 100644 Function/BNSetScriptingInstanceCurrentBasicBlock.cs create mode 100644 Function/BNSetScriptingInstanceCurrentBinaryView.cs create mode 100644 Function/BNSetScriptingInstanceCurrentFunction.cs create mode 100644 Function/BNSetScriptingInstanceCurrentSelection.cs create mode 100644 Function/BNSetScriptingInstanceDelimiters.cs create mode 100644 Function/BNSetSnapshotName.cs create mode 100644 Function/BNSetStructureBuilderAlignment.cs create mode 100644 Function/BNSetStructureBuilderPacked.cs create mode 100644 Function/BNSetStructureBuilderPointerOffset.cs create mode 100644 Function/BNSetStructureBuilderPropagatesDataVariableReferences.cs create mode 100644 Function/BNSetStructureBuilderType.cs create mode 100644 Function/BNSetStructureBuilderWidth.cs create mode 100644 Function/BNSetSwitchRecovery.cs create mode 100644 Function/BNSetThreadName.cs create mode 100644 Function/BNSetTypeArchiveCurrentSnapshot.cs create mode 100644 Function/BNSetTypeBuilderAttribute.cs create mode 100644 Function/BNSetTypeBuilderAttributeList.cs create mode 100644 Function/BNSetTypeBuilderHasTemplateArguments.cs create mode 100644 Function/BNSetTypeBuilderNameType.cs create mode 100644 Function/BNSetTypeBuilderNamedTypeReference.cs create mode 100644 Function/BNSetTypeBuilderOffset.cs create mode 100644 Function/BNSetTypeBuilderPointerBase.cs create mode 100644 Function/BNSetTypeBuilderPointerSuffix.cs create mode 100644 Function/BNSetTypeBuilderPure.cs create mode 100644 Function/BNSetTypeLibraryDependencyName.cs create mode 100644 Function/BNSetTypeLibraryGuid.cs create mode 100644 Function/BNSetTypeLibraryName.cs create mode 100644 Function/BNSetUserBasicBlockHighlight.cs create mode 100644 Function/BNSetUserCallRegisterStackAdjustment.cs create mode 100644 Function/BNSetUserCallRegisterStackAdjustmentForRegisterStack.cs create mode 100644 Function/BNSetUserCallStackAdjustment.cs create mode 100644 Function/BNSetUserCallTypeAdjustment.cs create mode 100644 Function/BNSetUserFunctionCallingConvention.cs create mode 100644 Function/BNSetUserFunctionCanReturn.cs create mode 100644 Function/BNSetUserFunctionClobberedRegisters.cs create mode 100644 Function/BNSetUserFunctionHasVariableArguments.cs create mode 100644 Function/BNSetUserFunctionInlinedDuringAnalysis.cs create mode 100644 Function/BNSetUserFunctionParameterVariables.cs create mode 100644 Function/BNSetUserFunctionPure.cs create mode 100644 Function/BNSetUserFunctionRegisterStackAdjustments.cs create mode 100644 Function/BNSetUserFunctionReturnRegisters.cs create mode 100644 Function/BNSetUserFunctionReturnType.cs create mode 100644 Function/BNSetUserFunctionStackAdjustment.cs create mode 100644 Function/BNSetUserGlobalPointerValue.cs create mode 100644 Function/BNSetUserGotoLabelName.cs create mode 100644 Function/BNSetUserIndirectBranches.cs create mode 100644 Function/BNSetUserInstructionHighlight.cs create mode 100644 Function/BNSetUserVariableValue.cs create mode 100644 Function/BNSetViewForFlowGraph.cs create mode 100644 Function/BNSetVirtualPath.cs create mode 100644 Function/BNSetWorkerThreadCount.cs create mode 100644 Function/BNSettingsContains.cs create mode 100644 Function/BNSettingsDeserializeSchema.cs create mode 100644 Function/BNSettingsGetBool.cs create mode 100644 Function/BNSettingsGetDouble.cs create mode 100644 Function/BNSettingsGetInt64.cs create mode 100644 Function/BNSettingsGetJson.cs create mode 100644 Function/BNSettingsGetString.cs create mode 100644 Function/BNSettingsGetStringList.cs create mode 100644 Function/BNSettingsGetUInt64.cs create mode 100644 Function/BNSettingsIsEmpty.cs create mode 100644 Function/BNSettingsKeysList.cs create mode 100644 Function/BNSettingsQueryPropertyString.cs create mode 100644 Function/BNSettingsQueryPropertyStringList.cs create mode 100644 Function/BNSettingsRegisterGroup.cs create mode 100644 Function/BNSettingsRegisterSetting.cs create mode 100644 Function/BNSettingsReset.cs create mode 100644 Function/BNSettingsResetAll.cs create mode 100644 Function/BNSettingsSerializeSchema.cs create mode 100644 Function/BNSettingsSetBool.cs create mode 100644 Function/BNSettingsSetDouble.cs create mode 100644 Function/BNSettingsSetInt64.cs create mode 100644 Function/BNSettingsSetJson.cs create mode 100644 Function/BNSettingsSetResourceId.cs create mode 100644 Function/BNSettingsSetString.cs create mode 100644 Function/BNSettingsSetStringList.cs create mode 100644 Function/BNSettingsSetUInt64.cs create mode 100644 Function/BNSettingsUpdateBoolProperty.cs create mode 100644 Function/BNSettingsUpdateDoubleProperty.cs create mode 100644 Function/BNSettingsUpdateInt64Property.cs create mode 100644 Function/BNSettingsUpdateProperty.cs create mode 100644 Function/BNSettingsUpdateStringListProperty.cs create mode 100644 Function/BNSettingsUpdateStringProperty.cs create mode 100644 Function/BNSettingsUpdateUInt64Property.cs create mode 100644 Function/BNShouldSkipTargetAnalysis.cs create mode 100644 Function/BNShowGraphReport.cs create mode 100644 Function/BNShowHTMLReport.cs create mode 100644 Function/BNShowMarkdownReport.cs create mode 100644 Function/BNShowMessageBox.cs create mode 100644 Function/BNShowPlainTextReport.cs create mode 100644 Function/BNShowReportCollection.cs create mode 100644 Function/BNShowWorkflowReportForBinaryView.cs create mode 100644 Function/BNShowWorkflowReportForFunction.cs create mode 100644 Function/BNShutdown.cs create mode 100644 Function/BNSignExtend.cs create mode 100644 Function/BNSkipAndReturnValue.cs create mode 100644 Function/BNSnapshotHasAncestor.cs create mode 100644 Function/BNSnapshotHasContents.cs create mode 100644 Function/BNSnapshotHasData.cs create mode 100644 Function/BNSnapshotHasUndo.cs create mode 100644 Function/BNSnapshotStoreData.cs create mode 100644 Function/BNSplitVariable.cs create mode 100644 Function/BNStartFlowGraphLayout.cs create mode 100644 Function/BNStopScriptingInstance.cs create mode 100644 Function/BNStoreSecretsProviderData.cs create mode 100644 Function/BNStringifyUnicodeData.cs create mode 100644 Function/BNStructureBuilderPropagatesDataVariableReferences.cs create mode 100644 Function/BNStructurePropagatesDataVariableReferences.cs create mode 100644 Function/BNStructureWithReplacedEnumeration.cs create mode 100644 Function/BNStructureWithReplacedNamedTypeReference.cs create mode 100644 Function/BNStructureWithReplacedStructure.cs create mode 100644 Function/BNTagGetData.cs create mode 100644 Function/BNTagGetId.cs create mode 100644 Function/BNTagGetType.cs create mode 100644 Function/BNTagSetData.cs create mode 100644 Function/BNTagTypeGetIcon.cs create mode 100644 Function/BNTagTypeGetId.cs create mode 100644 Function/BNTagTypeGetName.cs create mode 100644 Function/BNTagTypeGetType.cs create mode 100644 Function/BNTagTypeGetView.cs create mode 100644 Function/BNTagTypeGetVisible.cs create mode 100644 Function/BNTagTypeSetIcon.cs create mode 100644 Function/BNTagTypeSetName.cs create mode 100644 Function/BNTagTypeSetType.cs create mode 100644 Function/BNTagTypeSetVisible.cs create mode 100644 Function/BNToVariableIdentifier.cs create mode 100644 Function/BNTransformContextClearTransformParameter.cs create mode 100644 Function/BNTransformContextGetAvailableFiles.cs create mode 100644 Function/BNTransformContextGetChild.cs create mode 100644 Function/BNTransformContextGetChildCount.cs create mode 100644 Function/BNTransformContextGetChildren.cs create mode 100644 Function/BNTransformContextGetExtractionMessage.cs create mode 100644 Function/BNTransformContextGetExtractionResult.cs create mode 100644 Function/BNTransformContextGetFileName.cs create mode 100644 Function/BNTransformContextGetInput.cs create mode 100644 Function/BNTransformContextGetMetadata.cs create mode 100644 Function/BNTransformContextGetParent.cs create mode 100644 Function/BNTransformContextGetRequestedFiles.cs create mode 100644 Function/BNTransformContextGetTransformName.cs create mode 100644 Function/BNTransformContextGetTransformResult.cs create mode 100644 Function/BNTransformContextHasAvailableFiles.cs create mode 100644 Function/BNTransformContextHasRequestedFiles.cs create mode 100644 Function/BNTransformContextHasTransformParameter.cs create mode 100644 Function/BNTransformContextIsDatabase.cs create mode 100644 Function/BNTransformContextIsLeaf.cs create mode 100644 Function/BNTransformContextIsRoot.cs create mode 100644 Function/BNTransformContextSetAvailableFiles.cs create mode 100644 Function/BNTransformContextSetChild.cs create mode 100644 Function/BNTransformContextSetRequestedFiles.cs create mode 100644 Function/BNTransformContextSetTransformParameter.cs create mode 100644 Function/BNTransformContextSetTransformParameters.cs create mode 100644 Function/BNTransformSessionGetAvailableFileChoices.cs create mode 100644 Function/BNTransformSessionGetCurrentContext.cs create mode 100644 Function/BNTransformSessionGetCurrentView.cs create mode 100644 Function/BNTransformSessionGetRootContext.cs create mode 100644 Function/BNTransformSessionGetSelectedContexts.cs create mode 100644 Function/BNTransformSessionHasAnyStages.cs create mode 100644 Function/BNTransformSessionHasMultipleFileChoices.cs create mode 100644 Function/BNTransformSessionHasSinglePath.cs create mode 100644 Function/BNTransformSessionProcess.cs create mode 100644 Function/BNTransformSessionProcessFrom.cs create mode 100644 Function/BNTransformSessionProcessWithUserInput.cs create mode 100644 Function/BNTransformSessionRequiresUserInput.cs create mode 100644 Function/BNTransformSessionSelectFiles.cs create mode 100644 Function/BNTransformSessionSetSelectedContexts.cs create mode 100644 Function/BNTransformSupportsContext.cs create mode 100644 Function/BNTransformSupportsDetection.cs create mode 100644 Function/BNTrimDatabaseSnapshot.cs create mode 100644 Function/BNTypeArchiveDeserializeSnapshot.cs create mode 100644 Function/BNTypeArchiveMergeConflictGetBaseSnapshotId.cs create mode 100644 Function/BNTypeArchiveMergeConflictGetFirstSnapshotId.cs create mode 100644 Function/BNTypeArchiveMergeConflictGetSecondSnapshotId.cs create mode 100644 Function/BNTypeArchiveMergeConflictGetTypeArchive.cs create mode 100644 Function/BNTypeArchiveMergeConflictGetTypeId.cs create mode 100644 Function/BNTypeArchiveMergeConflictSuccess.cs create mode 100644 Function/BNTypeArchiveMergeSnapshots.cs create mode 100644 Function/BNTypeArchiveNewSnapshotTransaction.cs create mode 100644 Function/BNTypeArchiveQueryMetadata.cs create mode 100644 Function/BNTypeArchiveRemoveMetadata.cs create mode 100644 Function/BNTypeArchiveSerializeSnapshot.cs create mode 100644 Function/BNTypeArchiveStoreMetadata.cs create mode 100644 Function/BNTypeBuilderGetPointerBaseOffset.cs create mode 100644 Function/BNTypeBuilderGetPointerBaseType.cs create mode 100644 Function/BNTypeBuilderGetReferenceType.cs create mode 100644 Function/BNTypeBuilderGetStructureName.cs create mode 100644 Function/BNTypeBuilderGetSystemCallNumber.cs create mode 100644 Function/BNTypeBuilderGetTypeName.cs create mode 100644 Function/BNTypeBuilderHasTemplateArguments.cs create mode 100644 Function/BNTypeBuilderHasVariableArguments.cs create mode 100644 Function/BNTypeBuilderIsSystemCall.cs create mode 100644 Function/BNTypeBuilderSetAlignment.cs create mode 100644 Function/BNTypeBuilderSetAlternateName.cs create mode 100644 Function/BNTypeBuilderSetCallingConvention.cs create mode 100644 Function/BNTypeBuilderSetCallingConventionName.cs create mode 100644 Function/BNTypeBuilderSetChildType.cs create mode 100644 Function/BNTypeBuilderSetConst.cs create mode 100644 Function/BNTypeBuilderSetSigned.cs create mode 100644 Function/BNTypeBuilderSetStackAdjustment.cs create mode 100644 Function/BNTypeBuilderSetSystemCallNumber.cs create mode 100644 Function/BNTypeBuilderSetTypeName.cs create mode 100644 Function/BNTypeBuilderSetVolatile.cs create mode 100644 Function/BNTypeBuilderSetWidth.cs create mode 100644 Function/BNTypeContainerAddTypes.cs create mode 100644 Function/BNTypeContainerDeleteType.cs create mode 100644 Function/BNTypeContainerGetId.cs create mode 100644 Function/BNTypeContainerGetName.cs create mode 100644 Function/BNTypeContainerGetPlatform.cs create mode 100644 Function/BNTypeContainerGetType.cs create mode 100644 Function/BNTypeContainerGetTypeById.cs create mode 100644 Function/BNTypeContainerGetTypeByName.cs create mode 100644 Function/BNTypeContainerGetTypeId.cs create mode 100644 Function/BNTypeContainerGetTypeIds.cs create mode 100644 Function/BNTypeContainerGetTypeName.cs create mode 100644 Function/BNTypeContainerGetTypeNames.cs create mode 100644 Function/BNTypeContainerGetTypeNamesAndIds.cs create mode 100644 Function/BNTypeContainerGetTypes.cs create mode 100644 Function/BNTypeContainerIsMutable.cs create mode 100644 Function/BNTypeContainerParseTypeString.cs create mode 100644 Function/BNTypeContainerParseTypesFromSource.cs create mode 100644 Function/BNTypeContainerRenameType.cs create mode 100644 Function/BNTypeGetNameType.cs create mode 100644 Function/BNTypeGetPointerBaseOffset.cs create mode 100644 Function/BNTypeGetPointerBaseType.cs create mode 100644 Function/BNTypeGetReferenceType.cs create mode 100644 Function/BNTypeGetStructureName.cs create mode 100644 Function/BNTypeGetSystemCallNumber.cs create mode 100644 Function/BNTypeGetTypeName.cs create mode 100644 Function/BNTypeHasTemplateArguments.cs create mode 100644 Function/BNTypeHasVariableArguments.cs create mode 100644 Function/BNTypeIsSystemCall.cs create mode 100644 Function/BNTypeLibraryDecompressToFile.cs create mode 100644 Function/BNTypeLibraryGetMetadata.cs create mode 100644 Function/BNTypeLibraryQueryMetadata.cs create mode 100644 Function/BNTypeLibraryRemoveMetadata.cs create mode 100644 Function/BNTypeLibraryStoreMetadata.cs create mode 100644 Function/BNTypeParserParseTypeString.cs create mode 100644 Function/BNTypeParserParseTypesFromSource.cs create mode 100644 Function/BNTypeParserPreprocessSource.cs create mode 100644 Function/BNTypePrinterDefaultPrintAllTypes.cs create mode 100644 Function/BNTypePrinterPrintAllTypes.cs create mode 100644 Function/BNTypeShouldDisplayReturnType.cs create mode 100644 Function/BNTypeWithReplacedEnumeration.cs create mode 100644 Function/BNTypeWithReplacedNamedTypeReference.cs create mode 100644 Function/BNTypeWithReplacedStructure.cs create mode 100644 Function/BNTypesEqual.cs create mode 100644 Function/BNTypesNotEqual.cs create mode 100644 Function/BNUndefineAnalysisType.cs create mode 100644 Function/BNUndefineAutoSymbol.cs create mode 100644 Function/BNUndefineDataVariable.cs create mode 100644 Function/BNUndefineUserAnalysisType.cs create mode 100644 Function/BNUndefineUserDataVariable.cs create mode 100644 Function/BNUndefineUserSymbol.cs create mode 100644 Function/BNUndo.cs create mode 100644 Function/BNUndoActionGetSummary.cs create mode 100644 Function/BNUndoActionGetSummaryText.cs create mode 100644 Function/BNUndoEntryGetActions.cs create mode 100644 Function/BNUndoEntryGetId.cs create mode 100644 Function/BNUndoEntryGetTimestamp.cs create mode 100644 Function/BNUnescapeTypeName.cs create mode 100644 Function/BNUnicodeGetBlockNames.cs create mode 100644 Function/BNUnicodeGetBlockRange.cs create mode 100644 Function/BNUnicodeGetBlockRanges.cs create mode 100644 Function/BNUnicodeGetBlocksForNames.cs create mode 100644 Function/BNUnicodeGetUTF8String.cs create mode 100644 Function/BNUnicodeToEscapedString.cs create mode 100644 Function/BNUnicodeUTF16ToUTF8.cs create mode 100644 Function/BNUnicodeUTF32ToUTF8.cs create mode 100644 Function/BNUnmergeVariables.cs create mode 100644 Function/BNUnregisterDataNotification.cs create mode 100644 Function/BNUnregisterDebugInfoParser.cs create mode 100644 Function/BNUnregisterEnterpriseServerNotification.cs create mode 100644 Function/BNUnregisterLogListener.cs create mode 100644 Function/BNUnregisterObjectDestructionCallbacks.cs create mode 100644 Function/BNUnregisterObjectRefDebugTrace.cs create mode 100644 Function/BNUnregisterProjectNotification.cs create mode 100644 Function/BNUnregisterScriptingInstanceOutputListener.cs create mode 100644 Function/BNUnregisterTypeArchiveNotification.cs create mode 100644 Function/BNUnregisterViewOfType.cs create mode 100644 Function/BNUnsplitVariable.cs create mode 100644 Function/BNUpdateAnalysis.cs create mode 100644 Function/BNUpdateAnalysisAndWait.cs create mode 100644 Function/BNUpdateEnterpriseServerLicense.cs create mode 100644 Function/BNUpdateFlowGraph.cs create mode 100644 Function/BNUpdateHighLevelILOperand.cs create mode 100644 Function/BNUpdateLogListeners.cs create mode 100644 Function/BNUpdateLowLevelILOperand.cs create mode 100644 Function/BNUpdateMediumLevelILOperand.cs create mode 100644 Function/BNUpdateReportFlowGraph.cs create mode 100644 Function/BNUpdateToLatestVersion.cs create mode 100644 Function/BNUpdateToVersion.cs create mode 100644 Function/BNUpdatesChecked.cs create mode 100644 Function/BNUserGlobalPointerValueSet.cs create mode 100644 Function/BNVersionLessThan.cs create mode 100644 Function/BNWaitForMainThreadAction.cs create mode 100644 Function/BNWasFunctionAutomaticallyDiscovered.cs create mode 100644 Function/BNWorkerEnqueue.cs create mode 100644 Function/BNWorkerEnqueueNamed.cs create mode 100644 Function/BNWorkerInteractiveEnqueue.cs create mode 100644 Function/BNWorkerInteractiveEnqueueNamed.cs create mode 100644 Function/BNWorkerPriorityEnqueue.cs create mode 100644 Function/BNWorkerPriorityEnqueueNamed.cs create mode 100644 Function/BNWorkflowAssignSubactivities.cs create mode 100644 Function/BNWorkflowClear.cs create mode 100644 Function/BNWorkflowClone.cs create mode 100644 Function/BNWorkflowContains.cs create mode 100644 Function/BNWorkflowGet.cs create mode 100644 Function/BNWorkflowGetActivity.cs create mode 100644 Function/BNWorkflowGetActivityRoots.cs create mode 100644 Function/BNWorkflowGetConfiguration.cs create mode 100644 Function/BNWorkflowGetEligibilitySettings.cs create mode 100644 Function/BNWorkflowGetGraph.cs create mode 100644 Function/BNWorkflowGetOrCreate.cs create mode 100644 Function/BNWorkflowGetSubactivities.cs create mode 100644 Function/BNWorkflowInsert.cs create mode 100644 Function/BNWorkflowInsertAfter.cs create mode 100644 Function/BNWorkflowIsRegistered.cs create mode 100644 Function/BNWorkflowRegisterActivity.cs create mode 100644 Function/BNWorkflowRemove.cs create mode 100644 Function/BNWorkflowReplace.cs create mode 100644 Function/BNWorkflowShowReport.cs create mode 100644 Function/BNWorkflowSize.cs create mode 100644 Function/BNWrite16.cs create mode 100644 Function/BNWrite32.cs create mode 100644 Function/BNWrite64.cs create mode 100644 Function/BNWrite8.cs create mode 100644 Function/BNWriteBE16.cs create mode 100644 Function/BNWriteBE32.cs create mode 100644 Function/BNWriteBE64.cs create mode 100644 Function/BNWriteData.cs create mode 100644 Function/BNWriteDataForDownloadInstance.cs create mode 100644 Function/BNWriteDatabaseAnalysisCache.cs create mode 100644 Function/BNWriteDatabaseGlobal.cs create mode 100644 Function/BNWriteDatabaseGlobalData.cs create mode 100644 Function/BNWriteDatabaseSnapshotData.cs create mode 100644 Function/BNWriteLE16.cs create mode 100644 Function/BNWriteLE32.cs create mode 100644 Function/BNWriteLE64.cs create mode 100644 Function/BNWriteTypeLibraryToFile.cs create mode 100644 Function/BNWriteViewBuffer.cs create mode 100644 Function/BNWriteViewData.cs create mode 100644 Function/BNWriteWebsocketClientData.cs create mode 100644 Function/BNXzDecompress.cs create mode 100644 Function/BNZeroExtend.cs create mode 100644 Function/BNZlibCompress.cs create mode 100644 Function/BNZlibDecompress.cs create mode 100644 Handle/BNActivity.cs create mode 100644 Handle/BNAnalysisCompletionEvent.cs create mode 100644 Handle/BNAnalysisContext.cs create mode 100644 Handle/BNAnalysisMergeConflict.cs create mode 100644 Handle/BNAnalysisMergeConflictSplitter.cs create mode 100644 Handle/BNArchitecture.cs create mode 100644 Handle/BNBackgroundTask.cs create mode 100644 Handle/BNBaseAddressDetection.cs create mode 100644 Handle/BNBasicBlock.cs create mode 100644 Handle/BNBinaryReader.cs create mode 100644 Handle/BNBinaryView.cs create mode 100644 Handle/BNBinaryViewType.cs create mode 100644 Handle/BNBinaryWriter.cs create mode 100644 Handle/BNCallingConvention.cs create mode 100644 Handle/BNCollaborationChangeset.cs create mode 100644 Handle/BNCollaborationGroup.cs create mode 100644 Handle/BNCollaborationLazyT.cs create mode 100644 Handle/BNCollaborationPermission.cs create mode 100644 Handle/BNCollaborationSnapshot.cs create mode 100644 Handle/BNCollaborationUndoEntry.cs create mode 100644 Handle/BNCollaborationUser.cs create mode 100644 Handle/BNComponent.cs create mode 100644 Handle/BNDataBuffer.cs create mode 100644 Handle/BNDataRenderer.cs create mode 100644 Handle/BNDataRendererContainer.cs create mode 100644 Handle/BNDatabase.cs create mode 100644 Handle/BNDebugInfo.cs create mode 100644 Handle/BNDebugInfoParser.cs create mode 100644 Handle/BNDemangler.cs create mode 100644 Handle/BNDisassemblySettings.cs create mode 100644 Handle/BNDisassemblyTextRenderer.cs create mode 100644 Handle/BNDownloadInstance.cs create mode 100644 Handle/BNDownloadProvider.cs create mode 100644 Handle/BNEnumeration.cs create mode 100644 Handle/BNEnumerationBuilder.cs create mode 100644 Handle/BNExternalLibrary.cs create mode 100644 Handle/BNExternalLocation.cs create mode 100644 Handle/BNFieldResolutionInfo.cs create mode 100644 Handle/BNFileMetadata.cs create mode 100644 Handle/BNFirmwareNinja.cs create mode 100644 Handle/BNFirmwareNinjaReferenceNode.cs create mode 100644 Handle/BNFirmwareNinjaRelationship.cs create mode 100644 Handle/BNFlowGraph.cs create mode 100644 Handle/BNFlowGraphLayout.cs create mode 100644 Handle/BNFlowGraphLayoutRequest.cs create mode 100644 Handle/BNFlowGraphNode.cs create mode 100644 Handle/BNFunction.cs create mode 100644 Handle/BNHighLevelILFunction.cs create mode 100644 Handle/BNHighLevelILTokenEmitter.cs create mode 100644 Handle/BNKeyValueStore.cs create mode 100644 Handle/BNLanguageRepresentationFunction.cs create mode 100644 Handle/BNLanguageRepresentationFunctionType.cs create mode 100644 Handle/BNLineFormatter.cs create mode 100644 Handle/BNLinearViewCursor.cs create mode 100644 Handle/BNLinearViewObject.cs create mode 100644 Handle/BNLogger.cs create mode 100644 Handle/BNLowLevelILFunction.cs create mode 100644 Handle/BNMainThreadAction.cs create mode 100644 Handle/BNMediumLevelILFunction.cs create mode 100644 Handle/BNMetadata.cs create mode 100644 Handle/BNNamedTypeReference.cs create mode 100644 Handle/BNNamedTypeReferenceBuilder.cs create mode 100644 Handle/BNPlatform.cs create mode 100644 Handle/BNProject.cs create mode 100644 Handle/BNProjectFile.cs create mode 100644 Handle/BNProjectFolder.cs create mode 100644 Handle/BNRelocation.cs create mode 100644 Handle/BNRelocationHandler.cs create mode 100644 Handle/BNRemote.cs create mode 100644 Handle/BNRemoteFile.cs create mode 100644 Handle/BNRemoteFolder.cs create mode 100644 Handle/BNRemoteProject.cs create mode 100644 Handle/BNRenderLayer.cs create mode 100644 Handle/BNRepoPlugin.cs create mode 100644 Handle/BNReportCollection.cs create mode 100644 Handle/BNRepository.cs create mode 100644 Handle/BNRepositoryManager.cs create mode 100644 Handle/BNSaveSettings.cs create mode 100644 Handle/BNScriptingInstance.cs create mode 100644 Handle/BNScriptingProvider.cs create mode 100644 Handle/BNSecretsProvider.cs create mode 100644 Handle/BNSection.cs create mode 100644 Handle/BNSegment.cs create mode 100644 Handle/BNSettings.cs create mode 100644 Handle/BNSnapshot.cs create mode 100644 Handle/BNStringRef.cs create mode 100644 Handle/BNStructure.cs create mode 100644 Handle/BNStructureBuilder.cs create mode 100644 Handle/BNSymbol.cs create mode 100644 Handle/BNSymbolQueue.cs create mode 100644 Handle/BNTag.cs create mode 100644 Handle/BNTagType.cs create mode 100644 Handle/BNTemporaryFile.cs create mode 100644 Handle/BNTransform.cs create mode 100644 Handle/BNTransformContext.cs create mode 100644 Handle/BNTransformSession.cs create mode 100644 Handle/BNType.cs create mode 100644 Handle/BNTypeArchive.cs create mode 100644 Handle/BNTypeArchiveMergeConflict.cs create mode 100644 Handle/BNTypeBuilder.cs create mode 100644 Handle/BNTypeContainer.cs create mode 100644 Handle/BNTypeLibrary.cs create mode 100644 Handle/BNTypeLibraryMapping.cs create mode 100644 Handle/BNTypeParser.cs create mode 100644 Handle/BNTypePrinter.cs create mode 100644 Handle/BNUndoAction.cs create mode 100644 Handle/BNUndoEntry.cs create mode 100644 Handle/BNUser.cs create mode 100644 Handle/BNWebsocketClient.cs create mode 100644 Handle/BNWebsocketProvider.cs create mode 100644 Handle/BNWorkflow.cs create mode 100644 HighLevelIL/AbstractHighLevelILBinaryInstruction.cs create mode 100644 HighLevelIL/AbstractHighLevelILCarryInstruction.cs create mode 100644 HighLevelIL/AbstractHighLevelILConstInstruction.cs create mode 100644 HighLevelIL/AbstractHighLevelILUnaryInstruction.cs create mode 100644 HighLevelIL/HLILAdd.cs create mode 100644 HighLevelIL/HLILAddCarry.cs create mode 100644 HighLevelIL/HLILAddOverflow.cs create mode 100644 HighLevelIL/HLILAddressOf.cs create mode 100644 HighLevelIL/HLILAnd.cs create mode 100644 HighLevelIL/HLILArrayIndex.cs create mode 100644 HighLevelIL/HLILArrayIndexSSA.cs create mode 100644 HighLevelIL/HLILAssert.cs create mode 100644 HighLevelIL/HLILAssertSSA.cs create mode 100644 HighLevelIL/HLILAssign.cs create mode 100644 HighLevelIL/HLILAssignMemorySSA.cs create mode 100644 HighLevelIL/HLILAssignUnpack.cs create mode 100644 HighLevelIL/HLILAssignUnpackMemorySSA.cs create mode 100644 HighLevelIL/HLILBlock.cs create mode 100644 HighLevelIL/HLILBoolToInt.cs create mode 100644 HighLevelIL/HLILBreak.cs create mode 100644 HighLevelIL/HLILBreakpoint.cs create mode 100644 HighLevelIL/HLILCall.cs create mode 100644 HighLevelIL/HLILCallSSA.cs create mode 100644 HighLevelIL/HLILCase.cs create mode 100644 HighLevelIL/HLILCeil.cs create mode 100644 HighLevelIL/HLILConst.cs create mode 100644 HighLevelIL/HLILConstData.cs create mode 100644 HighLevelIL/HLILConstPointer.cs create mode 100644 HighLevelIL/HLILContinue.cs create mode 100644 HighLevelIL/HLILDeref.cs create mode 100644 HighLevelIL/HLILDerefField.cs create mode 100644 HighLevelIL/HLILDerefFieldSSA.cs create mode 100644 HighLevelIL/HLILDerefSSA.cs create mode 100644 HighLevelIL/HLILDivSigned.cs create mode 100644 HighLevelIL/HLILDivSignedDoublePrecision.cs create mode 100644 HighLevelIL/HLILDivUnsigned.cs create mode 100644 HighLevelIL/HLILDivUnsignedDoublePrecision.cs create mode 100644 HighLevelIL/HLILDoWhile.cs create mode 100644 HighLevelIL/HLILDoWhileSSA.cs create mode 100644 HighLevelIL/HLILEqual.cs create mode 100644 HighLevelIL/HLILExternPointer.cs create mode 100644 HighLevelIL/HLILFloatAbs.cs create mode 100644 HighLevelIL/HLILFloatAdd.cs create mode 100644 HighLevelIL/HLILFloatCompareOrdered.cs create mode 100644 HighLevelIL/HLILFloatCompareUnordered.cs create mode 100644 HighLevelIL/HLILFloatConst.cs create mode 100644 HighLevelIL/HLILFloatConvert.cs create mode 100644 HighLevelIL/HLILFloatDiv.cs create mode 100644 HighLevelIL/HLILFloatEqual.cs create mode 100644 HighLevelIL/HLILFloatGreaterEqual.cs create mode 100644 HighLevelIL/HLILFloatGreaterThan.cs create mode 100644 HighLevelIL/HLILFloatLessEqual.cs create mode 100644 HighLevelIL/HLILFloatLessThan.cs create mode 100644 HighLevelIL/HLILFloatMul.cs create mode 100644 HighLevelIL/HLILFloatNeg.cs create mode 100644 HighLevelIL/HLILFloatNotEqual.cs create mode 100644 HighLevelIL/HLILFloatSquareRoot.cs create mode 100644 HighLevelIL/HLILFloatSub.cs create mode 100644 HighLevelIL/HLILFloatToInt.cs create mode 100644 HighLevelIL/HLILFloatTrunc.cs create mode 100644 HighLevelIL/HLILFloor.cs create mode 100644 HighLevelIL/HLILFor.cs create mode 100644 HighLevelIL/HLILForSSA.cs create mode 100644 HighLevelIL/HLILForceVersion.cs create mode 100644 HighLevelIL/HLILForceVersionSSA.cs create mode 100644 HighLevelIL/HLILGoto.cs create mode 100644 HighLevelIL/HLILIf.cs create mode 100644 HighLevelIL/HLILImport.cs create mode 100644 HighLevelIL/HLILIntToFloat.cs create mode 100644 HighLevelIL/HLILIntrinsic.cs create mode 100644 HighLevelIL/HLILIntrinsicSSA.cs create mode 100644 HighLevelIL/HLILJump.cs create mode 100644 HighLevelIL/HLILLabel.cs create mode 100644 HighLevelIL/HLILLogicalShiftLef.cs create mode 100644 HighLevelIL/HLILLogicalShiftRight.cs create mode 100644 HighLevelIL/HLILLowPart.cs create mode 100644 HighLevelIL/HLILMemoryPhi.cs create mode 100644 HighLevelIL/HLILModSignedDoublePrecision.cs create mode 100644 HighLevelIL/HLILModUnsigned.cs create mode 100644 HighLevelIL/HLILModUnsignedDoublePrecision.cs create mode 100644 HighLevelIL/HLILMul.cs create mode 100644 HighLevelIL/HLILMulSignedDoublePrecision.cs create mode 100644 HighLevelIL/HLILMulUnsignedDoublePrecision.cs create mode 100644 HighLevelIL/HLILNeg.cs create mode 100644 HighLevelIL/HLILNoReturn.cs create mode 100644 HighLevelIL/HLILNop.cs create mode 100644 HighLevelIL/HLILNot.cs create mode 100644 HighLevelIL/HLILNotEqual.cs create mode 100644 HighLevelIL/HLILOr.cs create mode 100644 HighLevelIL/HLILReturn.cs create mode 100644 HighLevelIL/HLILRotateLeft.cs create mode 100644 HighLevelIL/HLILRotateLeftCarry.cs create mode 100644 HighLevelIL/HLILRotateRight.cs create mode 100644 HighLevelIL/HLILRotateRightCarry.cs create mode 100644 HighLevelIL/HLILRoundToInt.cs create mode 100644 HighLevelIL/HLILSignExtend.cs create mode 100644 HighLevelIL/HLILSignedGreaterEqual.cs create mode 100644 HighLevelIL/HLILSignedGreaterThan.cs create mode 100644 HighLevelIL/HLILSignedLessEqual.cs create mode 100644 HighLevelIL/HLILSignedLessThan.cs create mode 100644 HighLevelIL/HLILSplit.cs create mode 100644 HighLevelIL/HLILStructField.cs create mode 100644 HighLevelIL/HLILSub.cs create mode 100644 HighLevelIL/HLILSubBorrow.cs create mode 100644 HighLevelIL/HLILSwitch.cs create mode 100644 HighLevelIL/HLILSysCall.cs create mode 100644 HighLevelIL/HLILSysCallSSA.cs create mode 100644 HighLevelIL/HLILTailCall.cs create mode 100644 HighLevelIL/HLILTestBit.cs create mode 100644 HighLevelIL/HLILTrap.cs create mode 100644 HighLevelIL/HLILUndefined.cs create mode 100644 HighLevelIL/HLILUnimplemented.cs create mode 100644 HighLevelIL/HLILUnimplementedMemory.cs create mode 100644 HighLevelIL/HLILUnreachable.cs create mode 100644 HighLevelIL/HLILUnsignedGreaterEqual.cs create mode 100644 HighLevelIL/HLILUnsignedGreaterThan.cs create mode 100644 HighLevelIL/HLILUnsignedLessEqual.cs create mode 100644 HighLevelIL/HLILUnsignedLessThan.cs create mode 100644 HighLevelIL/HLILVariable.cs create mode 100644 HighLevelIL/HLILVariableDeclare.cs create mode 100644 HighLevelIL/HLILVariableInit.cs create mode 100644 HighLevelIL/HLILVariableInitSSA.cs create mode 100644 HighLevelIL/HLILVariablePhi.cs create mode 100644 HighLevelIL/HLILVariableSSA.cs create mode 100644 HighLevelIL/HLILWhile.cs create mode 100644 HighLevelIL/HLILWhileSSA.cs create mode 100644 HighLevelIL/HLILXor.cs create mode 100644 HighLevelIL/HLILZeroExtend.cs create mode 100644 HighLevelIL/HighLevelILBasicBlock.cs create mode 100644 HighLevelIL/HighLevelILBasicBlockEdge.cs create mode 100644 HighLevelIL/HighLevelILFlowGraph.cs create mode 100644 HighLevelIL/HighLevelILFlowGraphEdge.cs create mode 100644 HighLevelIL/HighLevelILFlowGraphLayoutRequest.cs create mode 100644 HighLevelIL/HighLevelILFlowGraphNode.cs create mode 100644 HighLevelIL/HighLevelILLabel.cs create mode 100644 HighLevelIL/HighLevelILSSAVariable.cs create mode 100644 HighLevelIL/HighLevelILVariable.cs create mode 100644 HighLevelIL/HlilArithmeticShiftRight.cs create mode 100644 HighLevelIL/HlilModSigned.cs create mode 100644 IL/AbstractSSAVariable.cs create mode 100644 IL/Alias.cs create mode 100644 IL/FlagOrRegister.cs create mode 100644 IL/ILFlag.cs create mode 100644 IL/ILLabel.cs create mode 100644 IL/ILRegister.cs create mode 100644 IL/Intrinsic.cs create mode 100644 IL/RegisterStack.cs create mode 100644 IL/SSAFlagOrRegister.cs create mode 100644 IL/SSARegisterStack.cs create mode 100644 IL/SemanticFlagClass.cs create mode 100644 IL/SemanticFlagGroup.cs create mode 100644 IL/SourceLocation.cs create mode 100644 IL/Variable.cs create mode 100644 LibraryResolver.cs create mode 100644 LowLevelIL/LLILAdd.cs create mode 100644 LowLevelIL/LLILAddCarry.cs create mode 100644 LowLevelIL/LLILAddOverflow.cs create mode 100644 LowLevelIL/LLILAnd.cs create mode 100644 LowLevelIL/LLILArithmeticShiftRight.cs create mode 100644 LowLevelIL/LLILAssert.cs create mode 100644 LowLevelIL/LLILAssertSSA.cs create mode 100644 LowLevelIL/LLILBoolToInt.cs create mode 100644 LowLevelIL/LLILBreakpoint.cs create mode 100644 LowLevelIL/LLILCall.cs create mode 100644 LowLevelIL/LLILCallOutputSSA.cs create mode 100644 LowLevelIL/LLILCallParameter.cs create mode 100644 LowLevelIL/LLILCallSSA.cs create mode 100644 LowLevelIL/LLILCallStackAdjust.cs create mode 100644 LowLevelIL/LLILCallStackSSA.cs create mode 100644 LowLevelIL/LLILCeil.cs create mode 100644 LowLevelIL/LLILConst.cs create mode 100644 LowLevelIL/LLILConstPointer.cs create mode 100644 LowLevelIL/LLILDivSigned.cs create mode 100644 LowLevelIL/LLILDivSignedDoublePrecision.cs create mode 100644 LowLevelIL/LLILDivUnsigned.cs create mode 100644 LowLevelIL/LLILDivUnsignedDoublePrecision.cs create mode 100644 LowLevelIL/LLILEqual.cs create mode 100644 LowLevelIL/LLILExternPointer.cs create mode 100644 LowLevelIL/LLILFlag.cs create mode 100644 LowLevelIL/LLILFlagBit.cs create mode 100644 LowLevelIL/LLILFlagBitSSA.cs create mode 100644 LowLevelIL/LLILFlagCond.cs create mode 100644 LowLevelIL/LLILFlagGroup.cs create mode 100644 LowLevelIL/LLILFlagPhi.cs create mode 100644 LowLevelIL/LLILFlagSSA.cs create mode 100644 LowLevelIL/LLILFloatAbs.cs create mode 100644 LowLevelIL/LLILFloatAdd.cs create mode 100644 LowLevelIL/LLILFloatCompareOrdered.cs create mode 100644 LowLevelIL/LLILFloatCompareUnordered.cs create mode 100644 LowLevelIL/LLILFloatConst.cs create mode 100644 LowLevelIL/LLILFloatConvert.cs create mode 100644 LowLevelIL/LLILFloatDiv.cs create mode 100644 LowLevelIL/LLILFloatEqual.cs create mode 100644 LowLevelIL/LLILFloatGreaterEqual.cs create mode 100644 LowLevelIL/LLILFloatGreaterThan.cs create mode 100644 LowLevelIL/LLILFloatLessEqual.cs create mode 100644 LowLevelIL/LLILFloatLessThan.cs create mode 100644 LowLevelIL/LLILFloatMul.cs create mode 100644 LowLevelIL/LLILFloatNeg.cs create mode 100644 LowLevelIL/LLILFloatNotEqual.cs create mode 100644 LowLevelIL/LLILFloatSquareRoot.cs create mode 100644 LowLevelIL/LLILFloatSub.cs create mode 100644 LowLevelIL/LLILFloatToInt.cs create mode 100644 LowLevelIL/LLILFloatTrunc.cs create mode 100644 LowLevelIL/LLILFloor.cs create mode 100644 LowLevelIL/LLILForceVersion.cs create mode 100644 LowLevelIL/LLILForceVersionSSA.cs create mode 100644 LowLevelIL/LLILGoto.cs create mode 100644 LowLevelIL/LLILIf.cs create mode 100644 LowLevelIL/LLILIntToFloat.cs create mode 100644 LowLevelIL/LLILIntrinsic.cs create mode 100644 LowLevelIL/LLILIntrinsicSSA.cs create mode 100644 LowLevelIL/LLILJump.cs create mode 100644 LowLevelIL/LLILJumpTo.cs create mode 100644 LowLevelIL/LLILLoad.cs create mode 100644 LowLevelIL/LLILLoadSSA.cs create mode 100644 LowLevelIL/LLILLogicalShiftLeft.cs create mode 100644 LowLevelIL/LLILLogicalShiftRight.cs create mode 100644 LowLevelIL/LLILLowPart.cs create mode 100644 LowLevelIL/LLILMemoryIntrinsicOutputSSA.cs create mode 100644 LowLevelIL/LLILMemoryIntrinsicSSA.cs create mode 100644 LowLevelIL/LLILMemoryPhi.cs create mode 100644 LowLevelIL/LLILModSigned.cs create mode 100644 LowLevelIL/LLILModSignedDoublePrecision.cs create mode 100644 LowLevelIL/LLILModUnsigned.cs create mode 100644 LowLevelIL/LLILModUnsignedDoublePrecision.cs create mode 100644 LowLevelIL/LLILMul.cs create mode 100644 LowLevelIL/LLILMulSignedDoublePrecision.cs create mode 100644 LowLevelIL/LLILMulUnsignedDoublePrecision.cs create mode 100644 LowLevelIL/LLILNeg.cs create mode 100644 LowLevelIL/LLILNoReturn.cs create mode 100644 LowLevelIL/LLILNop.cs create mode 100644 LowLevelIL/LLILNot.cs create mode 100644 LowLevelIL/LLILNotEqual.cs create mode 100644 LowLevelIL/LLILOr.cs create mode 100644 LowLevelIL/LLILPop.cs create mode 100644 LowLevelIL/LLILPush.cs create mode 100644 LowLevelIL/LLILRegister.cs create mode 100644 LowLevelIL/LLILRegisterPhi.cs create mode 100644 LowLevelIL/LLILRegisterSSA.cs create mode 100644 LowLevelIL/LLILRegisterSSAPartial.cs create mode 100644 LowLevelIL/LLILRegisterSplit.cs create mode 100644 LowLevelIL/LLILRegisterSplitDestinationSSA.cs create mode 100644 LowLevelIL/LLILRegisterSplitSSA.cs create mode 100644 LowLevelIL/LLILRegisterStackAbsSSA.cs create mode 100644 LowLevelIL/LLILRegisterStackDestinationSSA.cs create mode 100644 LowLevelIL/LLILRegisterStackFreeAbsSSA.cs create mode 100644 LowLevelIL/LLILRegisterStackFreeRegister.cs create mode 100644 LowLevelIL/LLILRegisterStackFreeRel.cs create mode 100644 LowLevelIL/LLILRegisterStackFreeRelativeSSA.cs create mode 100644 LowLevelIL/LLILRegisterStackPhi.cs create mode 100644 LowLevelIL/LLILRegisterStackPop.cs create mode 100644 LowLevelIL/LLILRegisterStackPush.cs create mode 100644 LowLevelIL/LLILRegisterStackRelative.cs create mode 100644 LowLevelIL/LLILRegisterStackRelativeSSA.cs create mode 100644 LowLevelIL/LLILReturn.cs create mode 100644 LowLevelIL/LLILRotateLeft.cs create mode 100644 LowLevelIL/LLILRotateLeftCarry.cs create mode 100644 LowLevelIL/LLILRotateRight.cs create mode 100644 LowLevelIL/LLILRotateRightCarry.cs create mode 100644 LowLevelIL/LLILRoundToInt.cs create mode 100644 LowLevelIL/LLILSeparateParamListSSA.cs create mode 100644 LowLevelIL/LLILSetFlag.cs create mode 100644 LowLevelIL/LLILSetFlagSSA.cs create mode 100644 LowLevelIL/LLILSetRegister.cs create mode 100644 LowLevelIL/LLILSetRegisterSSA.cs create mode 100644 LowLevelIL/LLILSetRegisterSSAPartial.cs create mode 100644 LowLevelIL/LLILSetRegisterSplit.cs create mode 100644 LowLevelIL/LLILSetRegisterSplitSSA.cs create mode 100644 LowLevelIL/LLILSetRegisterStackAbsSSA.cs create mode 100644 LowLevelIL/LLILSetRegisterStackRel.cs create mode 100644 LowLevelIL/LLILSetRegisterStackRelativeSSA.cs create mode 100644 LowLevelIL/LLILSharedParamSlotSSA.cs create mode 100644 LowLevelIL/LLILSignExtend.cs create mode 100644 LowLevelIL/LLILSignedGreaterEqual.cs create mode 100644 LowLevelIL/LLILSignedGreaterThan.cs create mode 100644 LowLevelIL/LLILSignedLessEqual.cs create mode 100644 LowLevelIL/LLILSignedLessThan.cs create mode 100644 LowLevelIL/LLILStore.cs create mode 100644 LowLevelIL/LLILStoreSSA.cs create mode 100644 LowLevelIL/LLILSub.cs create mode 100644 LowLevelIL/LLILSubBorrow.cs create mode 100644 LowLevelIL/LLILSysCall.cs create mode 100644 LowLevelIL/LLILSysCallSSA.cs create mode 100644 LowLevelIL/LLILTailCall.cs create mode 100644 LowLevelIL/LLILTailCallSSA.cs create mode 100644 LowLevelIL/LLILTestBit.cs create mode 100644 LowLevelIL/LLILTrap.cs create mode 100644 LowLevelIL/LLILUndefined.cs create mode 100644 LowLevelIL/LLILUnimplemented.cs create mode 100644 LowLevelIL/LLILUnimplementedMemory.cs create mode 100644 LowLevelIL/LLILUnsignedGreaterEqual.cs create mode 100644 LowLevelIL/LLILUnsignedGreaterThan.cs create mode 100644 LowLevelIL/LLILUnsignedLessEqual.cs create mode 100644 LowLevelIL/LLILUnsignedLessThan.cs create mode 100644 LowLevelIL/LLILXor.cs create mode 100644 LowLevelIL/LLILZeroExtend.cs create mode 100644 LowLevelIL/LowLevelILBasicBlock.cs create mode 100644 LowLevelIL/LowLevelILBasicBlockEdge.cs create mode 100644 LowLevelIL/LowLevelILFlag.cs create mode 100644 LowLevelIL/LowLevelILFlowGraph.cs create mode 100644 LowLevelIL/LowLevelILFlowGraphEdge.cs create mode 100644 LowLevelIL/LowLevelILFlowGraphNode.cs create mode 100644 LowLevelIL/LowLevelILSSAFlag.cs create mode 100644 LowLevelIL/LowLevelILSSARegister.cs create mode 100644 LowLevelIL/LowLevelILSSAVariable.cs create mode 100644 LowLevelIL/LowLevelILVariable.cs create mode 100644 MediumLevelIL/MLILAdd.cs create mode 100644 MediumLevelIL/MLILAddCarry.cs create mode 100644 MediumLevelIL/MLILAddOverflow.cs create mode 100644 MediumLevelIL/MLILAddressOf.cs create mode 100644 MediumLevelIL/MLILAddressOfField.cs create mode 100644 MediumLevelIL/MLILAnd.cs create mode 100644 MediumLevelIL/MLILArithmeticShiftRight.cs create mode 100644 MediumLevelIL/MLILAssert.cs create mode 100644 MediumLevelIL/MLILAssertSSA.cs create mode 100644 MediumLevelIL/MLILBoolToInt.cs create mode 100644 MediumLevelIL/MLILBreakpoint.cs create mode 100644 MediumLevelIL/MLILCall.cs create mode 100644 MediumLevelIL/MLILCallOutput.cs create mode 100644 MediumLevelIL/MLILCallOutputSSA.cs create mode 100644 MediumLevelIL/MLILCallParam.cs create mode 100644 MediumLevelIL/MLILCallParamSSA.cs create mode 100644 MediumLevelIL/MLILCallSSA.cs create mode 100644 MediumLevelIL/MLILCallUntyped.cs create mode 100644 MediumLevelIL/MLILCallUntypedSSA.cs create mode 100644 MediumLevelIL/MLILCeil.cs create mode 100644 MediumLevelIL/MLILConst.cs create mode 100644 MediumLevelIL/MLILConstData.cs create mode 100644 MediumLevelIL/MLILConstPointer.cs create mode 100644 MediumLevelIL/MLILDivSigned.cs create mode 100644 MediumLevelIL/MLILDivSignedDoublePrecision.cs create mode 100644 MediumLevelIL/MLILDivUnsigned.cs create mode 100644 MediumLevelIL/MLILDivUnsignedDoublePrecision.cs create mode 100644 MediumLevelIL/MLILEqual.cs create mode 100644 MediumLevelIL/MLILExternPointer.cs create mode 100644 MediumLevelIL/MLILFloatAbs.cs create mode 100644 MediumLevelIL/MLILFloatAdd.cs create mode 100644 MediumLevelIL/MLILFloatCompareOrdered.cs create mode 100644 MediumLevelIL/MLILFloatCompareUnordered.cs create mode 100644 MediumLevelIL/MLILFloatConst.cs create mode 100644 MediumLevelIL/MLILFloatConvert.cs create mode 100644 MediumLevelIL/MLILFloatDiv.cs create mode 100644 MediumLevelIL/MLILFloatEqual.cs create mode 100644 MediumLevelIL/MLILFloatGreaterOrEqual.cs create mode 100644 MediumLevelIL/MLILFloatGreaterThan.cs create mode 100644 MediumLevelIL/MLILFloatLessThan.cs create mode 100644 MediumLevelIL/MLILFloatLessThanOrEqual.cs create mode 100644 MediumLevelIL/MLILFloatMul.cs create mode 100644 MediumLevelIL/MLILFloatNeg.cs create mode 100644 MediumLevelIL/MLILFloatNotEqual.cs create mode 100644 MediumLevelIL/MLILFloatSquareRoot.cs create mode 100644 MediumLevelIL/MLILFloatSub.cs create mode 100644 MediumLevelIL/MLILFloatToInt.cs create mode 100644 MediumLevelIL/MLILFloatTruncate.cs create mode 100644 MediumLevelIL/MLILFloor.cs create mode 100644 MediumLevelIL/MLILForceVersion.cs create mode 100644 MediumLevelIL/MLILForceVersionSSA.cs create mode 100644 MediumLevelIL/MLILFreeVariableSlot.cs create mode 100644 MediumLevelIL/MLILFreeVariableSlotSSA.cs create mode 100644 MediumLevelIL/MLILGoto.cs create mode 100644 MediumLevelIL/MLILIf.cs create mode 100644 MediumLevelIL/MLILImport.cs create mode 100644 MediumLevelIL/MLILIntToFloat.cs create mode 100644 MediumLevelIL/MLILIntrinsic.cs create mode 100644 MediumLevelIL/MLILIntrinsicSSA.cs create mode 100644 MediumLevelIL/MLILJump.cs create mode 100644 MediumLevelIL/MLILJumpTo.cs create mode 100644 MediumLevelIL/MLILLoad.cs create mode 100644 MediumLevelIL/MLILLoadSSA.cs create mode 100644 MediumLevelIL/MLILLoadStruct.cs create mode 100644 MediumLevelIL/MLILLoadStructSSA.cs create mode 100644 MediumLevelIL/MLILLogicalShiftLeft.cs create mode 100644 MediumLevelIL/MLILLogicalShiftRight.cs create mode 100644 MediumLevelIL/MLILLowPart.cs create mode 100644 MediumLevelIL/MLILMemoryIntrinsicOutputSSA.cs create mode 100644 MediumLevelIL/MLILMemoryIntrinsicSSA.cs create mode 100644 MediumLevelIL/MLILMemoryPhi.cs create mode 100644 MediumLevelIL/MLILModSigned.cs create mode 100644 MediumLevelIL/MLILModSignedDoublePrecision.cs create mode 100644 MediumLevelIL/MLILModUnsigned.cs create mode 100644 MediumLevelIL/MLILModUnsignedDoublePrecision.cs create mode 100644 MediumLevelIL/MLILMul.cs create mode 100644 MediumLevelIL/MLILMulSignedDoublePrecision.cs create mode 100644 MediumLevelIL/MLILMulUnsignedDoublePrecision.cs create mode 100644 MediumLevelIL/MLILNeg.cs create mode 100644 MediumLevelIL/MLILNoReturn.cs create mode 100644 MediumLevelIL/MLILNop.cs create mode 100644 MediumLevelIL/MLILNot.cs create mode 100644 MediumLevelIL/MLILNotEqual.cs create mode 100644 MediumLevelIL/MLILOr.cs create mode 100644 MediumLevelIL/MLILReturn.cs create mode 100644 MediumLevelIL/MLILReturnHint.cs create mode 100644 MediumLevelIL/MLILRotateLeft.cs create mode 100644 MediumLevelIL/MLILRotateLeftCarry.cs create mode 100644 MediumLevelIL/MLILRotateRight.cs create mode 100644 MediumLevelIL/MLILRotateRightCarry.cs create mode 100644 MediumLevelIL/MLILRoundToInt.cs create mode 100644 MediumLevelIL/MLILSeparateParamList.cs create mode 100644 MediumLevelIL/MLILSetVariable.cs create mode 100644 MediumLevelIL/MLILSetVariableAliased.cs create mode 100644 MediumLevelIL/MLILSetVariableAliasedField.cs create mode 100644 MediumLevelIL/MLILSetVariableField.cs create mode 100644 MediumLevelIL/MLILSetVariableSSA.cs create mode 100644 MediumLevelIL/MLILSetVariableSSAField.cs create mode 100644 MediumLevelIL/MLILSetVariableSplit.cs create mode 100644 MediumLevelIL/MLILSetVariableSplitSSA.cs create mode 100644 MediumLevelIL/MLILSharedParamSlot.cs create mode 100644 MediumLevelIL/MLILSignExtend.cs create mode 100644 MediumLevelIL/MLILSignedGreaterOrEqual.cs create mode 100644 MediumLevelIL/MLILSignedGreaterThan.cs create mode 100644 MediumLevelIL/MLILSignedLessOrEqual.cs create mode 100644 MediumLevelIL/MLILSignedLessThan.cs create mode 100644 MediumLevelIL/MLILStore.cs create mode 100644 MediumLevelIL/MLILStoreSSA.cs create mode 100644 MediumLevelIL/MLILStoreStruct.cs create mode 100644 MediumLevelIL/MLILStoreStructSSA.cs create mode 100644 MediumLevelIL/MLILSub.cs create mode 100644 MediumLevelIL/MLILSubBorrow.cs create mode 100644 MediumLevelIL/MLILSysCall.cs create mode 100644 MediumLevelIL/MLILSysCallSSA.cs create mode 100644 MediumLevelIL/MLILSysCallUntyped.cs create mode 100644 MediumLevelIL/MLILSysCallUntypedSSA.cs create mode 100644 MediumLevelIL/MLILTailCall.cs create mode 100644 MediumLevelIL/MLILTailCallSSA.cs create mode 100644 MediumLevelIL/MLILTailCallUntyped.cs create mode 100644 MediumLevelIL/MLILTailCallUntypedSSA.cs create mode 100644 MediumLevelIL/MLILTestBit.cs create mode 100644 MediumLevelIL/MLILTrap.cs create mode 100644 MediumLevelIL/MLILUndefine.cs create mode 100644 MediumLevelIL/MLILUnimplemented.cs create mode 100644 MediumLevelIL/MLILUnimplementedMemory.cs create mode 100644 MediumLevelIL/MLILUnsignedGreaterOrEqual.cs create mode 100644 MediumLevelIL/MLILUnsignedGreaterThan.cs create mode 100644 MediumLevelIL/MLILUnsignedLessOrEqual.cs create mode 100644 MediumLevelIL/MLILUnsignedLessThan.cs create mode 100644 MediumLevelIL/MLILVariable.cs create mode 100644 MediumLevelIL/MLILVariableAliased.cs create mode 100644 MediumLevelIL/MLILVariableAliasedField.cs create mode 100644 MediumLevelIL/MLILVariableField.cs create mode 100644 MediumLevelIL/MLILVariablePhi.cs create mode 100644 MediumLevelIL/MLILVariableSSA.cs create mode 100644 MediumLevelIL/MLILVariableSSAField.cs create mode 100644 MediumLevelIL/MLILVariableSplit.cs create mode 100644 MediumLevelIL/MLILVariableSplitSSA.cs create mode 100644 MediumLevelIL/MLILXor.cs create mode 100644 MediumLevelIL/MLILZeroExtend.cs create mode 100644 MediumLevelIL/MediumLevelILBasicBlock.cs create mode 100644 MediumLevelIL/MediumLevelILBasicBlockEdge.cs create mode 100644 MediumLevelIL/MediumLevelILFlowGraph.cs create mode 100644 MediumLevelIL/MediumLevelILFlowGraphEdge.cs create mode 100644 MediumLevelIL/MediumLevelILFlowGraphNode.cs create mode 100644 MediumLevelIL/MediumLevelILSSAVariable.cs create mode 100644 MediumLevelIL/MediumLevelILVariable.cs create mode 100644 Misc/AbstractBinaryView.cs create mode 100644 Misc/AbstractSafeHandle.cs create mode 100644 Misc/BinaryViewStream.cs create mode 100644 Misc/NativeWrapper.cs create mode 100644 README.md create mode 100644 Report/AbstractReport.cs create mode 100644 Report/FlowGraphReport.cs create mode 100644 Report/HTMLReport.cs create mode 100644 Report/IReport.cs create mode 100644 Report/MarkdownReport.cs create mode 100644 Report/PlainTextReport.cs create mode 100644 ScopedAllocator.cs create mode 100644 Struct/BNActiveAnalysisInfo.cs create mode 100644 Struct/BNAddressRange.cs create mode 100644 Struct/BNAllTypeFieldReferences.cs create mode 100644 Struct/BNAllTypeReferences.cs create mode 100644 Struct/BNAnalysisInfo.cs create mode 100644 Struct/BNAnalysisMergeConflictSplitterCallbacks.cs create mode 100644 Struct/BNAnalysisParameters.cs create mode 100644 Struct/BNAnalysisProgress.cs create mode 100644 Struct/BNArchitectureAndAddress.cs create mode 100644 Struct/BNBaseAddressDetectionReason.cs create mode 100644 Struct/BNBaseAddressDetectionScore.cs create mode 100644 Struct/BNBaseAddressDetectionSettings.cs create mode 100644 Struct/BNBaseStructure.cs create mode 100644 Struct/BNBasicBlockAnalysisContext.cs create mode 100644 Struct/BNBasicBlockEdge.cs create mode 100644 Struct/BNBinaryDataNotification.cs create mode 100644 Struct/BNBinaryViewEvent.cs create mode 100644 Struct/BNBoolWithConfidence.cs create mode 100644 Struct/BNCallingConventionWithConfidence.cs create mode 100644 Struct/BNChangelogEntry.cs create mode 100644 Struct/BNConstantReference.cs create mode 100644 Struct/BNCustomArchitecture.cs create mode 100644 Struct/BNCustomBinaryView.cs create mode 100644 Struct/BNCustomBinaryViewType.cs create mode 100644 Struct/BNCustomCallingConvention.cs create mode 100644 Struct/BNCustomDataRenderer.cs create mode 100644 Struct/BNCustomFlowGraph.cs create mode 100644 Struct/BNCustomFlowGraphLayout.cs create mode 100644 Struct/BNCustomLanguageRepresentationFunction.cs create mode 100644 Struct/BNCustomLanguageRepresentationFunctionType.cs create mode 100644 Struct/BNCustomLineFormatter.cs create mode 100644 Struct/BNCustomPlatform.cs create mode 100644 Struct/BNCustomRelocationHandler.cs create mode 100644 Struct/BNCustomTransform.cs create mode 100644 Struct/BNDataVariable.cs create mode 100644 Struct/BNDataVariableAndName.cs create mode 100644 Struct/BNDataVariableAndNameAndDebugParser.cs create mode 100644 Struct/BNDebugFunctionInfo.cs create mode 100644 Struct/BNDemanglerCallbacks.cs create mode 100644 Struct/BNDisassemblyTextLine.cs create mode 100644 Struct/BNDisassemblyTextLineTypeInfo.cs create mode 100644 Struct/BNDownloadInstanceCallbacks.cs create mode 100644 Struct/BNDownloadInstanceInputOutputCallbacks.cs create mode 100644 Struct/BNDownloadInstanceOutputCallbacks.cs create mode 100644 Struct/BNDownloadInstanceResponse.cs create mode 100644 Struct/BNDownloadProviderCallbacks.cs create mode 100644 Struct/BNEdgeStyle.cs create mode 100644 Struct/BNEnterpriseServerCallbacks.cs create mode 100644 Struct/BNEnumerationMember.cs create mode 100644 Struct/BNExprMapInfo.cs create mode 100644 Struct/BNFileAccessor.cs create mode 100644 Struct/BNFirmwareNinjaDevice.cs create mode 100644 Struct/BNFirmwareNinjaDeviceAccesses.cs create mode 100644 Struct/BNFirmwareNinjaFunctionMemoryAccesses.cs create mode 100644 Struct/BNFirmwareNinjaMemoryAccess.cs create mode 100644 Struct/BNFirmwareNinjaSection.cs create mode 100644 Struct/BNFlagConditionForSemanticClass.cs create mode 100644 Struct/BNFlowGraphEdge.cs create mode 100644 Struct/BNFormInputField.cs create mode 100644 Struct/BNFunctionParameter.cs create mode 100644 Struct/BNFunctionRecognizer.cs create mode 100644 Struct/BNFunctionViewType.cs create mode 100644 Struct/BNHighLevelILInstruction.cs create mode 100644 Struct/BNHighlightColor.cs create mode 100644 Struct/BNILBranchInstructionAndDependence.cs create mode 100644 Struct/BNILIndexRange.cs create mode 100644 Struct/BNILReferenceSource.cs create mode 100644 Struct/BNIndirectBranchInfo.cs create mode 100644 Struct/BNInheritedStructureMember.cs create mode 100644 Struct/BNInstructionInfo.cs create mode 100644 Struct/BNInstructionTextLine.cs create mode 100644 Struct/BNInstructionTextToken.cs create mode 100644 Struct/BNInteractionHandlerCallbacks.cs create mode 100644 Struct/BNLineFormatterSettings.cs create mode 100644 Struct/BNLinearDisassemblyLine.cs create mode 100644 Struct/BNLinearViewObjectIdentifier.cs create mode 100644 Struct/BNLogListener.cs create mode 100644 Struct/BNLookupTableEntry.cs create mode 100644 Struct/BNLowLevelILInstruction.cs create mode 100644 Struct/BNLowLevelILLabel.cs create mode 100644 Struct/BNMainThreadCallbacks.cs create mode 100644 Struct/BNMediumLevelILInstruction.cs create mode 100644 Struct/BNMediumLevelILLabel.cs create mode 100644 Struct/BNMemoryUsageInfo.cs create mode 100644 Struct/BNMergedVariable.cs create mode 100644 Struct/BNMetadataValueStore.cs create mode 100644 Struct/BNNameAndType.cs create mode 100644 Struct/BNNameList.cs create mode 100644 Struct/BNNameSpace.cs create mode 100644 Struct/BNNavigationHandler.cs create mode 100644 Struct/BNObjectDestructionCallbacks.cs create mode 100644 Struct/BNOffsetWithConfidence.cs create mode 100644 Struct/BNParameterVariablesWithConfidence.cs create mode 100644 Struct/BNParsedType.cs create mode 100644 Struct/BNPendingBasicBlockEdge.cs create mode 100644 Struct/BNPerformanceInfo.cs create mode 100644 Struct/BNPluginCommand.cs create mode 100644 Struct/BNPoint.cs create mode 100644 Struct/BNPossibleValueSet.cs create mode 100644 Struct/BNProjectNotification.cs create mode 100644 Struct/BNQualifiedName.cs create mode 100644 Struct/BNQualifiedNameAndType.cs create mode 100644 Struct/BNQualifiedNameList.cs create mode 100644 Struct/BNQualifiedNameTypeAndId.cs create mode 100644 Struct/BNRange.cs create mode 100644 Struct/BNReferenceSource.cs create mode 100644 Struct/BNRegisterInfo.cs create mode 100644 Struct/BNRegisterOrConstant.cs create mode 100644 Struct/BNRegisterSetWithConfidence.cs create mode 100644 Struct/BNRegisterStackAdjustment.cs create mode 100644 Struct/BNRegisterStackInfo.cs create mode 100644 Struct/BNRegisterValue.cs create mode 100644 Struct/BNRegisterValueWithConfidence.cs create mode 100644 Struct/BNRelocationInfo.cs create mode 100644 Struct/BNRenderLayerCallbacks.cs create mode 100644 Struct/BNScriptingInstanceCallbacks.cs create mode 100644 Struct/BNScriptingOutputListener.cs create mode 100644 Struct/BNScriptingProviderCallbacks.cs create mode 100644 Struct/BNSecretsProviderCallbacks.cs create mode 100644 Struct/BNSegmentInfo.cs create mode 100644 Struct/BNStackVariableReference.cs create mode 100644 Struct/BNStringReference.cs create mode 100644 Struct/BNStructureMember.cs create mode 100644 Struct/BNSystemCallInfo.cs create mode 100644 Struct/BNTagReference.cs create mode 100644 Struct/BNTokenEmitterExpr.cs create mode 100644 Struct/BNTransformParameter.cs create mode 100644 Struct/BNTransformParameterInfo.cs create mode 100644 Struct/BNTypeArchiveNotification.cs create mode 100644 Struct/BNTypeAttribute.cs create mode 100644 Struct/BNTypeContext.cs create mode 100644 Struct/BNTypeDefinitionLine.cs create mode 100644 Struct/BNTypeField.cs create mode 100644 Struct/BNTypeFieldReference.cs create mode 100644 Struct/BNTypeFieldReferenceSizeInfo.cs create mode 100644 Struct/BNTypeFieldReferenceTypeInfo.cs create mode 100644 Struct/BNTypeParserCallbacks.cs create mode 100644 Struct/BNTypeParserError.cs create mode 100644 Struct/BNTypeParserResult.cs create mode 100644 Struct/BNTypePrinterCallbacks.cs create mode 100644 Struct/BNTypeReferenceSource.cs create mode 100644 Struct/BNTypeWithConfidence.cs create mode 100644 Struct/BNUpdateChannel.cs create mode 100644 Struct/BNUpdateChannelFullInfo.cs create mode 100644 Struct/BNUpdateVersion.cs create mode 100644 Struct/BNUpdateVersionNew.cs create mode 100644 Struct/BNUserVariableValue.cs create mode 100644 Struct/BNValueRange.cs create mode 100644 Struct/BNVariable.cs create mode 100644 Struct/BNVariableFieldResolutionInfo.cs create mode 100644 Struct/BNVariableNameAndType.cs create mode 100644 Struct/BNVariableReferenceSource.cs create mode 100644 Struct/BNVersionInfo.cs create mode 100644 Struct/BNWebsocketClientCallbacks.cs create mode 100644 Struct/BNWebsocketClientOutputCallbacks.cs create mode 100644 Struct/BNWebsocketProviderCallbacks.cs create mode 100644 Type/ArrayType.cs create mode 100644 Type/BoolType.cs create mode 100644 Type/CharType.cs create mode 100644 Type/EnumerationType.cs create mode 100644 Type/FloatType.cs create mode 100644 Type/FunctionType.cs create mode 100644 Type/IntegerType.cs create mode 100644 Type/NamedTypeReferenceType.cs create mode 100644 Type/PointerType.cs create mode 100644 Type/StructureType.cs create mode 100644 Type/VoidType.cs create mode 100644 Type/WideCharType.cs create mode 100644 UnsafeUtils.cs create mode 100644 Utils.cs diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..5ef3c99 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,120 @@ +name: build + +on: + push: + branches: + - master + pull_request: + branches: + - master + +env: + VERSION_MAJOR: 0 + VERSION_MINOR: 1 + +jobs: + version: + runs-on: ubuntu-latest + outputs: + version: ${{ steps.version.outputs.version }} + build: ${{ steps.version.outputs.build }} + revision: ${{ steps.version.outputs.revision }} + steps: + - name: checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: generate version + id: version + shell: bash + run: | + BUILD_NUMBER=0 + REVISION=${{ github.run_number }} + VERSION="${{ env.VERSION_MAJOR }}.${{ env.VERSION_MINOR }}.${BUILD_NUMBER}.${REVISION}" + + echo "version=${VERSION}" >> $GITHUB_OUTPUT + echo "build=${BUILD_NUMBER}" >> $GITHUB_OUTPUT + echo "revision=${REVISION}" >> $GITHUB_OUTPUT + + echo "Generated version: ${VERSION}" + echo " - Build: ${BUILD_NUMBER}" + echo " - Revision (Run Number): ${REVISION}" + + build: + needs: version + strategy: + matrix: + include: + - os: windows-latest + artifact_name: BinaryNinja.dll + platform: windows + - os: ubuntu-latest + artifact_name: BinaryNinja.so + platform: linux + + runs-on: ${{ matrix.os }} + + steps: + - name: checkout + uses: actions/checkout@v5 + with: + fetch-depth: 0 + + - name: setup .NET + uses: actions/setup-dotnet@v5 + with: + dotnet-version: 8.0.x + + - name: build (Linux) + if: runner.os == 'Linux' + run: | + echo "[+] build linux" + dotnet publish -r linux-x64 --self-contained=true -c Release -p:PublishDir=build /p:Version=${{ needs.version.outputs.version }} /p:FileVersion=${{ needs.version.outputs.version }} /p:AssemblyVersion=${{ needs.version.outputs.version }} /p:ProductVersion=${{ needs.version.outputs.version }} + + - name: build (Windows) + if: runner.os == 'Windows' + run: | + echo "[+] build windows" + dotnet publish -r win-x64 --self-contained=true -c Release -p:PublishDir=build /p:Version=${{ needs.version.outputs.version }} /p:FileVersion=${{ needs.version.outputs.version }} /p:AssemblyVersion=${{ needs.version.outputs.version }} /p:ProductVersion=${{ needs.version.outputs.version }} + + - name: collect artifacts + shell: bash + run: | + mkdir -p artifacts + cp "build/${{ matrix.artifact_name }}" artifacts/ + ls -lh artifacts + + - name: upload artifacts + uses: actions/upload-artifact@v3 + if: github.event_name == 'push' && github.ref == 'refs/heads/master' + with: + name: ${{ matrix.platform }}-v${{ needs.version.outputs.version }} + path: artifacts/*.* + + release: + needs: [ version , build ] + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/master' && github.ref == 'refs/heads/master' && secrets.GIT_TOKEN != '' + + steps: + - name: checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: download artifacts + uses: actions/download-artifact@v3 + with: + path: artifacts + + - name: create release + uses: softprops/action-gh-release@v1 + with: + tag_name: v${{ needs.version.outputs.version }} + name: release v${{ needs.version.outputs.version }} + generate_releases: true + draft: false + prerelease: true + token: ${{ secrets.GIT_TOKEN }} + files: artifacts/*.* \ No newline at end of file diff --git a/.gitignore b/.gitignore index 35063fc..c43d99b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,54 +1,7 @@ -## A streamlined .gitignore for modern .NET projects -## including temporary files, build results, and -## files generated by popular .NET tools. If you are -## developing with Visual Studio, the VS .gitignore -## https://github.com/github/gitignore/blob/main/VisualStudio.gitignore -## has more thorough IDE-specific entries. -## -## Get latest from https://github.com/github/gitignore/blob/main/Dotnet.gitignore - -# Build results -[Dd]ebug/ -[Dd]ebugPublic/ -[Rr]elease/ -[Rr]eleases/ -x64/ -x86/ -[Ww][Ii][Nn]32/ -[Aa][Rr][Mm]/ -[Aa][Rr][Mm]64/ -bld/ -[Bb]in/ -[Oo]bj/ -[Ll]og/ -[Ll]ogs/ - -# .NET Core -project.lock.json -project.fragment.lock.json -artifacts/ - -# ASP.NET Scaffolding -ScaffoldingReadMe.txt - -# NuGet Packages -*.nupkg -# NuGet Symbol Packages -*.snupkg - -# Others -~$* -*~ -CodeCoverage/ - -# MSBuild Binary and Structured Log -*.binlog - -# MSTest test Results -[Tt]est[Rr]esult*/ -[Bb]uild[Ll]og.* - -# NUnit -*.VisualState.xml -TestResult.xml -nunit-*.xml \ No newline at end of file +# dir +.idea/ +obj/ +bin/ +dist/ +build/ +Folder.DotSettings.user/ diff --git a/.globalconfig b/.globalconfig new file mode 100644 index 0000000..ece179d --- /dev/null +++ b/.globalconfig @@ -0,0 +1,3 @@ +is_global = true +dotnet_diagnostic.CA1510.severity = none +dotnet_diagnostic.CA1822.severity = none \ No newline at end of file diff --git a/BinaryNinja.csproj b/BinaryNinja.csproj new file mode 100644 index 0000000..3da09cd --- /dev/null +++ b/BinaryNinja.csproj @@ -0,0 +1,33 @@ + + + BinaryNinja + BinaryNinja + + net8.0 + latestmajor + disable + enable + library + + Shared + true + true + true + + + 0.1.0.0 + 0.1.0.0 + 0.1.0.0 + 0.1.0.0 + tinysec.net + SharpBinja + tinysec©2006-2025 + BinaryNinja dotnet bindings + + + + + true + true + + diff --git a/Constant.cs b/Constant.cs new file mode 100644 index 0000000..4162e1d --- /dev/null +++ b/Constant.cs @@ -0,0 +1,10 @@ +namespace BinaryNinja +{ + public static partial class Core + { + public const byte MaxConfidence = 255; + + // BN_CURRENT_CORE_ABI_VERSION 147 + public const uint CurrentCoreABIVersion = 147; + } +} diff --git a/Delegate/BNProgressFunction.cs b/Delegate/BNProgressFunction.cs new file mode 100644 index 0000000..785e6ac --- /dev/null +++ b/Delegate/BNProgressFunction.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public delegate bool ProgressDelegate( + + // uint64_t param2 + ulong param2 , + + // uint64_t param3 + ulong param3 + ); + + internal static partial class NativeDelegates + { + /// + /// + /// typedef bool (*BNProgressFunction)(void* param1, uint64_t param2, uint64_t param3) + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal delegate bool BNProgressFunction( + + // void* param1 + IntPtr param1 , + + // uint64_t param2 + ulong param2 , + + // uint64_t param3 + ulong param3 + ); + } + + internal static partial class UnsafeUtils + { + internal static NativeDelegates.BNProgressFunction WrapProgressDelegate( + ProgressDelegate callback) + { + return bool (param1 , param2 , param3) => + { + return callback(param2 , param3); + }; + } + } +} \ No newline at end of file diff --git a/Delegate/MatchConstantDelegate.cs b/Delegate/MatchConstantDelegate.cs new file mode 100644 index 0000000..3361433 --- /dev/null +++ b/Delegate/MatchConstantDelegate.cs @@ -0,0 +1,35 @@ +using System; + +namespace BinaryNinja +{ + public delegate bool MatchConstantDelegate + ( + ulong address , + LinearDisassemblyLine line + ); + + internal static partial class NativeDelegates + { + // bool (*matchCallback)(void* matchCtxt, uint64_t addr, BNLinearDisassemblyLine* line) + public delegate bool MatchConstantDelegate( + IntPtr matchCtxt, + ulong address, + IntPtr line + ); + } + + internal static partial class UnsafeUtils + { + internal static NativeDelegates.MatchConstantDelegate WrapMatchConstantDelegate( + MatchConstantDelegate callback) + { + return bool (matchCtxt , address , line) => + { + return callback ( + address , + LinearDisassemblyLine.MustFromNativePointer(line) + ); + }; + } + } +} diff --git a/Delegate/MatchDataDelegate.cs b/Delegate/MatchDataDelegate.cs new file mode 100644 index 0000000..1db93c2 --- /dev/null +++ b/Delegate/MatchDataDelegate.cs @@ -0,0 +1,35 @@ +using System; + +namespace BinaryNinja +{ + public delegate bool MatchDataDelegate + ( + ulong address , + byte[] data + ); + + internal static partial class NativeDelegates + { + // bool (*matchCallback)(void* matchCtxt, uint64_t addr, BNDataBuffer* match) + public delegate bool MatchDataDelegate( + IntPtr matchCtxt, + ulong address, + IntPtr match + ); + } + + internal static partial class UnsafeUtils + { + internal static NativeDelegates.MatchDataDelegate WrapMatchDataDelegate( + MatchDataDelegate callback) + { + return bool (matchCtxt , address , buffer) => + { + return callback( + address , + DataBuffer.MustBorrowHandle(buffer).Contents + ); + }; + } + } +} diff --git a/Delegate/MatchTextDelegate.cs b/Delegate/MatchTextDelegate.cs new file mode 100644 index 0000000..2883718 --- /dev/null +++ b/Delegate/MatchTextDelegate.cs @@ -0,0 +1,38 @@ +using System; + +namespace BinaryNinja +{ + public delegate bool MatchTextDelegate + ( + ulong address , + string text, + LinearDisassemblyLine line + ); + + internal static partial class NativeDelegates + { + // bool (*matchCallback)(void* matchCtxt, uint64_t addr, const char* match, BNLinearDisassemblyLine* line) + public delegate bool MatchTextDelegate( + IntPtr matchCtxt, + ulong address, + IntPtr match , + IntPtr line + ); + } + + internal static partial class UnsafeUtils + { + internal static NativeDelegates.MatchTextDelegate WrapMatchTextDelegate( + MatchTextDelegate callback) + { + return bool (matchCtxt , address , text , line) => + { + return callback ( + address , + UnsafeUtils.ReadUtf8String(text), + LinearDisassemblyLine.MustFromNativePointer(line) + ); + }; + } + } +} diff --git a/Enumeration/BNActionType.cs b/Enumeration/BNActionType.cs new file mode 100644 index 0000000..6358164 --- /dev/null +++ b/Enumeration/BNActionType.cs @@ -0,0 +1,30 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum ActionType : uint + { + /// + /// + /// + TemporaryAction = 0, + + /// + /// + /// + DataModificationAction = 1, + + /// + /// + /// + AnalysisAction = 2, + + /// + /// + /// + DataModificationAndAnalysisAction = 3 + } +} \ No newline at end of file diff --git a/Enumeration/BNAnalysisMode.cs b/Enumeration/BNAnalysisMode.cs new file mode 100644 index 0000000..fd58ff6 --- /dev/null +++ b/Enumeration/BNAnalysisMode.cs @@ -0,0 +1,30 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum AnalysisMode : uint + { + /// + /// + /// + FullAnalysisMode = 0, + + /// + /// + /// + IntermediateAnalysisMode = 1, + + /// + /// + /// + BasicAnalysisMode = 2, + + /// + /// + /// + ControlFlowAnalysisMode = 3 + } +} \ No newline at end of file diff --git a/Enumeration/BNAnalysisSkipReason.cs b/Enumeration/BNAnalysisSkipReason.cs new file mode 100644 index 0000000..3a8b49f --- /dev/null +++ b/Enumeration/BNAnalysisSkipReason.cs @@ -0,0 +1,55 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum AnalysisSkipReason : uint + { + /// + /// + /// + NoSkipReason = 0, + + /// + /// + /// + AlwaysSkipReason = 1, + + /// + /// + /// + ExceedFunctionSizeSkipReason = 2, + + /// + /// + /// + ExceedFunctionAnalysisTimeSkipReason = 3, + + /// + /// + /// + ExceedFunctionUpdateCountSkipReason = 4, + + /// + /// + /// + NewAutoFunctionAnalysisSuppressedReason = 5, + + /// + /// + /// + BasicAnalysisSkipReason = 6, + + /// + /// + /// + IntermediateAnalysisSkipReason = 7, + + /// + /// + /// + AnalysisPipelineSuspendedReason = 8 + } +} \ No newline at end of file diff --git a/Enumeration/BNAnalysisState.cs b/Enumeration/BNAnalysisState.cs new file mode 100644 index 0000000..b1740a4 --- /dev/null +++ b/Enumeration/BNAnalysisState.cs @@ -0,0 +1,45 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum AnalysisState : uint + { + /// + /// + /// + InitialState = 0, + + /// + /// + /// + HoldState = 1, + + /// + /// + /// + IdleState = 2, + + /// + /// + /// + DiscoveryState = 3, + + /// + /// + /// + DisassembleState = 4, + + /// + /// + /// + AnalyzeState = 5, + + /// + /// + /// + ExtendedAnalyzeState = 6 + } +} \ No newline at end of file diff --git a/Enumeration/BNAnalysisWarningActionType.cs b/Enumeration/BNAnalysisWarningActionType.cs new file mode 100644 index 0000000..3e4d1c4 --- /dev/null +++ b/Enumeration/BNAnalysisWarningActionType.cs @@ -0,0 +1,30 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum AnalysisWarningActionType : uint + { + /// + /// + /// + NoAnalysisWarningAction = 0, + + /// + /// + /// + ForceAnalysisWarningAction = 1, + + /// + /// + /// + ShowStackGraphWarningAction = 2, + + /// + /// + /// + DisableGuidedAnalysisWarningAction = 3 + } +} \ No newline at end of file diff --git a/Enumeration/BNBaseAddressDetectionConfidence.cs b/Enumeration/BNBaseAddressDetectionConfidence.cs new file mode 100644 index 0000000..3155641 --- /dev/null +++ b/Enumeration/BNBaseAddressDetectionConfidence.cs @@ -0,0 +1,25 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum BaseAddressDetectionConfidence : uint + { + /// + /// + /// + NoConfidence = 0, + + /// + /// + /// + LowConfidence = 1, + + /// + /// + /// + HighConfidence = 2 + } +} \ No newline at end of file diff --git a/Enumeration/BNBaseAddressDetectionPOISetting.cs b/Enumeration/BNBaseAddressDetectionPOISetting.cs new file mode 100644 index 0000000..9837775 --- /dev/null +++ b/Enumeration/BNBaseAddressDetectionPOISetting.cs @@ -0,0 +1,25 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum BaseAddressDetectionPOISetting : uint + { + /// + /// + /// + POIAnalysisStringsOnly = 0, + + /// + /// + /// + POIAnalysisFunctionsOnly = 1, + + /// + /// + /// + POIAnalysisAll = 2 + } +} \ No newline at end of file diff --git a/Enumeration/BNBaseAddressDetectionPOIType.cs b/Enumeration/BNBaseAddressDetectionPOIType.cs new file mode 100644 index 0000000..a17d6ff --- /dev/null +++ b/Enumeration/BNBaseAddressDetectionPOIType.cs @@ -0,0 +1,35 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum BaseAddressDetectionPOIType : uint + { + /// + /// + /// + POIString = 0, + + /// + /// + /// + POIFunction = 1, + + /// + /// + /// + POIDataVariable = 2, + + /// + /// + /// + POIFileStart = 3, + + /// + /// + /// + POIFileEnd = 4 + } +} \ No newline at end of file diff --git a/Enumeration/BNBinaryViewEventType.cs b/Enumeration/BNBinaryViewEventType.cs new file mode 100644 index 0000000..168ac1c --- /dev/null +++ b/Enumeration/BNBinaryViewEventType.cs @@ -0,0 +1,20 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum BinaryViewEventType : uint + { + /// + /// + /// + BinaryViewFinalizationEvent = 0, + + /// + /// + /// + BinaryViewInitialAnalysisCompletionEvent = 1 + } +} \ No newline at end of file diff --git a/Enumeration/BNBraceRequirement.cs b/Enumeration/BNBraceRequirement.cs new file mode 100644 index 0000000..e2419d0 --- /dev/null +++ b/Enumeration/BNBraceRequirement.cs @@ -0,0 +1,25 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum BraceRequirement : uint + { + /// + /// + /// + OptionalBraces = 0, + + /// + /// + /// + BracesNotAllowed = 1, + + /// + /// + /// + BracesAlwaysRequired = 2 + } +} \ No newline at end of file diff --git a/Enumeration/BNBranchType.cs b/Enumeration/BNBranchType.cs new file mode 100644 index 0000000..1989cf0 --- /dev/null +++ b/Enumeration/BNBranchType.cs @@ -0,0 +1,60 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum BranchType : uint + { + /// + /// + /// + UnconditionalBranch = 0, + + /// + /// + /// + FalseBranch = 1, + + /// + /// + /// + TrueBranch = 2, + + /// + /// + /// + CallDestination = 3, + + /// + /// + /// + FunctionReturn = 4, + + /// + /// + /// + SystemCall = 5, + + /// + /// + /// + IndirectBranch = 6, + + /// + /// + /// + ExceptionBranch = 7, + + /// + /// + /// + UnresolvedBranch = 127, + + /// + /// + /// + UserDefinedBranch = 128 + } +} \ No newline at end of file diff --git a/Enumeration/BNBuiltinType.cs b/Enumeration/BNBuiltinType.cs new file mode 100644 index 0000000..d0ee4e5 --- /dev/null +++ b/Enumeration/BNBuiltinType.cs @@ -0,0 +1,45 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum BuiltinType : uint + { + /// + /// + /// + BuiltinNone = 0, + + /// + /// + /// + BuiltinMemcpy = 1, + + /// + /// + /// + BuiltinMemset = 2, + + /// + /// + /// + BuiltinStrncpy = 3, + + /// + /// + /// + BuiltinStrcpy = 4, + + /// + /// + /// + BuiltinWcscpy = 5, + + /// + /// + /// + BuiltinWmemcpy = 6 + } +} \ No newline at end of file diff --git a/Enumeration/BNCallingConventionName.cs b/Enumeration/BNCallingConventionName.cs new file mode 100644 index 0000000..8a698e4 --- /dev/null +++ b/Enumeration/BNCallingConventionName.cs @@ -0,0 +1,65 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum CallingConventionName : uint + { + /// + /// + /// + NoCallingConvention = 0, + + /// + /// + /// + CdeclCallingConvention = 1, + + /// + /// + /// + PascalCallingConvention = 2, + + /// + /// + /// + ThisCallCallingConvention = 3, + + /// + /// + /// + STDCallCallingConvention = 4, + + /// + /// + /// + FastcallCallingConvention = 5, + + /// + /// + /// + CLRCallCallingConvention = 6, + + /// + /// + /// + EabiCallCallingConvention = 7, + + /// + /// + /// + VectorCallCallingConvention = 8, + + /// + /// + /// + SwiftCallingConvention = 9, + + /// + /// + /// + SwiftAsyncCallingConvention = 10 + } +} \ No newline at end of file diff --git a/Enumeration/BNCollaborationPermissionLevel.cs b/Enumeration/BNCollaborationPermissionLevel.cs new file mode 100644 index 0000000..283f04d --- /dev/null +++ b/Enumeration/BNCollaborationPermissionLevel.cs @@ -0,0 +1,25 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum CollaborationPermissionLevel : uint + { + /// + /// + /// + AdminPermission = 1, + + /// + /// + /// + EditPermission = 2, + + /// + /// + /// + ViewPermission = 3 + } +} \ No newline at end of file diff --git a/Enumeration/BNDataFlowQueryOption.cs b/Enumeration/BNDataFlowQueryOption.cs new file mode 100644 index 0000000..a1fe2b9 --- /dev/null +++ b/Enumeration/BNDataFlowQueryOption.cs @@ -0,0 +1,20 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum DataFlowQueryOption : uint + { + /// + /// + /// + FromAddressesInLookupTableQueryOption = 0, + + /// + /// + /// + AllowReadingWritableMemoryQueryOption = 1 + } +} \ No newline at end of file diff --git a/Enumeration/BNDeadStoreElimination.cs b/Enumeration/BNDeadStoreElimination.cs new file mode 100644 index 0000000..2be44ec --- /dev/null +++ b/Enumeration/BNDeadStoreElimination.cs @@ -0,0 +1,25 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum DeadStoreElimination : uint + { + /// + /// + /// + DefaultDeadStoreElimination = 0, + + /// + /// + /// + PreventDeadStoreElimination = 1, + + /// + /// + /// + AllowDeadStoreElimination = 2 + } +} \ No newline at end of file diff --git a/Enumeration/BNDisassemblyAddressMode.cs b/Enumeration/BNDisassemblyAddressMode.cs new file mode 100644 index 0000000..af41721 --- /dev/null +++ b/Enumeration/BNDisassemblyAddressMode.cs @@ -0,0 +1,65 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum DisassemblyAddressMode : uint + { + /// + /// + /// + AbsoluteDisassemblyAddressMode = 0, + + /// + /// + /// + RelativeToBinaryStartDisassemblyAddressMode = 1, + + /// + /// + /// + RelativeToSegmentStartDisassemblyAddressMode = 2, + + /// + /// + /// + RelativeToSectionStartDisassemblyAddressMode = 3, + + /// + /// + /// + RelativeToFunctionStartDisassemblyAddressMode = 4, + + /// + /// + /// + RelativeToAddressBaseOffsetDisassemblyAddressMode = 5, + + /// + /// + /// + RelativeToDataStartDisassemblyAddressMode = 6, + + /// + /// + /// + DisassemblyAddressModeMask = 65535, + + /// + /// + /// + IncludeNameDisassemblyAddressModeFlag = 65536, + + /// + /// + /// + DecimalDisassemblyAddressModeFlag = 131072, + + /// + /// + /// + DisassemblyAddressModeFlagsMask = 4294901760 + } +} \ No newline at end of file diff --git a/Enumeration/BNDisassemblyBlockLabels.cs b/Enumeration/BNDisassemblyBlockLabels.cs new file mode 100644 index 0000000..8c9557f --- /dev/null +++ b/Enumeration/BNDisassemblyBlockLabels.cs @@ -0,0 +1,25 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum DisassemblyBlockLabels : uint + { + /// + /// + /// + NeverShowDefaultBlockLabels = 0, + + /// + /// + /// + AlwaysShowBlockLabels = 1, + + /// + /// + /// + NeverShowBlockLabels = 2 + } +} \ No newline at end of file diff --git a/Enumeration/BNDisassemblyCallParameterHints.cs b/Enumeration/BNDisassemblyCallParameterHints.cs new file mode 100644 index 0000000..2aac30b --- /dev/null +++ b/Enumeration/BNDisassemblyCallParameterHints.cs @@ -0,0 +1,25 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum DisassemblyCallParameterHints : uint + { + /// + /// + /// + NeverShowMatchingParameterHints = 0, + + /// + /// + /// + AlwaysShowParameterHints = 1, + + /// + /// + /// + NeverShowParameterHints = 2 + } +} \ No newline at end of file diff --git a/Enumeration/BNDisassemblyOption.cs b/Enumeration/BNDisassemblyOption.cs new file mode 100644 index 0000000..8d93fa7 --- /dev/null +++ b/Enumeration/BNDisassemblyOption.cs @@ -0,0 +1,105 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum DisassemblyOption : uint + { + /// + /// + /// + ShowAddress = 0, + + /// + /// + /// + ShowOpcode = 1, + + /// + /// + /// + ExpandLongOpcode = 2, + + /// + /// + /// + ShowVariablesAtTopOfGraph = 3, + + /// + /// + /// + ShowVariableTypesWhenAssigned = 4, + + /// + /// + /// + ShowRegisterHighlight = 7, + + /// + /// + /// + ShowFunctionAddress = 8, + + /// + /// + /// + ShowFunctionHeader = 9, + + /// + /// + /// + ShowTypeCasts = 10, + + /// + /// + /// + GroupLinearDisassemblyFunctions = 64, + + /// + /// + /// + HighLevelILLinearDisassembly = 65, + + /// + /// + /// + WaitForIL = 66, + + /// + /// + /// + IndentHLILBody = 67, + + /// + /// + /// + DisableLineFormatting = 68, + + /// + /// + /// + ShowFlagUsage = 128, + + /// + /// + /// + ShowStackPointer = 129, + + /// + /// + /// + ShowILTypes = 130, + + /// + /// + /// + ShowILOpcodes = 131, + + /// + /// + /// + ShowCollapseIndicators = 132 + } +} \ No newline at end of file diff --git a/Enumeration/BNEarlyReturn.cs b/Enumeration/BNEarlyReturn.cs new file mode 100644 index 0000000..5ccd97d --- /dev/null +++ b/Enumeration/BNEarlyReturn.cs @@ -0,0 +1,35 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum EarlyReturn : uint + { + /// + /// + /// + DefaultEarlyReturn = 0, + + /// + /// + /// + PreventEarlyReturn = 1, + + /// + /// + /// + SmallestSideEarlyReturn = 2, + + /// + /// + /// + TrueSideEarlyReturn = 3, + + /// + /// + /// + FalseSideEarlyReturn = 4 + } +} \ No newline at end of file diff --git a/Enumeration/BNEdgePenStyle.cs b/Enumeration/BNEdgePenStyle.cs new file mode 100644 index 0000000..170c752 --- /dev/null +++ b/Enumeration/BNEdgePenStyle.cs @@ -0,0 +1,40 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum EdgePenStyle : uint + { + /// + /// + /// + NoPen = 0, + + /// + /// + /// + SolidLine = 1, + + /// + /// + /// + DashLine = 2, + + /// + /// + /// + DotLine = 3, + + /// + /// + /// + DashDotLine = 4, + + /// + /// + /// + DashDotDotLine = 5 + } +} \ No newline at end of file diff --git a/Enumeration/BNEndianness.cs b/Enumeration/BNEndianness.cs new file mode 100644 index 0000000..e89791e --- /dev/null +++ b/Enumeration/BNEndianness.cs @@ -0,0 +1,20 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum Endianness : uint + { + /// + /// + /// + LittleEndian = 0, + + /// + /// + /// + BigEndian = 1 + } +} \ No newline at end of file diff --git a/Enumeration/BNExprFolding.cs b/Enumeration/BNExprFolding.cs new file mode 100644 index 0000000..945d09a --- /dev/null +++ b/Enumeration/BNExprFolding.cs @@ -0,0 +1,25 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum ExprFolding : uint + { + /// + /// + /// + DefaultExprFolding = 0, + + /// + /// + /// + PreventExprFolding = 1, + + /// + /// + /// + AllowExprFolding = 2 + } +} \ No newline at end of file diff --git a/Enumeration/BNFindFlag.cs b/Enumeration/BNFindFlag.cs new file mode 100644 index 0000000..6c8bab1 --- /dev/null +++ b/Enumeration/BNFindFlag.cs @@ -0,0 +1,25 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum FindFlag : uint + { + /// + /// + /// + FindCaseSensitive = 0, + + /// + /// + /// + FindCaseInsensitive = 1, + + /// + /// + /// + FindIgnoreWhitespace = 2 + } +} \ No newline at end of file diff --git a/Enumeration/BNFindRangeType.cs b/Enumeration/BNFindRangeType.cs new file mode 100644 index 0000000..507cd61 --- /dev/null +++ b/Enumeration/BNFindRangeType.cs @@ -0,0 +1,25 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum FindRangeType : uint + { + /// + /// + /// + AllRangeType = 0, + + /// + /// + /// + CustomRangeType = 1, + + /// + /// + /// + CurrentFunctionRangeType = 2 + } +} \ No newline at end of file diff --git a/Enumeration/BNFindType.cs b/Enumeration/BNFindType.cs new file mode 100644 index 0000000..5dea425 --- /dev/null +++ b/Enumeration/BNFindType.cs @@ -0,0 +1,35 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum FindType : uint + { + /// + /// + /// + FindTypeRawString = 0, + + /// + /// + /// + FindTypeEscapedString = 1, + + /// + /// + /// + FindTypeText = 2, + + /// + /// + /// + FindTypeConstant = 3, + + /// + /// + /// + FindTypeBytes = 4 + } +} \ No newline at end of file diff --git a/Enumeration/BNFirmwareNinjaMemoryAccessType.cs b/Enumeration/BNFirmwareNinjaMemoryAccessType.cs new file mode 100644 index 0000000..6a944a7 --- /dev/null +++ b/Enumeration/BNFirmwareNinjaMemoryAccessType.cs @@ -0,0 +1,25 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum FirmwareNinjaMemoryAccessType : uint + { + /// + /// + /// + NoMemoryAccessType = 0, + + /// + /// + /// + ReadMemoryAccessType = 1, + + /// + /// + /// + WriteMemoryAccessType = 2 + } +} \ No newline at end of file diff --git a/Enumeration/BNFirmwareNinjaMemoryHeuristic.cs b/Enumeration/BNFirmwareNinjaMemoryHeuristic.cs new file mode 100644 index 0000000..174c582 --- /dev/null +++ b/Enumeration/BNFirmwareNinjaMemoryHeuristic.cs @@ -0,0 +1,45 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum FirmwareNinjaMemoryHeuristic : uint + { + /// + /// + /// + NoMemoryHeuristic = 0, + + /// + /// + /// + HasReadBarrierMemoryHeuristic = 1, + + /// + /// + /// + HasWriteBarrierMemoryHeuristic = 2, + + /// + /// + /// + StoreToOOBMemoryMemoryHeuristic = 3, + + /// + /// + /// + LoadFromOOBMemoryMemoryHeuristic = 4, + + /// + /// + /// + RepeatLoadStoreMemoryHeuristic = 5, + + /// + /// + /// + CallParamOOBPointerMemoryHeuristic = 6 + } +} \ No newline at end of file diff --git a/Enumeration/BNFirmwareNinjaSectionAnalysisMode.cs b/Enumeration/BNFirmwareNinjaSectionAnalysisMode.cs new file mode 100644 index 0000000..1e0e6ed --- /dev/null +++ b/Enumeration/BNFirmwareNinjaSectionAnalysisMode.cs @@ -0,0 +1,25 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum FirmwareNinjaSectionAnalysisMode : uint + { + /// + /// + /// + DefaultSectionAnalysisMode = 0, + + /// + /// + /// + IgnorePaddingSectionAnalysisMode = 1, + + /// + /// + /// + DetectStringsSectionAnalysisMode = 2 + } +} \ No newline at end of file diff --git a/Enumeration/BNFirmwareNinjaSectionType.cs b/Enumeration/BNFirmwareNinjaSectionType.cs new file mode 100644 index 0000000..897cfd6 --- /dev/null +++ b/Enumeration/BNFirmwareNinjaSectionType.cs @@ -0,0 +1,30 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum FirmwareNinjaSectionType : uint + { + /// + /// + /// + CodeSectionType = 0, + + /// + /// + /// + DataSectionType = 1, + + /// + /// + /// + CompressionSectionType = 2, + + /// + /// + /// + PaddingSectionType = 3 + } +} \ No newline at end of file diff --git a/Enumeration/BNFlagRole.cs b/Enumeration/BNFlagRole.cs new file mode 100644 index 0000000..628fdd9 --- /dev/null +++ b/Enumeration/BNFlagRole.cs @@ -0,0 +1,70 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum FlagRole : uint + { + /// + /// + /// + SpecialFlagRole = 0, + + /// + /// + /// + ZeroFlagRole = 1, + + /// + /// + /// + PositiveSignFlagRole = 2, + + /// + /// + /// + NegativeSignFlagRole = 3, + + /// + /// + /// + CarryFlagRole = 4, + + /// + /// + /// + OverflowFlagRole = 5, + + /// + /// + /// + HalfCarryFlagRole = 6, + + /// + /// + /// + EvenParityFlagRole = 7, + + /// + /// + /// + OddParityFlagRole = 8, + + /// + /// + /// + OrderedFlagRole = 9, + + /// + /// + /// + UnorderedFlagRole = 10, + + /// + /// + /// + CarryFlagWithInvertedSubtractRole = 11 + } +} \ No newline at end of file diff --git a/Enumeration/BNFlowGraphOption.cs b/Enumeration/BNFlowGraphOption.cs new file mode 100644 index 0000000..955abf1 --- /dev/null +++ b/Enumeration/BNFlowGraphOption.cs @@ -0,0 +1,50 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum FlowGraphOption : uint + { + /// + /// + /// + FlowGraphUsesBlockHighlights = 0, + + /// + /// + /// + FlowGraphUsesInstructionHighlights = 1, + + /// + /// + /// + FlowGraphIncludesUserComments = 2, + + /// + /// + /// + FlowGraphAllowsPatching = 3, + + /// + /// + /// + FlowGraphAllowsInlineInstructionEditing = 4, + + /// + /// + /// + FlowGraphShowsSecondaryRegisterHighlighting = 5, + + /// + /// + /// + FlowGraphIsAddressable = 6, + + /// + /// + /// + FlowGraphIsWorkflowGraph = 7 + } +} \ No newline at end of file diff --git a/Enumeration/BNFormInputFieldType.cs b/Enumeration/BNFormInputFieldType.cs new file mode 100644 index 0000000..6fac2be --- /dev/null +++ b/Enumeration/BNFormInputFieldType.cs @@ -0,0 +1,65 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum FormInputFieldType : uint + { + /// + /// + /// + LabelFormField = 0, + + /// + /// + /// + SeparatorFormField = 1, + + /// + /// + /// + TextLineFormField = 2, + + /// + /// + /// + MultilineTextFormField = 3, + + /// + /// + /// + IntegerFormField = 4, + + /// + /// + /// + AddressFormField = 5, + + /// + /// + /// + ChoiceFormField = 6, + + /// + /// + /// + OpenFileNameFormField = 7, + + /// + /// + /// + SaveFileNameFormField = 8, + + /// + /// + /// + DirectoryNameFormField = 9, + + /// + /// + /// + CheckboxFormField = 10 + } +} \ No newline at end of file diff --git a/Enumeration/BNFunctionAnalysisSkipOverride.cs b/Enumeration/BNFunctionAnalysisSkipOverride.cs new file mode 100644 index 0000000..578b180 --- /dev/null +++ b/Enumeration/BNFunctionAnalysisSkipOverride.cs @@ -0,0 +1,25 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum FunctionAnalysisSkipOverride : uint + { + /// + /// + /// + DefaultFunctionAnalysisSkip = 0, + + /// + /// + /// + NeverSkipFunctionAnalysis = 1, + + /// + /// + /// + AlwaysSkipFunctionAnalysis = 2 + } +} \ No newline at end of file diff --git a/Enumeration/BNFunctionGraphType.cs b/Enumeration/BNFunctionGraphType.cs new file mode 100644 index 0000000..f5da8b2 --- /dev/null +++ b/Enumeration/BNFunctionGraphType.cs @@ -0,0 +1,70 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum FunctionGraphType : uint + { + /// + /// + /// + InvalidILViewType = 0xffffffff, + + /// + /// + /// + NormalFunctionGraph = 0, + + /// + /// + /// + LowLevelILFunctionGraph = 1, + + /// + /// + /// + LiftedILFunctionGraph = 2, + + /// + /// + /// + LowLevelILSSAFormFunctionGraph = 3, + + /// + /// + /// + MediumLevelILFunctionGraph = 4, + + /// + /// + /// + MediumLevelILSSAFormFunctionGraph = 5, + + /// + /// + /// + MappedMediumLevelILFunctionGraph = 6, + + /// + /// + /// + MappedMediumLevelILSSAFormFunctionGraph = 7, + + /// + /// + /// + HighLevelILFunctionGraph = 8, + + /// + /// + /// + HighLevelILSSAFormFunctionGraph = 9, + + /// + /// + /// + HighLevelLanguageRepresentationFunctionGraph = 10 + } +} \ No newline at end of file diff --git a/Enumeration/BNFunctionUpdateType.cs b/Enumeration/BNFunctionUpdateType.cs new file mode 100644 index 0000000..03394fe --- /dev/null +++ b/Enumeration/BNFunctionUpdateType.cs @@ -0,0 +1,25 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum FunctionUpdateType : uint + { + /// + /// + /// + UserFunctionUpdate = 0, + + /// + /// + /// + FullAutoFunctionUpdate = 1, + + /// + /// + /// + IncrementalAutoFunctionUpdate = 2 + } +} \ No newline at end of file diff --git a/Enumeration/BNHighLevelILOperation.cs b/Enumeration/BNHighLevelILOperation.cs new file mode 100644 index 0000000..80050a4 --- /dev/null +++ b/Enumeration/BNHighLevelILOperation.cs @@ -0,0 +1,640 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum HighLevelILOperation : uint + { + /// + /// + /// + HLIL_NOP = 0, + + /// + /// + /// + HLIL_BLOCK = 1, + + /// + /// + /// + HLIL_IF = 2, + + /// + /// + /// + HLIL_WHILE = 3, + + /// + /// + /// + HLIL_DO_WHILE = 4, + + /// + /// + /// + HLIL_FOR = 5, + + /// + /// + /// + HLIL_SWITCH = 6, + + /// + /// + /// + HLIL_CASE = 7, + + /// + /// + /// + HLIL_BREAK = 8, + + /// + /// + /// + HLIL_CONTINUE = 9, + + /// + /// + /// + HLIL_JUMP = 10, + + /// + /// + /// + HLIL_RET = 11, + + /// + /// + /// + HLIL_NORET = 12, + + /// + /// + /// + HLIL_GOTO = 13, + + /// + /// + /// + HLIL_LABEL = 14, + + /// + /// + /// + HLIL_VAR_DECLARE = 15, + + /// + /// + /// + HLIL_VAR_INIT = 16, + + /// + /// + /// + HLIL_ASSIGN = 17, + + /// + /// + /// + HLIL_ASSIGN_UNPACK = 18, + + /// + /// + /// + HLIL_FORCE_VER = 19, + + /// + /// + /// + HLIL_ASSERT = 20, + + /// + /// + /// + HLIL_VAR = 21, + + /// + /// + /// + HLIL_STRUCT_FIELD = 22, + + /// + /// + /// + HLIL_ARRAY_INDEX = 23, + + /// + /// + /// + HLIL_SPLIT = 24, + + /// + /// + /// + HLIL_DEREF = 25, + + /// + /// + /// + HLIL_DEREF_FIELD = 26, + + /// + /// + /// + HLIL_ADDRESS_OF = 27, + + /// + /// + /// + HLIL_CONST = 28, + + /// + /// + /// + HLIL_CONST_DATA = 29, + + /// + /// + /// + HLIL_CONST_PTR = 30, + + /// + /// + /// + HLIL_EXTERN_PTR = 31, + + /// + /// + /// + HLIL_FLOAT_CONST = 32, + + /// + /// + /// + HLIL_IMPORT = 33, + + /// + /// + /// + HLIL_ADD = 34, + + /// + /// + /// + HLIL_ADC = 35, + + /// + /// + /// + HLIL_SUB = 36, + + /// + /// + /// + HLIL_SBB = 37, + + /// + /// + /// + HLIL_AND = 38, + + /// + /// + /// + HLIL_OR = 39, + + /// + /// + /// + HLIL_XOR = 40, + + /// + /// + /// + HLIL_LSL = 41, + + /// + /// + /// + HLIL_LSR = 42, + + /// + /// + /// + HLIL_ASR = 43, + + /// + /// + /// + HLIL_ROL = 44, + + /// + /// + /// + HLIL_RLC = 45, + + /// + /// + /// + HLIL_ROR = 46, + + /// + /// + /// + HLIL_RRC = 47, + + /// + /// + /// + HLIL_MUL = 48, + + /// + /// + /// + HLIL_MULU_DP = 49, + + /// + /// + /// + HLIL_MULS_DP = 50, + + /// + /// + /// + HLIL_DIVU = 51, + + /// + /// + /// + HLIL_DIVU_DP = 52, + + /// + /// + /// + HLIL_DIVS = 53, + + /// + /// + /// + HLIL_DIVS_DP = 54, + + /// + /// + /// + HLIL_MODU = 55, + + /// + /// + /// + HLIL_MODU_DP = 56, + + /// + /// + /// + HLIL_MODS = 57, + + /// + /// + /// + HLIL_MODS_DP = 58, + + /// + /// + /// + HLIL_NEG = 59, + + /// + /// + /// + HLIL_NOT = 60, + + /// + /// + /// + HLIL_SX = 61, + + /// + /// + /// + HLIL_ZX = 62, + + /// + /// + /// + HLIL_LOW_PART = 63, + + /// + /// + /// + HLIL_CALL = 64, + + /// + /// + /// + HLIL_CMP_E = 65, + + /// + /// + /// + HLIL_CMP_NE = 66, + + /// + /// + /// + HLIL_CMP_SLT = 67, + + /// + /// + /// + HLIL_CMP_ULT = 68, + + /// + /// + /// + HLIL_CMP_SLE = 69, + + /// + /// + /// + HLIL_CMP_ULE = 70, + + /// + /// + /// + HLIL_CMP_SGE = 71, + + /// + /// + /// + HLIL_CMP_UGE = 72, + + /// + /// + /// + HLIL_CMP_SGT = 73, + + /// + /// + /// + HLIL_CMP_UGT = 74, + + /// + /// + /// + HLIL_TEST_BIT = 75, + + /// + /// + /// + HLIL_BOOL_TO_INT = 76, + + /// + /// + /// + HLIL_ADD_OVERFLOW = 77, + + /// + /// + /// + HLIL_SYSCALL = 78, + + /// + /// + /// + HLIL_TAILCALL = 79, + + /// + /// + /// + HLIL_INTRINSIC = 80, + + /// + /// + /// + HLIL_BP = 81, + + /// + /// + /// + HLIL_TRAP = 82, + + /// + /// + /// + HLIL_UNDEF = 83, + + /// + /// + /// + HLIL_UNIMPL = 84, + + /// + /// + /// + HLIL_UNIMPL_MEM = 85, + + /// + /// + /// + HLIL_FADD = 86, + + /// + /// + /// + HLIL_FSUB = 87, + + /// + /// + /// + HLIL_FMUL = 88, + + /// + /// + /// + HLIL_FDIV = 89, + + /// + /// + /// + HLIL_FSQRT = 90, + + /// + /// + /// + HLIL_FNEG = 91, + + /// + /// + /// + HLIL_FABS = 92, + + /// + /// + /// + HLIL_FLOAT_TO_INT = 93, + + /// + /// + /// + HLIL_INT_TO_FLOAT = 94, + + /// + /// + /// + HLIL_FLOAT_CONV = 95, + + /// + /// + /// + HLIL_ROUND_TO_INT = 96, + + /// + /// + /// + HLIL_FLOOR = 97, + + /// + /// + /// + HLIL_CEIL = 98, + + /// + /// + /// + HLIL_FTRUNC = 99, + + /// + /// + /// + HLIL_FCMP_E = 100, + + /// + /// + /// + HLIL_FCMP_NE = 101, + + /// + /// + /// + HLIL_FCMP_LT = 102, + + /// + /// + /// + HLIL_FCMP_LE = 103, + + /// + /// + /// + HLIL_FCMP_GE = 104, + + /// + /// + /// + HLIL_FCMP_GT = 105, + + /// + /// + /// + HLIL_FCMP_O = 106, + + /// + /// + /// + HLIL_FCMP_UO = 107, + + /// + /// + /// + HLIL_UNREACHABLE = 108, + + /// + /// + /// + HLIL_WHILE_SSA = 109, + + /// + /// + /// + HLIL_DO_WHILE_SSA = 110, + + /// + /// + /// + HLIL_FOR_SSA = 111, + + /// + /// + /// + HLIL_VAR_INIT_SSA = 112, + + /// + /// + /// + HLIL_ASSIGN_MEM_SSA = 113, + + /// + /// + /// + HLIL_ASSIGN_UNPACK_MEM_SSA = 114, + + /// + /// + /// + HLIL_FORCE_VER_SSA = 115, + + /// + /// + /// + HLIL_ASSERT_SSA = 116, + + /// + /// + /// + HLIL_VAR_SSA = 117, + + /// + /// + /// + HLIL_ARRAY_INDEX_SSA = 118, + + /// + /// + /// + HLIL_DEREF_SSA = 119, + + /// + /// + /// + HLIL_DEREF_FIELD_SSA = 120, + + /// + /// + /// + HLIL_CALL_SSA = 121, + + /// + /// + /// + HLIL_SYSCALL_SSA = 122, + + /// + /// + /// + HLIL_INTRINSIC_SSA = 123, + + /// + /// + /// + HLIL_VAR_PHI = 124, + + /// + /// + /// + HLIL_MEM_PHI = 125 + } +} \ No newline at end of file diff --git a/Enumeration/BNHighlightColorStyle.cs b/Enumeration/BNHighlightColorStyle.cs new file mode 100644 index 0000000..feb784e --- /dev/null +++ b/Enumeration/BNHighlightColorStyle.cs @@ -0,0 +1,25 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum HighlightColorStyle : uint + { + /// + /// + /// + StandardHighlightColor = 0, + + /// + /// + /// + MixedHighlightColor = 1, + + /// + /// + /// + CustomHighlightColor = 2 + } +} \ No newline at end of file diff --git a/Enumeration/BNHighlightStandardColor.cs b/Enumeration/BNHighlightStandardColor.cs new file mode 100644 index 0000000..4a55501 --- /dev/null +++ b/Enumeration/BNHighlightStandardColor.cs @@ -0,0 +1,60 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum HighlightStandardColor : uint + { + /// + /// + /// + NoHighlightColor = 0, + + /// + /// + /// + BlueHighlightColor = 1, + + /// + /// + /// + GreenHighlightColor = 2, + + /// + /// + /// + CyanHighlightColor = 3, + + /// + /// + /// + RedHighlightColor = 4, + + /// + /// + /// + MagentaHighlightColor = 5, + + /// + /// + /// + YellowHighlightColor = 6, + + /// + /// + /// + OrangeHighlightColor = 7, + + /// + /// + /// + WhiteHighlightColor = 8, + + /// + /// + /// + BlackHighlightColor = 9 + } +} \ No newline at end of file diff --git a/Enumeration/BNILBranchDependence.cs b/Enumeration/BNILBranchDependence.cs new file mode 100644 index 0000000..361bd0a --- /dev/null +++ b/Enumeration/BNILBranchDependence.cs @@ -0,0 +1,25 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum ILBranchDependence : uint + { + /// + /// + /// + NotBranchDependent = 0, + + /// + /// + /// + TrueBranchDependent = 1, + + /// + /// + /// + FalseBranchDependent = 2 + } +} \ No newline at end of file diff --git a/Enumeration/BNILInstructionAttribute.cs b/Enumeration/BNILInstructionAttribute.cs new file mode 100644 index 0000000..09bcae8 --- /dev/null +++ b/Enumeration/BNILInstructionAttribute.cs @@ -0,0 +1,75 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum ILInstructionAttribute : uint + { + /// + /// + /// + ILAllowDeadStoreElimination = 1, + + /// + /// + /// + ILPreventDeadStoreElimination = 2, + + /// + /// + /// + MLILAssumePossibleUse = 4, + + /// + /// + /// + MLILUnknownSize = 8, + + /// + /// + /// + SrcInstructionUsesPointerAuth = 16, + + /// + /// + /// + ILPreventAliasAnalysis = 32, + + /// + /// + /// + ILIsCFGProtected = 64, + + /// + /// + /// + MLILPossiblyUnusedIntermediate = 128, + + /// + /// + /// + HLILFoldableExpr = 256, + + /// + /// + /// + HLILInvertableCondition = 512, + + /// + /// + /// + HLILEarlyReturnPossible = 1024, + + /// + /// + /// + HLILSwitchRecoveryPossible = 2048, + + /// + /// + /// + ILTransparentCopy = 4096 + } +} \ No newline at end of file diff --git a/Enumeration/BNImplicitRegisterExtend.cs b/Enumeration/BNImplicitRegisterExtend.cs new file mode 100644 index 0000000..bb82fb8 --- /dev/null +++ b/Enumeration/BNImplicitRegisterExtend.cs @@ -0,0 +1,25 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum ImplicitRegisterExtend : uint + { + /// + /// + /// + NoExtend = 0, + + /// + /// + /// + ZeroExtendToFullWidth = 1, + + /// + /// + /// + SignExtendToFullWidth = 2 + } +} \ No newline at end of file diff --git a/Enumeration/BNInstructionTextTokenContext.cs b/Enumeration/BNInstructionTextTokenContext.cs new file mode 100644 index 0000000..70b593f --- /dev/null +++ b/Enumeration/BNInstructionTextTokenContext.cs @@ -0,0 +1,80 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum InstructionTextTokenContext : uint + { + /// + /// + /// + NoTokenContext = 0, + + /// + /// + /// + LocalVariableTokenContext = 1, + + /// + /// + /// + DataVariableTokenContext = 2, + + /// + /// + /// + FunctionReturnTokenContext = 3, + + /// + /// + /// + InstructionAddressTokenContext = 4, + + /// + /// + /// + ILInstructionIndexTokenContext = 5, + + /// + /// + /// + ConstDataTokenContext = 6, + + /// + /// + /// + ConstStringDataTokenContext = 7, + + /// + /// + /// + StringReferenceTokenContext = 8, + + /// + /// + /// + StringDataVariableTokenContext = 9, + + /// + /// + /// + StringDisplayTokenContext = 10, + + /// + /// + /// + ContentCollapsedContext = 11, + + /// + /// + /// + ContentExpandedContext = 12, + + /// + /// + /// + ContentCollapsiblePadding = 13 + } +} \ No newline at end of file diff --git a/Enumeration/BNInstructionTextTokenType.cs b/Enumeration/BNInstructionTextTokenType.cs new file mode 100644 index 0000000..5f27c45 --- /dev/null +++ b/Enumeration/BNInstructionTextTokenType.cs @@ -0,0 +1,272 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum InstructionTextTokenType : uint + { + + /// + /// + /// + TextToken = 0, + + /// + /// + /// + InstructionToken = 1, + + /// + /// + /// + OperandSeparatorToken = 2, + + /// + /// + /// + RegisterToken = 3, + + /// + /// + /// + IntegerToken = 4, + + /// + /// + /// + PossibleAddressToken = 5, + + /// + /// + /// + BeginMemoryOperandToken = 6, + + /// + /// + /// + EndMemoryOperandToken = 7, + + /// + /// + /// + FloatingPointToken = 8, + + /// + /// + /// + AnnotationToken = 9, + + /// + /// + /// + CodeRelativeAddressToken = 10, + + /// + /// + /// + ArgumentNameToken = 11, + + /// + /// + /// + HexDumpByteValueToken = 12, + + /// + /// + /// + HexDumpSkippedByteToken = 13, + + /// + /// + /// + HexDumpInvalidByteToken = 14, + + /// + /// + /// + HexDumpTextToken = 15, + + /// + /// + /// + OpcodeToken = 16, + + /// + /// + /// + StringToken = 17, + + /// + /// + /// + CharacterConstantToken = 18, + + /// + /// + /// + KeywordToken = 19, + + /// + /// + /// + TypeNameToken = 20, + + /// + /// + /// + FieldNameToken = 21, + + /// + /// + /// + NameSpaceToken = 22, + + /// + /// + /// + NameSpaceSeparatorToken = 23, + + /// + /// + /// + TagToken = 24, + + /// + /// + /// + StructOffsetToken = 25, + + /// + /// + /// + StructOffsetByteValueToken = 26, + + /// + /// + /// + StructureHexDumpTextToken = 27, + + /// + /// + /// + GotoLabelToken = 28, + + /// + /// + /// + CommentToken = 29, + + /// + /// + /// + PossibleValueToken = 30, + + /// + /// + /// + PossibleValueTypeToken = 31, + + /// + /// + /// + ArrayIndexToken = 32, + + /// + /// + /// + IndentationToken = 33, + + /// + /// + /// + UnknownMemoryToken = 34, + + /// + /// + /// + EnumerationMemberToken = 35, + + /// + /// + /// + OperationToken = 36, + + /// + /// + /// + BaseStructureNameToken = 37, + + /// + /// + /// + BaseStructureSeparatorToken = 38, + + /// + /// + /// + BraceToken = 39, + + /// + /// + /// + CodeSymbolToken = 64, + + /// + /// + /// + DataSymbolToken = 65, + + /// + /// + /// + LocalVariableToken = 66, + + /// + /// + /// + ImportToken = 67, + + /// + /// + /// + AddressDisplayToken = 68, + + /// + /// + /// + IndirectImportToken = 69, + + /// + /// + /// + ExternalSymbolToken = 70, + + /// + /// + /// + StackVariableToken = 71, + + /// + /// + /// + AddressSeparatorToken = 72, + + /// + /// + /// + CollapsedInformationToken = 73, + + /// + /// + /// + CollapseStateIndicatorToken = 74, + + /// + /// + /// + NewLineToken = 75 + + } +} \ No newline at end of file diff --git a/Enumeration/BNIntegerDisplayType.cs b/Enumeration/BNIntegerDisplayType.cs new file mode 100644 index 0000000..74b36e6 --- /dev/null +++ b/Enumeration/BNIntegerDisplayType.cs @@ -0,0 +1,80 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum IntegerDisplayType : uint + { + /// + /// + /// + DefaultIntegerDisplayType = 0, + + /// + /// + /// + BinaryDisplayType = 1, + + /// + /// + /// + SignedOctalDisplayType = 2, + + /// + /// + /// + UnsignedOctalDisplayType = 3, + + /// + /// + /// + SignedDecimalDisplayType = 4, + + /// + /// + /// + UnsignedDecimalDisplayType = 5, + + /// + /// + /// + SignedHexadecimalDisplayType = 6, + + /// + /// + /// + UnsignedHexadecimalDisplayType = 7, + + /// + /// + /// + CharacterConstantDisplayType = 8, + + /// + /// + /// + PointerDisplayType = 9, + + /// + /// + /// + FloatDisplayType = 10, + + /// + /// + /// + DoubleDisplayType = 11, + + /// + /// + /// + EnumerationDisplayType = 12, + + /// + /// + /// + InvertedCharacterConstantDisplayType = 13 + } +} \ No newline at end of file diff --git a/Enumeration/BNIntrinsicClass.cs b/Enumeration/BNIntrinsicClass.cs new file mode 100644 index 0000000..0f4bcc6 --- /dev/null +++ b/Enumeration/BNIntrinsicClass.cs @@ -0,0 +1,20 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum IntrinsicClass : uint + { + /// + /// + /// + GeneralIntrinsicClass = 0, + + /// + /// + /// + MemoryIntrinsicClass = 1 + } +} \ No newline at end of file diff --git a/Enumeration/BNLinearDisassemblyLineType.cs b/Enumeration/BNLinearDisassemblyLineType.cs new file mode 100644 index 0000000..0331e74 --- /dev/null +++ b/Enumeration/BNLinearDisassemblyLineType.cs @@ -0,0 +1,115 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum LinearDisassemblyLineType : uint + { + /// + /// + /// + BlankLineType = 0, + + /// + /// + /// + BasicLineType = 1, + + /// + /// + /// + CodeDisassemblyLineType = 2, + + /// + /// + /// + DataVariableLineType = 3, + + /// + /// + /// + HexDumpLineType = 4, + + /// + /// + /// + FunctionHeaderLineType = 5, + + /// + /// + /// + FunctionHeaderStartLineType = 6, + + /// + /// + /// + FunctionHeaderEndLineType = 7, + + /// + /// + /// + FunctionContinuationLineType = 8, + + /// + /// + /// + LocalVariableLineType = 9, + + /// + /// + /// + LocalVariableListEndLineType = 10, + + /// + /// + /// + FunctionEndLineType = 11, + + /// + /// + /// + NoteStartLineType = 12, + + /// + /// + /// + NoteLineType = 13, + + /// + /// + /// + NoteEndLineType = 14, + + /// + /// + /// + SectionStartLineType = 15, + + /// + /// + /// + SectionEndLineType = 16, + + /// + /// + /// + SectionSeparatorLineType = 17, + + /// + /// + /// + NonContiguousSeparatorLineType = 18, + + /// + /// + /// + AnalysisWarningLineType = 19, + + /// + /// + /// + CollapsedFunctionEndLineType = 20 + } +} \ No newline at end of file diff --git a/Enumeration/BNLinearViewObjectIdentifierType.cs b/Enumeration/BNLinearViewObjectIdentifierType.cs new file mode 100644 index 0000000..7cafd34 --- /dev/null +++ b/Enumeration/BNLinearViewObjectIdentifierType.cs @@ -0,0 +1,25 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum LinearViewObjectIdentifierType : uint + { + /// + /// + /// + SingleLinearViewObject = 0, + + /// + /// + /// + AddressLinearViewObject = 1, + + /// + /// + /// + AddressRangeLinearViewObject = 2 + } +} \ No newline at end of file diff --git a/Enumeration/BNLogLevel.cs b/Enumeration/BNLogLevel.cs new file mode 100644 index 0000000..c340ab2 --- /dev/null +++ b/Enumeration/BNLogLevel.cs @@ -0,0 +1,35 @@ +using System; + +namespace BinaryNinja +{ + /// + /// Console log levels + /// + public enum LogLevel : uint + { + /// + /// + /// + DebugLog = 0, + + /// + /// Debug logging level, most verbose logging level + /// + InfoLog = 1, + + /// + /// Information logging level, default logging level + /// + WarningLog = 2, + + /// + /// Warning logging level, messages show with warning icon in the UI + /// + ErrorLog = 3, + + /// + /// Error logging level, messages show with error icon in the UI + /// + AlertLog = 4 + } +} \ No newline at end of file diff --git a/Enumeration/BNLowLevelILFlagCondition.cs b/Enumeration/BNLowLevelILFlagCondition.cs new file mode 100644 index 0000000..1130072 --- /dev/null +++ b/Enumeration/BNLowLevelILFlagCondition.cs @@ -0,0 +1,120 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum LowLevelILFlagCondition : uint + { + /// + /// + /// + LLFC_E = 0, + + /// + /// + /// + LLFC_NE = 1, + + /// + /// + /// + LLFC_SLT = 2, + + /// + /// + /// + LLFC_ULT = 3, + + /// + /// + /// + LLFC_SLE = 4, + + /// + /// + /// + LLFC_ULE = 5, + + /// + /// + /// + LLFC_SGE = 6, + + /// + /// + /// + LLFC_UGE = 7, + + /// + /// + /// + LLFC_SGT = 8, + + /// + /// + /// + LLFC_UGT = 9, + + /// + /// + /// + LLFC_NEG = 10, + + /// + /// + /// + LLFC_POS = 11, + + /// + /// + /// + LLFC_O = 12, + + /// + /// + /// + LLFC_NO = 13, + + /// + /// + /// + LLFC_FE = 14, + + /// + /// + /// + LLFC_FNE = 15, + + /// + /// + /// + LLFC_FLT = 16, + + /// + /// + /// + LLFC_FLE = 17, + + /// + /// + /// + LLFC_FGE = 18, + + /// + /// + /// + LLFC_FGT = 19, + + /// + /// + /// + LLFC_FO = 20, + + /// + /// + /// + LLFC_FUO = 21 + } +} \ No newline at end of file diff --git a/Enumeration/BNLowLevelILOperation.cs b/Enumeration/BNLowLevelILOperation.cs new file mode 100644 index 0000000..a845560 --- /dev/null +++ b/Enumeration/BNLowLevelILOperation.cs @@ -0,0 +1,725 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum LowLevelILOperation : uint + { + /// + /// + /// + LLIL_NOP = 0, + + /// + /// + /// + LLIL_SET_REG = 1, + + /// + /// + /// + LLIL_SET_REG_SPLIT = 2, + + /// + /// + /// + LLIL_SET_FLAG = 3, + + /// + /// + /// + LLIL_SET_REG_STACK_REL = 4, + + /// + /// + /// + LLIL_REG_STACK_PUSH = 5, + + /// + /// + /// + LLIL_ASSERT = 6, + + /// + /// + /// + LLIL_FORCE_VER = 7, + + /// + /// + /// + LLIL_LOAD = 8, + + /// + /// + /// + LLIL_STORE = 9, + + /// + /// + /// + LLIL_PUSH = 10, + + /// + /// + /// + LLIL_POP = 11, + + /// + /// + /// + LLIL_REG = 12, + + /// + /// + /// + LLIL_REG_SPLIT = 13, + + /// + /// + /// + LLIL_REG_STACK_REL = 14, + + /// + /// + /// + LLIL_REG_STACK_POP = 15, + + /// + /// + /// + LLIL_REG_STACK_FREE_REG = 16, + + /// + /// + /// + LLIL_REG_STACK_FREE_REL = 17, + + /// + /// + /// + LLIL_CONST = 18, + + /// + /// + /// + LLIL_CONST_PTR = 19, + + /// + /// + /// + LLIL_EXTERN_PTR = 20, + + /// + /// + /// + LLIL_FLOAT_CONST = 21, + + /// + /// + /// + LLIL_FLAG = 22, + + /// + /// + /// + LLIL_FLAG_BIT = 23, + + /// + /// + /// + LLIL_ADD = 24, + + /// + /// + /// + LLIL_ADC = 25, + + /// + /// + /// + LLIL_SUB = 26, + + /// + /// + /// + LLIL_SBB = 27, + + /// + /// + /// + LLIL_AND = 28, + + /// + /// + /// + LLIL_OR = 29, + + /// + /// + /// + LLIL_XOR = 30, + + /// + /// + /// + LLIL_LSL = 31, + + /// + /// + /// + LLIL_LSR = 32, + + /// + /// + /// + LLIL_ASR = 33, + + /// + /// + /// + LLIL_ROL = 34, + + /// + /// + /// + LLIL_RLC = 35, + + /// + /// + /// + LLIL_ROR = 36, + + /// + /// + /// + LLIL_RRC = 37, + + /// + /// + /// + LLIL_MUL = 38, + + /// + /// + /// + LLIL_MULU_DP = 39, + + /// + /// + /// + LLIL_MULS_DP = 40, + + /// + /// + /// + LLIL_DIVU = 41, + + /// + /// + /// + LLIL_DIVU_DP = 42, + + /// + /// + /// + LLIL_DIVS = 43, + + /// + /// + /// + LLIL_DIVS_DP = 44, + + /// + /// + /// + LLIL_MODU = 45, + + /// + /// + /// + LLIL_MODU_DP = 46, + + /// + /// + /// + LLIL_MODS = 47, + + /// + /// + /// + LLIL_MODS_DP = 48, + + /// + /// + /// + LLIL_NEG = 49, + + /// + /// + /// + LLIL_NOT = 50, + + /// + /// + /// + LLIL_SX = 51, + + /// + /// + /// + LLIL_ZX = 52, + + /// + /// + /// + LLIL_LOW_PART = 53, + + /// + /// + /// + LLIL_JUMP = 54, + + /// + /// + /// + LLIL_JUMP_TO = 55, + + /// + /// + /// + LLIL_CALL = 56, + + /// + /// + /// + LLIL_CALL_STACK_ADJUST = 57, + + /// + /// + /// + LLIL_TAILCALL = 58, + + /// + /// + /// + LLIL_RET = 59, + + /// + /// + /// + LLIL_NORET = 60, + + /// + /// + /// + LLIL_IF = 61, + + /// + /// + /// + LLIL_GOTO = 62, + + /// + /// + /// + LLIL_FLAG_COND = 63, + + /// + /// + /// + LLIL_FLAG_GROUP = 64, + + /// + /// + /// + LLIL_CMP_E = 65, + + /// + /// + /// + LLIL_CMP_NE = 66, + + /// + /// + /// + LLIL_CMP_SLT = 67, + + /// + /// + /// + LLIL_CMP_ULT = 68, + + /// + /// + /// + LLIL_CMP_SLE = 69, + + /// + /// + /// + LLIL_CMP_ULE = 70, + + /// + /// + /// + LLIL_CMP_SGE = 71, + + /// + /// + /// + LLIL_CMP_UGE = 72, + + /// + /// + /// + LLIL_CMP_SGT = 73, + + /// + /// + /// + LLIL_CMP_UGT = 74, + + /// + /// + /// + LLIL_TEST_BIT = 75, + + /// + /// + /// + LLIL_BOOL_TO_INT = 76, + + /// + /// + /// + LLIL_ADD_OVERFLOW = 77, + + /// + /// + /// + LLIL_SYSCALL = 78, + + /// + /// + /// + LLIL_BP = 79, + + /// + /// + /// + LLIL_TRAP = 80, + + /// + /// + /// + LLIL_INTRINSIC = 81, + + /// + /// + /// + LLIL_UNDEF = 82, + + /// + /// + /// + LLIL_UNIMPL = 83, + + /// + /// + /// + LLIL_UNIMPL_MEM = 84, + + /// + /// + /// + LLIL_FADD = 85, + + /// + /// + /// + LLIL_FSUB = 86, + + /// + /// + /// + LLIL_FMUL = 87, + + /// + /// + /// + LLIL_FDIV = 88, + + /// + /// + /// + LLIL_FSQRT = 89, + + /// + /// + /// + LLIL_FNEG = 90, + + /// + /// + /// + LLIL_FABS = 91, + + /// + /// + /// + LLIL_FLOAT_TO_INT = 92, + + /// + /// + /// + LLIL_INT_TO_FLOAT = 93, + + /// + /// + /// + LLIL_FLOAT_CONV = 94, + + /// + /// + /// + LLIL_ROUND_TO_INT = 95, + + /// + /// + /// + LLIL_FLOOR = 96, + + /// + /// + /// + LLIL_CEIL = 97, + + /// + /// + /// + LLIL_FTRUNC = 98, + + /// + /// + /// + LLIL_FCMP_E = 99, + + /// + /// + /// + LLIL_FCMP_NE = 100, + + /// + /// + /// + LLIL_FCMP_LT = 101, + + /// + /// + /// + LLIL_FCMP_LE = 102, + + /// + /// + /// + LLIL_FCMP_GE = 103, + + /// + /// + /// + LLIL_FCMP_GT = 104, + + /// + /// + /// + LLIL_FCMP_O = 105, + + /// + /// + /// + LLIL_FCMP_UO = 106, + + /// + /// + /// + LLIL_SET_REG_SSA = 107, + + /// + /// + /// + LLIL_SET_REG_SSA_PARTIAL = 108, + + /// + /// + /// + LLIL_SET_REG_SPLIT_SSA = 109, + + /// + /// + /// + LLIL_SET_REG_STACK_REL_SSA = 110, + + /// + /// + /// + LLIL_SET_REG_STACK_ABS_SSA = 111, + + /// + /// + /// + LLIL_REG_SPLIT_DEST_SSA = 112, + + /// + /// + /// + LLIL_REG_STACK_DEST_SSA = 113, + + /// + /// + /// + LLIL_REG_SSA = 114, + + /// + /// + /// + LLIL_REG_SSA_PARTIAL = 115, + + /// + /// + /// + LLIL_REG_SPLIT_SSA = 116, + + /// + /// + /// + LLIL_REG_STACK_REL_SSA = 117, + + /// + /// + /// + LLIL_REG_STACK_ABS_SSA = 118, + + /// + /// + /// + LLIL_REG_STACK_FREE_REL_SSA = 119, + + /// + /// + /// + LLIL_REG_STACK_FREE_ABS_SSA = 120, + + /// + /// + /// + LLIL_SET_FLAG_SSA = 121, + + /// + /// + /// + LLIL_ASSERT_SSA = 122, + + /// + /// + /// + LLIL_FORCE_VER_SSA = 123, + + /// + /// + /// + LLIL_FLAG_SSA = 124, + + /// + /// + /// + LLIL_FLAG_BIT_SSA = 125, + + /// + /// + /// + LLIL_CALL_SSA = 126, + + /// + /// + /// + LLIL_SYSCALL_SSA = 127, + + /// + /// + /// + LLIL_TAILCALL_SSA = 128, + + /// + /// + /// + LLIL_CALL_PARAM = 129, + + /// + /// + /// + LLIL_CALL_STACK_SSA = 130, + + /// + /// + /// + LLIL_CALL_OUTPUT_SSA = 131, + + /// + /// + /// + LLIL_SEPARATE_PARAM_LIST_SSA = 132, + + /// + /// + /// + LLIL_SHARED_PARAM_SLOT_SSA = 133, + + /// + /// + /// + LLIL_MEMORY_INTRINSIC_OUTPUT_SSA = 134, + + /// + /// + /// + LLIL_LOAD_SSA = 135, + + /// + /// + /// + LLIL_STORE_SSA = 136, + + /// + /// + /// + LLIL_INTRINSIC_SSA = 137, + + /// + /// + /// + LLIL_MEMORY_INTRINSIC_SSA = 138, + + /// + /// + /// + LLIL_REG_PHI = 139, + + /// + /// + /// + LLIL_REG_STACK_PHI = 140, + + /// + /// + /// + LLIL_FLAG_PHI = 141, + + /// + /// + /// + LLIL_MEM_PHI = 142 + } +} \ No newline at end of file diff --git a/Enumeration/BNMediumLevelILOperation.cs b/Enumeration/BNMediumLevelILOperation.cs new file mode 100644 index 0000000..ab6f125 --- /dev/null +++ b/Enumeration/BNMediumLevelILOperation.cs @@ -0,0 +1,710 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum MediumLevelILOperation : uint + { + /// + /// + /// + MLIL_NOP = 0, + + /// + /// + /// + MLIL_SET_VAR = 1, + + /// + /// + /// + MLIL_SET_VAR_FIELD = 2, + + /// + /// + /// + MLIL_SET_VAR_SPLIT = 3, + + /// + /// + /// + MLIL_ASSERT = 4, + + /// + /// + /// + MLIL_FORCE_VER = 5, + + /// + /// + /// + MLIL_LOAD = 6, + + /// + /// + /// + MLIL_LOAD_STRUCT = 7, + + /// + /// + /// + MLIL_STORE = 8, + + /// + /// + /// + MLIL_STORE_STRUCT = 9, + + /// + /// + /// + MLIL_VAR = 10, + + /// + /// + /// + MLIL_VAR_FIELD = 11, + + /// + /// + /// + MLIL_VAR_SPLIT = 12, + + /// + /// + /// + MLIL_ADDRESS_OF = 13, + + /// + /// + /// + MLIL_ADDRESS_OF_FIELD = 14, + + /// + /// + /// + MLIL_CONST = 15, + + /// + /// + /// + MLIL_CONST_DATA = 16, + + /// + /// + /// + MLIL_CONST_PTR = 17, + + /// + /// + /// + MLIL_EXTERN_PTR = 18, + + /// + /// + /// + MLIL_FLOAT_CONST = 19, + + /// + /// + /// + MLIL_IMPORT = 20, + + /// + /// + /// + MLIL_ADD = 21, + + /// + /// + /// + MLIL_ADC = 22, + + /// + /// + /// + MLIL_SUB = 23, + + /// + /// + /// + MLIL_SBB = 24, + + /// + /// + /// + MLIL_AND = 25, + + /// + /// + /// + MLIL_OR = 26, + + /// + /// + /// + MLIL_XOR = 27, + + /// + /// + /// + MLIL_LSL = 28, + + /// + /// + /// + MLIL_LSR = 29, + + /// + /// + /// + MLIL_ASR = 30, + + /// + /// + /// + MLIL_ROL = 31, + + /// + /// + /// + MLIL_RLC = 32, + + /// + /// + /// + MLIL_ROR = 33, + + /// + /// + /// + MLIL_RRC = 34, + + /// + /// + /// + MLIL_MUL = 35, + + /// + /// + /// + MLIL_MULU_DP = 36, + + /// + /// + /// + MLIL_MULS_DP = 37, + + /// + /// + /// + MLIL_DIVU = 38, + + /// + /// + /// + MLIL_DIVU_DP = 39, + + /// + /// + /// + MLIL_DIVS = 40, + + /// + /// + /// + MLIL_DIVS_DP = 41, + + /// + /// + /// + MLIL_MODU = 42, + + /// + /// + /// + MLIL_MODU_DP = 43, + + /// + /// + /// + MLIL_MODS = 44, + + /// + /// + /// + MLIL_MODS_DP = 45, + + /// + /// + /// + MLIL_NEG = 46, + + /// + /// + /// + MLIL_NOT = 47, + + /// + /// + /// + MLIL_SX = 48, + + /// + /// + /// + MLIL_ZX = 49, + + /// + /// + /// + MLIL_LOW_PART = 50, + + /// + /// + /// + MLIL_JUMP = 51, + + /// + /// + /// + MLIL_JUMP_TO = 52, + + /// + /// + /// + MLIL_RET_HINT = 53, + + /// + /// + /// + MLIL_CALL = 54, + + /// + /// + /// + MLIL_CALL_UNTYPED = 55, + + /// + /// + /// + MLIL_CALL_OUTPUT = 56, + + /// + /// + /// + MLIL_CALL_PARAM = 57, + + /// + /// + /// + MLIL_SEPARATE_PARAM_LIST = 58, + + /// + /// + /// + MLIL_SHARED_PARAM_SLOT = 59, + + /// + /// + /// + MLIL_RET = 60, + + /// + /// + /// + MLIL_NORET = 61, + + /// + /// + /// + MLIL_IF = 62, + + /// + /// + /// + MLIL_GOTO = 63, + + /// + /// + /// + MLIL_CMP_E = 64, + + /// + /// + /// + MLIL_CMP_NE = 65, + + /// + /// + /// + MLIL_CMP_SLT = 66, + + /// + /// + /// + MLIL_CMP_ULT = 67, + + /// + /// + /// + MLIL_CMP_SLE = 68, + + /// + /// + /// + MLIL_CMP_ULE = 69, + + /// + /// + /// + MLIL_CMP_SGE = 70, + + /// + /// + /// + MLIL_CMP_UGE = 71, + + /// + /// + /// + MLIL_CMP_SGT = 72, + + /// + /// + /// + MLIL_CMP_UGT = 73, + + /// + /// + /// + MLIL_TEST_BIT = 74, + + /// + /// + /// + MLIL_BOOL_TO_INT = 75, + + /// + /// + /// + MLIL_ADD_OVERFLOW = 76, + + /// + /// + /// + MLIL_SYSCALL = 77, + + /// + /// + /// + MLIL_SYSCALL_UNTYPED = 78, + + /// + /// + /// + MLIL_TAILCALL = 79, + + /// + /// + /// + MLIL_TAILCALL_UNTYPED = 80, + + /// + /// + /// + MLIL_INTRINSIC = 81, + + /// + /// + /// + MLIL_FREE_VAR_SLOT = 82, + + /// + /// + /// + MLIL_BP = 83, + + /// + /// + /// + MLIL_TRAP = 84, + + /// + /// + /// + MLIL_UNDEF = 85, + + /// + /// + /// + MLIL_UNIMPL = 86, + + /// + /// + /// + MLIL_UNIMPL_MEM = 87, + + /// + /// + /// + MLIL_FADD = 88, + + /// + /// + /// + MLIL_FSUB = 89, + + /// + /// + /// + MLIL_FMUL = 90, + + /// + /// + /// + MLIL_FDIV = 91, + + /// + /// + /// + MLIL_FSQRT = 92, + + /// + /// + /// + MLIL_FNEG = 93, + + /// + /// + /// + MLIL_FABS = 94, + + /// + /// + /// + MLIL_FLOAT_TO_INT = 95, + + /// + /// + /// + MLIL_INT_TO_FLOAT = 96, + + /// + /// + /// + MLIL_FLOAT_CONV = 97, + + /// + /// + /// + MLIL_ROUND_TO_INT = 98, + + /// + /// + /// + MLIL_FLOOR = 99, + + /// + /// + /// + MLIL_CEIL = 100, + + /// + /// + /// + MLIL_FTRUNC = 101, + + /// + /// + /// + MLIL_FCMP_E = 102, + + /// + /// + /// + MLIL_FCMP_NE = 103, + + /// + /// + /// + MLIL_FCMP_LT = 104, + + /// + /// + /// + MLIL_FCMP_LE = 105, + + /// + /// + /// + MLIL_FCMP_GE = 106, + + /// + /// + /// + MLIL_FCMP_GT = 107, + + /// + /// + /// + MLIL_FCMP_O = 108, + + /// + /// + /// + MLIL_FCMP_UO = 109, + + /// + /// + /// + MLIL_SET_VAR_SSA = 110, + + /// + /// + /// + MLIL_SET_VAR_SSA_FIELD = 111, + + /// + /// + /// + MLIL_SET_VAR_SPLIT_SSA = 112, + + /// + /// + /// + MLIL_SET_VAR_ALIASED = 113, + + /// + /// + /// + MLIL_SET_VAR_ALIASED_FIELD = 114, + + /// + /// + /// + MLIL_VAR_SSA = 115, + + /// + /// + /// + MLIL_VAR_SSA_FIELD = 116, + + /// + /// + /// + MLIL_VAR_ALIASED = 117, + + /// + /// + /// + MLIL_VAR_ALIASED_FIELD = 118, + + /// + /// + /// + MLIL_VAR_SPLIT_SSA = 119, + + /// + /// + /// + MLIL_ASSERT_SSA = 120, + + /// + /// + /// + MLIL_FORCE_VER_SSA = 121, + + /// + /// + /// + MLIL_CALL_SSA = 122, + + /// + /// + /// + MLIL_CALL_UNTYPED_SSA = 123, + + /// + /// + /// + MLIL_SYSCALL_SSA = 124, + + /// + /// + /// + MLIL_SYSCALL_UNTYPED_SSA = 125, + + /// + /// + /// + MLIL_TAILCALL_SSA = 126, + + /// + /// + /// + MLIL_TAILCALL_UNTYPED_SSA = 127, + + /// + /// + /// + MLIL_CALL_PARAM_SSA = 128, + + /// + /// + /// + MLIL_CALL_OUTPUT_SSA = 129, + + /// + /// + /// + MLIL_MEMORY_INTRINSIC_OUTPUT_SSA = 130, + + /// + /// + /// + MLIL_LOAD_SSA = 131, + + /// + /// + /// + MLIL_LOAD_STRUCT_SSA = 132, + + /// + /// + /// + MLIL_STORE_SSA = 133, + + /// + /// + /// + MLIL_STORE_STRUCT_SSA = 134, + + /// + /// + /// + MLIL_INTRINSIC_SSA = 135, + + /// + /// + /// + MLIL_MEMORY_INTRINSIC_SSA = 136, + + /// + /// + /// + MLIL_FREE_VAR_SLOT_SSA = 137, + + /// + /// + /// + MLIL_VAR_PHI = 138, + + /// + /// + /// + MLIL_MEM_PHI = 139 + } +} \ No newline at end of file diff --git a/Enumeration/BNMemberAccess.cs b/Enumeration/BNMemberAccess.cs new file mode 100644 index 0000000..b8b8d2e --- /dev/null +++ b/Enumeration/BNMemberAccess.cs @@ -0,0 +1,30 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum MemberAccess : uint + { + /// + /// + /// + NoAccess = 0, + + /// + /// + /// + PrivateAccess = 1, + + /// + /// + /// + ProtectedAccess = 2, + + /// + /// + /// + PublicAccess = 3 + } +} \ No newline at end of file diff --git a/Enumeration/BNMemberScope.cs b/Enumeration/BNMemberScope.cs new file mode 100644 index 0000000..c52eeca --- /dev/null +++ b/Enumeration/BNMemberScope.cs @@ -0,0 +1,35 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum MemberScope : uint + { + /// + /// + /// + NoScope = 0, + + /// + /// + /// + StaticScope = 1, + + /// + /// + /// + VirtualScope = 2, + + /// + /// + /// + ThunkScope = 3, + + /// + /// + /// + FriendScope = 4 + } +} \ No newline at end of file diff --git a/Enumeration/BNMergeConflictDataType.cs b/Enumeration/BNMergeConflictDataType.cs new file mode 100644 index 0000000..3f011df --- /dev/null +++ b/Enumeration/BNMergeConflictDataType.cs @@ -0,0 +1,25 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum MergeConflictDataType : uint + { + /// + /// + /// + TextConflictDataType = 0, + + /// + /// + /// + JsonConflictDataType = 1, + + /// + /// + /// + BinaryConflictDataType = 2 + } +} \ No newline at end of file diff --git a/Enumeration/BNMessageBoxButtonResult.cs b/Enumeration/BNMessageBoxButtonResult.cs new file mode 100644 index 0000000..40759cc --- /dev/null +++ b/Enumeration/BNMessageBoxButtonResult.cs @@ -0,0 +1,30 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum MessageBoxButtonResult : uint + { + /// + /// + /// + NoButton = 0, + + /// + /// + /// + YesButton = 1, + + /// + /// + /// + OKButton = 2, + + /// + /// + /// + CancelButton = 3 + } +} \ No newline at end of file diff --git a/Enumeration/BNMessageBoxButtonSet.cs b/Enumeration/BNMessageBoxButtonSet.cs new file mode 100644 index 0000000..aa488fc --- /dev/null +++ b/Enumeration/BNMessageBoxButtonSet.cs @@ -0,0 +1,25 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum MessageBoxButtonSet : uint + { + /// + /// + /// + OKButtonSet = 0, + + /// + /// + /// + YesNoButtonSet = 1, + + /// + /// + /// + YesNoCancelButtonSet = 2 + } +} \ No newline at end of file diff --git a/Enumeration/BNMessageBoxIcon.cs b/Enumeration/BNMessageBoxIcon.cs new file mode 100644 index 0000000..d07c58e --- /dev/null +++ b/Enumeration/BNMessageBoxIcon.cs @@ -0,0 +1,30 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum MessageBoxIcon : uint + { + /// + /// + /// + InformationIcon = 0, + + /// + /// + /// + QuestionIcon = 1, + + /// + /// + /// + WarningIcon = 2, + + /// + /// + /// + ErrorIcon = 3 + } +} \ No newline at end of file diff --git a/Enumeration/BNMetadataType.cs b/Enumeration/BNMetadataType.cs new file mode 100644 index 0000000..0a4a182 --- /dev/null +++ b/Enumeration/BNMetadataType.cs @@ -0,0 +1,55 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum MetadataType : uint + { + /// + /// + /// + InvalidDataType = 0, + + /// + /// + /// + BooleanDataType = 1, + + /// + /// + /// + StringDataType = 2, + + /// + /// + /// + UnsignedIntegerDataType = 3, + + /// + /// + /// + SignedIntegerDataType = 4, + + /// + /// + /// + DoubleDataType = 5, + + /// + /// + /// + RawDataType = 6, + + /// + /// + /// + KeyValueDataType = 7, + + /// + /// + /// + ArrayDataType = 8 + } +} \ No newline at end of file diff --git a/Enumeration/BNModificationStatus.cs b/Enumeration/BNModificationStatus.cs new file mode 100644 index 0000000..e99162b --- /dev/null +++ b/Enumeration/BNModificationStatus.cs @@ -0,0 +1,25 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum ModificationStatus : uint + { + /// + /// + /// + Original = 0, + + /// + /// + /// + Changed = 1, + + /// + /// + /// + Inserted = 2 + } +} \ No newline at end of file diff --git a/Enumeration/BNNameType.cs b/Enumeration/BNNameType.cs new file mode 100644 index 0000000..554001b --- /dev/null +++ b/Enumeration/BNNameType.cs @@ -0,0 +1,460 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum NameType : uint + { + /// + /// + /// + NoNameType = 0, + + /// + /// + /// + ConstructorNameType = 1, + + /// + /// + /// + DestructorNameType = 2, + + /// + /// + /// + OperatorNewNameType = 3, + + /// + /// + /// + OperatorDeleteNameType = 4, + + /// + /// + /// + OperatorAssignNameType = 5, + + /// + /// + /// + OperatorRightShiftNameType = 6, + + /// + /// + /// + OperatorLeftShiftNameType = 7, + + /// + /// + /// + OperatorNotNameType = 8, + + /// + /// + /// + OperatorEqualNameType = 9, + + /// + /// + /// + OperatorNotEqualNameType = 10, + + /// + /// + /// + OperatorArrayNameType = 11, + + /// + /// + /// + OperatorArrowNameType = 12, + + /// + /// + /// + OperatorStarNameType = 13, + + /// + /// + /// + OperatorIncrementNameType = 14, + + /// + /// + /// + OperatorDecrementNameType = 15, + + /// + /// + /// + OperatorMinusNameType = 16, + + /// + /// + /// + OperatorPlusNameType = 17, + + /// + /// + /// + OperatorBitAndNameType = 18, + + /// + /// + /// + OperatorArrowStarNameType = 19, + + /// + /// + /// + OperatorDivideNameType = 20, + + /// + /// + /// + OperatorModulusNameType = 21, + + /// + /// + /// + OperatorLessThanNameType = 22, + + /// + /// + /// + OperatorLessThanEqualNameType = 23, + + /// + /// + /// + OperatorGreaterThanNameType = 24, + + /// + /// + /// + OperatorGreaterThanEqualNameType = 25, + + /// + /// + /// + OperatorCommaNameType = 26, + + /// + /// + /// + OperatorParenthesesNameType = 27, + + /// + /// + /// + OperatorTildeNameType = 28, + + /// + /// + /// + OperatorXorNameType = 29, + + /// + /// + /// + OperatorBitOrNameType = 30, + + /// + /// + /// + OperatorLogicalAndNameType = 31, + + /// + /// + /// + OperatorLogicalOrNameType = 32, + + /// + /// + /// + OperatorStarEqualNameType = 33, + + /// + /// + /// + OperatorPlusEqualNameType = 34, + + /// + /// + /// + OperatorMinusEqualNameType = 35, + + /// + /// + /// + OperatorDivideEqualNameType = 36, + + /// + /// + /// + OperatorModulusEqualNameType = 37, + + /// + /// + /// + OperatorRightShiftEqualNameType = 38, + + /// + /// + /// + OperatorLeftShiftEqualNameType = 39, + + /// + /// + /// + OperatorAndEqualNameType = 40, + + /// + /// + /// + OperatorOrEqualNameType = 41, + + /// + /// + /// + OperatorXorEqualNameType = 42, + + /// + /// + /// + VFTableNameType = 43, + + /// + /// + /// + VBTableNameType = 44, + + /// + /// + /// + VCallNameType = 45, + + /// + /// + /// + TypeofNameType = 46, + + /// + /// + /// + LocalStaticGuardNameType = 47, + + /// + /// + /// + StringNameType = 48, + + /// + /// + /// + VBaseDestructorNameType = 49, + + /// + /// + /// + VectorDeletingDestructorNameType = 50, + + /// + /// + /// + DefaultConstructorClosureNameType = 51, + + /// + /// + /// + ScalarDeletingDestructorNameType = 52, + + /// + /// + /// + VectorConstructorIteratorNameType = 53, + + /// + /// + /// + VectorDestructorIteratorNameType = 54, + + /// + /// + /// + VectorVBaseConstructorIteratorNameType = 55, + + /// + /// + /// + VirtualDisplacementMapNameType = 56, + + /// + /// + /// + EHVectorConstructorIteratorNameType = 57, + + /// + /// + /// + EHVectorDestructorIteratorNameType = 58, + + /// + /// + /// + EHVectorVBaseConstructorIteratorNameType = 59, + + /// + /// + /// + CopyConstructorClosureNameType = 60, + + /// + /// + /// + UDTReturningNameType = 61, + + /// + /// + /// + LocalVFTableNameType = 62, + + /// + /// + /// + LocalVFTableConstructorClosureNameType = 63, + + /// + /// + /// + OperatorNewArrayNameType = 64, + + /// + /// + /// + OperatorDeleteArrayNameType = 65, + + /// + /// + /// + PlacementDeleteClosureNameType = 66, + + /// + /// + /// + PlacementDeleteClosureArrayNameType = 67, + + /// + /// + /// + OperatorReturnTypeNameType = 68, + + /// + /// + /// + RttiTypeDescriptor = 69, + + /// + /// + /// + RttiBaseClassDescriptor = 70, + + /// + /// + /// + RttiBaseClassArray = 71, + + /// + /// + /// + RttiClassHierarchyDescriptor = 72, + + /// + /// + /// + RttiCompleteObjectLocator = 73, + + /// + /// + /// + OperatorUnaryMinusNameType = 74, + + /// + /// + /// + OperatorUnaryPlusNameType = 75, + + /// + /// + /// + OperatorUnaryBitAndNameType = 76, + + /// + /// + /// + OperatorUnaryStarNameType = 77, + + /// + /// + /// + OmniCallSigNameType = 78, + + /// + /// + /// + ManagedVectorConstructorIteratorNameType = 79, + + /// + /// + /// + ManagedVectorDestructorIteratorNameType = 80, + + /// + /// + /// + EHVectorCopyConstructorIteratorNameType = 81, + + /// + /// + /// + EHVectorVBaseCopyConstructorIteratorNameType = 82, + + /// + /// + /// + DynamicInitializerNameType = 83, + + /// + /// + /// + DynamicAtExitDestructorNameType = 84, + + /// + /// + /// + VectorCopyConstructorIteratorNameType = 85, + + /// + /// + /// + VectorVBaseCopyConstructorIteratorNameType = 86, + + /// + /// + /// + ManagedVectorCopyConstructorIteratorNameType = 87, + + /// + /// + /// + LocalStaticThreadGuardNameType = 88, + + /// + /// + /// + UserDefinedLiteralOperatorNameType = 89 + } +} \ No newline at end of file diff --git a/Enumeration/BNNamedTypeReferenceClass.cs b/Enumeration/BNNamedTypeReferenceClass.cs new file mode 100644 index 0000000..4422dfb --- /dev/null +++ b/Enumeration/BNNamedTypeReferenceClass.cs @@ -0,0 +1,40 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum NamedTypeReferenceClass : uint + { + /// + /// + /// + UnknownNamedTypeClass = 0, + + /// + /// + /// + TypedefNamedTypeClass = 1, + + /// + /// + /// + ClassNamedTypeClass = 2, + + /// + /// + /// + StructNamedTypeClass = 3, + + /// + /// + /// + UnionNamedTypeClass = 4, + + /// + /// + /// + EnumNamedTypeClass = 5 + } +} \ No newline at end of file diff --git a/Enumeration/BNOperatorPrecedence.cs b/Enumeration/BNOperatorPrecedence.cs new file mode 100644 index 0000000..58a17f0 --- /dev/null +++ b/Enumeration/BNOperatorPrecedence.cs @@ -0,0 +1,110 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum OperatorPrecedence : uint + { + /// + /// + /// + TopLevelOperatorPrecedence = 0, + + /// + /// + /// + AssignmentOperatorPrecedence = 1, + + /// + /// + /// + TernaryOperatorPrecedence = 2, + + /// + /// + /// + LogicalOrOperatorPrecedence = 3, + + /// + /// + /// + LogicalAndOperatorPrecedence = 4, + + /// + /// + /// + BitwiseOrOperatorPrecedence = 5, + + /// + /// + /// + BitwiseXorOperatorPrecedence = 6, + + /// + /// + /// + BitwiseAndOperatorPrecedence = 7, + + /// + /// + /// + EqualityOperatorPrecedence = 8, + + /// + /// + /// + CompareOperatorPrecedence = 9, + + /// + /// + /// + ShiftOperatorPrecedence = 10, + + /// + /// + /// + AddOperatorPrecedence = 11, + + /// + /// + /// + SubOperatorPrecedence = 12, + + /// + /// + /// + MultiplyOperatorPrecedence = 13, + + /// + /// + /// + DivideOperatorPrecedence = 14, + + /// + /// + /// + LowUnaryOperatorPrecedence = 15, + + /// + /// + /// + UnaryOperatorPrecedence = 16, + + /// + /// + /// + HighUnaryOperatorPrecedence = 17, + + /// + /// + /// + MemberAndFunctionOperatorPrecedence = 18, + + /// + /// + /// + ScopeOperatorPrecedence = 19 + } +} \ No newline at end of file diff --git a/Enumeration/BNPluginCommandType.cs b/Enumeration/BNPluginCommandType.cs new file mode 100644 index 0000000..16924f3 --- /dev/null +++ b/Enumeration/BNPluginCommandType.cs @@ -0,0 +1,65 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum PluginCommandType : uint + { + /// + /// + /// + DefaultPluginCommand = 0, + + /// + /// + /// + AddressPluginCommand = 1, + + /// + /// + /// + RangePluginCommand = 2, + + /// + /// + /// + FunctionPluginCommand = 3, + + /// + /// + /// + LowLevelILFunctionPluginCommand = 4, + + /// + /// + /// + LowLevelILInstructionPluginCommand = 5, + + /// + /// + /// + MediumLevelILFunctionPluginCommand = 6, + + /// + /// + /// + MediumLevelILInstructionPluginCommand = 7, + + /// + /// + /// + HighLevelILFunctionPluginCommand = 8, + + /// + /// + /// + HighLevelILInstructionPluginCommand = 9, + + /// + /// + /// + ProjectPluginCommand = 10 + } +} \ No newline at end of file diff --git a/Enumeration/BNPluginLoadOrder.cs b/Enumeration/BNPluginLoadOrder.cs new file mode 100644 index 0000000..efc1266 --- /dev/null +++ b/Enumeration/BNPluginLoadOrder.cs @@ -0,0 +1,25 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum PluginLoadOrder : uint + { + /// + /// + /// + EarlyPluginLoadOrder = 0, + + /// + /// + /// + NormalPluginLoadOrder = 1, + + /// + /// + /// + LatePluginLoadOrder = 2 + } +} \ No newline at end of file diff --git a/Enumeration/BNPluginOrigin.cs b/Enumeration/BNPluginOrigin.cs new file mode 100644 index 0000000..8c1a3d8 --- /dev/null +++ b/Enumeration/BNPluginOrigin.cs @@ -0,0 +1,25 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum PluginOrigin : uint + { + /// + /// + /// + OfficialPluginOrigin = 0, + + /// + /// + /// + CommunityPluginOrigin = 1, + + /// + /// + /// + OtherPluginOrigin = 2 + } +} \ No newline at end of file diff --git a/Enumeration/BNPluginStatus.cs b/Enumeration/BNPluginStatus.cs new file mode 100644 index 0000000..22076be --- /dev/null +++ b/Enumeration/BNPluginStatus.cs @@ -0,0 +1,65 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum PluginStatus : uint + { + /// + /// + /// + NotInstalledPluginStatus = 0, + + /// + /// + /// + InstalledPluginStatus = 1, + + /// + /// + /// + EnabledPluginStatus = 2, + + /// + /// + /// + UpdateAvailablePluginStatus = 16, + + /// + /// + /// + DeletePendingPluginStatus = 32, + + /// + /// + /// + UpdatePendingPluginStatus = 64, + + /// + /// + /// + DisablePendingPluginStatus = 128, + + /// + /// + /// + PendingRestartPluginStatus = 512, + + /// + /// + /// + BeingUpdatedPluginStatus = 1024, + + /// + /// + /// + BeingDeletedPluginStatus = 2048, + + /// + /// + /// + DependenciesBeingInstalledStatus = 4096 + } +} \ No newline at end of file diff --git a/Enumeration/BNPluginType.cs b/Enumeration/BNPluginType.cs new file mode 100644 index 0000000..11e36dd --- /dev/null +++ b/Enumeration/BNPluginType.cs @@ -0,0 +1,40 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum PluginType : uint + { + /// + /// + /// + CorePluginType = 0, + + /// + /// + /// + UiPluginType = 1, + + /// + /// + /// + ArchitecturePluginType = 2, + + /// + /// + /// + BinaryViewPluginType = 3, + + /// + /// + /// + HelperPluginType = 4, + + /// + /// + /// + SyncPluginType = 5 + } +} \ No newline at end of file diff --git a/Enumeration/BNPointerBaseType.cs b/Enumeration/BNPointerBaseType.cs new file mode 100644 index 0000000..e2f11ce --- /dev/null +++ b/Enumeration/BNPointerBaseType.cs @@ -0,0 +1,30 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum PointerBaseType : uint + { + /// + /// + /// + AbsolutePointerBaseType = 0, + + /// + /// + /// + RelativeToConstantPointerBaseType = 1, + + /// + /// + /// + RelativeToBinaryStartPointerBaseType = 2, + + /// + /// + /// + RelativeToVariableAddressPointerBaseType = 3 + } +} \ No newline at end of file diff --git a/Enumeration/BNPointerSuffix.cs b/Enumeration/BNPointerSuffix.cs new file mode 100644 index 0000000..be04649 --- /dev/null +++ b/Enumeration/BNPointerSuffix.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; + +namespace BinaryNinja +{ + /// + /// + /// + public enum PointerSuffix : uint + { + /// + /// + /// + Ptr64Suffix = 0, + + /// + /// + /// + UnalignedSuffix = 1, + + /// + /// + /// + RestrictSuffix = 2, + + /// + /// + /// + ReferenceSuffix = 3, + + /// + /// + /// + LvalueSuffix = 4 + } +} \ No newline at end of file diff --git a/Enumeration/BNReferenceType.cs b/Enumeration/BNReferenceType.cs new file mode 100644 index 0000000..0e2edc4 --- /dev/null +++ b/Enumeration/BNReferenceType.cs @@ -0,0 +1,30 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum ReferenceType : uint + { + /// + /// + /// + PointerReferenceType = 0, + + /// + /// + /// + ReferenceReferenceType = 1, + + /// + /// + /// + RValueReferenceType = 2, + + /// + /// + /// + NoReference = 3 + } +} \ No newline at end of file diff --git a/Enumeration/BNRegisterValueType.cs b/Enumeration/BNRegisterValueType.cs new file mode 100644 index 0000000..ea8c4e3 --- /dev/null +++ b/Enumeration/BNRegisterValueType.cs @@ -0,0 +1,95 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum RegisterValueType : uint + { + /// + /// + /// + UndeterminedValue = 0, + + /// + /// + /// + EntryValue = 1, + + /// + /// + /// + ConstantValue = 2, + + /// + /// + /// + ConstantPointerValue = 3, + + /// + /// + /// + ExternalPointerValue = 4, + + /// + /// + /// + StackFrameOffset = 5, + + /// + /// + /// + ReturnAddressValue = 6, + + /// + /// + /// + ImportedAddressValue = 7, + + /// + /// + /// + SignedRangeValue = 8, + + /// + /// + /// + UnsignedRangeValue = 9, + + /// + /// + /// + LookupTableValue = 10, + + /// + /// + /// + InSetOfValues = 11, + + /// + /// + /// + NotInSetOfValues = 12, + + /// + /// + /// + ConstantDataValue = 32768, + + /// + /// + /// + ConstantDataZeroExtendValue = 32769, + + /// + /// + /// + ConstantDataSignExtendValue = 32770, + + /// + /// + /// + ConstantDataAggregateValue = 32771 + } +} \ No newline at end of file diff --git a/Enumeration/BNRelocationType.cs b/Enumeration/BNRelocationType.cs new file mode 100644 index 0000000..9735c8b --- /dev/null +++ b/Enumeration/BNRelocationType.cs @@ -0,0 +1,40 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum RelocationType : uint + { + /// + /// + /// + ELFGlobalRelocationType = 0, + + /// + /// + /// + ELFCopyRelocationType = 1, + + /// + /// + /// + ELFJumpSlotRelocationType = 2, + + /// + /// + /// + StandardRelocationType = 3, + + /// + /// + /// + IgnoredRelocation = 4, + + /// + /// + /// + UnhandledRelocation = 5 + } +} \ No newline at end of file diff --git a/Enumeration/BNRemoteFileType.cs b/Enumeration/BNRemoteFileType.cs new file mode 100644 index 0000000..ca30fb8 --- /dev/null +++ b/Enumeration/BNRemoteFileType.cs @@ -0,0 +1,30 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum RemoteFileType : uint + { + /// + /// + /// + RawDataFileType = 0, + + /// + /// + /// + BinaryViewAnalysisFileType = 1, + + /// + /// + /// + TypeArchiveFileType = 2, + + /// + /// + /// + UnknownFileType = 3 + } +} \ No newline at end of file diff --git a/Enumeration/BNRenderLayerDefaultEnableState.cs b/Enumeration/BNRenderLayerDefaultEnableState.cs new file mode 100644 index 0000000..3249f44 --- /dev/null +++ b/Enumeration/BNRenderLayerDefaultEnableState.cs @@ -0,0 +1,25 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum RenderLayerDefaultEnableState : uint + { + /// + /// + /// + DisabledByDefaultRenderLayerDefaultEnableState = 0, + + /// + /// + /// + EnabledByDefaultRenderLayerDefaultEnableState = 1, + + /// + /// + /// + AlwaysEnabledRenderLayerDefaultEnableState = 2 + } +} \ No newline at end of file diff --git a/Enumeration/BNReportType.cs b/Enumeration/BNReportType.cs new file mode 100644 index 0000000..4561dc7 --- /dev/null +++ b/Enumeration/BNReportType.cs @@ -0,0 +1,30 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum ReportType : uint + { + /// + /// + /// + PlainTextReportType = 0, + + /// + /// + /// + MarkdownReportType = 1, + + /// + /// + /// + HTMLReportType = 2, + + /// + /// + /// + FlowGraphReportType = 3 + } +} \ No newline at end of file diff --git a/Enumeration/BNSaveOption.cs b/Enumeration/BNSaveOption.cs new file mode 100644 index 0000000..8838a07 --- /dev/null +++ b/Enumeration/BNSaveOption.cs @@ -0,0 +1,25 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum SaveOption : uint + { + /// + /// + /// + RemoveUndoData = 0, + + /// + /// + /// + TrimSnapshots = 1, + + /// + /// + /// + PurgeOriginalFilenamePath = 2 + } +} \ No newline at end of file diff --git a/Enumeration/BNScopeType.cs b/Enumeration/BNScopeType.cs new file mode 100644 index 0000000..99abb11 --- /dev/null +++ b/Enumeration/BNScopeType.cs @@ -0,0 +1,35 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum ScopeType : uint + { + /// + /// + /// + OneLineScopeType = 0, + + /// + /// + /// + HasSubScopeScopeType = 1, + + /// + /// + /// + BlockScopeType = 2, + + /// + /// + /// + SwitchScopeType = 3, + + /// + /// + /// + CaseScopeType = 4 + } +} \ No newline at end of file diff --git a/Enumeration/BNScriptingProviderExecuteResult.cs b/Enumeration/BNScriptingProviderExecuteResult.cs new file mode 100644 index 0000000..fed9af8 --- /dev/null +++ b/Enumeration/BNScriptingProviderExecuteResult.cs @@ -0,0 +1,30 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum ScriptingProviderExecuteResult : uint + { + /// + /// + /// + InvalidScriptInput = 0, + + /// + /// + /// + IncompleteScriptInput = 1, + + /// + /// + /// + SuccessfulScriptExecution = 2, + + /// + /// + /// + ScriptExecutionCancelled = 3 + } +} \ No newline at end of file diff --git a/Enumeration/BNScriptingProviderInputReadyState.cs b/Enumeration/BNScriptingProviderInputReadyState.cs new file mode 100644 index 0000000..9867aee --- /dev/null +++ b/Enumeration/BNScriptingProviderInputReadyState.cs @@ -0,0 +1,25 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum ScriptingProviderInputReadyState : uint + { + /// + /// + /// + NotReadyForInput = 0, + + /// + /// + /// + ReadyForScriptExecution = 1, + + /// + /// + /// + ReadyForScriptProgramInput = 2 + } +} \ No newline at end of file diff --git a/Enumeration/BNSectionSemantics.cs b/Enumeration/BNSectionSemantics.cs new file mode 100644 index 0000000..a9551e7 --- /dev/null +++ b/Enumeration/BNSectionSemantics.cs @@ -0,0 +1,35 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum SectionSemantics : uint + { + /// + /// + /// + DefaultSectionSemantics = 0, + + /// + /// + /// + ReadOnlyCodeSectionSemantics = 1, + + /// + /// + /// + ReadOnlyDataSectionSemantics = 2, + + /// + /// + /// + ReadWriteDataSectionSemantics = 3, + + /// + /// + /// + ExternalSectionSemantics = 4 + } +} \ No newline at end of file diff --git a/Enumeration/BNSegmentFlag.cs b/Enumeration/BNSegmentFlag.cs new file mode 100644 index 0000000..5b3b52f --- /dev/null +++ b/Enumeration/BNSegmentFlag.cs @@ -0,0 +1,45 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum SegmentFlag : uint + { + /// + /// + /// + SegmentExecutable = 1, + + /// + /// + /// + SegmentWritable = 2, + + /// + /// + /// + SegmentReadable = 4, + + /// + /// + /// + SegmentContainsData = 8, + + /// + /// + /// + SegmentContainsCode = 16, + + /// + /// + /// + SegmentDenyWrite = 32, + + /// + /// + /// + SegmentDenyExecute = 64 + } +} \ No newline at end of file diff --git a/Enumeration/BNSettingsScope.cs b/Enumeration/BNSettingsScope.cs new file mode 100644 index 0000000..cbbb220 --- /dev/null +++ b/Enumeration/BNSettingsScope.cs @@ -0,0 +1,40 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum SettingsScope : uint + { + /// + /// + /// + SettingsInvalidScope = 0, + + /// + /// + /// + SettingsAutoScope = 1, + + /// + /// + /// + SettingsDefaultScope = 2, + + /// + /// + /// + SettingsUserScope = 4, + + /// + /// + /// + SettingsProjectScope = 8, + + /// + /// + /// + SettingsResourceScope = 16 + } +} \ No newline at end of file diff --git a/Enumeration/BNStringType.cs b/Enumeration/BNStringType.cs new file mode 100644 index 0000000..6b4980f --- /dev/null +++ b/Enumeration/BNStringType.cs @@ -0,0 +1,30 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum StringType : uint + { + /// + /// + /// + AsciiString = 0, + + /// + /// + /// + Utf16String = 1, + + /// + /// + /// + Utf32String = 2, + + /// + /// + /// + Utf8String = 3 + } +} \ No newline at end of file diff --git a/Enumeration/BNStructureVariant.cs b/Enumeration/BNStructureVariant.cs new file mode 100644 index 0000000..a187599 --- /dev/null +++ b/Enumeration/BNStructureVariant.cs @@ -0,0 +1,25 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum StructureVariant : uint + { + /// + /// + /// + ClassStructureType = 0, + + /// + /// + /// + StructStructureType = 1, + + /// + /// + /// + UnionStructureType = 2 + } +} \ No newline at end of file diff --git a/Enumeration/BNSwitchRecovery.cs b/Enumeration/BNSwitchRecovery.cs new file mode 100644 index 0000000..8e217e1 --- /dev/null +++ b/Enumeration/BNSwitchRecovery.cs @@ -0,0 +1,25 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum SwitchRecovery : uint + { + /// + /// + /// + DefaultSwitchRecovery = 0, + + /// + /// + /// + PreventSwitchRecovery = 1, + + /// + /// + /// + AllowSwitchRecovery = 2 + } +} \ No newline at end of file diff --git a/Enumeration/BNSymbolBinding.cs b/Enumeration/BNSymbolBinding.cs new file mode 100644 index 0000000..69c5cb1 --- /dev/null +++ b/Enumeration/BNSymbolBinding.cs @@ -0,0 +1,30 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum SymbolBinding : uint + { + /// + /// + /// + NoBinding = 0, + + /// + /// + /// + LocalBinding = 1, + + /// + /// + /// + GlobalBinding = 2, + + /// + /// + /// + WeakBinding = 3 + } +} \ No newline at end of file diff --git a/Enumeration/BNSymbolDisplayResult.cs b/Enumeration/BNSymbolDisplayResult.cs new file mode 100644 index 0000000..99bdbe3 --- /dev/null +++ b/Enumeration/BNSymbolDisplayResult.cs @@ -0,0 +1,25 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum SymbolDisplayResult : uint + { + /// + /// + /// + NoSymbolAvailable = 0, + + /// + /// + /// + DataSymbolResult = 1, + + /// + /// + /// + OtherSymbolResult = 2 + } +} \ No newline at end of file diff --git a/Enumeration/BNSymbolDisplayType.cs b/Enumeration/BNSymbolDisplayType.cs new file mode 100644 index 0000000..7c9ad8b --- /dev/null +++ b/Enumeration/BNSymbolDisplayType.cs @@ -0,0 +1,25 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum SymbolDisplayType : uint + { + /// + /// + /// + DisplaySymbolOnly = 0, + + /// + /// + /// + AddressOfDataSymbols = 1, + + /// + /// + /// + DereferenceNonDataSymbols = 2 + } +} \ No newline at end of file diff --git a/Enumeration/BNSymbolType.cs b/Enumeration/BNSymbolType.cs new file mode 100644 index 0000000..f35fc5f --- /dev/null +++ b/Enumeration/BNSymbolType.cs @@ -0,0 +1,55 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum SymbolType : uint + { + /// + /// + /// + FunctionSymbol = 0, + + /// + /// + /// + ImportAddressSymbol = 1, + + /// + /// + /// + ImportedFunctionSymbol = 2, + + /// + /// + /// + DataSymbol = 3, + + /// + /// + /// + ImportedDataSymbol = 4, + + /// + /// + /// + ExternalSymbol = 5, + + /// + /// + /// + LibraryFunctionSymbol = 6, + + /// + /// + /// + SymbolicFunctionSymbol = 7, + + /// + /// + /// + LocalLabelSymbol = 8 + } +} \ No newline at end of file diff --git a/Enumeration/BNSyncStatus.cs b/Enumeration/BNSyncStatus.cs new file mode 100644 index 0000000..7b52852 --- /dev/null +++ b/Enumeration/BNSyncStatus.cs @@ -0,0 +1,45 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum SyncStatus : uint + { + /// + /// + /// + NotSyncedSyncStatus = 0, + + /// + /// + /// + NoChangesSyncStatus = 1, + + /// + /// + /// + UnknownSyncStatus = 2, + + /// + /// + /// + CanPushSyncStatus = 3, + + /// + /// + /// + CanPullSyncStatus = 4, + + /// + /// + /// + CanPushAndPullSyncStatus = 5, + + /// + /// + /// + ConflictSyncStatus = 6 + } +} \ No newline at end of file diff --git a/Enumeration/BNTagReferenceType.cs b/Enumeration/BNTagReferenceType.cs new file mode 100644 index 0000000..b883b4a --- /dev/null +++ b/Enumeration/BNTagReferenceType.cs @@ -0,0 +1,25 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum TagReferenceType : uint + { + /// + /// + /// + AddressTagReference = 0, + + /// + /// + /// + FunctionTagReference = 1, + + /// + /// + /// + DataTagReference = 2 + } +} \ No newline at end of file diff --git a/Enumeration/BNTagTypeType.cs b/Enumeration/BNTagTypeType.cs new file mode 100644 index 0000000..5ba0dce --- /dev/null +++ b/Enumeration/BNTagTypeType.cs @@ -0,0 +1,25 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum TagTypeType : uint + { + /// + /// + /// + UserTagType = 0, + + /// + /// + /// + NotificationTagType = 1, + + /// + /// + /// + BookmarksTagType = 2 + } +} \ No newline at end of file diff --git a/Enumeration/BNThemeColor.cs b/Enumeration/BNThemeColor.cs new file mode 100644 index 0000000..018e2e2 --- /dev/null +++ b/Enumeration/BNThemeColor.cs @@ -0,0 +1,645 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum ThemeColor : uint + { + /// + /// + /// + AddressColor = 0, + + /// + /// + /// + ModifiedColor = 1, + + /// + /// + /// + InsertedColor = 2, + + /// + /// + /// + NotPresentColor = 3, + + /// + /// + /// + SelectionColor = 4, + + /// + /// + /// + OutlineColor = 5, + + /// + /// + /// + BackgroundHighlightDarkColor = 6, + + /// + /// + /// + BackgroundHighlightLightColor = 7, + + /// + /// + /// + BoldBackgroundHighlightDarkColor = 8, + + /// + /// + /// + BoldBackgroundHighlightLightColor = 9, + + /// + /// + /// + AlphanumericHighlightColor = 10, + + /// + /// + /// + PrintableHighlightColor = 11, + + /// + /// + /// + GraphBackgroundDarkColor = 12, + + /// + /// + /// + GraphBackgroundLightColor = 13, + + /// + /// + /// + GraphNodeDarkColor = 14, + + /// + /// + /// + GraphNodeLightColor = 15, + + /// + /// + /// + GraphNodeOutlineColor = 16, + + /// + /// + /// + GraphNodeShadowColor = 17, + + /// + /// + /// + GraphEntryNodeIndicatorColor = 18, + + /// + /// + /// + GraphExitNodeIndicatorColor = 19, + + /// + /// + /// + GraphExitNoreturnNodeIndicatorColor = 20, + + /// + /// + /// + TrueBranchColor = 21, + + /// + /// + /// + FalseBranchColor = 22, + + /// + /// + /// + UnconditionalBranchColor = 23, + + /// + /// + /// + AltTrueBranchColor = 24, + + /// + /// + /// + AltFalseBranchColor = 25, + + /// + /// + /// + AltUnconditionalBranchColor = 26, + + /// + /// + /// + InstructionColor = 27, + + /// + /// + /// + RegisterColor = 28, + + /// + /// + /// + NumberColor = 29, + + /// + /// + /// + CodeSymbolColor = 30, + + /// + /// + /// + DataSymbolColor = 31, + + /// + /// + /// + LocalVariableColor = 32, + + /// + /// + /// + StackVariableColor = 33, + + /// + /// + /// + ImportColor = 34, + + /// + /// + /// + ExportColor = 35, + + /// + /// + /// + InstructionHighlightColor = 36, + + /// + /// + /// + RelatedInstructionHighlightColor = 37, + + /// + /// + /// + TokenHighlightColor = 38, + + /// + /// + /// + TokenSelectionColor = 39, + + /// + /// + /// + AnnotationColor = 40, + + /// + /// + /// + OpcodeColor = 41, + + /// + /// + /// + LinearDisassemblyFunctionHeaderColor = 42, + + /// + /// + /// + LinearDisassemblyBlockColor = 43, + + /// + /// + /// + LinearDisassemblyNoteColor = 44, + + /// + /// + /// + LinearDisassemblySeparatorColor = 45, + + /// + /// + /// + LinearDisassemblyCodeFoldColor = 46, + + /// + /// + /// + StringColor = 47, + + /// + /// + /// + TypeNameColor = 48, + + /// + /// + /// + FieldNameColor = 49, + + /// + /// + /// + KeywordColor = 50, + + /// + /// + /// + UncertainColor = 51, + + /// + /// + /// + NameSpaceColor = 52, + + /// + /// + /// + NameSpaceSeparatorColor = 53, + + /// + /// + /// + GotoLabelColor = 54, + + /// + /// + /// + CommentColor = 55, + + /// + /// + /// + OperationColor = 56, + + /// + /// + /// + BaseStructureNameColor = 57, + + /// + /// + /// + IndentationLineColor = 58, + + /// + /// + /// + IndentationLineHighlightColor = 59, + + /// + /// + /// + ScriptConsoleOutputColor = 60, + + /// + /// + /// + ScriptConsoleWarningColor = 61, + + /// + /// + /// + ScriptConsoleErrorColor = 62, + + /// + /// + /// + ScriptConsoleEchoColor = 63, + + /// + /// + /// + BlueStandardHighlightColor = 64, + + /// + /// + /// + GreenStandardHighlightColor = 65, + + /// + /// + /// + CyanStandardHighlightColor = 66, + + /// + /// + /// + RedStandardHighlightColor = 67, + + /// + /// + /// + MagentaStandardHighlightColor = 68, + + /// + /// + /// + YellowStandardHighlightColor = 69, + + /// + /// + /// + OrangeStandardHighlightColor = 70, + + /// + /// + /// + WhiteStandardHighlightColor = 71, + + /// + /// + /// + BlackStandardHighlightColor = 72, + + /// + /// + /// + MiniGraphOverlayColor = 73, + + /// + /// + /// + FeatureMapBaseColor = 74, + + /// + /// + /// + FeatureMapNavLineColor = 75, + + /// + /// + /// + FeatureMapNavHighlightColor = 76, + + /// + /// + /// + FeatureMapDataVariableColor = 77, + + /// + /// + /// + FeatureMapAsciiStringColor = 78, + + /// + /// + /// + FeatureMapUnicodeStringColor = 79, + + /// + /// + /// + FeatureMapFunctionColor = 80, + + /// + /// + /// + FeatureMapImportColor = 81, + + /// + /// + /// + FeatureMapExternColor = 82, + + /// + /// + /// + FeatureMapLibraryColor = 83, + + /// + /// + /// + SidebarBackgroundColor = 84, + + /// + /// + /// + SidebarInactiveIconColor = 85, + + /// + /// + /// + SidebarHoverIconColor = 86, + + /// + /// + /// + SidebarActiveIconColor = 87, + + /// + /// + /// + SidebarFocusedIconColor = 88, + + /// + /// + /// + SidebarHoverBackgroundColor = 89, + + /// + /// + /// + SidebarActiveBackgroundColor = 90, + + /// + /// + /// + SidebarFocusedBackgroundColor = 91, + + /// + /// + /// + SidebarActiveIndicatorLineColor = 92, + + /// + /// + /// + SidebarHeaderBackgroundColor = 93, + + /// + /// + /// + SidebarHeaderTextColor = 94, + + /// + /// + /// + SidebarWidgetBackgroundColor = 95, + + /// + /// + /// + ActivePaneBackgroundColor = 96, + + /// + /// + /// + InactivePaneBackgroundColor = 97, + + /// + /// + /// + FocusedPaneBackgroundColor = 98, + + /// + /// + /// + TabBarTabActiveColor = 99, + + /// + /// + /// + TabBarTabHoverColor = 100, + + /// + /// + /// + TabBarTabInactiveColor = 101, + + /// + /// + /// + TabBarTabBorderColor = 102, + + /// + /// + /// + TabBarTabGlowColor = 103, + + /// + /// + /// + StatusBarServerConnectedColor = 104, + + /// + /// + /// + StatusBarServerDisconnectedColor = 105, + + /// + /// + /// + StatusBarServerWarningColor = 106, + + /// + /// + /// + StatusBarProjectColor = 107, + + /// + /// + /// + BraceOption1Color = 108, + + /// + /// + /// + BraceOption2Color = 109, + + /// + /// + /// + BraceOption3Color = 110, + + /// + /// + /// + BraceOption4Color = 111, + + /// + /// + /// + BraceOption5Color = 112, + + /// + /// + /// + BraceOption6Color = 113, + + /// + /// + /// + VoidTypeColor = 114, + + /// + /// + /// + StructureTypeColor = 115, + + /// + /// + /// + EnumerationTypeColor = 116, + + /// + /// + /// + FunctionTypeColor = 117, + + /// + /// + /// + BoolTypeColor = 118, + + /// + /// + /// + IntegerTypeColor = 119, + + /// + /// + /// + FloatTypeColor = 120, + + /// + /// + /// + PointerTypeColor = 121, + + /// + /// + /// + ArrayTypeColor = 122, + + /// + /// + /// + VarArgsTypeColor = 123, + + /// + /// + /// + ValueTypeColor = 124, + + /// + /// + /// + NamedTypeReferenceColor = 125, + + /// + /// + /// + WideCharTypeColor = 126 + } +} \ No newline at end of file diff --git a/Enumeration/BNTokenEscapingType.cs b/Enumeration/BNTokenEscapingType.cs new file mode 100644 index 0000000..2121fd5 --- /dev/null +++ b/Enumeration/BNTokenEscapingType.cs @@ -0,0 +1,30 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum TokenEscapingType : uint + { + /// + /// + /// + NoTokenEscapingType = 0, + + /// + /// + /// + BackticksTokenEscapingType = 1, + + /// + /// + /// + QuotedStringEscapingType = 2, + + /// + /// + /// + ReplaceInvalidCharsEscapingType = 3 + } +} \ No newline at end of file diff --git a/Enumeration/BNTransformCapabilities.cs b/Enumeration/BNTransformCapabilities.cs new file mode 100644 index 0000000..44ee546 --- /dev/null +++ b/Enumeration/BNTransformCapabilities.cs @@ -0,0 +1,25 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum TransformCapabilities : uint + { + /// + /// + /// + TransformNoCapabilities = 0, + + /// + /// + /// + TransformSupportsDetection = 1, + + /// + /// + /// + TransformSupportsContext = 2 + } +} \ No newline at end of file diff --git a/Enumeration/BNTransformResult.cs b/Enumeration/BNTransformResult.cs new file mode 100644 index 0000000..791434b --- /dev/null +++ b/Enumeration/BNTransformResult.cs @@ -0,0 +1,30 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum TransformResult : uint + { + /// + /// + /// + TransformSuccess = 0, + + /// + /// + /// + TransformNotAttempted = 1, + + /// + /// + /// + TransformFailure = 2, + + /// + /// + /// + TransformRequiresPassword = 3 + } +} \ No newline at end of file diff --git a/Enumeration/BNTransformSessionMode.cs b/Enumeration/BNTransformSessionMode.cs new file mode 100644 index 0000000..e7d3d14 --- /dev/null +++ b/Enumeration/BNTransformSessionMode.cs @@ -0,0 +1,25 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum TransformSessionMode : uint + { + /// + /// + /// + TransformSessionModeDisabled = 0, + + /// + /// + /// + TransformSessionModeFull = 1, + + /// + /// + /// + TransformSessionModeOnDemand = 2 + } +} \ No newline at end of file diff --git a/Enumeration/BNTransformType.cs b/Enumeration/BNTransformType.cs new file mode 100644 index 0000000..b9ea2ae --- /dev/null +++ b/Enumeration/BNTransformType.cs @@ -0,0 +1,55 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum TransformType : uint + { + /// + /// + /// + BinaryCodecTransform = 0, + + /// + /// + /// + TextCodecTransform = 1, + + /// + /// + /// + UnicodeCodecTransform = 2, + + /// + /// + /// + DecodeTransform = 3, + + /// + /// + /// + BinaryEncodeTransform = 4, + + /// + /// + /// + TextEncodeTransform = 5, + + /// + /// + /// + EncryptTransform = 6, + + /// + /// + /// + InvertingTransform = 7, + + /// + /// + /// + HashTransform = 8 + } +} \ No newline at end of file diff --git a/Enumeration/BNTypeClass.cs b/Enumeration/BNTypeClass.cs new file mode 100644 index 0000000..01266d6 --- /dev/null +++ b/Enumeration/BNTypeClass.cs @@ -0,0 +1,75 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum TypeClass : uint + { + /// + /// + /// + VoidTypeClass = 0, + + /// + /// + /// + BoolTypeClass = 1, + + /// + /// + /// + IntegerTypeClass = 2, + + /// + /// + /// + FloatTypeClass = 3, + + /// + /// + /// + StructureTypeClass = 4, + + /// + /// + /// + EnumerationTypeClass = 5, + + /// + /// + /// + PointerTypeClass = 6, + + /// + /// + /// + ArrayTypeClass = 7, + + /// + /// + /// + FunctionTypeClass = 8, + + /// + /// + /// + VarArgsTypeClass = 9, + + /// + /// + /// + ValueTypeClass = 10, + + /// + /// + /// + NamedTypeReferenceClass = 11, + + /// + /// + /// + WideCharTypeClass = 12 + } +} \ No newline at end of file diff --git a/Enumeration/BNTypeContainerType.cs b/Enumeration/BNTypeContainerType.cs new file mode 100644 index 0000000..df3024c --- /dev/null +++ b/Enumeration/BNTypeContainerType.cs @@ -0,0 +1,55 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum TypeContainerType : uint + { + /// + /// + /// + AnalysisTypeContainerType = 0, + + /// + /// + /// + AnalysisAutoTypeContainerType = 1, + + /// + /// + /// + AnalysisUserTypeContainerType = 2, + + /// + /// + /// + TypeLibraryTypeContainerType = 3, + + /// + /// + /// + TypeArchiveTypeContainerType = 4, + + /// + /// + /// + DebugInfoTypeContainerType = 5, + + /// + /// + /// + PlatformTypeContainerType = 6, + + /// + /// + /// + EmptyTypeContainerType = 7, + + /// + /// + /// + OtherTypeContainerType = 8 + } +} \ No newline at end of file diff --git a/Enumeration/BNTypeDefinitionLineType.cs b/Enumeration/BNTypeDefinitionLineType.cs new file mode 100644 index 0000000..88da3ba --- /dev/null +++ b/Enumeration/BNTypeDefinitionLineType.cs @@ -0,0 +1,65 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum TypeDefinitionLineType : uint + { + /// + /// + /// + TypedefLineType = 0, + + /// + /// + /// + StructDefinitionLineType = 1, + + /// + /// + /// + StructFieldLineType = 2, + + /// + /// + /// + StructDefinitionEndLineType = 3, + + /// + /// + /// + EnumDefinitionLineType = 4, + + /// + /// + /// + EnumMemberLineType = 5, + + /// + /// + /// + EnumDefinitionEndLineType = 6, + + /// + /// + /// + PaddingLineType = 7, + + /// + /// + /// + UndefinedXrefLineType = 8, + + /// + /// + /// + CollapsedPaddingLineType = 9, + + /// + /// + /// + EmptyLineType = 10 + } +} \ No newline at end of file diff --git a/Enumeration/BNTypeParserErrorSeverity.cs b/Enumeration/BNTypeParserErrorSeverity.cs new file mode 100644 index 0000000..334f416 --- /dev/null +++ b/Enumeration/BNTypeParserErrorSeverity.cs @@ -0,0 +1,40 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum TypeParserErrorSeverity : uint + { + /// + /// + /// + IgnoredSeverity = 0, + + /// + /// + /// + NoteSeverity = 1, + + /// + /// + /// + RemarkSeverity = 2, + + /// + /// + /// + WarningSeverity = 3, + + /// + /// + /// + ErrorSeverity = 4, + + /// + /// + /// + FatalSeverity = 5 + } +} \ No newline at end of file diff --git a/Enumeration/BNTypeParserOption.cs b/Enumeration/BNTypeParserOption.cs new file mode 100644 index 0000000..bdd1b85 --- /dev/null +++ b/Enumeration/BNTypeParserOption.cs @@ -0,0 +1,20 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum TypeParserOption : uint + { + /// + /// + /// + IncludeSystemTypes = 0, + + /// + /// + /// + BuiltinMacros = 1 + } +} \ No newline at end of file diff --git a/Enumeration/BNTypeReferenceType.cs b/Enumeration/BNTypeReferenceType.cs new file mode 100644 index 0000000..f590f70 --- /dev/null +++ b/Enumeration/BNTypeReferenceType.cs @@ -0,0 +1,25 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum TypeReferenceType : uint + { + /// + /// + /// + DirectTypeReferenceType = 0, + + /// + /// + /// + IndirectTypeReferenceType = 1, + + /// + /// + /// + UnknownTypeReferenceType = 2 + } +} \ No newline at end of file diff --git a/Enumeration/BNUpdateResult.cs b/Enumeration/BNUpdateResult.cs new file mode 100644 index 0000000..c90398d --- /dev/null +++ b/Enumeration/BNUpdateResult.cs @@ -0,0 +1,30 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum UpdateResult : uint + { + /// + /// + /// + UpdateFailed = 0, + + /// + /// + /// + UpdateSuccess = 1, + + /// + /// + /// + AlreadyUpToDate = 2, + + /// + /// + /// + UpdateAvailable = 3 + } +} \ No newline at end of file diff --git a/Enumeration/BNVariableSourceType.cs b/Enumeration/BNVariableSourceType.cs new file mode 100644 index 0000000..0cbd9ef --- /dev/null +++ b/Enumeration/BNVariableSourceType.cs @@ -0,0 +1,25 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum VariableSourceType : uint + { + /// + /// + /// + StackVariableSourceType = 0, + + /// + /// + /// + RegisterVariableSourceType = 1, + + /// + /// + /// + FlagVariableSourceType = 2 + } +} \ No newline at end of file diff --git a/Enumeration/PluginLoadStatus.cs b/Enumeration/PluginLoadStatus.cs new file mode 100644 index 0000000..2218a4e --- /dev/null +++ b/Enumeration/PluginLoadStatus.cs @@ -0,0 +1,25 @@ +using System; + +namespace BinaryNinja +{ + /// + /// + /// + public enum PluginLoadStatus : uint + { + /// + /// + /// + NotAttemptedStatus = 0, + + /// + /// + /// + LoadSucceededStatus = 1, + + /// + /// + /// + LoadFailedStatus = 2 + } +} \ No newline at end of file diff --git a/Form/LabelField.cs b/Form/LabelField.cs new file mode 100644 index 0000000..5c30453 --- /dev/null +++ b/Form/LabelField.cs @@ -0,0 +1,27 @@ +namespace BinaryNinja +{ + public sealed class LabelField : AbstractFormInputField + { + public string Text { get; set; } = ""; + + public LabelField() + { + + } + + public LabelField(string text) + { + this.Text = text; + } + + public override BNFormInputField ToNativeEx(ScopedAllocator allocator) + { + return new BNFormInputField() + { + type = FormInputFieldType.LabelFormField, + hasDefault = false, + prompt = allocator.AllocAnsiString(this.Text) + }; + } + } +} diff --git a/Form/SeparatorField.cs b/Form/SeparatorField.cs new file mode 100644 index 0000000..9d6a863 --- /dev/null +++ b/Form/SeparatorField.cs @@ -0,0 +1,19 @@ +namespace BinaryNinja +{ + public sealed class SeparatorField : AbstractFormInputField + { + public SeparatorField() + { + + } + + public override BNFormInputField ToNativeEx(ScopedAllocator allocator) + { + return new BNFormInputField() + { + type = FormInputFieldType.SeparatorFormField, + hasDefault = false + }; + } + } +} diff --git a/Form/TextLineField.cs b/Form/TextLineField.cs new file mode 100644 index 0000000..1ed0797 --- /dev/null +++ b/Form/TextLineField.cs @@ -0,0 +1,33 @@ +using System; +using Microsoft.VisualBasic; + +namespace BinaryNinja +{ + public sealed class TextLineField : AbstractFormInputField + { + public string Prompt { get; set; } = ""; + + public string Default { get; set; } = ""; + + public string Result { get; set; } = ""; + + public TextLineField() + { + + } + + public override BNFormInputField ToNativeEx(ScopedAllocator allocator) + { + return new BNFormInputField() + { + type = FormInputFieldType.TextLineFormField, + prompt = allocator.AllocAnsiString(this.Prompt), + stringDefault = ( string.IsNullOrEmpty(this.Default) ? IntPtr.Zero : + allocator.AllocAnsiString(this.Default) + ), + hasDefault = (!string.IsNullOrEmpty(this.Default)), + }; + } + + } +} diff --git a/Function/BNAbortAnalysis.cs b/Function/BNAbortAnalysis.cs new file mode 100644 index 0000000..84b94e3 --- /dev/null +++ b/Function/BNAbortAnalysis.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNAbortAnalysis(BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAbortAnalysis" + )] + internal static extern void BNAbortAnalysis( + + // BNBinaryView* view + IntPtr view + ); + } +} \ No newline at end of file diff --git a/Function/BNAbortBaseAddressDetection.cs b/Function/BNAbortBaseAddressDetection.cs new file mode 100644 index 0000000..6043657 --- /dev/null +++ b/Function/BNAbortBaseAddressDetection.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNAbortBaseAddressDetection(BNBaseAddressDetection* bad) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAbortBaseAddressDetection" + )] + internal static extern void BNAbortBaseAddressDetection( + + // BNBaseAddressDetection* bad + IntPtr bad + ); + } +} \ No newline at end of file diff --git a/Function/BNAbortFlowGraphLayoutRequest.cs b/Function/BNAbortFlowGraphLayoutRequest.cs new file mode 100644 index 0000000..26646b1 --- /dev/null +++ b/Function/BNAbortFlowGraphLayoutRequest.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNAbortFlowGraphLayoutRequest(BNFlowGraphLayoutRequest* graph) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAbortFlowGraphLayoutRequest" + )] + internal static extern void BNAbortFlowGraphLayoutRequest( + + // BNFlowGraphLayoutRequest* graph + IntPtr graph + ); + } +} \ No newline at end of file diff --git a/Function/BNActivityGetName.cs b/Function/BNActivityGetName.cs new file mode 100644 index 0000000..2e56bf7 --- /dev/null +++ b/Function/BNActivityGetName.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// char* BNActivityGetName(BNActivity* activity) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNActivityGetName" + )] + internal static extern IntPtr BNActivityGetName( + + // BNActivity* activity + IntPtr activity + ); + } +} \ No newline at end of file diff --git a/Function/BNAddAnalysisCompletionEvent.cs b/Function/BNAddAnalysisCompletionEvent.cs new file mode 100644 index 0000000..5ee79cb --- /dev/null +++ b/Function/BNAddAnalysisCompletionEvent.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNAnalysisCompletionEvent* BNAddAnalysisCompletionEvent(BNBinaryView* view, void* ctxt, void** callback) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAddAnalysisCompletionEvent" + )] + internal static extern IntPtr BNAddAnalysisCompletionEvent( + + // BNBinaryView* view + IntPtr view , + + // void* ctxt + IntPtr ctxt , + + // void** callback + IntPtr callback + ); + } +} \ No newline at end of file diff --git a/Function/BNAddAnalysisOption.cs b/Function/BNAddAnalysisOption.cs new file mode 100644 index 0000000..2cebd4f --- /dev/null +++ b/Function/BNAddAnalysisOption.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNAddAnalysisOption(BNBinaryView* view, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNAddAnalysisOption" + )] + internal static extern void BNAddAnalysisOption( + + // BNBinaryView* view + IntPtr view , + + // const char* name + string name + ); + } +} \ No newline at end of file diff --git a/Function/BNAddArchitectureRedirection.cs b/Function/BNAddArchitectureRedirection.cs new file mode 100644 index 0000000..f5ae5ba --- /dev/null +++ b/Function/BNAddArchitectureRedirection.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNAddArchitectureRedirection(BNArchitecture* arch, BNArchitecture* from, BNArchitecture* to) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAddArchitectureRedirection" + )] + internal static extern void BNAddArchitectureRedirection( + + // BNArchitecture* arch + IntPtr arch , + + // BNArchitecture* _from + IntPtr _from , + + // BNArchitecture* to + IntPtr to + ); + } +} \ No newline at end of file diff --git a/Function/BNAddAutoAddressTag.cs b/Function/BNAddAutoAddressTag.cs new file mode 100644 index 0000000..a6e2539 --- /dev/null +++ b/Function/BNAddAutoAddressTag.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNAddAutoAddressTag(BNFunction* func, BNArchitecture* arch, uint64_t addr, BNTag* tag) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAddAutoAddressTag" + )] + internal static extern void BNAddAutoAddressTag( + + // BNFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t addr + ulong addr , + + // BNTag* tag + IntPtr tag + ); + } +} \ No newline at end of file diff --git a/Function/BNAddAutoDataTag.cs b/Function/BNAddAutoDataTag.cs new file mode 100644 index 0000000..7bba887 --- /dev/null +++ b/Function/BNAddAutoDataTag.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNAddAutoDataTag(BNBinaryView* view, uint64_t addr, BNTag* tag) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAddAutoDataTag" + )] + internal static extern void BNAddAutoDataTag( + + // BNBinaryView* view + IntPtr view , + + // uint64_t addr + ulong addr , + + // BNTag* tag + IntPtr tag + ); + } +} \ No newline at end of file diff --git a/Function/BNAddAutoFunctionTag.cs b/Function/BNAddAutoFunctionTag.cs new file mode 100644 index 0000000..11376bd --- /dev/null +++ b/Function/BNAddAutoFunctionTag.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNAddAutoFunctionTag(BNFunction* func, BNTag* tag) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAddAutoFunctionTag" + )] + internal static extern void BNAddAutoFunctionTag( + + // BNFunction* func + IntPtr func , + + // BNTag* tag + IntPtr tag + ); + } +} \ No newline at end of file diff --git a/Function/BNAddAutoSection.cs b/Function/BNAddAutoSection.cs new file mode 100644 index 0000000..f9338ed --- /dev/null +++ b/Function/BNAddAutoSection.cs @@ -0,0 +1,55 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNAddAutoSection(BNBinaryView* view, const char* name, uint64_t start, uint64_t length, BNSectionSemantics semantics, const char* type, uint64_t align, uint64_t entrySize, const char* linkedSection, const char* infoSection, uint64_t infoData) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNAddAutoSection" + )] + internal static extern void BNAddAutoSection( + + // BNBinaryView* view + IntPtr view , + + // const char* name + string name , + + // uint64_t start + ulong start , + + // uint64_t length + ulong length , + + // BNSectionSemantics semantics + SectionSemantics semantics , + + // const char* type + string type , + + // uint64_t align + ulong align , + + // uint64_t entrySize + ulong entrySize , + + // const char* linkedSection + string linkedSection , + + // const char* infoSection + string infoSection , + + // uint64_t infoData + ulong infoData + ); + } +} \ No newline at end of file diff --git a/Function/BNAddAutoSegment.cs b/Function/BNAddAutoSegment.cs new file mode 100644 index 0000000..3431470 --- /dev/null +++ b/Function/BNAddAutoSegment.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNAddAutoSegment(BNBinaryView* view, uint64_t start, uint64_t length, uint64_t dataOffset, uint64_t dataLength, uint32_t flags) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNAddAutoSegment" + )] + internal static extern void BNAddAutoSegment( + + // BNBinaryView* view + IntPtr view , + + // uint64_t start + ulong start , + + // uint64_t length + ulong length , + + // uint64_t dataOffset + ulong dataOffset , + + // uint64_t dataLength + ulong dataLength , + + // uint32_t flags + uint flags + ); + } +} \ No newline at end of file diff --git a/Function/BNAddAutoSegments.cs b/Function/BNAddAutoSegments.cs new file mode 100644 index 0000000..06f092b --- /dev/null +++ b/Function/BNAddAutoSegments.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNAddAutoSegments(BNBinaryView* view, BNSegmentInfo* segmentInfo, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAddAutoSegments" + )] + internal static extern void BNAddAutoSegments( + + // BNBinaryView* view + IntPtr view , + + // BNSegmentInfo* segmentInfo + BNSegmentInfo[] segmentInfo , + + // uint64_t count + ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNAddBinaryMemoryRegion.cs b/Function/BNAddBinaryMemoryRegion.cs new file mode 100644 index 0000000..82b542f --- /dev/null +++ b/Function/BNAddBinaryMemoryRegion.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNAddBinaryMemoryRegion(BNBinaryView* view, const char* name, uint64_t start, BNBinaryView* data, uint32_t flags) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNAddBinaryMemoryRegion" + )] + internal static extern bool BNAddBinaryMemoryRegion( + + // BNBinaryView* view + IntPtr view , + + // const char* name + string name , + + // uint64_t start + ulong start , + + // BNBinaryView* data + IntPtr data , + + // uint32_t flags + uint flags + ); + } +} \ No newline at end of file diff --git a/Function/BNAddBinaryViewTypeLibrary.cs b/Function/BNAddBinaryViewTypeLibrary.cs new file mode 100644 index 0000000..c324e41 --- /dev/null +++ b/Function/BNAddBinaryViewTypeLibrary.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNAddBinaryViewTypeLibrary(BNBinaryView* view, BNTypeLibrary* lib) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAddBinaryViewTypeLibrary" + )] + internal static extern void BNAddBinaryViewTypeLibrary( + + // BNBinaryView* view + IntPtr view , + + // BNTypeLibrary* lib + IntPtr lib + ); + } +} \ No newline at end of file diff --git a/Function/BNAddDataMemoryRegion.cs b/Function/BNAddDataMemoryRegion.cs new file mode 100644 index 0000000..bae9eb9 --- /dev/null +++ b/Function/BNAddDataMemoryRegion.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNAddDataMemoryRegion(BNBinaryView* view, const char* name, uint64_t start, BNDataBuffer* data, uint32_t flags) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNAddDataMemoryRegion" + )] + internal static extern bool BNAddDataMemoryRegion( + + // BNBinaryView* view + IntPtr view , + + // const char* name + string name , + + // uint64_t start + ulong start , + + // BNDataBuffer* data + IntPtr data , + + // uint32_t flags + uint flags + ); + } +} \ No newline at end of file diff --git a/Function/BNAddDataReference.cs b/Function/BNAddDataReference.cs new file mode 100644 index 0000000..76411ee --- /dev/null +++ b/Function/BNAddDataReference.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNAddDataReference(BNBinaryView* view, uint64_t fromAddr, uint64_t toAddr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAddDataReference" + )] + internal static extern void BNAddDataReference( + + // BNBinaryView* view + IntPtr view , + + // uint64_t fromAddr + ulong fromAddr , + + // uint64_t toAddr + ulong toAddr + ); + } +} \ No newline at end of file diff --git a/Function/BNAddDebugDataVariable.cs b/Function/BNAddDebugDataVariable.cs new file mode 100644 index 0000000..71a242e --- /dev/null +++ b/Function/BNAddDebugDataVariable.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNAddDebugDataVariable(BNDebugInfo* debugInfo, uint64_t address, BNType* type, const char* name, const char** components, uint64_t components_count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNAddDebugDataVariable" + )] + internal static extern bool BNAddDebugDataVariable( + + // BNDebugInfo* debugInfo + IntPtr debugInfo , + + // uint64_t address + ulong address , + + // BNType* type + IntPtr type , + + // const char* name + string name , + + // const char** components + string[] components , + + // uint64_t components_count + ulong components_count + ); + } +} \ No newline at end of file diff --git a/Function/BNAddDebugDataVariableInfo.cs b/Function/BNAddDebugDataVariableInfo.cs new file mode 100644 index 0000000..56f2bd9 --- /dev/null +++ b/Function/BNAddDebugDataVariableInfo.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNAddDebugDataVariableInfo(BNDebugInfo* debugInfo, BNDataVariableAndName* var) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAddDebugDataVariableInfo" + )] + internal static extern bool BNAddDebugDataVariableInfo( + + // BNDebugInfo* debugInfo + IntPtr debugInfo , + + // BNDataVariableAndName* _var + IntPtr _var + ); + } +} \ No newline at end of file diff --git a/Function/BNAddDebugFunction.cs b/Function/BNAddDebugFunction.cs new file mode 100644 index 0000000..67b61bc --- /dev/null +++ b/Function/BNAddDebugFunction.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNAddDebugFunction(BNDebugInfo* debugInfo, BNDebugFunctionInfo* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAddDebugFunction" + )] + internal static extern bool BNAddDebugFunction( + + // BNDebugInfo* debugInfo + IntPtr debugInfo , + + // BNDebugFunctionInfo* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNAddDebugType.cs b/Function/BNAddDebugType.cs new file mode 100644 index 0000000..f2528c5 --- /dev/null +++ b/Function/BNAddDebugType.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNAddDebugType(BNDebugInfo* debugInfo, const char* name, BNType* type, const char** components, uint64_t components_count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNAddDebugType" + )] + internal static extern bool BNAddDebugType( + + // BNDebugInfo* debugInfo + IntPtr debugInfo , + + // const char* name + string name , + + // BNType* type + IntPtr type , + + // const char** components + string[] components , + + // uint64_t components_count + ulong components_count + ); + } +} \ No newline at end of file diff --git a/Function/BNAddEntryPointForAnalysis.cs b/Function/BNAddEntryPointForAnalysis.cs new file mode 100644 index 0000000..7db1a32 --- /dev/null +++ b/Function/BNAddEntryPointForAnalysis.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNAddEntryPointForAnalysis(BNBinaryView* view, BNPlatform* platform, uint64_t addr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAddEntryPointForAnalysis" + )] + internal static extern void BNAddEntryPointForAnalysis( + + // BNBinaryView* view + IntPtr view , + + // BNPlatform* platform + IntPtr platform , + + // uint64_t addr + ulong addr + ); + } +} \ No newline at end of file diff --git a/Function/BNAddEnumerationBuilderMember.cs b/Function/BNAddEnumerationBuilderMember.cs new file mode 100644 index 0000000..e0f23d0 --- /dev/null +++ b/Function/BNAddEnumerationBuilderMember.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNAddEnumerationBuilderMember(BNEnumerationBuilder* e, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNAddEnumerationBuilderMember" + )] + internal static extern void BNAddEnumerationBuilderMember( + + // BNEnumerationBuilder* e + IntPtr e , + + // const char* name + string name + ); + } +} \ No newline at end of file diff --git a/Function/BNAddEnumerationBuilderMemberWithValue.cs b/Function/BNAddEnumerationBuilderMemberWithValue.cs new file mode 100644 index 0000000..2a73f17 --- /dev/null +++ b/Function/BNAddEnumerationBuilderMemberWithValue.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNAddEnumerationBuilderMemberWithValue(BNEnumerationBuilder* e, const char* name, uint64_t value) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNAddEnumerationBuilderMemberWithValue" + )] + internal static extern void BNAddEnumerationBuilderMemberWithValue( + + // BNEnumerationBuilder* e + IntPtr e , + + // const char* name + string name , + + // uint64_t _value + ulong _value + ); + } +} \ No newline at end of file diff --git a/Function/BNAddExpressionParserMagicValue.cs b/Function/BNAddExpressionParserMagicValue.cs new file mode 100644 index 0000000..e394bd2 --- /dev/null +++ b/Function/BNAddExpressionParserMagicValue.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNAddExpressionParserMagicValue(BNBinaryView* view, const char* name, uint64_t value) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNAddExpressionParserMagicValue" + )] + internal static extern void BNAddExpressionParserMagicValue( + + // BNBinaryView* view + IntPtr view , + + // const char* name + string name , + + // uint64_t value + ulong value + ); + } +} \ No newline at end of file diff --git a/Function/BNAddExpressionParserMagicValues.cs b/Function/BNAddExpressionParserMagicValues.cs new file mode 100644 index 0000000..d60d97d --- /dev/null +++ b/Function/BNAddExpressionParserMagicValues.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNAddExpressionParserMagicValues(BNBinaryView* view, const char** names, uint64_t* values, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNAddExpressionParserMagicValues" + )] + internal static extern void BNAddExpressionParserMagicValues( + + // BNBinaryView* view + IntPtr view , + + // const char** names + string[] names , + + // uint64_t* values + ulong[] values , + + // uint64_t count + ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNAddFlowGraphNode.cs b/Function/BNAddFlowGraphNode.cs new file mode 100644 index 0000000..27f350e --- /dev/null +++ b/Function/BNAddFlowGraphNode.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNAddFlowGraphNode(BNFlowGraph* graph, BNFlowGraphNode* node) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAddFlowGraphNode" + )] + internal static extern ulong BNAddFlowGraphNode( + + // BNFlowGraph* graph + IntPtr graph , + + // BNFlowGraphNode* node + IntPtr node + ); + } +} \ No newline at end of file diff --git a/Function/BNAddFlowGraphNodeOutgoingEdge.cs b/Function/BNAddFlowGraphNodeOutgoingEdge.cs new file mode 100644 index 0000000..6135409 --- /dev/null +++ b/Function/BNAddFlowGraphNodeOutgoingEdge.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNAddFlowGraphNodeOutgoingEdge(BNFlowGraphNode* node, BNBranchType type, BNFlowGraphNode* target, BNEdgeStyle edgeStyle) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAddFlowGraphNodeOutgoingEdge" + )] + internal static extern void BNAddFlowGraphNodeOutgoingEdge( + + // BNFlowGraphNode* node + IntPtr node , + + // BNBranchType type + BranchType type , + + // BNFlowGraphNode* target + IntPtr target , + + // BNEdgeStyle edgeStyle + EdgeStyle edgeStyle + ); + } +} \ No newline at end of file diff --git a/Function/BNAddFlowGraphRenderLayer.cs b/Function/BNAddFlowGraphRenderLayer.cs new file mode 100644 index 0000000..1856ae8 --- /dev/null +++ b/Function/BNAddFlowGraphRenderLayer.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNAddFlowGraphRenderLayer(BNFlowGraph* graph, BNRenderLayer* layer) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAddFlowGraphRenderLayer" + )] + internal static extern void BNAddFlowGraphRenderLayer( + + // BNFlowGraph* graph + IntPtr graph , + + // BNRenderLayer* layer + IntPtr layer + ); + } +} \ No newline at end of file diff --git a/Function/BNAddFunctionForAnalysis.cs b/Function/BNAddFunctionForAnalysis.cs new file mode 100644 index 0000000..d799912 --- /dev/null +++ b/Function/BNAddFunctionForAnalysis.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFunction* BNAddFunctionForAnalysis(BNBinaryView* view, BNPlatform* platform, uint64_t addr, bool autoDiscovered, BNType* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAddFunctionForAnalysis" + )] + internal static extern IntPtr BNAddFunctionForAnalysis( + + // BNBinaryView* view + IntPtr view , + + // BNPlatform* platform + IntPtr platform , + + // uint64_t addr + ulong addr , + + // bool autoDiscovered + bool autoDiscovered , + + // BNType* type + IntPtr type + ); + } +} \ No newline at end of file diff --git a/Function/BNAddGraphReportToCollection.cs b/Function/BNAddGraphReportToCollection.cs new file mode 100644 index 0000000..da89618 --- /dev/null +++ b/Function/BNAddGraphReportToCollection.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNAddGraphReportToCollection(BNReportCollection* reports, BNBinaryView* view, const char* title, BNFlowGraph* graph) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNAddGraphReportToCollection" + )] + internal static extern void BNAddGraphReportToCollection( + + // BNReportCollection* reports + IntPtr reports , + + // BNBinaryView* view + IntPtr view , + + // const char* title + string title , + + // BNFlowGraph* graph + IntPtr graph + ); + } +} \ No newline at end of file diff --git a/Function/BNAddGuidedSourceBlocks.cs b/Function/BNAddGuidedSourceBlocks.cs new file mode 100644 index 0000000..51983a4 --- /dev/null +++ b/Function/BNAddGuidedSourceBlocks.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNAddGuidedSourceBlocks(BNFunction* func, BNArchitectureAndAddress* addresses, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAddGuidedSourceBlocks" + )] + internal static extern void BNAddGuidedSourceBlocks( + + // BNFunction* func + IntPtr func , + + // BNArchitectureAndAddress* addresses + IntPtr addresses , + + // uint64_t count + ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNAddHTMLReportToCollection.cs b/Function/BNAddHTMLReportToCollection.cs new file mode 100644 index 0000000..57761cb --- /dev/null +++ b/Function/BNAddHTMLReportToCollection.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNAddHTMLReportToCollection(BNReportCollection* reports, BNBinaryView* view, const char* title, const char* contents, const char* plaintext) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNAddHTMLReportToCollection" + )] + internal static extern void BNAddHTMLReportToCollection( + + // BNReportCollection* reports + IntPtr reports , + + // BNBinaryView* view + IntPtr view , + + // const char* title + string title , + + // const char* contents + string contents , + + // const char* plaintext + string plaintext + ); + } +} \ No newline at end of file diff --git a/Function/BNAddHighLevelILArrayIndexToken.cs b/Function/BNAddHighLevelILArrayIndexToken.cs new file mode 100644 index 0000000..4942136 --- /dev/null +++ b/Function/BNAddHighLevelILArrayIndexToken.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNAddHighLevelILArrayIndexToken(BNHighLevelILFunction* func, uint64_t exprIndex, int64_t val, uint64_t size, BNHighLevelILTokenEmitter* tokens, uint64_t address) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAddHighLevelILArrayIndexToken" + )] + internal static extern void BNAddHighLevelILArrayIndexToken( + + // BNHighLevelILFunction* func + IntPtr func , + + // uint64_t exprIndex + ulong exprIndex , + + // int64_t val + long val , + + // uint64_t size + ulong size , + + // BNHighLevelILTokenEmitter* tokens + IntPtr tokens , + + // uint64_t address + ulong address + ); + } +} \ No newline at end of file diff --git a/Function/BNAddHighLevelILConstantTextToken.cs b/Function/BNAddHighLevelILConstantTextToken.cs new file mode 100644 index 0000000..1eae5d4 --- /dev/null +++ b/Function/BNAddHighLevelILConstantTextToken.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNAddHighLevelILConstantTextToken(BNHighLevelILFunction* func, uint64_t exprIndex, int64_t val, uint64_t size, BNHighLevelILTokenEmitter* tokens, BNDisassemblySettings* settings, BNOperatorPrecedence precedence) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAddHighLevelILConstantTextToken" + )] + internal static extern void BNAddHighLevelILConstantTextToken( + + // BNHighLevelILFunction* func + IntPtr func , + + // uint64_t exprIndex + ulong exprIndex , + + // int64_t val + long val , + + // uint64_t size + ulong size , + + // BNHighLevelILTokenEmitter* tokens + IntPtr tokens , + + // BNDisassemblySettings* settings + IntPtr settings , + + // BNOperatorPrecedence precedence + OperatorPrecedence precedence + ); + } +} \ No newline at end of file diff --git a/Function/BNAddHighLevelILFloatSizeToken.cs b/Function/BNAddHighLevelILFloatSizeToken.cs new file mode 100644 index 0000000..13f2b7f --- /dev/null +++ b/Function/BNAddHighLevelILFloatSizeToken.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNAddHighLevelILFloatSizeToken(uint64_t size, BNInstructionTextTokenType type, BNHighLevelILTokenEmitter* tokens) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAddHighLevelILFloatSizeToken" + )] + internal static extern void BNAddHighLevelILFloatSizeToken( + + // uint64_t size + ulong size , + + // BNInstructionTextTokenType type + InstructionTextTokenType type , + + // BNHighLevelILTokenEmitter* tokens + IntPtr tokens + ); + } +} \ No newline at end of file diff --git a/Function/BNAddHighLevelILIntegerTextToken.cs b/Function/BNAddHighLevelILIntegerTextToken.cs new file mode 100644 index 0000000..d3706ee --- /dev/null +++ b/Function/BNAddHighLevelILIntegerTextToken.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNAddHighLevelILIntegerTextToken(BNHighLevelILFunction* func, uint64_t exprIndex, int64_t val, uint64_t size, BNHighLevelILTokenEmitter* tokens) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAddHighLevelILIntegerTextToken" + )] + internal static extern void BNAddHighLevelILIntegerTextToken( + + // BNHighLevelILFunction* func + IntPtr func , + + // uint64_t exprIndex + ulong exprIndex , + + // int64_t val + long val , + + // uint64_t size + ulong size , + + // BNHighLevelILTokenEmitter* tokens + IntPtr tokens + ); + } +} \ No newline at end of file diff --git a/Function/BNAddHighLevelILPointerTextToken.cs b/Function/BNAddHighLevelILPointerTextToken.cs new file mode 100644 index 0000000..879b969 --- /dev/null +++ b/Function/BNAddHighLevelILPointerTextToken.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNSymbolDisplayResult BNAddHighLevelILPointerTextToken(BNHighLevelILFunction* func, uint64_t exprIndex, int64_t val, BNHighLevelILTokenEmitter* tokens, BNDisassemblySettings* settings, BNSymbolDisplayType symbolDisplay, BNOperatorPrecedence precedence, bool allowShortString) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAddHighLevelILPointerTextToken" + )] + internal static extern SymbolDisplayResult BNAddHighLevelILPointerTextToken( + + // BNHighLevelILFunction* func + IntPtr func , + + // uint64_t exprIndex + ulong exprIndex , + + // int64_t val + long val , + + // BNHighLevelILTokenEmitter* tokens + IntPtr tokens , + + // BNDisassemblySettings* settings + IntPtr settings , + + // BNSymbolDisplayType symbolDisplay + SymbolDisplayType symbolDisplay , + + // BNOperatorPrecedence precedence + OperatorPrecedence precedence , + + // bool allowShortString + bool allowShortString + ); + } +} \ No newline at end of file diff --git a/Function/BNAddHighLevelILSizeToken.cs b/Function/BNAddHighLevelILSizeToken.cs new file mode 100644 index 0000000..f4c1fee --- /dev/null +++ b/Function/BNAddHighLevelILSizeToken.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNAddHighLevelILSizeToken(uint64_t size, BNInstructionTextTokenType type, BNHighLevelILTokenEmitter* tokens) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAddHighLevelILSizeToken" + )] + internal static extern void BNAddHighLevelILSizeToken( + + // uint64_t size + ulong size , + + // BNInstructionTextTokenType type + InstructionTextTokenType type , + + // BNHighLevelILTokenEmitter* tokens + IntPtr tokens + ); + } +} \ No newline at end of file diff --git a/Function/BNAddHighLevelILVarTextToken.cs b/Function/BNAddHighLevelILVarTextToken.cs new file mode 100644 index 0000000..e92e009 --- /dev/null +++ b/Function/BNAddHighLevelILVarTextToken.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNAddHighLevelILVarTextToken(BNHighLevelILFunction* func, BNVariable* var, BNHighLevelILTokenEmitter* tokens, uint64_t exprIndex, uint64_t size) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAddHighLevelILVarTextToken" + )] + internal static extern void BNAddHighLevelILVarTextToken( + + // BNHighLevelILFunction* func + IntPtr func , + + // BNVariable* _var + IntPtr _var , + + // BNHighLevelILTokenEmitter* tokens + IntPtr tokens , + + // uint64_t exprIndex + ulong exprIndex , + + // uint64_t size + ulong size + ); + } +} \ No newline at end of file diff --git a/Function/BNAddLinearViewCursorRenderLayer.cs b/Function/BNAddLinearViewCursorRenderLayer.cs new file mode 100644 index 0000000..e3c5719 --- /dev/null +++ b/Function/BNAddLinearViewCursorRenderLayer.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNAddLinearViewCursorRenderLayer(BNLinearViewCursor* cursor, BNRenderLayer* layer) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAddLinearViewCursorRenderLayer" + )] + internal static extern void BNAddLinearViewCursorRenderLayer( + + // BNLinearViewCursor* cursor + IntPtr cursor , + + // BNRenderLayer* layer + IntPtr layer + ); + } +} \ No newline at end of file diff --git a/Function/BNAddLowLevelILLabelForAddress.cs b/Function/BNAddLowLevelILLabelForAddress.cs new file mode 100644 index 0000000..cfc8ba4 --- /dev/null +++ b/Function/BNAddLowLevelILLabelForAddress.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNAddLowLevelILLabelForAddress(BNLowLevelILFunction* func, BNArchitecture* arch, uint64_t addr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAddLowLevelILLabelForAddress" + )] + internal static extern void BNAddLowLevelILLabelForAddress( + + // BNLowLevelILFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t addr + ulong addr + ); + } +} \ No newline at end of file diff --git a/Function/BNAddMarkdownReportToCollection.cs b/Function/BNAddMarkdownReportToCollection.cs new file mode 100644 index 0000000..2cd42e8 --- /dev/null +++ b/Function/BNAddMarkdownReportToCollection.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNAddMarkdownReportToCollection(BNReportCollection* reports, BNBinaryView* view, const char* title, const char* contents, const char* plaintext) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNAddMarkdownReportToCollection" + )] + internal static extern void BNAddMarkdownReportToCollection( + + // BNReportCollection* reports + IntPtr reports , + + // BNBinaryView* view + IntPtr view , + + // const char* title + string title , + + // const char* contents + string contents , + + // const char* plaintext + string plaintext + ); + } +} \ No newline at end of file diff --git a/Function/BNAddNamesForOuterStructureMembers.cs b/Function/BNAddNamesForOuterStructureMembers.cs new file mode 100644 index 0000000..a1f742f --- /dev/null +++ b/Function/BNAddNamesForOuterStructureMembers.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char** BNAddNamesForOuterStructureMembers(BNBinaryView* data, BNType* type, BNHighLevelILFunction* hlil, uint64_t varExpr, uint64_t* nameCount) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAddNamesForOuterStructureMembers" + )] + internal static extern IntPtr BNAddNamesForOuterStructureMembers( + + // BNBinaryView* data + IntPtr data , + + // BNType* type + IntPtr type , + + // BNHighLevelILFunction* hlil + IntPtr hlil , + + // uint64_t varExpr + ulong varExpr , + + // uint64_t* nameCount + IntPtr nameCount + ); + } +} \ No newline at end of file diff --git a/Function/BNAddOptionalPluginDependency.cs b/Function/BNAddOptionalPluginDependency.cs new file mode 100644 index 0000000..1caaccc --- /dev/null +++ b/Function/BNAddOptionalPluginDependency.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public static partial class Core + { + public static void AddOptionalPluginDependency(string name) + { + NativeMethods.BNAddOptionalPluginDependency(name); + } + } + + internal static partial class NativeMethods + { + /// + /// void BNAddOptionalPluginDependency(const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNAddOptionalPluginDependency" + )] + public static extern void BNAddOptionalPluginDependency( + + // const char* name + string name + ); + } +} \ No newline at end of file diff --git a/Function/BNAddPlainTextReportToCollection.cs b/Function/BNAddPlainTextReportToCollection.cs new file mode 100644 index 0000000..d7751b6 --- /dev/null +++ b/Function/BNAddPlainTextReportToCollection.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNAddPlainTextReportToCollection(BNReportCollection* reports, BNBinaryView* view, const char* title, const char* contents) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNAddPlainTextReportToCollection" + )] + internal static extern void BNAddPlainTextReportToCollection( + + // BNReportCollection* reports + IntPtr reports , + + // BNBinaryView* view + IntPtr view , + + // const char* title + string title , + + // const char* contents + string contents + ); + } +} \ No newline at end of file diff --git a/Function/BNAddRelatedPlatform.cs b/Function/BNAddRelatedPlatform.cs new file mode 100644 index 0000000..825e4c4 --- /dev/null +++ b/Function/BNAddRelatedPlatform.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNAddRelatedPlatform(BNPlatform* platform, BNArchitecture* arch, BNPlatform* related) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAddRelatedPlatform" + )] + internal static extern void BNAddRelatedPlatform( + + // BNPlatform* platform + IntPtr platform , + + // BNArchitecture* arch + IntPtr arch , + + // BNPlatform* related + IntPtr related + ); + } +} \ No newline at end of file diff --git a/Function/BNAddRemoteMemoryRegion.cs b/Function/BNAddRemoteMemoryRegion.cs new file mode 100644 index 0000000..4547279 --- /dev/null +++ b/Function/BNAddRemoteMemoryRegion.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNAddRemoteMemoryRegion(BNBinaryView* view, const char* name, uint64_t start, BNFileAccessor* accessor, uint32_t flags) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNAddRemoteMemoryRegion" + )] + internal static extern bool BNAddRemoteMemoryRegion( + + // BNBinaryView* view + IntPtr view , + + // const char* name + string name , + + // uint64_t start + ulong start , + + // BNFileAccessor* accessor + in BNFileAccessor accessor , + + // uint32_t flags + uint flags + ); + } +} \ No newline at end of file diff --git a/Function/BNAddRequiredPluginDependency.cs b/Function/BNAddRequiredPluginDependency.cs new file mode 100644 index 0000000..528ea02 --- /dev/null +++ b/Function/BNAddRequiredPluginDependency.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public static partial class Core + { + public static void AddRequiredPluginDependency(string name) + { + NativeMethods.BNAddRequiredPluginDependency(name); + } + } + + internal static partial class NativeMethods + { + /// + /// void BNAddRequiredPluginDependency(const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNAddRequiredPluginDependency" + )] + public static extern void BNAddRequiredPluginDependency( + + // const char* name + string name + ); + } +} \ No newline at end of file diff --git a/Function/BNAddStructureBuilderMember.cs b/Function/BNAddStructureBuilderMember.cs new file mode 100644 index 0000000..eda9566 --- /dev/null +++ b/Function/BNAddStructureBuilderMember.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNAddStructureBuilderMember(BNStructureBuilder* s, BNTypeWithConfidence* type, const char* name, BNMemberAccess access, BNMemberScope scope) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNAddStructureBuilderMember" + )] + internal static extern void BNAddStructureBuilderMember( + + // BNStructureBuilder* s + IntPtr s , + + // BNTypeWithConfidence* type + in BNTypeWithConfidence type , + + // const char* name + string name , + + // BNMemberAccess access + MemberAccess access , + + // BNMemberScope scope + MemberScope scope + ); + } +} \ No newline at end of file diff --git a/Function/BNAddStructureBuilderMemberAtOffset.cs b/Function/BNAddStructureBuilderMemberAtOffset.cs new file mode 100644 index 0000000..d3c7fec --- /dev/null +++ b/Function/BNAddStructureBuilderMemberAtOffset.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNAddStructureBuilderMemberAtOffset(BNStructureBuilder* s, BNTypeWithConfidence* type, const char* name, uint64_t offset, bool overwriteExisting, BNMemberAccess access, BNMemberScope scope) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNAddStructureBuilderMemberAtOffset" + )] + internal static extern void BNAddStructureBuilderMemberAtOffset( + + // BNStructureBuilder* s + IntPtr s , + + // BNTypeWithConfidence* type + in BNTypeWithConfidence type , + + // const char* name + string name , + + // uint64_t offset + ulong offset , + + // bool overwriteExisting + bool overwriteExisting , + + // BNMemberAccess access + MemberAccess access , + + // BNMemberScope scope + MemberScope scope + ); + } +} \ No newline at end of file diff --git a/Function/BNAddTag.cs b/Function/BNAddTag.cs new file mode 100644 index 0000000..326cf3a --- /dev/null +++ b/Function/BNAddTag.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNAddTag(BNBinaryView* view, BNTag* tag, bool user) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAddTag" + )] + internal static extern void BNAddTag( + + // BNBinaryView* view + IntPtr view , + + // BNTag* tag + IntPtr tag , + + // bool user + bool user + ); + } +} \ No newline at end of file diff --git a/Function/BNAddTagType.cs b/Function/BNAddTagType.cs new file mode 100644 index 0000000..7f7341b --- /dev/null +++ b/Function/BNAddTagType.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNAddTagType(BNBinaryView* view, BNTagType* tagType) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAddTagType" + )] + internal static extern void BNAddTagType( + + // BNBinaryView* view + IntPtr view , + + // BNTagType* tagType + IntPtr tagType + ); + } +} \ No newline at end of file diff --git a/Function/BNAddToEntryFunctions.cs b/Function/BNAddToEntryFunctions.cs new file mode 100644 index 0000000..20fb665 --- /dev/null +++ b/Function/BNAddToEntryFunctions.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNAddToEntryFunctions(BNBinaryView* view, BNFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAddToEntryFunctions" + )] + internal static extern void BNAddToEntryFunctions( + + // BNBinaryView* view + IntPtr view , + + // BNFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNAddTypeArchiveTypes.cs b/Function/BNAddTypeArchiveTypes.cs new file mode 100644 index 0000000..9d62f1e --- /dev/null +++ b/Function/BNAddTypeArchiveTypes.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNAddTypeArchiveTypes(BNTypeArchive* archive, BNQualifiedNameAndType* types, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAddTypeArchiveTypes" + )] + internal static extern bool BNAddTypeArchiveTypes( + + // BNTypeArchive* archive + IntPtr archive , + + // BNQualifiedNameAndType* types + IntPtr types , + + // uint64_t count + ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNAddTypeBuilderPointerSuffix.cs b/Function/BNAddTypeBuilderPointerSuffix.cs new file mode 100644 index 0000000..726a006 --- /dev/null +++ b/Function/BNAddTypeBuilderPointerSuffix.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNAddTypeBuilderPointerSuffix(BNTypeBuilder* type, BNPointerSuffix ps) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAddTypeBuilderPointerSuffix" + )] + internal static extern void BNAddTypeBuilderPointerSuffix( + + // BNTypeBuilder* type + IntPtr type , + + // BNPointerSuffix ps + PointerSuffix ps + ); + } +} \ No newline at end of file diff --git a/Function/BNAddTypeLibraryAlternateName.cs b/Function/BNAddTypeLibraryAlternateName.cs new file mode 100644 index 0000000..a9c142d --- /dev/null +++ b/Function/BNAddTypeLibraryAlternateName.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNAddTypeLibraryAlternateName(BNTypeLibrary* lib, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNAddTypeLibraryAlternateName" + )] + internal static extern void BNAddTypeLibraryAlternateName( + + // BNTypeLibrary* lib + IntPtr lib , + + // const char* name + string name + ); + } +} \ No newline at end of file diff --git a/Function/BNAddTypeLibraryNamedObject.cs b/Function/BNAddTypeLibraryNamedObject.cs new file mode 100644 index 0000000..498e363 --- /dev/null +++ b/Function/BNAddTypeLibraryNamedObject.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNAddTypeLibraryNamedObject(BNTypeLibrary* lib, BNQualifiedName* name, BNType* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAddTypeLibraryNamedObject" + )] + internal static extern void BNAddTypeLibraryNamedObject( + + // BNTypeLibrary* lib + IntPtr lib , + + // BNQualifiedName* name + in BNQualifiedName name , + + // BNType* type + IntPtr type + ); + } +} \ No newline at end of file diff --git a/Function/BNAddTypeLibraryNamedType.cs b/Function/BNAddTypeLibraryNamedType.cs new file mode 100644 index 0000000..88e2307 --- /dev/null +++ b/Function/BNAddTypeLibraryNamedType.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNAddTypeLibraryNamedType(BNTypeLibrary* lib, BNQualifiedName* name, BNType* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAddTypeLibraryNamedType" + )] + internal static extern void BNAddTypeLibraryNamedType( + + // BNTypeLibrary* lib + IntPtr lib , + + // BNQualifiedName* name + in BNQualifiedName name , + + // BNType* type + IntPtr type + ); + } +} \ No newline at end of file diff --git a/Function/BNAddTypeLibraryNamedTypeSource.cs b/Function/BNAddTypeLibraryNamedTypeSource.cs new file mode 100644 index 0000000..bae1ac7 --- /dev/null +++ b/Function/BNAddTypeLibraryNamedTypeSource.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNAddTypeLibraryNamedTypeSource(BNTypeLibrary* lib, BNQualifiedName* name, const char* source) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNAddTypeLibraryNamedTypeSource" + )] + internal static extern void BNAddTypeLibraryNamedTypeSource( + + // BNTypeLibrary* lib + IntPtr lib , + + // BNQualifiedName* name + in BNQualifiedName name , + + // const char* source + string source + ); + } +} \ No newline at end of file diff --git a/Function/BNAddTypeLibraryPlatform.cs b/Function/BNAddTypeLibraryPlatform.cs new file mode 100644 index 0000000..db9bb6a --- /dev/null +++ b/Function/BNAddTypeLibraryPlatform.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNAddTypeLibraryPlatform(BNTypeLibrary* lib, BNPlatform* platform) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAddTypeLibraryPlatform" + )] + internal static extern void BNAddTypeLibraryPlatform( + + // BNTypeLibrary* lib + IntPtr lib , + + // BNPlatform* platform + IntPtr platform + ); + } +} \ No newline at end of file diff --git a/Function/BNAddTypeMemberTokens.cs b/Function/BNAddTypeMemberTokens.cs new file mode 100644 index 0000000..a96c9bb --- /dev/null +++ b/Function/BNAddTypeMemberTokens.cs @@ -0,0 +1,51 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNAddTypeMemberTokens(BNType* type, BNBinaryView* data, BNInstructionTextToken** tokens, uint64_t* tokenCount, int64_t offset, const char*** nameList, uint64_t* nameCount, uint64_t size, bool indirect, BNFieldResolutionInfo* info) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAddTypeMemberTokens" + )] + internal static extern bool BNAddTypeMemberTokens( + + // BNType* type + IntPtr type , + + // BNBinaryView* data + IntPtr data , + + // BNInstructionTextToken** tokens + IntPtr tokens , + + // uint64_t* tokenCount + IntPtr tokenCount , + + // int64_t offset + long offset , + + // const char*** nameList + IntPtr nameList , + + // uint64_t* nameCount + IntPtr nameCount , + + // uint64_t size + ulong size , + + // bool indirect + bool indirect , + + // BNFieldResolutionInfo* info + IntPtr info + ); + } +} \ No newline at end of file diff --git a/Function/BNAddUnbackedMemoryRegion.cs b/Function/BNAddUnbackedMemoryRegion.cs new file mode 100644 index 0000000..3d1d2f3 --- /dev/null +++ b/Function/BNAddUnbackedMemoryRegion.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNAddUnbackedMemoryRegion(BNBinaryView* view, const char* name, uint64_t start, uint64_t length, uint32_t flags, uint8_t fill) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNAddUnbackedMemoryRegion" + )] + internal static extern bool BNAddUnbackedMemoryRegion( + + // BNBinaryView* view + IntPtr view , + + // const char* name + string name , + + // uint64_t start + ulong start , + + // uint64_t length + ulong length , + + // uint32_t flags + uint flags , + + // uint8_t fill + byte fill + ); + } +} \ No newline at end of file diff --git a/Function/BNAddUserAddressTag.cs b/Function/BNAddUserAddressTag.cs new file mode 100644 index 0000000..2fbceba --- /dev/null +++ b/Function/BNAddUserAddressTag.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNAddUserAddressTag(BNFunction* func, BNArchitecture* arch, uint64_t addr, BNTag* tag) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAddUserAddressTag" + )] + internal static extern void BNAddUserAddressTag( + + // BNFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t addr + ulong addr , + + // BNTag* tag + IntPtr tag + ); + } +} \ No newline at end of file diff --git a/Function/BNAddUserCodeReference.cs b/Function/BNAddUserCodeReference.cs new file mode 100644 index 0000000..db3d58e --- /dev/null +++ b/Function/BNAddUserCodeReference.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNAddUserCodeReference(BNFunction* func, BNArchitecture* fromArch, uint64_t fromAddr, uint64_t toAddr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAddUserCodeReference" + )] + internal static extern void BNAddUserCodeReference( + + // BNFunction* func + IntPtr func , + + // BNArchitecture* fromArch + IntPtr fromArch , + + // uint64_t fromAddr + ulong fromAddr , + + // uint64_t toAddr + ulong toAddr + ); + } +} \ No newline at end of file diff --git a/Function/BNAddUserDataReference.cs b/Function/BNAddUserDataReference.cs new file mode 100644 index 0000000..34ae036 --- /dev/null +++ b/Function/BNAddUserDataReference.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNAddUserDataReference(BNBinaryView* view, uint64_t fromAddr, uint64_t toAddr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAddUserDataReference" + )] + internal static extern void BNAddUserDataReference( + + // BNBinaryView* view + IntPtr view , + + // uint64_t fromAddr + ulong fromAddr , + + // uint64_t toAddr + ulong toAddr + ); + } +} \ No newline at end of file diff --git a/Function/BNAddUserDataTag.cs b/Function/BNAddUserDataTag.cs new file mode 100644 index 0000000..84065c1 --- /dev/null +++ b/Function/BNAddUserDataTag.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNAddUserDataTag(BNBinaryView* view, uint64_t addr, BNTag* tag) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAddUserDataTag" + )] + internal static extern void BNAddUserDataTag( + + // BNBinaryView* view + IntPtr view , + + // uint64_t addr + ulong addr , + + // BNTag* tag + IntPtr tag + ); + } +} \ No newline at end of file diff --git a/Function/BNAddUserFunctionTag.cs b/Function/BNAddUserFunctionTag.cs new file mode 100644 index 0000000..0fee92f --- /dev/null +++ b/Function/BNAddUserFunctionTag.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNAddUserFunctionTag(BNFunction* func, BNTag* tag) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAddUserFunctionTag" + )] + internal static extern void BNAddUserFunctionTag( + + // BNFunction* func + IntPtr func , + + // BNTag* tag + IntPtr tag + ); + } +} \ No newline at end of file diff --git a/Function/BNAddUserSection.cs b/Function/BNAddUserSection.cs new file mode 100644 index 0000000..b07df2f --- /dev/null +++ b/Function/BNAddUserSection.cs @@ -0,0 +1,55 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNAddUserSection(BNBinaryView* view, const char* name, uint64_t start, uint64_t length, BNSectionSemantics semantics, const char* type, uint64_t align, uint64_t entrySize, const char* linkedSection, const char* infoSection, uint64_t infoData) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNAddUserSection" + )] + internal static extern void BNAddUserSection( + + // BNBinaryView* view + IntPtr view , + + // const char* name + string name , + + // uint64_t start + ulong start , + + // uint64_t length + ulong length , + + // BNSectionSemantics semantics + SectionSemantics semantics , + + // const char* type + string kind , + + // uint64_t align + ulong align , + + // uint64_t entrySize + ulong entrySize , + + // const char* linkedSection + string linkedSection , + + // const char* infoSection + string infoSection , + + // uint64_t infoData + ulong infoData + ); + } +} \ No newline at end of file diff --git a/Function/BNAddUserSegment.cs b/Function/BNAddUserSegment.cs new file mode 100644 index 0000000..78d21a9 --- /dev/null +++ b/Function/BNAddUserSegment.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNAddUserSegment(BNBinaryView* view, uint64_t start, uint64_t length, uint64_t dataOffset, uint64_t dataLength, uint32_t flags) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAddUserSegment" + )] + internal static extern void BNAddUserSegment( + + // BNBinaryView* view + IntPtr view , + + // uint64_t start + ulong start , + + // uint64_t length + ulong length , + + // uint64_t dataOffset + ulong dataOffset , + + // uint64_t dataLength + ulong dataLength , + + // uint32_t flags + uint flags + ); + } +} \ No newline at end of file diff --git a/Function/BNAddUserSegments.cs b/Function/BNAddUserSegments.cs new file mode 100644 index 0000000..0f78502 --- /dev/null +++ b/Function/BNAddUserSegments.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNAddUserSegments(BNBinaryView* view, BNSegmentInfo* segmentInfo, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAddUserSegments" + )] + internal static extern void BNAddUserSegments( + + // BNBinaryView* view + IntPtr view , + + // BNSegmentInfo* segmentInfo + BNSegmentInfo[] segmentInfo , + + // uint64_t count + ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNAddUserTypeFieldReference.cs b/Function/BNAddUserTypeFieldReference.cs new file mode 100644 index 0000000..55145f5 --- /dev/null +++ b/Function/BNAddUserTypeFieldReference.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNAddUserTypeFieldReference(BNFunction* func, BNArchitecture* fromArch, uint64_t fromAddr, BNQualifiedName* name, uint64_t offset, uint64_t size) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAddUserTypeFieldReference" + )] + internal static extern void BNAddUserTypeFieldReference( + + // BNFunction* func + IntPtr func , + + // BNArchitecture* fromArch + IntPtr fromArch , + + // uint64_t fromAddr + ulong fromAddr , + + // BNQualifiedName* name + IntPtr name , + + // uint64_t offset + ulong offset , + + // uint64_t size + ulong size + ); + } +} \ No newline at end of file diff --git a/Function/BNAddUserTypeReference.cs b/Function/BNAddUserTypeReference.cs new file mode 100644 index 0000000..620f9ed --- /dev/null +++ b/Function/BNAddUserTypeReference.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNAddUserTypeReference(BNFunction* func, BNArchitecture* fromArch, uint64_t fromAddr, BNQualifiedName* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAddUserTypeReference" + )] + internal static extern void BNAddUserTypeReference( + + // BNFunction* func + IntPtr func , + + // BNArchitecture* fromArch + IntPtr fromArch , + + // uint64_t fromAddr + ulong fromAddr , + + // BNQualifiedName* name + IntPtr name + ); + } +} \ No newline at end of file diff --git a/Function/BNAllocString.cs b/Function/BNAllocString.cs new file mode 100644 index 0000000..9624e57 --- /dev/null +++ b/Function/BNAllocString.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNAllocString(const char* contents) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNAllocString" + )] + internal static extern IntPtr BNAllocString( + + // const char* contents + string contents + ); + } +} \ No newline at end of file diff --git a/Function/BNAllocStringList.cs b/Function/BNAllocStringList.cs new file mode 100644 index 0000000..aa79ca3 --- /dev/null +++ b/Function/BNAllocStringList.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// char** BNAllocStringList(const char** contents, uint64_t size) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNAllocStringList" + )] + internal static extern IntPtr BNAllocStringList( + + // const char** contents + string[] contents , + + // uint64_t size + ulong size + ); + } +} \ No newline at end of file diff --git a/Function/BNAllocStringWithLength.cs b/Function/BNAllocStringWithLength.cs new file mode 100644 index 0000000..4b08147 --- /dev/null +++ b/Function/BNAllocStringWithLength.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNAllocStringWithLength(const char* contents, uint64_t len) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNAllocStringWithLength" + )] + internal static extern IntPtr BNAllocStringWithLength( + + // const char* contents + string contents , + + // uint64_t len + ulong len + ); + } +} \ No newline at end of file diff --git a/Function/BNAlwaysBranch.cs b/Function/BNAlwaysBranch.cs new file mode 100644 index 0000000..daefbf4 --- /dev/null +++ b/Function/BNAlwaysBranch.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNAlwaysBranch(BNBinaryView* view, BNArchitecture* arch, uint64_t addr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAlwaysBranch" + )] + internal static extern bool BNAlwaysBranch( + + // BNBinaryView* view + IntPtr view , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t addr + ulong addr + ); + } +} \ No newline at end of file diff --git a/Function/BNAnalysisContextGetBinaryView.cs b/Function/BNAnalysisContextGetBinaryView.cs new file mode 100644 index 0000000..ee41a8f --- /dev/null +++ b/Function/BNAnalysisContextGetBinaryView.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBinaryView* BNAnalysisContextGetBinaryView(BNAnalysisContext* analysisContext) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAnalysisContextGetBinaryView" + )] + internal static extern IntPtr BNAnalysisContextGetBinaryView( + + // BNAnalysisContext* analysisContext + IntPtr analysisContext + ); + } +} \ No newline at end of file diff --git a/Function/BNAnalysisContextGetFunction.cs b/Function/BNAnalysisContextGetFunction.cs new file mode 100644 index 0000000..e84ae4a --- /dev/null +++ b/Function/BNAnalysisContextGetFunction.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFunction* BNAnalysisContextGetFunction(BNAnalysisContext* analysisContext) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAnalysisContextGetFunction" + )] + internal static extern IntPtr BNAnalysisContextGetFunction( + + // BNAnalysisContext* analysisContext + IntPtr analysisContext + ); + } +} \ No newline at end of file diff --git a/Function/BNAnalysisContextGetHighLevelILFunction.cs b/Function/BNAnalysisContextGetHighLevelILFunction.cs new file mode 100644 index 0000000..133ae2d --- /dev/null +++ b/Function/BNAnalysisContextGetHighLevelILFunction.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNHighLevelILFunction* BNAnalysisContextGetHighLevelILFunction(BNAnalysisContext* analysisContext) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAnalysisContextGetHighLevelILFunction" + )] + internal static extern IntPtr BNAnalysisContextGetHighLevelILFunction( + + // BNAnalysisContext* analysisContext + IntPtr analysisContext + ); + } +} \ No newline at end of file diff --git a/Function/BNAnalysisContextGetLiftedILFunction.cs b/Function/BNAnalysisContextGetLiftedILFunction.cs new file mode 100644 index 0000000..718da3d --- /dev/null +++ b/Function/BNAnalysisContextGetLiftedILFunction.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLowLevelILFunction* BNAnalysisContextGetLiftedILFunction(BNAnalysisContext* analysisContext) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAnalysisContextGetLiftedILFunction" + )] + internal static extern IntPtr BNAnalysisContextGetLiftedILFunction( + + // BNAnalysisContext* analysisContext + IntPtr analysisContext + ); + } +} \ No newline at end of file diff --git a/Function/BNAnalysisContextGetLowLevelILFunction.cs b/Function/BNAnalysisContextGetLowLevelILFunction.cs new file mode 100644 index 0000000..96d2e80 --- /dev/null +++ b/Function/BNAnalysisContextGetLowLevelILFunction.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLowLevelILFunction* BNAnalysisContextGetLowLevelILFunction(BNAnalysisContext* analysisContext) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAnalysisContextGetLowLevelILFunction" + )] + internal static extern IntPtr BNAnalysisContextGetLowLevelILFunction( + + // BNAnalysisContext* analysisContext + IntPtr analysisContext + ); + } +} \ No newline at end of file diff --git a/Function/BNAnalysisContextGetMediumLevelILFunction.cs b/Function/BNAnalysisContextGetMediumLevelILFunction.cs new file mode 100644 index 0000000..e5606cc --- /dev/null +++ b/Function/BNAnalysisContextGetMediumLevelILFunction.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNMediumLevelILFunction* BNAnalysisContextGetMediumLevelILFunction(BNAnalysisContext* analysisContext) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAnalysisContextGetMediumLevelILFunction" + )] + internal static extern IntPtr BNAnalysisContextGetMediumLevelILFunction( + + // BNAnalysisContext* analysisContext + IntPtr analysisContext + ); + } +} \ No newline at end of file diff --git a/Function/BNAnalysisContextInform.cs b/Function/BNAnalysisContextInform.cs new file mode 100644 index 0000000..7e68db5 --- /dev/null +++ b/Function/BNAnalysisContextInform.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNAnalysisContextInform(BNAnalysisContext* analysisContext, const char* request) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNAnalysisContextInform" + )] + internal static extern bool BNAnalysisContextInform( + + // BNAnalysisContext* analysisContext + IntPtr analysisContext , + + // const char* request + string request + ); + } +} \ No newline at end of file diff --git a/Function/BNAnalysisIsAborted.cs b/Function/BNAnalysisIsAborted.cs new file mode 100644 index 0000000..7450d20 --- /dev/null +++ b/Function/BNAnalysisIsAborted.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNAnalysisIsAborted(BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAnalysisIsAborted" + )] + internal static extern bool BNAnalysisIsAborted( + + // BNBinaryView* view + IntPtr view + ); + } +} \ No newline at end of file diff --git a/Function/BNAnalysisMergeConflictGetBase.cs b/Function/BNAnalysisMergeConflictGetBase.cs new file mode 100644 index 0000000..b962ddd --- /dev/null +++ b/Function/BNAnalysisMergeConflictGetBase.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNAnalysisMergeConflictGetBase(BNAnalysisMergeConflict* conflict) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAnalysisMergeConflictGetBase" + )] + internal static extern IntPtr BNAnalysisMergeConflictGetBase( + + // BNAnalysisMergeConflict* conflict + IntPtr conflict + ); + } +} \ No newline at end of file diff --git a/Function/BNAnalysisMergeConflictGetBaseFile.cs b/Function/BNAnalysisMergeConflictGetBaseFile.cs new file mode 100644 index 0000000..2e83669 --- /dev/null +++ b/Function/BNAnalysisMergeConflictGetBaseFile.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFileMetadata* BNAnalysisMergeConflictGetBaseFile(BNAnalysisMergeConflict* conflict) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAnalysisMergeConflictGetBaseFile" + )] + internal static extern IntPtr BNAnalysisMergeConflictGetBaseFile( + + // BNAnalysisMergeConflict* conflict + IntPtr conflict + ); + } +} \ No newline at end of file diff --git a/Function/BNAnalysisMergeConflictGetBaseSnapshot.cs b/Function/BNAnalysisMergeConflictGetBaseSnapshot.cs new file mode 100644 index 0000000..96274d2 --- /dev/null +++ b/Function/BNAnalysisMergeConflictGetBaseSnapshot.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNSnapshot* BNAnalysisMergeConflictGetBaseSnapshot(BNAnalysisMergeConflict* conflict) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAnalysisMergeConflictGetBaseSnapshot" + )] + internal static extern IntPtr BNAnalysisMergeConflictGetBaseSnapshot( + + // BNAnalysisMergeConflict* conflict + IntPtr conflict + ); + } +} \ No newline at end of file diff --git a/Function/BNAnalysisMergeConflictGetDataType.cs b/Function/BNAnalysisMergeConflictGetDataType.cs new file mode 100644 index 0000000..2e9f783 --- /dev/null +++ b/Function/BNAnalysisMergeConflictGetDataType.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNMergeConflictDataType BNAnalysisMergeConflictGetDataType(BNAnalysisMergeConflict* conflict) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAnalysisMergeConflictGetDataType" + )] + internal static extern MergeConflictDataType BNAnalysisMergeConflictGetDataType( + + // BNAnalysisMergeConflict* conflict + IntPtr conflict + ); + } +} \ No newline at end of file diff --git a/Function/BNAnalysisMergeConflictGetDatabase.cs b/Function/BNAnalysisMergeConflictGetDatabase.cs new file mode 100644 index 0000000..c66515a --- /dev/null +++ b/Function/BNAnalysisMergeConflictGetDatabase.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDatabase* BNAnalysisMergeConflictGetDatabase(BNAnalysisMergeConflict* conflict) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAnalysisMergeConflictGetDatabase" + )] + internal static extern IntPtr BNAnalysisMergeConflictGetDatabase( + + // BNAnalysisMergeConflict* conflict + IntPtr conflict + ); + } +} \ No newline at end of file diff --git a/Function/BNAnalysisMergeConflictGetFirst.cs b/Function/BNAnalysisMergeConflictGetFirst.cs new file mode 100644 index 0000000..3f184c7 --- /dev/null +++ b/Function/BNAnalysisMergeConflictGetFirst.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNAnalysisMergeConflictGetFirst(BNAnalysisMergeConflict* conflict) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAnalysisMergeConflictGetFirst" + )] + internal static extern IntPtr BNAnalysisMergeConflictGetFirst( + + // BNAnalysisMergeConflict* conflict + IntPtr conflict + ); + } +} \ No newline at end of file diff --git a/Function/BNAnalysisMergeConflictGetFirstFile.cs b/Function/BNAnalysisMergeConflictGetFirstFile.cs new file mode 100644 index 0000000..853f6f2 --- /dev/null +++ b/Function/BNAnalysisMergeConflictGetFirstFile.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFileMetadata* BNAnalysisMergeConflictGetFirstFile(BNAnalysisMergeConflict* conflict) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAnalysisMergeConflictGetFirstFile" + )] + internal static extern IntPtr BNAnalysisMergeConflictGetFirstFile( + + // BNAnalysisMergeConflict* conflict + IntPtr conflict + ); + } +} \ No newline at end of file diff --git a/Function/BNAnalysisMergeConflictGetFirstSnapshot.cs b/Function/BNAnalysisMergeConflictGetFirstSnapshot.cs new file mode 100644 index 0000000..36708e0 --- /dev/null +++ b/Function/BNAnalysisMergeConflictGetFirstSnapshot.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNSnapshot* BNAnalysisMergeConflictGetFirstSnapshot(BNAnalysisMergeConflict* conflict) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAnalysisMergeConflictGetFirstSnapshot" + )] + internal static extern IntPtr BNAnalysisMergeConflictGetFirstSnapshot( + + // BNAnalysisMergeConflict* conflict + IntPtr conflict + ); + } +} \ No newline at end of file diff --git a/Function/BNAnalysisMergeConflictGetKey.cs b/Function/BNAnalysisMergeConflictGetKey.cs new file mode 100644 index 0000000..78457ed --- /dev/null +++ b/Function/BNAnalysisMergeConflictGetKey.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNAnalysisMergeConflictGetKey(BNAnalysisMergeConflict* conflict) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAnalysisMergeConflictGetKey" + )] + internal static extern IntPtr BNAnalysisMergeConflictGetKey( + + // BNAnalysisMergeConflict* conflict + IntPtr conflict + ); + } +} \ No newline at end of file diff --git a/Function/BNAnalysisMergeConflictGetPathItem.cs b/Function/BNAnalysisMergeConflictGetPathItem.cs new file mode 100644 index 0000000..f74f6bf --- /dev/null +++ b/Function/BNAnalysisMergeConflictGetPathItem.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void* BNAnalysisMergeConflictGetPathItem(BNAnalysisMergeConflict* conflict, const char* path) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNAnalysisMergeConflictGetPathItem" + )] + internal static extern IntPtr BNAnalysisMergeConflictGetPathItem( + + // BNAnalysisMergeConflict* conflict + IntPtr conflict , + + // const char* path + string path + ); + } +} \ No newline at end of file diff --git a/Function/BNAnalysisMergeConflictGetPathItemSerialized.cs b/Function/BNAnalysisMergeConflictGetPathItemSerialized.cs new file mode 100644 index 0000000..c9d2067 --- /dev/null +++ b/Function/BNAnalysisMergeConflictGetPathItemSerialized.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNAnalysisMergeConflictGetPathItemSerialized(BNAnalysisMergeConflict* conflict, const char* path) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNAnalysisMergeConflictGetPathItemSerialized" + )] + internal static extern IntPtr BNAnalysisMergeConflictGetPathItemSerialized( + + // BNAnalysisMergeConflict* conflict + IntPtr conflict , + + // const char* path + string path + ); + } +} \ No newline at end of file diff --git a/Function/BNAnalysisMergeConflictGetPathItemString.cs b/Function/BNAnalysisMergeConflictGetPathItemString.cs new file mode 100644 index 0000000..2778cf6 --- /dev/null +++ b/Function/BNAnalysisMergeConflictGetPathItemString.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNAnalysisMergeConflictGetPathItemString(BNAnalysisMergeConflict* conflict, const char* path) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNAnalysisMergeConflictGetPathItemString" + )] + internal static extern IntPtr BNAnalysisMergeConflictGetPathItemString( + + // BNAnalysisMergeConflict* conflict + IntPtr conflict , + + // const char* path + string path + ); + } +} \ No newline at end of file diff --git a/Function/BNAnalysisMergeConflictGetSecond.cs b/Function/BNAnalysisMergeConflictGetSecond.cs new file mode 100644 index 0000000..65d5322 --- /dev/null +++ b/Function/BNAnalysisMergeConflictGetSecond.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNAnalysisMergeConflictGetSecond(BNAnalysisMergeConflict* conflict) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAnalysisMergeConflictGetSecond" + )] + internal static extern IntPtr BNAnalysisMergeConflictGetSecond( + + // BNAnalysisMergeConflict* conflict + IntPtr conflict + ); + } +} \ No newline at end of file diff --git a/Function/BNAnalysisMergeConflictGetSecondFile.cs b/Function/BNAnalysisMergeConflictGetSecondFile.cs new file mode 100644 index 0000000..9590080 --- /dev/null +++ b/Function/BNAnalysisMergeConflictGetSecondFile.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFileMetadata* BNAnalysisMergeConflictGetSecondFile(BNAnalysisMergeConflict* conflict) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAnalysisMergeConflictGetSecondFile" + )] + internal static extern IntPtr BNAnalysisMergeConflictGetSecondFile( + + // BNAnalysisMergeConflict* conflict + IntPtr conflict + ); + } +} \ No newline at end of file diff --git a/Function/BNAnalysisMergeConflictGetSecondSnapshot.cs b/Function/BNAnalysisMergeConflictGetSecondSnapshot.cs new file mode 100644 index 0000000..49f29f8 --- /dev/null +++ b/Function/BNAnalysisMergeConflictGetSecondSnapshot.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNSnapshot* BNAnalysisMergeConflictGetSecondSnapshot(BNAnalysisMergeConflict* conflict) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAnalysisMergeConflictGetSecondSnapshot" + )] + internal static extern IntPtr BNAnalysisMergeConflictGetSecondSnapshot( + + // BNAnalysisMergeConflict* conflict + IntPtr conflict + ); + } +} \ No newline at end of file diff --git a/Function/BNAnalysisMergeConflictGetType.cs b/Function/BNAnalysisMergeConflictGetType.cs new file mode 100644 index 0000000..8f68cc5 --- /dev/null +++ b/Function/BNAnalysisMergeConflictGetType.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNAnalysisMergeConflictGetType(BNAnalysisMergeConflict* conflict) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAnalysisMergeConflictGetType" + )] + internal static extern IntPtr BNAnalysisMergeConflictGetType( + + // BNAnalysisMergeConflict* conflict + IntPtr conflict + ); + } +} \ No newline at end of file diff --git a/Function/BNAnalysisMergeConflictSplitterCanSplit.cs b/Function/BNAnalysisMergeConflictSplitterCanSplit.cs new file mode 100644 index 0000000..3c927a5 --- /dev/null +++ b/Function/BNAnalysisMergeConflictSplitterCanSplit.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNAnalysisMergeConflictSplitterCanSplit(BNAnalysisMergeConflictSplitter* splitter, const char* key, BNAnalysisMergeConflict* conflict) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNAnalysisMergeConflictSplitterCanSplit" + )] + internal static extern bool BNAnalysisMergeConflictSplitterCanSplit( + + // BNAnalysisMergeConflictSplitter* splitter + IntPtr splitter , + + // const char* key + string key , + + // BNAnalysisMergeConflict* conflict + IntPtr conflict + ); + } +} \ No newline at end of file diff --git a/Function/BNAnalysisMergeConflictSplitterGetName.cs b/Function/BNAnalysisMergeConflictSplitterGetName.cs new file mode 100644 index 0000000..d14968c --- /dev/null +++ b/Function/BNAnalysisMergeConflictSplitterGetName.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNAnalysisMergeConflictSplitterGetName(BNAnalysisMergeConflictSplitter* splitter) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAnalysisMergeConflictSplitterGetName" + )] + internal static extern IntPtr BNAnalysisMergeConflictSplitterGetName( + + // BNAnalysisMergeConflictSplitter* splitter + IntPtr splitter + ); + } +} \ No newline at end of file diff --git a/Function/BNAnalysisMergeConflictSplitterSplit.cs b/Function/BNAnalysisMergeConflictSplitterSplit.cs new file mode 100644 index 0000000..6d0f12b --- /dev/null +++ b/Function/BNAnalysisMergeConflictSplitterSplit.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNAnalysisMergeConflictSplitterSplit(BNAnalysisMergeConflictSplitter* splitter, const char* originalKey, BNAnalysisMergeConflict* originalConflict, BNKeyValueStore* result, const char*** newKeys, BNAnalysisMergeConflict*** newConflicts, uint64_t* newCount) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNAnalysisMergeConflictSplitterSplit" + )] + internal static extern bool BNAnalysisMergeConflictSplitterSplit( + + // BNAnalysisMergeConflictSplitter* splitter + IntPtr splitter , + + // const char* originalKey + string originalKey , + + // BNAnalysisMergeConflict* originalConflict + IntPtr originalConflict , + + // BNKeyValueStore* result + IntPtr result , + + // const char*** newKeys + IntPtr newKeys , + + // BNAnalysisMergeConflict*** newConflicts + IntPtr newConflicts , + + // uint64_t* newCount + IntPtr newCount + ); + } +} \ No newline at end of file diff --git a/Function/BNAnalysisMergeConflictSuccess.cs b/Function/BNAnalysisMergeConflictSuccess.cs new file mode 100644 index 0000000..991d692 --- /dev/null +++ b/Function/BNAnalysisMergeConflictSuccess.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNAnalysisMergeConflictSuccess(BNAnalysisMergeConflict* conflict, const char* value) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNAnalysisMergeConflictSuccess" + )] + internal static extern bool BNAnalysisMergeConflictSuccess( + + // BNAnalysisMergeConflict* conflict + IntPtr conflict , + + // const char* _value + string _value + ); + } +} \ No newline at end of file diff --git a/Function/BNAnalyzeBasicBlocksContextAddBasicBlockToFunction.cs b/Function/BNAnalyzeBasicBlocksContextAddBasicBlockToFunction.cs new file mode 100644 index 0000000..d04bbf7 --- /dev/null +++ b/Function/BNAnalyzeBasicBlocksContextAddBasicBlockToFunction.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNAnalyzeBasicBlocksContextAddBasicBlockToFunction(BNBasicBlockAnalysisContext* abb, BNBasicBlock* block) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAnalyzeBasicBlocksContextAddBasicBlockToFunction" + )] + internal static extern void BNAnalyzeBasicBlocksContextAddBasicBlockToFunction( + + // BNBasicBlockAnalysisContext* abb + IntPtr abb , + + // BNBasicBlock* block + IntPtr block + ); + } +} \ No newline at end of file diff --git a/Function/BNAnalyzeBasicBlocksContextAddTempReference.cs b/Function/BNAnalyzeBasicBlocksContextAddTempReference.cs new file mode 100644 index 0000000..cb618f6 --- /dev/null +++ b/Function/BNAnalyzeBasicBlocksContextAddTempReference.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNAnalyzeBasicBlocksContextAddTempReference(BNBasicBlockAnalysisContext* abb, BNFunction* target) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAnalyzeBasicBlocksContextAddTempReference" + )] + internal static extern void BNAnalyzeBasicBlocksContextAddTempReference( + + // BNBasicBlockAnalysisContext* abb + IntPtr abb , + + // BNFunction* target + IntPtr target + ); + } +} \ No newline at end of file diff --git a/Function/BNAnalyzeBasicBlocksContextCreateBasicBlock.cs b/Function/BNAnalyzeBasicBlocksContextCreateBasicBlock.cs new file mode 100644 index 0000000..f6e5537 --- /dev/null +++ b/Function/BNAnalyzeBasicBlocksContextCreateBasicBlock.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBasicBlock* BNAnalyzeBasicBlocksContextCreateBasicBlock(BNBasicBlockAnalysisContext* abb, BNArchitecture* arch, uint64_t addr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAnalyzeBasicBlocksContextCreateBasicBlock" + )] + internal static extern IntPtr BNAnalyzeBasicBlocksContextCreateBasicBlock( + + // BNBasicBlockAnalysisContext* abb + IntPtr abb , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t addr + ulong addr + ); + } +} \ No newline at end of file diff --git a/Function/BNAnalyzeBasicBlocksContextFinalize.cs b/Function/BNAnalyzeBasicBlocksContextFinalize.cs new file mode 100644 index 0000000..b930077 --- /dev/null +++ b/Function/BNAnalyzeBasicBlocksContextFinalize.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNAnalyzeBasicBlocksContextFinalize(BNBasicBlockAnalysisContext* abb) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAnalyzeBasicBlocksContextFinalize" + )] + internal static extern void BNAnalyzeBasicBlocksContextFinalize( + + // BNBasicBlockAnalysisContext* abb + IntPtr abb + ); + } +} \ No newline at end of file diff --git a/Function/BNAnalyzeBasicBlocksContextSetContextualFunctionReturns.cs b/Function/BNAnalyzeBasicBlocksContextSetContextualFunctionReturns.cs new file mode 100644 index 0000000..45c9c36 --- /dev/null +++ b/Function/BNAnalyzeBasicBlocksContextSetContextualFunctionReturns.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNAnalyzeBasicBlocksContextSetContextualFunctionReturns(BNBasicBlockAnalysisContext* abb, BNArchitectureAndAddress* sources, bool* values, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAnalyzeBasicBlocksContextSetContextualFunctionReturns" + )] + internal static extern void BNAnalyzeBasicBlocksContextSetContextualFunctionReturns( + + // BNBasicBlockAnalysisContext* abb + IntPtr abb , + + // BNArchitectureAndAddress* sources + IntPtr sources , + + // bool* values + IntPtr values , + + // uint64_t count + ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNAnalyzeBasicBlocksContextSetDirectCodeReferences.cs b/Function/BNAnalyzeBasicBlocksContextSetDirectCodeReferences.cs new file mode 100644 index 0000000..d39ea39 --- /dev/null +++ b/Function/BNAnalyzeBasicBlocksContextSetDirectCodeReferences.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNAnalyzeBasicBlocksContextSetDirectCodeReferences(BNBasicBlockAnalysisContext* abb, BNArchitectureAndAddress* sources, uint64_t* targets, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAnalyzeBasicBlocksContextSetDirectCodeReferences" + )] + internal static extern void BNAnalyzeBasicBlocksContextSetDirectCodeReferences( + + // BNBasicBlockAnalysisContext* abb + IntPtr abb , + + // BNArchitectureAndAddress* sources + IntPtr sources , + + // uint64_t* targets + IntPtr targets , + + // uint64_t count + ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNAnalyzeBasicBlocksContextSetDirectNoReturnCalls.cs b/Function/BNAnalyzeBasicBlocksContextSetDirectNoReturnCalls.cs new file mode 100644 index 0000000..4eae9a7 --- /dev/null +++ b/Function/BNAnalyzeBasicBlocksContextSetDirectNoReturnCalls.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNAnalyzeBasicBlocksContextSetDirectNoReturnCalls(BNBasicBlockAnalysisContext* abb, BNArchitectureAndAddress* sources, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAnalyzeBasicBlocksContextSetDirectNoReturnCalls" + )] + internal static extern void BNAnalyzeBasicBlocksContextSetDirectNoReturnCalls( + + // BNBasicBlockAnalysisContext* abb + IntPtr abb , + + // BNArchitectureAndAddress* sources + IntPtr sources , + + // uint64_t count + ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNAnalyzeBasicBlocksContextSetHaltedDisassemblyAddresses.cs b/Function/BNAnalyzeBasicBlocksContextSetHaltedDisassemblyAddresses.cs new file mode 100644 index 0000000..5f4ceda --- /dev/null +++ b/Function/BNAnalyzeBasicBlocksContextSetHaltedDisassemblyAddresses.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNAnalyzeBasicBlocksContextSetHaltedDisassemblyAddresses(BNBasicBlockAnalysisContext* abb, BNArchitectureAndAddress* sources, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAnalyzeBasicBlocksContextSetHaltedDisassemblyAddresses" + )] + internal static extern void BNAnalyzeBasicBlocksContextSetHaltedDisassemblyAddresses( + + // BNBasicBlockAnalysisContext* abb + IntPtr abb , + + // BNArchitectureAndAddress* sources + IntPtr sources , + + // uint64_t count + ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNAnalyzeBasicBlocksContextSetInlinedUnresolvedIndirectBranches.cs b/Function/BNAnalyzeBasicBlocksContextSetInlinedUnresolvedIndirectBranches.cs new file mode 100644 index 0000000..b3dd8ef --- /dev/null +++ b/Function/BNAnalyzeBasicBlocksContextSetInlinedUnresolvedIndirectBranches.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNAnalyzeBasicBlocksContextSetInlinedUnresolvedIndirectBranches(BNBasicBlockAnalysisContext* abb, BNArchitectureAndAddress* locations, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAnalyzeBasicBlocksContextSetInlinedUnresolvedIndirectBranches" + )] + internal static extern void BNAnalyzeBasicBlocksContextSetInlinedUnresolvedIndirectBranches( + + // BNBasicBlockAnalysisContext* abb + IntPtr abb , + + // BNArchitectureAndAddress* locations + IntPtr locations , + + // uint64_t count + ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNAnalyzeFunction.cs b/Function/BNAnalyzeFunction.cs new file mode 100644 index 0000000..c8e72cc --- /dev/null +++ b/Function/BNAnalyzeFunction.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNAnalyzeFunction(BNFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAnalyzeFunction" + )] + internal static extern void BNAnalyzeFunction( + + // BNFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNAppendDataBuffer.cs b/Function/BNAppendDataBuffer.cs new file mode 100644 index 0000000..aefcbc4 --- /dev/null +++ b/Function/BNAppendDataBuffer.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNAppendDataBuffer(BNDataBuffer* dest, BNDataBuffer* src) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAppendDataBuffer" + )] + internal static extern void BNAppendDataBuffer( + + // BNDataBuffer* dest + IntPtr dest , + + // BNDataBuffer* src + IntPtr src + ); + } +} \ No newline at end of file diff --git a/Function/BNAppendDataBufferContents.cs b/Function/BNAppendDataBufferContents.cs new file mode 100644 index 0000000..f82c2b5 --- /dev/null +++ b/Function/BNAppendDataBufferContents.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNAppendDataBufferContents(BNDataBuffer* dest, void* src, uint64_t len) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAppendDataBufferContents" + )] + internal static extern void BNAppendDataBufferContents( + + // BNDataBuffer* dest + IntPtr dest , + + // void* src + byte[] src , + + // uint64_t len + ulong len + ); + } +} \ No newline at end of file diff --git a/Function/BNAppendPath.cs b/Function/BNAppendPath.cs new file mode 100644 index 0000000..576e140 --- /dev/null +++ b/Function/BNAppendPath.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNAppendPath(const char* path, const char* part) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNAppendPath" + )] + internal static extern IntPtr BNAppendPath( + + // const char* path + string path , + + // const char* part + string part + ); + } +} \ No newline at end of file diff --git a/Function/BNAppendSymbolQueue.cs b/Function/BNAppendSymbolQueue.cs new file mode 100644 index 0000000..ec77a14 --- /dev/null +++ b/Function/BNAppendSymbolQueue.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNAppendSymbolQueue(BNSymbolQueue* queue, void** resolve, void* resolveContext, void** add, void* addContext) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAppendSymbolQueue" + )] + internal static extern void BNAppendSymbolQueue( + + // BNSymbolQueue* queue + IntPtr queue , + + // void** resolve + IntPtr resolve , + + // void* resolveContext + IntPtr resolveContext , + + // void** _add + IntPtr _add , + + // void* addContext + IntPtr addContext + ); + } +} \ No newline at end of file diff --git a/Function/BNApplyAutoDiscoveredFunctionType.cs b/Function/BNApplyAutoDiscoveredFunctionType.cs new file mode 100644 index 0000000..f8749b4 --- /dev/null +++ b/Function/BNApplyAutoDiscoveredFunctionType.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNApplyAutoDiscoveredFunctionType(BNFunction* func, BNType* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNApplyAutoDiscoveredFunctionType" + )] + internal static extern void BNApplyAutoDiscoveredFunctionType( + + // BNFunction* func + IntPtr func , + + // BNType* type + IntPtr type + ); + } +} \ No newline at end of file diff --git a/Function/BNApplyDebugInfo.cs b/Function/BNApplyDebugInfo.cs new file mode 100644 index 0000000..c8e28ad --- /dev/null +++ b/Function/BNApplyDebugInfo.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNApplyDebugInfo(BNBinaryView* view, BNDebugInfo* newDebugInfo) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNApplyDebugInfo" + )] + internal static extern void BNApplyDebugInfo( + + // BNBinaryView* view + IntPtr view , + + // BNDebugInfo* newDebugInfo + IntPtr newDebugInfo + ); + } +} \ No newline at end of file diff --git a/Function/BNApplyImportedTypes.cs b/Function/BNApplyImportedTypes.cs new file mode 100644 index 0000000..9aacbbe --- /dev/null +++ b/Function/BNApplyImportedTypes.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNApplyImportedTypes(BNFunction* func, BNSymbol* sym, BNType* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNApplyImportedTypes" + )] + internal static extern void BNApplyImportedTypes( + + // BNFunction* func + IntPtr func , + + // BNSymbol* sym + IntPtr sym , + + // BNType* type + IntPtr type + ); + } +} \ No newline at end of file diff --git a/Function/BNApplyRenderLayerToFlowGraph.cs b/Function/BNApplyRenderLayerToFlowGraph.cs new file mode 100644 index 0000000..a7f2d21 --- /dev/null +++ b/Function/BNApplyRenderLayerToFlowGraph.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNApplyRenderLayerToFlowGraph(BNRenderLayer* renderLayer, BNFlowGraph* graph) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNApplyRenderLayerToFlowGraph" + )] + internal static extern void BNApplyRenderLayerToFlowGraph( + + // BNRenderLayer* renderLayer + IntPtr renderLayer , + + // BNFlowGraph* graph + IntPtr graph + ); + } +} \ No newline at end of file diff --git a/Function/BNApplyRenderLayerToLinearViewObject.cs b/Function/BNApplyRenderLayerToLinearViewObject.cs new file mode 100644 index 0000000..bb917a6 --- /dev/null +++ b/Function/BNApplyRenderLayerToLinearViewObject.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNApplyRenderLayerToLinearViewObject(BNRenderLayer* renderLayer, BNLinearViewObject* obj, BNLinearViewObject* prev, BNLinearViewObject* next, BNLinearDisassemblyLine* inLines, uint64_t inLineCount, BNLinearDisassemblyLine** outLines, uint64_t* outLineCount) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNApplyRenderLayerToLinearViewObject" + )] + internal static extern void BNApplyRenderLayerToLinearViewObject( + + // BNRenderLayer* renderLayer + IntPtr renderLayer , + + // BNLinearViewObject* obj + IntPtr obj , + + // BNLinearViewObject* prev + IntPtr prev , + + // BNLinearViewObject* next + IntPtr next , + + // BNLinearDisassemblyLine* inLines + BNLinearDisassemblyLine[] inLines , + + // uint64_t inLineCount + ulong inLineCount , + + // BNLinearDisassemblyLine** outLines + out IntPtr outLines , + + // uint64_t* outLineCount + out ulong outLineCount + ); + } +} \ No newline at end of file diff --git a/Function/BNApplySnapshotData.cs b/Function/BNApplySnapshotData.cs new file mode 100644 index 0000000..e597343 --- /dev/null +++ b/Function/BNApplySnapshotData.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNApplySnapshotData(BNFileMetadata* file, BNBinaryView* view, BNKeyValueStore* data, BNKeyValueStore* cache, void* ctxt, void** progress, bool openForConfiguration, bool restoreRawView) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNApplySnapshotData" + )] + internal static extern void BNApplySnapshotData( + + // BNFileMetadata* file + IntPtr file , + + // BNBinaryView* view + IntPtr view , + + // BNKeyValueStore* data + IntPtr data , + + // BNKeyValueStore* cache + IntPtr cache , + + // void* ctxt + IntPtr ctxt , + + // void** progress + IntPtr progress , + + // bool openForConfiguration + bool openForConfiguration , + + // bool restoreRawView + bool restoreRawView + ); + } +} \ No newline at end of file diff --git a/Function/BNArchitectureAlwaysBranch.cs b/Function/BNArchitectureAlwaysBranch.cs new file mode 100644 index 0000000..3b33100 --- /dev/null +++ b/Function/BNArchitectureAlwaysBranch.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNArchitectureAlwaysBranch(BNArchitecture* arch, uint8_t* data, uint64_t addr, uint64_t len) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNArchitectureAlwaysBranch" + )] + internal static extern bool BNArchitectureAlwaysBranch( + + // BNArchitecture* arch + IntPtr arch , + + // uint8_t* data + byte[] data , + + // uint64_t addr + ulong addr , + + // uint64_t len + ulong len + ); + } +} \ No newline at end of file diff --git a/Function/BNArchitectureAnalyzeBasicBlocks.cs b/Function/BNArchitectureAnalyzeBasicBlocks.cs new file mode 100644 index 0000000..fec2d5e --- /dev/null +++ b/Function/BNArchitectureAnalyzeBasicBlocks.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNArchitectureAnalyzeBasicBlocks(BNArchitecture* arch, BNFunction* function, BNBasicBlockAnalysisContext* context) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNArchitectureAnalyzeBasicBlocks" + )] + internal static extern void BNArchitectureAnalyzeBasicBlocks( + + // BNArchitecture* arch + IntPtr arch , + + // BNFunction* function + IntPtr function , + + // BNBasicBlockAnalysisContext* context + IntPtr context + ); + } +} \ No newline at end of file diff --git a/Function/BNArchitectureConvertToNop.cs b/Function/BNArchitectureConvertToNop.cs new file mode 100644 index 0000000..966182c --- /dev/null +++ b/Function/BNArchitectureConvertToNop.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNArchitectureConvertToNop(BNArchitecture* arch, uint8_t* data, uint64_t addr, uint64_t len) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNArchitectureConvertToNop" + )] + internal static extern bool BNArchitectureConvertToNop( + + // BNArchitecture* arch + IntPtr arch , + + // uint8_t* data + byte[] data , + + // uint64_t addr + ulong addr , + + // uint64_t len + ulong len + ); + } +} \ No newline at end of file diff --git a/Function/BNArchitectureDefaultAnalyzeBasicBlocks.cs b/Function/BNArchitectureDefaultAnalyzeBasicBlocks.cs new file mode 100644 index 0000000..a3bc155 --- /dev/null +++ b/Function/BNArchitectureDefaultAnalyzeBasicBlocks.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNArchitectureDefaultAnalyzeBasicBlocks(BNFunction* function, BNBasicBlockAnalysisContext* context) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNArchitectureDefaultAnalyzeBasicBlocks" + )] + internal static extern void BNArchitectureDefaultAnalyzeBasicBlocks( + + // BNFunction* function + IntPtr function , + + // BNBasicBlockAnalysisContext* context + IntPtr context + ); + } +} \ No newline at end of file diff --git a/Function/BNArchitectureGetRelocationHandler.cs b/Function/BNArchitectureGetRelocationHandler.cs new file mode 100644 index 0000000..7f15114 --- /dev/null +++ b/Function/BNArchitectureGetRelocationHandler.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRelocationHandler* BNArchitectureGetRelocationHandler(BNArchitecture* arch, const char* viewName) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNArchitectureGetRelocationHandler" + )] + internal static extern IntPtr BNArchitectureGetRelocationHandler( + + // BNArchitecture* arch + IntPtr arch , + + // const char* viewName + string viewName + ); + } +} \ No newline at end of file diff --git a/Function/BNArchitectureInvertBranch.cs b/Function/BNArchitectureInvertBranch.cs new file mode 100644 index 0000000..7727b66 --- /dev/null +++ b/Function/BNArchitectureInvertBranch.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNArchitectureInvertBranch(BNArchitecture* arch, uint8_t* data, uint64_t addr, uint64_t len) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNArchitectureInvertBranch" + )] + internal static extern bool BNArchitectureInvertBranch( + + // BNArchitecture* arch + IntPtr arch , + + // uint8_t* data + byte[] data , + + // uint64_t addr + ulong addr , + + // uint64_t len + ulong len + ); + } +} \ No newline at end of file diff --git a/Function/BNArchitectureRegisterRelocationHandler.cs b/Function/BNArchitectureRegisterRelocationHandler.cs new file mode 100644 index 0000000..f6c5183 --- /dev/null +++ b/Function/BNArchitectureRegisterRelocationHandler.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNArchitectureRegisterRelocationHandler(BNArchitecture* arch, const char* viewName, BNRelocationHandler* handler) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNArchitectureRegisterRelocationHandler" + )] + internal static extern void BNArchitectureRegisterRelocationHandler( + + // BNArchitecture* arch + IntPtr arch , + + // const char* viewName + string viewName , + + // BNRelocationHandler* handler + IntPtr handler + ); + } +} \ No newline at end of file diff --git a/Function/BNArchitectureSetDefaultAnalyzeBasicBlocksCallback.cs b/Function/BNArchitectureSetDefaultAnalyzeBasicBlocksCallback.cs new file mode 100644 index 0000000..ba2d863 --- /dev/null +++ b/Function/BNArchitectureSetDefaultAnalyzeBasicBlocksCallback.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNArchitectureSetDefaultAnalyzeBasicBlocksCallback(void* callback) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNArchitectureSetDefaultAnalyzeBasicBlocksCallback" + )] + internal static extern bool BNArchitectureSetDefaultAnalyzeBasicBlocksCallback( + + // void* callback + IntPtr callback + ); + } +} \ No newline at end of file diff --git a/Function/BNArchitectureSkipAndReturnValue.cs b/Function/BNArchitectureSkipAndReturnValue.cs new file mode 100644 index 0000000..8c80b92 --- /dev/null +++ b/Function/BNArchitectureSkipAndReturnValue.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNArchitectureSkipAndReturnValue(BNArchitecture* arch, uint8_t* data, uint64_t addr, uint64_t len, uint64_t value) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNArchitectureSkipAndReturnValue" + )] + internal static extern bool BNArchitectureSkipAndReturnValue( + + // BNArchitecture* arch + IntPtr arch , + + // uint8_t* data + byte[] data , + + // uint64_t addr + ulong addr , + + // uint64_t len + ulong len , + + // uint64_t _value + ulong _value + ); + } +} \ No newline at end of file diff --git a/Function/BNAreArgumentRegistersSharedIndex.cs b/Function/BNAreArgumentRegistersSharedIndex.cs new file mode 100644 index 0000000..4c31bd8 --- /dev/null +++ b/Function/BNAreArgumentRegistersSharedIndex.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNAreArgumentRegistersSharedIndex(BNCallingConvention* cc) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAreArgumentRegistersSharedIndex" + )] + internal static extern bool BNAreArgumentRegistersSharedIndex( + + // BNCallingConvention* cc + IntPtr cc + ); + } +} \ No newline at end of file diff --git a/Function/BNAreArgumentRegistersUsedForVarArgs.cs b/Function/BNAreArgumentRegistersUsedForVarArgs.cs new file mode 100644 index 0000000..2e386bb --- /dev/null +++ b/Function/BNAreArgumentRegistersUsedForVarArgs.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNAreArgumentRegistersUsedForVarArgs(BNCallingConvention* cc) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAreArgumentRegistersUsedForVarArgs" + )] + internal static extern bool BNAreArgumentRegistersUsedForVarArgs( + + // BNCallingConvention* cc + IntPtr cc + ); + } +} \ No newline at end of file diff --git a/Function/BNAreAutoUpdatesEnabled.cs b/Function/BNAreAutoUpdatesEnabled.cs new file mode 100644 index 0000000..df4e43f --- /dev/null +++ b/Function/BNAreAutoUpdatesEnabled.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNAreAutoUpdatesEnabled() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNAreAutoUpdatesEnabled" + )] + public static extern bool BNAreAutoUpdatesEnabled(); + } +} \ No newline at end of file diff --git a/Function/BNAreUpdatesAvailable.cs b/Function/BNAreUpdatesAvailable.cs new file mode 100644 index 0000000..f3ad0d0 --- /dev/null +++ b/Function/BNAreUpdatesAvailable.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNAreUpdatesAvailable(const char* channel, uint64_t* expireTime, uint64_t* serverTime, const char** errors) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNAreUpdatesAvailable" + )] + internal static extern bool BNAreUpdatesAvailable( + + // const char* channel + string channel , + + // uint64_t* expireTime + out ulong expireTime , + + // uint64_t* serverTime + out ulong serverTime , + + // const char** errors + out IntPtr errors + ); + } +} \ No newline at end of file diff --git a/Function/BNAssemble.cs b/Function/BNAssemble.cs new file mode 100644 index 0000000..8a8aad0 --- /dev/null +++ b/Function/BNAssemble.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNAssemble(BNArchitecture* arch, const char* code, uint64_t addr, BNDataBuffer* result, const char** errors) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNAssemble" + )] + internal static extern bool BNAssemble( + + // BNArchitecture* arch + IntPtr arch , + + // const char* code + string code , + + // uint64_t addr + ulong addr , + + // BNDataBuffer* result + IntPtr result , + + // const char** errors + out IntPtr errors + ); + } +} \ No newline at end of file diff --git a/Function/BNAssignDataBuffer.cs b/Function/BNAssignDataBuffer.cs new file mode 100644 index 0000000..ec3eed3 --- /dev/null +++ b/Function/BNAssignDataBuffer.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNAssignDataBuffer(BNDataBuffer* dest, BNDataBuffer* src) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNAssignDataBuffer" + )] + internal static extern void BNAssignDataBuffer( + + // BNDataBuffer* dest + IntPtr dest , + + // BNDataBuffer* src + IntPtr src + + ); + } +} \ No newline at end of file diff --git a/Function/BNAuthenticateEnterpriseServerWithCredentials.cs b/Function/BNAuthenticateEnterpriseServerWithCredentials.cs new file mode 100644 index 0000000..bb938ba --- /dev/null +++ b/Function/BNAuthenticateEnterpriseServerWithCredentials.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNAuthenticateEnterpriseServerWithCredentials(const char* username, const char* password, bool remember) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNAuthenticateEnterpriseServerWithCredentials" + )] + internal static extern bool BNAuthenticateEnterpriseServerWithCredentials( + + // const char* username + string username , + + // const char* password + string password , + + // bool remember + bool remember + ); + } +} \ No newline at end of file diff --git a/Function/BNAuthenticateEnterpriseServerWithMethod.cs b/Function/BNAuthenticateEnterpriseServerWithMethod.cs new file mode 100644 index 0000000..9a1bb90 --- /dev/null +++ b/Function/BNAuthenticateEnterpriseServerWithMethod.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNAuthenticateEnterpriseServerWithMethod(const char* method, bool remember) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNAuthenticateEnterpriseServerWithMethod" + )] + internal static extern bool BNAuthenticateEnterpriseServerWithMethod( + + // const char* method + string method , + + // bool remember + bool remember + ); + } +} \ No newline at end of file diff --git a/Function/BNBasicBlockAddInstructionData.cs b/Function/BNBasicBlockAddInstructionData.cs new file mode 100644 index 0000000..2eef33d --- /dev/null +++ b/Function/BNBasicBlockAddInstructionData.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNBasicBlockAddInstructionData(BNBasicBlock* block, void* data, uint64_t len) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNBasicBlockAddInstructionData" + )] + internal static extern void BNBasicBlockAddInstructionData( + + // BNBasicBlock* block + IntPtr block , + + // void* data + byte[] data , + + // uint64_t len + ulong len + ); + } +} \ No newline at end of file diff --git a/Function/BNBasicBlockAddPendingOutgoingEdge.cs b/Function/BNBasicBlockAddPendingOutgoingEdge.cs new file mode 100644 index 0000000..d2cad88 --- /dev/null +++ b/Function/BNBasicBlockAddPendingOutgoingEdge.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNBasicBlockAddPendingOutgoingEdge(BNBasicBlock* block, BNBranchType type, uint64_t addr, BNArchitecture* arch, bool fallThrough) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNBasicBlockAddPendingOutgoingEdge" + )] + internal static extern void BNBasicBlockAddPendingOutgoingEdge( + + // BNBasicBlock* block + IntPtr block , + + // BNBranchType type + BranchType kind , + + // uint64_t addr + ulong addr , + + // BNArchitecture* arch + IntPtr arch , + + // bool fallThrough + bool fallThrough + ); + } +} \ No newline at end of file diff --git a/Function/BNBasicBlockCanExit.cs b/Function/BNBasicBlockCanExit.cs new file mode 100644 index 0000000..856be98 --- /dev/null +++ b/Function/BNBasicBlockCanExit.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNBasicBlockCanExit(BNBasicBlock* block) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNBasicBlockCanExit" + )] + internal static extern bool BNBasicBlockCanExit( + + // BNBasicBlock* block + IntPtr block + ); + } +} \ No newline at end of file diff --git a/Function/BNBasicBlockGetInstructionData.cs b/Function/BNBasicBlockGetInstructionData.cs new file mode 100644 index 0000000..bedd088 --- /dev/null +++ b/Function/BNBasicBlockGetInstructionData.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint8_t* BNBasicBlockGetInstructionData(BNBasicBlock* block, uint64_t addr, uint64_t* len) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNBasicBlockGetInstructionData" + )] + internal static extern IntPtr BNBasicBlockGetInstructionData( + + // BNBasicBlock* block + IntPtr block , + + // uint64_t addr + ulong addr , + + // uint64_t* len + out ulong len + ); + } +} \ No newline at end of file diff --git a/Function/BNBasicBlockHasInvalidInstructions.cs b/Function/BNBasicBlockHasInvalidInstructions.cs new file mode 100644 index 0000000..6555604 --- /dev/null +++ b/Function/BNBasicBlockHasInvalidInstructions.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNBasicBlockHasInvalidInstructions(BNBasicBlock* block) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNBasicBlockHasInvalidInstructions" + )] + internal static extern bool BNBasicBlockHasInvalidInstructions( + + // BNBasicBlock* block + IntPtr block + ); + } +} \ No newline at end of file diff --git a/Function/BNBasicBlockHasUndeterminedOutgoingEdges.cs b/Function/BNBasicBlockHasUndeterminedOutgoingEdges.cs new file mode 100644 index 0000000..13ba09e --- /dev/null +++ b/Function/BNBasicBlockHasUndeterminedOutgoingEdges.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNBasicBlockHasUndeterminedOutgoingEdges(BNBasicBlock* block) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNBasicBlockHasUndeterminedOutgoingEdges" + )] + internal static extern bool BNBasicBlockHasUndeterminedOutgoingEdges( + + // BNBasicBlock* block + IntPtr block + ); + } +} \ No newline at end of file diff --git a/Function/BNBasicBlockIsFallThroughToFunction.cs b/Function/BNBasicBlockIsFallThroughToFunction.cs new file mode 100644 index 0000000..19dc172 --- /dev/null +++ b/Function/BNBasicBlockIsFallThroughToFunction.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNBasicBlockIsFallThroughToFunction(BNBasicBlock* block) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNBasicBlockIsFallThroughToFunction" + )] + internal static extern bool BNBasicBlockIsFallThroughToFunction( + + // BNBasicBlock* block + IntPtr block + ); + } +} \ No newline at end of file diff --git a/Function/BNBasicBlockSetCanExit.cs b/Function/BNBasicBlockSetCanExit.cs new file mode 100644 index 0000000..7253ce7 --- /dev/null +++ b/Function/BNBasicBlockSetCanExit.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNBasicBlockSetCanExit(BNBasicBlock* block, bool value) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNBasicBlockSetCanExit" + )] + internal static extern void BNBasicBlockSetCanExit( + + // BNBasicBlock* block + IntPtr block , + + // bool _value + bool _value + ); + } +} \ No newline at end of file diff --git a/Function/BNBasicBlockSetFallThroughToFunction.cs b/Function/BNBasicBlockSetFallThroughToFunction.cs new file mode 100644 index 0000000..c0dca4f --- /dev/null +++ b/Function/BNBasicBlockSetFallThroughToFunction.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNBasicBlockSetFallThroughToFunction(BNBasicBlock* block, bool value) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNBasicBlockSetFallThroughToFunction" + )] + internal static extern void BNBasicBlockSetFallThroughToFunction( + + // BNBasicBlock* block + IntPtr block , + + // bool _value + bool _value + ); + } +} \ No newline at end of file diff --git a/Function/BNBasicBlockSetHasInvalidInstructions.cs b/Function/BNBasicBlockSetHasInvalidInstructions.cs new file mode 100644 index 0000000..8f9fa02 --- /dev/null +++ b/Function/BNBasicBlockSetHasInvalidInstructions.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNBasicBlockSetHasInvalidInstructions(BNBasicBlock* block, bool value) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNBasicBlockSetHasInvalidInstructions" + )] + internal static extern void BNBasicBlockSetHasInvalidInstructions( + + // BNBasicBlock* block + IntPtr block , + + // bool _value + bool _value + ); + } +} \ No newline at end of file diff --git a/Function/BNBasicBlockSetUndeterminedOutgoingEdges.cs b/Function/BNBasicBlockSetUndeterminedOutgoingEdges.cs new file mode 100644 index 0000000..e947958 --- /dev/null +++ b/Function/BNBasicBlockSetUndeterminedOutgoingEdges.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNBasicBlockSetUndeterminedOutgoingEdges(BNBasicBlock* block, bool value) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNBasicBlockSetUndeterminedOutgoingEdges" + )] + internal static extern void BNBasicBlockSetUndeterminedOutgoingEdges( + + // BNBasicBlock* block + IntPtr block , + + // bool _value + bool _value + ); + } +} \ No newline at end of file diff --git a/Function/BNBeginBackgroundTask.cs b/Function/BNBeginBackgroundTask.cs new file mode 100644 index 0000000..0144023 --- /dev/null +++ b/Function/BNBeginBackgroundTask.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBackgroundTask* BNBeginBackgroundTask(const char* initialText, bool canCancel) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNBeginBackgroundTask" + )] + internal static extern IntPtr BNBeginBackgroundTask( + + // const char* initialText + string initialText , + + // bool canCancel + bool canCancel + ); + } +} \ No newline at end of file diff --git a/Function/BNBeginBulkAddSegments.cs b/Function/BNBeginBulkAddSegments.cs new file mode 100644 index 0000000..d154c13 --- /dev/null +++ b/Function/BNBeginBulkAddSegments.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNBeginBulkAddSegments(BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNBeginBulkAddSegments" + )] + internal static extern void BNBeginBulkAddSegments( + + // BNBinaryView* view + IntPtr view + ); + } +} \ No newline at end of file diff --git a/Function/BNBeginBulkModifySymbols.cs b/Function/BNBeginBulkModifySymbols.cs new file mode 100644 index 0000000..e5dc5cc --- /dev/null +++ b/Function/BNBeginBulkModifySymbols.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNBeginBulkModifySymbols(BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNBeginBulkModifySymbols" + )] + internal static extern void BNBeginBulkModifySymbols( + + // BNBinaryView* view + IntPtr view + ); + } +} \ No newline at end of file diff --git a/Function/BNBeginKeyValueStoreNamespace.cs b/Function/BNBeginKeyValueStoreNamespace.cs new file mode 100644 index 0000000..244c45e --- /dev/null +++ b/Function/BNBeginKeyValueStoreNamespace.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNBeginKeyValueStoreNamespace(BNKeyValueStore* store, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNBeginKeyValueStoreNamespace" + )] + internal static extern void BNBeginKeyValueStoreNamespace( + + // BNKeyValueStore* store + IntPtr store , + + // const char* name + string name + ); + } +} \ No newline at end of file diff --git a/Function/BNBeginUndoActions.cs b/Function/BNBeginUndoActions.cs new file mode 100644 index 0000000..b217cb6 --- /dev/null +++ b/Function/BNBeginUndoActions.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNBeginUndoActions(BNFileMetadata* file, bool anonymousAllowed) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNBeginUndoActions" + )] + internal static extern IntPtr BNBeginUndoActions( + + // BNFileMetadata* file + IntPtr file , + + // bool anonymousAllowed + bool anonymousAllowed + ); + } +} \ No newline at end of file diff --git a/Function/BNBinaryViewAddExternalLibrary.cs b/Function/BNBinaryViewAddExternalLibrary.cs new file mode 100644 index 0000000..b6a60ed --- /dev/null +++ b/Function/BNBinaryViewAddExternalLibrary.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNExternalLibrary* BNBinaryViewAddExternalLibrary(BNBinaryView* view, const char* name, BNProjectFile* backingFile, bool isAuto) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNBinaryViewAddExternalLibrary" + )] + internal static extern IntPtr BNBinaryViewAddExternalLibrary( + + // BNBinaryView* view + IntPtr view , + + // const char* name + string name , + + // BNProjectFile* backingFile + IntPtr backingFile , + + // bool isAuto + bool isAuto + ); + } +} \ No newline at end of file diff --git a/Function/BNBinaryViewAddExternalLocation.cs b/Function/BNBinaryViewAddExternalLocation.cs new file mode 100644 index 0000000..1727ca1 --- /dev/null +++ b/Function/BNBinaryViewAddExternalLocation.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNExternalLocation* BNBinaryViewAddExternalLocation(BNBinaryView* view, BNSymbol* sourceSymbol, BNExternalLibrary* library, const char* targetSymbol, uint64_t* targetAddress, bool isAuto) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNBinaryViewAddExternalLocation" + )] + internal static extern IntPtr BNBinaryViewAddExternalLocation( + + // BNBinaryView* view + IntPtr view , + + // BNSymbol* sourceSymbol + IntPtr sourceSymbol , + + // BNExternalLibrary* library + IntPtr library , + + // const char* targetSymbol + string targetSymbol , + + // uint64_t* targetAddress + IntPtr targetAddress , + + // bool isAuto + bool isAuto + ); + } +} \ No newline at end of file diff --git a/Function/BNBinaryViewAttachTypeArchive.cs b/Function/BNBinaryViewAttachTypeArchive.cs new file mode 100644 index 0000000..11b2d80 --- /dev/null +++ b/Function/BNBinaryViewAttachTypeArchive.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeArchive* BNBinaryViewAttachTypeArchive(BNBinaryView* view, const char* id, const char* path) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNBinaryViewAttachTypeArchive" + )] + internal static extern IntPtr BNBinaryViewAttachTypeArchive( + + // BNBinaryView* view + IntPtr view , + + // const char* id + string id , + + // const char* path + string path + ); + } +} \ No newline at end of file diff --git a/Function/BNBinaryViewDetachTypeArchive.cs b/Function/BNBinaryViewDetachTypeArchive.cs new file mode 100644 index 0000000..3dfe83b --- /dev/null +++ b/Function/BNBinaryViewDetachTypeArchive.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNBinaryViewDetachTypeArchive(BNBinaryView* view, const char* id) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNBinaryViewDetachTypeArchive" + )] + internal static extern bool BNBinaryViewDetachTypeArchive( + + // BNBinaryView* view + IntPtr view , + + // const char* id + string id + ); + } +} \ No newline at end of file diff --git a/Function/BNBinaryViewDisassociateTypeArchiveType.cs b/Function/BNBinaryViewDisassociateTypeArchiveType.cs new file mode 100644 index 0000000..8a94713 --- /dev/null +++ b/Function/BNBinaryViewDisassociateTypeArchiveType.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNBinaryViewDisassociateTypeArchiveType(BNBinaryView* view, const char* typeId) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNBinaryViewDisassociateTypeArchiveType" + )] + internal static extern bool BNBinaryViewDisassociateTypeArchiveType( + + // BNBinaryView* view + IntPtr view , + + // const char* typeId + string typeId + ); + } +} \ No newline at end of file diff --git a/Function/BNBinaryViewExportObjectToTypeLibrary.cs b/Function/BNBinaryViewExportObjectToTypeLibrary.cs new file mode 100644 index 0000000..6cc0b80 --- /dev/null +++ b/Function/BNBinaryViewExportObjectToTypeLibrary.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNBinaryViewExportObjectToTypeLibrary(BNBinaryView* view, BNTypeLibrary* lib, BNQualifiedName* name, BNType* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNBinaryViewExportObjectToTypeLibrary" + )] + internal static extern void BNBinaryViewExportObjectToTypeLibrary( + + // BNBinaryView* view + IntPtr view , + + // BNTypeLibrary* lib + IntPtr lib , + + // BNQualifiedName* name + in BNQualifiedName name , + + // BNType* type + IntPtr type + ); + } +} \ No newline at end of file diff --git a/Function/BNBinaryViewExportTypeToTypeLibrary.cs b/Function/BNBinaryViewExportTypeToTypeLibrary.cs new file mode 100644 index 0000000..1f6b970 --- /dev/null +++ b/Function/BNBinaryViewExportTypeToTypeLibrary.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNBinaryViewExportTypeToTypeLibrary(BNBinaryView* view, BNTypeLibrary* lib, BNQualifiedName* name, BNType* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNBinaryViewExportTypeToTypeLibrary" + )] + internal static extern void BNBinaryViewExportTypeToTypeLibrary( + + // BNBinaryView* view + IntPtr view , + + // BNTypeLibrary* lib + IntPtr lib , + + // BNQualifiedName* name + in BNQualifiedName name , + + // BNType* type + IntPtr type + ); + } +} \ No newline at end of file diff --git a/Function/BNBinaryViewFinalizeNewSegments.cs b/Function/BNBinaryViewFinalizeNewSegments.cs new file mode 100644 index 0000000..cf564fb --- /dev/null +++ b/Function/BNBinaryViewFinalizeNewSegments.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNBinaryViewFinalizeNewSegments(BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNBinaryViewFinalizeNewSegments" + )] + internal static extern bool BNBinaryViewFinalizeNewSegments( + + // BNBinaryView* view + IntPtr view + ); + } +} \ No newline at end of file diff --git a/Function/BNBinaryViewGetAssociatedTypeArchiveTypeSource.cs b/Function/BNBinaryViewGetAssociatedTypeArchiveTypeSource.cs new file mode 100644 index 0000000..5fa89b2 --- /dev/null +++ b/Function/BNBinaryViewGetAssociatedTypeArchiveTypeSource.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNBinaryViewGetAssociatedTypeArchiveTypeSource(BNBinaryView* view, const char* archiveId, const char* archiveTypeId, const char** typeId) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNBinaryViewGetAssociatedTypeArchiveTypeSource" + )] + internal static extern bool BNBinaryViewGetAssociatedTypeArchiveTypeSource( + + // BNBinaryView* view + IntPtr view , + + // const char* archiveId + string archiveId , + + // const char* archiveTypeId + string archiveTypeId , + + // const char** typeId + string[] typeId + ); + } +} \ No newline at end of file diff --git a/Function/BNBinaryViewGetAssociatedTypeArchiveTypeTarget.cs b/Function/BNBinaryViewGetAssociatedTypeArchiveTypeTarget.cs new file mode 100644 index 0000000..eaeb903 --- /dev/null +++ b/Function/BNBinaryViewGetAssociatedTypeArchiveTypeTarget.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNBinaryViewGetAssociatedTypeArchiveTypeTarget(BNBinaryView* view, const char* typeId, const char** archiveId, const char** archiveTypeId) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNBinaryViewGetAssociatedTypeArchiveTypeTarget" + )] + internal static extern bool BNBinaryViewGetAssociatedTypeArchiveTypeTarget( + + // BNBinaryView* view + IntPtr view , + + // const char* typeId + string typeId , + + // const char** archiveId + string[] archiveId , + + // const char** archiveTypeId + string[] archiveTypeId + ); + } +} \ No newline at end of file diff --git a/Function/BNBinaryViewGetAssociatedTypeArchiveTypes.cs b/Function/BNBinaryViewGetAssociatedTypeArchiveTypes.cs new file mode 100644 index 0000000..8c7a9f7 --- /dev/null +++ b/Function/BNBinaryViewGetAssociatedTypeArchiveTypes.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNBinaryViewGetAssociatedTypeArchiveTypes(BNBinaryView* view, const char*** typeIds, const char*** archiveIds, const char*** archiveTypeIds) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNBinaryViewGetAssociatedTypeArchiveTypes" + )] + internal static extern ulong BNBinaryViewGetAssociatedTypeArchiveTypes( + + // BNBinaryView* view + IntPtr view , + + // const char*** typeIds + IntPtr typeIds , + + // const char*** archiveIds + IntPtr archiveIds , + + // const char*** archiveTypeIds + IntPtr archiveTypeIds + ); + } +} \ No newline at end of file diff --git a/Function/BNBinaryViewGetAssociatedTypesFromArchive.cs b/Function/BNBinaryViewGetAssociatedTypesFromArchive.cs new file mode 100644 index 0000000..3a67c1f --- /dev/null +++ b/Function/BNBinaryViewGetAssociatedTypesFromArchive.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNBinaryViewGetAssociatedTypesFromArchive(BNBinaryView* view, const char* archiveId, const char*** typeIds, const char*** archiveTypeIds) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNBinaryViewGetAssociatedTypesFromArchive" + )] + internal static extern ulong BNBinaryViewGetAssociatedTypesFromArchive( + + // BNBinaryView* view + IntPtr view , + + // const char* archiveId + string archiveId , + + // const char*** typeIds + IntPtr typeIds , + + // const char*** archiveTypeIds + IntPtr archiveTypeIds + ); + } +} \ No newline at end of file diff --git a/Function/BNBinaryViewGetAutoMetadata.cs b/Function/BNBinaryViewGetAutoMetadata.cs new file mode 100644 index 0000000..af60e7d --- /dev/null +++ b/Function/BNBinaryViewGetAutoMetadata.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNMetadata* BNBinaryViewGetAutoMetadata(BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNBinaryViewGetAutoMetadata" + )] + internal static extern IntPtr BNBinaryViewGetAutoMetadata( + + // BNBinaryView* view + IntPtr view + ); + } +} \ No newline at end of file diff --git a/Function/BNBinaryViewGetExternalLibraries.cs b/Function/BNBinaryViewGetExternalLibraries.cs new file mode 100644 index 0000000..0579281 --- /dev/null +++ b/Function/BNBinaryViewGetExternalLibraries.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNExternalLibrary** BNBinaryViewGetExternalLibraries(BNBinaryView* view, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNBinaryViewGetExternalLibraries" + )] + internal static extern IntPtr BNBinaryViewGetExternalLibraries( + + // BNBinaryView* view + IntPtr view , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNBinaryViewGetExternalLibrary.cs b/Function/BNBinaryViewGetExternalLibrary.cs new file mode 100644 index 0000000..c9a6d7f --- /dev/null +++ b/Function/BNBinaryViewGetExternalLibrary.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNExternalLibrary* BNBinaryViewGetExternalLibrary(BNBinaryView* view, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNBinaryViewGetExternalLibrary" + )] + internal static extern IntPtr BNBinaryViewGetExternalLibrary( + + // BNBinaryView* view + IntPtr view , + + // const char* name + string name + ); + } +} \ No newline at end of file diff --git a/Function/BNBinaryViewGetExternalLocation.cs b/Function/BNBinaryViewGetExternalLocation.cs new file mode 100644 index 0000000..a286b79 --- /dev/null +++ b/Function/BNBinaryViewGetExternalLocation.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNExternalLocation* BNBinaryViewGetExternalLocation(BNBinaryView* view, BNSymbol* sourceSymbol) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNBinaryViewGetExternalLocation" + )] + internal static extern IntPtr BNBinaryViewGetExternalLocation( + + // BNBinaryView* view + IntPtr view , + + // BNSymbol* sourceSymbol + IntPtr sourceSymbol + ); + } +} \ No newline at end of file diff --git a/Function/BNBinaryViewGetExternalLocations.cs b/Function/BNBinaryViewGetExternalLocations.cs new file mode 100644 index 0000000..9609595 --- /dev/null +++ b/Function/BNBinaryViewGetExternalLocations.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNExternalLocation** BNBinaryViewGetExternalLocations(BNBinaryView* view, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNBinaryViewGetExternalLocations" + )] + internal static extern IntPtr BNBinaryViewGetExternalLocations( + + // BNBinaryView* view + IntPtr view , + + // uint64_t* count + IntPtr count + ); + } +} \ No newline at end of file diff --git a/Function/BNBinaryViewGetLoadSettings.cs b/Function/BNBinaryViewGetLoadSettings.cs new file mode 100644 index 0000000..6f2b1a4 --- /dev/null +++ b/Function/BNBinaryViewGetLoadSettings.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNSettings* BNBinaryViewGetLoadSettings(BNBinaryView* view, const char* typeName) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNBinaryViewGetLoadSettings" + )] + internal static extern IntPtr BNBinaryViewGetLoadSettings( + + // BNBinaryView* view + IntPtr view , + + // const char* typeName + string typeName + ); + } +} \ No newline at end of file diff --git a/Function/BNBinaryViewGetLoadSettingsTypeNames.cs b/Function/BNBinaryViewGetLoadSettingsTypeNames.cs new file mode 100644 index 0000000..58d5423 --- /dev/null +++ b/Function/BNBinaryViewGetLoadSettingsTypeNames.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// char** BNBinaryViewGetLoadSettingsTypeNames(BNBinaryView* view, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNBinaryViewGetLoadSettingsTypeNames" + )] + internal static extern IntPtr BNBinaryViewGetLoadSettingsTypeNames( + + // BNBinaryView* view + IntPtr view , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNBinaryViewGetMetadata.cs b/Function/BNBinaryViewGetMetadata.cs new file mode 100644 index 0000000..75ee5a4 --- /dev/null +++ b/Function/BNBinaryViewGetMetadata.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNMetadata* BNBinaryViewGetMetadata(BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNBinaryViewGetMetadata" + )] + internal static extern IntPtr BNBinaryViewGetMetadata( + + // BNBinaryView* view + IntPtr view + ); + } +} \ No newline at end of file diff --git a/Function/BNBinaryViewGetTypeArchive.cs b/Function/BNBinaryViewGetTypeArchive.cs new file mode 100644 index 0000000..99250c5 --- /dev/null +++ b/Function/BNBinaryViewGetTypeArchive.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeArchive* BNBinaryViewGetTypeArchive(BNBinaryView* view, const char* id) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNBinaryViewGetTypeArchive" + )] + internal static extern IntPtr BNBinaryViewGetTypeArchive( + + // BNBinaryView* view + IntPtr view , + + // const char* id + string id + ); + } +} \ No newline at end of file diff --git a/Function/BNBinaryViewGetTypeArchivePath.cs b/Function/BNBinaryViewGetTypeArchivePath.cs new file mode 100644 index 0000000..0c3ecba --- /dev/null +++ b/Function/BNBinaryViewGetTypeArchivePath.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// char* BNBinaryViewGetTypeArchivePath(BNBinaryView* view, const char* id) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNBinaryViewGetTypeArchivePath" + )] + internal static extern IntPtr BNBinaryViewGetTypeArchivePath( + + // BNBinaryView* view + IntPtr view , + + // const char* id + string id + ); + } +} \ No newline at end of file diff --git a/Function/BNBinaryViewGetTypeArchiveSyncStatus.cs b/Function/BNBinaryViewGetTypeArchiveSyncStatus.cs new file mode 100644 index 0000000..eef1770 --- /dev/null +++ b/Function/BNBinaryViewGetTypeArchiveSyncStatus.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNSyncStatus BNBinaryViewGetTypeArchiveSyncStatus(BNBinaryView* view, const char* typeId) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNBinaryViewGetTypeArchiveSyncStatus" + )] + internal static extern SyncStatus BNBinaryViewGetTypeArchiveSyncStatus( + + // BNBinaryView* view + IntPtr view , + + // const char* typeId + string typeId + ); + } +} \ No newline at end of file diff --git a/Function/BNBinaryViewGetTypeArchiveTypeNameList.cs b/Function/BNBinaryViewGetTypeArchiveTypeNameList.cs new file mode 100644 index 0000000..d0564c2 --- /dev/null +++ b/Function/BNBinaryViewGetTypeArchiveTypeNameList.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNBinaryViewGetTypeArchiveTypeNameList(BNBinaryView* view, BNQualifiedName** names) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNBinaryViewGetTypeArchiveTypeNameList" + )] + internal static extern ulong BNBinaryViewGetTypeArchiveTypeNameList( + + // BNBinaryView* view + IntPtr view , + + // BNQualifiedName** names + IntPtr names + ); + } +} \ No newline at end of file diff --git a/Function/BNBinaryViewGetTypeArchiveTypeNames.cs b/Function/BNBinaryViewGetTypeArchiveTypeNames.cs new file mode 100644 index 0000000..fc5af54 --- /dev/null +++ b/Function/BNBinaryViewGetTypeArchiveTypeNames.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNBinaryViewGetTypeArchiveTypeNames(BNBinaryView* view, BNQualifiedName* name, const char*** archiveIds, const char*** archiveTypeIds) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNBinaryViewGetTypeArchiveTypeNames" + )] + internal static extern ulong BNBinaryViewGetTypeArchiveTypeNames( + + // BNBinaryView* view + IntPtr view , + + // BNQualifiedName* name + IntPtr name , + + // const char*** archiveIds + IntPtr archiveIds , + + // const char*** archiveTypeIds + IntPtr archiveTypeIds + ); + } +} \ No newline at end of file diff --git a/Function/BNBinaryViewGetTypeArchives.cs b/Function/BNBinaryViewGetTypeArchives.cs new file mode 100644 index 0000000..629a955 --- /dev/null +++ b/Function/BNBinaryViewGetTypeArchives.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNBinaryViewGetTypeArchives(BNBinaryView* view, const char*** ids, const char*** paths) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNBinaryViewGetTypeArchives" + )] + internal static extern ulong BNBinaryViewGetTypeArchives( + + // BNBinaryView* view + IntPtr view , + + // char** ids + out IntPtr ids , + + // char** paths + out IntPtr paths + ); + } +} \ No newline at end of file diff --git a/Function/BNBinaryViewGetTypeNameByGuid.cs b/Function/BNBinaryViewGetTypeNameByGuid.cs new file mode 100644 index 0000000..ff2b091 --- /dev/null +++ b/Function/BNBinaryViewGetTypeNameByGuid.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNQualifiedName BNBinaryViewGetTypeNameByGuid(BNBinaryView* view, const char* guid) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNBinaryViewGetTypeNameByGuid" + )] + internal static extern BNQualifiedName BNBinaryViewGetTypeNameByGuid( + + // BNBinaryView* view + IntPtr view , + + // const char* guid + string guid + ); + } +} \ No newline at end of file diff --git a/Function/BNBinaryViewImportTypeLibraryObject.cs b/Function/BNBinaryViewImportTypeLibraryObject.cs new file mode 100644 index 0000000..c6ce344 --- /dev/null +++ b/Function/BNBinaryViewImportTypeLibraryObject.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNType* BNBinaryViewImportTypeLibraryObject(BNBinaryView* view, BNTypeLibrary** lib, BNQualifiedName* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNBinaryViewImportTypeLibraryObject" + )] + internal static extern IntPtr BNBinaryViewImportTypeLibraryObject( + + // BNBinaryView* view + IntPtr view , + + // BNTypeLibrary** lib + ref IntPtr lib , + + // BNQualifiedName* name + in BNQualifiedName name + ); + } +} \ No newline at end of file diff --git a/Function/BNBinaryViewImportTypeLibraryType.cs b/Function/BNBinaryViewImportTypeLibraryType.cs new file mode 100644 index 0000000..734d156 --- /dev/null +++ b/Function/BNBinaryViewImportTypeLibraryType.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNType* BNBinaryViewImportTypeLibraryType(BNBinaryView* view, BNTypeLibrary** lib, BNQualifiedName* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNBinaryViewImportTypeLibraryType" + )] + internal static extern IntPtr BNBinaryViewImportTypeLibraryType( + + // BNBinaryView* view + IntPtr view , + + // BNTypeLibrary** lib + IntPtr lib , + + // BNQualifiedName* name + in BNQualifiedName? name + ); + } +} \ No newline at end of file diff --git a/Function/BNBinaryViewImportTypeLibraryTypeByGuid.cs b/Function/BNBinaryViewImportTypeLibraryTypeByGuid.cs new file mode 100644 index 0000000..70547a8 --- /dev/null +++ b/Function/BNBinaryViewImportTypeLibraryTypeByGuid.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNType* BNBinaryViewImportTypeLibraryTypeByGuid(BNBinaryView* view, const char* guid) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNBinaryViewImportTypeLibraryTypeByGuid" + )] + internal static extern IntPtr BNBinaryViewImportTypeLibraryTypeByGuid( + + // BNBinaryView* view + IntPtr view , + + // const char* guid + string guid + ); + } +} \ No newline at end of file diff --git a/Function/BNBinaryViewLookupImportedObjectLibrary.cs b/Function/BNBinaryViewLookupImportedObjectLibrary.cs new file mode 100644 index 0000000..3e22ea1 --- /dev/null +++ b/Function/BNBinaryViewLookupImportedObjectLibrary.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNBinaryViewLookupImportedObjectLibrary(BNBinaryView* view, BNPlatform* tgtPlatform, uint64_t tgtAddr, BNTypeLibrary** lib, BNQualifiedName* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNBinaryViewLookupImportedObjectLibrary" + )] + internal static extern bool BNBinaryViewLookupImportedObjectLibrary( + + // BNBinaryView* view + IntPtr view , + + // BNPlatform* tgtPlatform + IntPtr tgtPlatform , + + // uint64_t tgtAddr + ulong tgtAddr , + + // BNTypeLibrary** lib + out IntPtr lib , + + // BNQualifiedName* name + out BNQualifiedName name + ); + } +} \ No newline at end of file diff --git a/Function/BNBinaryViewLookupImportedTypeLibrary.cs b/Function/BNBinaryViewLookupImportedTypeLibrary.cs new file mode 100644 index 0000000..12cc2f4 --- /dev/null +++ b/Function/BNBinaryViewLookupImportedTypeLibrary.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNBinaryViewLookupImportedTypeLibrary(BNBinaryView* view, BNQualifiedName* typeName, BNTypeLibrary** lib, BNQualifiedName* resultName) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNBinaryViewLookupImportedTypeLibrary" + )] + internal static extern bool BNBinaryViewLookupImportedTypeLibrary( + + // BNBinaryView* view + IntPtr view , + + // BNQualifiedName* typeName + in BNQualifiedName typeName , + + // BNTypeLibrary** lib + out IntPtr lib , + + // BNQualifiedName* resultName + out BNQualifiedName resultName + ); + } +} \ No newline at end of file diff --git a/Function/BNBinaryViewPullTypeArchiveTypes.cs b/Function/BNBinaryViewPullTypeArchiveTypes.cs new file mode 100644 index 0000000..64e4c04 --- /dev/null +++ b/Function/BNBinaryViewPullTypeArchiveTypes.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNBinaryViewPullTypeArchiveTypes(BNBinaryView* view, const char* archiveId, const char** archiveTypeIds, uint64_t archiveTypeIdCount, const char*** updatedArchiveTypeIds, const char*** updatedAnalysisTypeIds, uint64_t* updatedTypeCount) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNBinaryViewPullTypeArchiveTypes" + )] + internal static extern bool BNBinaryViewPullTypeArchiveTypes( + + // BNBinaryView* view + IntPtr view , + + // const char* archiveId + string archiveId , + + // const char** archiveTypeIds + string[] archiveTypeIds , + + // uint64_t archiveTypeIdCount + ulong archiveTypeIdCount , + + // const char*** updatedArchiveTypeIds + IntPtr updatedArchiveTypeIds , + + // const char*** updatedAnalysisTypeIds + IntPtr updatedAnalysisTypeIds , + + // uint64_t* updatedTypeCount + IntPtr updatedTypeCount + ); + } +} \ No newline at end of file diff --git a/Function/BNBinaryViewPushTypeArchiveTypes.cs b/Function/BNBinaryViewPushTypeArchiveTypes.cs new file mode 100644 index 0000000..5492cff --- /dev/null +++ b/Function/BNBinaryViewPushTypeArchiveTypes.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNBinaryViewPushTypeArchiveTypes(BNBinaryView* view, const char* archiveId, const char** typeIds, uint64_t typeIdCount, const char*** updatedAnalysisTypeIds, const char*** updatedArchiveTypeIds, uint64_t* updatedTypeCount) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNBinaryViewPushTypeArchiveTypes" + )] + internal static extern bool BNBinaryViewPushTypeArchiveTypes( + + // BNBinaryView* view + IntPtr view , + + // const char* archiveId + string archiveId , + + // const char** typeIds + string[] typeIds , + + // uint64_t typeIdCount + ulong typeIdCount , + + // const char*** updatedAnalysisTypeIds + IntPtr updatedAnalysisTypeIds , + + // const char*** updatedArchiveTypeIds + IntPtr updatedArchiveTypeIds , + + // uint64_t* updatedTypeCount + IntPtr updatedTypeCount + ); + } +} \ No newline at end of file diff --git a/Function/BNBinaryViewQueryMetadata.cs b/Function/BNBinaryViewQueryMetadata.cs new file mode 100644 index 0000000..ea30161 --- /dev/null +++ b/Function/BNBinaryViewQueryMetadata.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNMetadata* BNBinaryViewQueryMetadata(BNBinaryView* view, const char* key) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNBinaryViewQueryMetadata" + )] + internal static extern IntPtr BNBinaryViewQueryMetadata( + + // BNBinaryView* view + IntPtr view , + + // const char* key + string key + ); + } +} \ No newline at end of file diff --git a/Function/BNBinaryViewRecordImportedObjectLibrary.cs b/Function/BNBinaryViewRecordImportedObjectLibrary.cs new file mode 100644 index 0000000..f40b23c --- /dev/null +++ b/Function/BNBinaryViewRecordImportedObjectLibrary.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNBinaryViewRecordImportedObjectLibrary(BNBinaryView* view, BNPlatform* tgtPlatform, uint64_t tgtAddr, BNTypeLibrary* lib, BNQualifiedName* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNBinaryViewRecordImportedObjectLibrary" + )] + internal static extern void BNBinaryViewRecordImportedObjectLibrary( + + // BNBinaryView* view + IntPtr view , + + // BNPlatform* tgtPlatform + IntPtr tgtPlatform , + + // uint64_t tgtAddr + ulong tgtAddr , + + // BNTypeLibrary* lib + IntPtr lib , + + // BNQualifiedName* name + in BNQualifiedName name + ); + } +} \ No newline at end of file diff --git a/Function/BNBinaryViewRemoveExternalLibrary.cs b/Function/BNBinaryViewRemoveExternalLibrary.cs new file mode 100644 index 0000000..5bdfb0a --- /dev/null +++ b/Function/BNBinaryViewRemoveExternalLibrary.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNBinaryViewRemoveExternalLibrary(BNBinaryView* view, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNBinaryViewRemoveExternalLibrary" + )] + internal static extern void BNBinaryViewRemoveExternalLibrary( + + // BNBinaryView* view + IntPtr view , + + // const char* name + string name + ); + } +} \ No newline at end of file diff --git a/Function/BNBinaryViewRemoveExternalLocation.cs b/Function/BNBinaryViewRemoveExternalLocation.cs new file mode 100644 index 0000000..eb63af6 --- /dev/null +++ b/Function/BNBinaryViewRemoveExternalLocation.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNBinaryViewRemoveExternalLocation(BNBinaryView* view, BNSymbol* sourceSymbol) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNBinaryViewRemoveExternalLocation" + )] + internal static extern void BNBinaryViewRemoveExternalLocation( + + // BNBinaryView* view + IntPtr view , + + // BNSymbol* sourceSymbol + IntPtr sourceSymbol + ); + } +} \ No newline at end of file diff --git a/Function/BNBinaryViewRemoveMetadata.cs b/Function/BNBinaryViewRemoveMetadata.cs new file mode 100644 index 0000000..dc9ec58 --- /dev/null +++ b/Function/BNBinaryViewRemoveMetadata.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNBinaryViewRemoveMetadata(BNBinaryView* view, const char* key) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNBinaryViewRemoveMetadata" + )] + internal static extern void BNBinaryViewRemoveMetadata( + + // BNBinaryView* view + IntPtr view , + + // const char* key + string key + ); + } +} \ No newline at end of file diff --git a/Function/BNBinaryViewSetLoadSettings.cs b/Function/BNBinaryViewSetLoadSettings.cs new file mode 100644 index 0000000..8707070 --- /dev/null +++ b/Function/BNBinaryViewSetLoadSettings.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNBinaryViewSetLoadSettings(BNBinaryView* view, const char* typeName, BNSettings* settings) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNBinaryViewSetLoadSettings" + )] + internal static extern void BNBinaryViewSetLoadSettings( + + // BNBinaryView* view + IntPtr view , + + // const char* typeName + string typeName , + + // BNSettings* settings + IntPtr settings + ); + } +} \ No newline at end of file diff --git a/Function/BNBinaryViewSetManualDependencies.cs b/Function/BNBinaryViewSetManualDependencies.cs new file mode 100644 index 0000000..737d70c --- /dev/null +++ b/Function/BNBinaryViewSetManualDependencies.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNBinaryViewSetManualDependencies(BNBinaryView* view, BNQualifiedName* viewTypeNames, BNQualifiedName* libTypeNames, const char** libNames, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNBinaryViewSetManualDependencies" + )] + internal static extern void BNBinaryViewSetManualDependencies( + + // BNBinaryView* view + IntPtr view , + + // BNQualifiedName* viewTypeNames + BNQualifiedName[] viewTypeNames , + + // BNQualifiedName* libTypeNames + BNQualifiedName[] libTypeNames , + + // const char** libNames + string[] libNames , + + // uint64_t count + ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNBinaryViewStoreMetadata.cs b/Function/BNBinaryViewStoreMetadata.cs new file mode 100644 index 0000000..945ccfc --- /dev/null +++ b/Function/BNBinaryViewStoreMetadata.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNBinaryViewStoreMetadata(BNBinaryView* view, const char* key, BNMetadata* value, bool isAuto) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNBinaryViewStoreMetadata" + )] + internal static extern void BNBinaryViewStoreMetadata( + + // BNBinaryView* view + IntPtr view , + + // const char* key + string key , + + // BNMetadata* value + IntPtr value , + + // bool isAuto + bool isAuto + ); + } +} \ No newline at end of file diff --git a/Function/BNCacheHighLevelILPossibleValueSet.cs b/Function/BNCacheHighLevelILPossibleValueSet.cs new file mode 100644 index 0000000..c199959 --- /dev/null +++ b/Function/BNCacheHighLevelILPossibleValueSet.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNCacheHighLevelILPossibleValueSet(BNHighLevelILFunction* func, BNPossibleValueSet* pvs) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCacheHighLevelILPossibleValueSet" + )] + internal static extern HighLevelILPossibleValueSetCacheIndex BNCacheHighLevelILPossibleValueSet( + + // BNHighLevelILFunction* func + IntPtr func , + + // BNPossibleValueSet* pvs + in BNPossibleValueSet pvs + ); + } +} \ No newline at end of file diff --git a/Function/BNCacheLowLevelILPossibleValueSet.cs b/Function/BNCacheLowLevelILPossibleValueSet.cs new file mode 100644 index 0000000..8c147f9 --- /dev/null +++ b/Function/BNCacheLowLevelILPossibleValueSet.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNCacheLowLevelILPossibleValueSet(BNLowLevelILFunction* func, BNPossibleValueSet* pvs) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCacheLowLevelILPossibleValueSet" + )] + internal static extern LowLevelILPossibleValueSetCacheIndex BNCacheLowLevelILPossibleValueSet( + + // BNLowLevelILFunction* func + IntPtr func , + + // BNPossibleValueSet* pvs + in BNPossibleValueSet pvs + ); + } +} \ No newline at end of file diff --git a/Function/BNCacheMediumLevelILPossibleValueSet.cs b/Function/BNCacheMediumLevelILPossibleValueSet.cs new file mode 100644 index 0000000..6dd928a --- /dev/null +++ b/Function/BNCacheMediumLevelILPossibleValueSet.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNCacheMediumLevelILPossibleValueSet(BNMediumLevelILFunction* func, BNPossibleValueSet* pvs) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCacheMediumLevelILPossibleValueSet" + )] + internal static extern MediumLevelILPossibleValueSetCacheIndex BNCacheMediumLevelILPossibleValueSet( + + // BNMediumLevelILFunction* func + IntPtr func , + + // BNPossibleValueSet* pvs + in BNPossibleValueSet pvs + ); + } +} \ No newline at end of file diff --git a/Function/BNCanArchitectureAssemble.cs b/Function/BNCanArchitectureAssemble.cs new file mode 100644 index 0000000..cdf15e2 --- /dev/null +++ b/Function/BNCanArchitectureAssemble.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNCanArchitectureAssemble(BNArchitecture* arch) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCanArchitectureAssemble" + )] + internal static extern bool BNCanArchitectureAssemble( + + // BNArchitecture* arch + IntPtr arch + ); + } +} \ No newline at end of file diff --git a/Function/BNCanAssemble.cs b/Function/BNCanAssemble.cs new file mode 100644 index 0000000..877d99c --- /dev/null +++ b/Function/BNCanAssemble.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNCanAssemble(BNBinaryView* view, BNArchitecture* arch) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCanAssemble" + )] + internal static extern bool BNCanAssemble( + + // BNBinaryView* view + IntPtr view , + + // BNArchitecture* arch + IntPtr arch + ); + } +} \ No newline at end of file diff --git a/Function/BNCanCancelBackgroundTask.cs b/Function/BNCanCancelBackgroundTask.cs new file mode 100644 index 0000000..e35c9d1 --- /dev/null +++ b/Function/BNCanCancelBackgroundTask.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNCanCancelBackgroundTask(BNBackgroundTask* task) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCanCancelBackgroundTask" + )] + internal static extern bool BNCanCancelBackgroundTask( + + // BNBackgroundTask* task + IntPtr task + ); + } +} \ No newline at end of file diff --git a/Function/BNCanDecode.cs b/Function/BNCanDecode.cs new file mode 100644 index 0000000..71830b4 --- /dev/null +++ b/Function/BNCanDecode.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNCanDecode(BNTransform* xform, BNBinaryView* input) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCanDecode" + )] + internal static extern bool BNCanDecode( + + // BNTransform* xform + IntPtr xform , + + // BNBinaryView* input + IntPtr input + ); + } +} \ No newline at end of file diff --git a/Function/BNCanFunctionReturn.cs b/Function/BNCanFunctionReturn.cs new file mode 100644 index 0000000..3713f1c --- /dev/null +++ b/Function/BNCanFunctionReturn.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBoolWithConfidence BNCanFunctionReturn(BNFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCanFunctionReturn" + )] + internal static extern BNBoolWithConfidence BNCanFunctionReturn( + + // BNFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNCanRedo.cs b/Function/BNCanRedo.cs new file mode 100644 index 0000000..2287f15 --- /dev/null +++ b/Function/BNCanRedo.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNCanRedo(BNFileMetadata* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCanRedo" + )] + internal static extern bool BNCanRedo( + + // BNFileMetadata* file + IntPtr file + ); + } +} \ No newline at end of file diff --git a/Function/BNCanUndo.cs b/Function/BNCanUndo.cs new file mode 100644 index 0000000..c3d8e8a --- /dev/null +++ b/Function/BNCanUndo.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNCanUndo(BNFileMetadata* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCanUndo" + )] + internal static extern bool BNCanUndo( + + // BNFileMetadata* file + IntPtr file + ); + } +} \ No newline at end of file diff --git a/Function/BNCancelAnalysisCompletionEvent.cs b/Function/BNCancelAnalysisCompletionEvent.cs new file mode 100644 index 0000000..73fdc0d --- /dev/null +++ b/Function/BNCancelAnalysisCompletionEvent.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNCancelAnalysisCompletionEvent(BNAnalysisCompletionEvent* @event) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCancelAnalysisCompletionEvent" + )] + internal static extern void BNCancelAnalysisCompletionEvent( + + // BNAnalysisCompletionEvent* _event + IntPtr _event + ); + } +} \ No newline at end of file diff --git a/Function/BNCancelBackgroundTask.cs b/Function/BNCancelBackgroundTask.cs new file mode 100644 index 0000000..79d991c --- /dev/null +++ b/Function/BNCancelBackgroundTask.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNCancelBackgroundTask(BNBackgroundTask* task) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCancelBackgroundTask" + )] + internal static extern void BNCancelBackgroundTask( + + // BNBackgroundTask* task + IntPtr task + ); + } +} \ No newline at end of file diff --git a/Function/BNCancelBulkAddSegments.cs b/Function/BNCancelBulkAddSegments.cs new file mode 100644 index 0000000..bd3e41b --- /dev/null +++ b/Function/BNCancelBulkAddSegments.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNCancelBulkAddSegments(BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCancelBulkAddSegments" + )] + internal static extern void BNCancelBulkAddSegments( + + // BNBinaryView* view + IntPtr view + ); + } +} \ No newline at end of file diff --git a/Function/BNCancelEnterpriseServerAuthentication.cs b/Function/BNCancelEnterpriseServerAuthentication.cs new file mode 100644 index 0000000..10182c0 --- /dev/null +++ b/Function/BNCancelEnterpriseServerAuthentication.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNCancelEnterpriseServerAuthentication() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCancelEnterpriseServerAuthentication" + )] + public static extern void BNCancelEnterpriseServerAuthentication(); + } +} \ No newline at end of file diff --git a/Function/BNCancelScriptInput.cs b/Function/BNCancelScriptInput.cs new file mode 100644 index 0000000..92c684a --- /dev/null +++ b/Function/BNCancelScriptInput.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNCancelScriptInput(BNScriptingInstance* instance) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCancelScriptInput" + )] + internal static extern void BNCancelScriptInput( + + // BNScriptingInstance* instance + IntPtr instance + ); + } +} \ No newline at end of file diff --git a/Function/BNCheckForStringAnnotationType.cs b/Function/BNCheckForStringAnnotationType.cs new file mode 100644 index 0000000..e90cb87 --- /dev/null +++ b/Function/BNCheckForStringAnnotationType.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNCheckForStringAnnotationType(BNBinaryView* view, uint64_t addr, const char** value, BNStringType* strType, bool allowShortStrings, bool allowLargeStrings, uint64_t childWidth) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCheckForStringAnnotationType" + )] + internal static extern bool BNCheckForStringAnnotationType( + + // BNBinaryView* view + IntPtr view , + + // uint64_t addr + ulong addr , + + // char** value + out IntPtr value , + + // BNStringType* strType + out StringType strType , + + // bool allowShortStrings + bool allowShortStrings , + + // bool allowLargeStrings + bool allowLargeStrings , + + // uint64_t childWidth + ulong childWidth + ); + } +} \ No newline at end of file diff --git a/Function/BNClearBasicBlockPendingOutgoingEdges.cs b/Function/BNClearBasicBlockPendingOutgoingEdges.cs new file mode 100644 index 0000000..959b3a6 --- /dev/null +++ b/Function/BNClearBasicBlockPendingOutgoingEdges.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNClearBasicBlockPendingOutgoingEdges(BNBasicBlock* block) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNClearBasicBlockPendingOutgoingEdges" + )] + internal static extern void BNClearBasicBlockPendingOutgoingEdges( + + // BNBasicBlock* block + IntPtr block + ); + } +} \ No newline at end of file diff --git a/Function/BNClearDataBuffer.cs b/Function/BNClearDataBuffer.cs new file mode 100644 index 0000000..3dfee32 --- /dev/null +++ b/Function/BNClearDataBuffer.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNClearDataBuffer(BNDataBuffer* buf) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNClearDataBuffer" + )] + internal static extern void BNClearDataBuffer( + + // BNDataBuffer* buf + IntPtr buf + ); + } +} \ No newline at end of file diff --git a/Function/BNClearFieldResolutionForVariableAt.cs b/Function/BNClearFieldResolutionForVariableAt.cs new file mode 100644 index 0000000..6630f0a --- /dev/null +++ b/Function/BNClearFieldResolutionForVariableAt.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNClearFieldResolutionForVariableAt(BNFunction* func, BNVariable* var, BNArchitectureAndAddress* defSite) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNClearFieldResolutionForVariableAt" + )] + internal static extern void BNClearFieldResolutionForVariableAt( + + // BNFunction* func + IntPtr func , + + // BNVariable* _var + IntPtr _var , + + // BNArchitectureAndAddress* defSite + IntPtr defSite + ); + } +} \ No newline at end of file diff --git a/Function/BNClearFlowGraphNodes.cs b/Function/BNClearFlowGraphNodes.cs new file mode 100644 index 0000000..a49434b --- /dev/null +++ b/Function/BNClearFlowGraphNodes.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNClearFlowGraphNodes(BNFlowGraph* graph) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNClearFlowGraphNodes" + )] + internal static extern void BNClearFlowGraphNodes( + + // BNFlowGraph* graph + IntPtr graph + ); + } +} \ No newline at end of file diff --git a/Function/BNClearForcedVariableVersion.cs b/Function/BNClearForcedVariableVersion.cs new file mode 100644 index 0000000..88f0c71 --- /dev/null +++ b/Function/BNClearForcedVariableVersion.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNClearForcedVariableVersion(BNFunction* func, BNVariable* var, BNArchitectureAndAddress* defSite) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNClearForcedVariableVersion" + )] + internal static extern void BNClearForcedVariableVersion( + + // BNFunction* func + IntPtr func , + + // BNVariable* _var + IntPtr _var , + + // BNArchitectureAndAddress* defSite + IntPtr defSite + ); + } +} \ No newline at end of file diff --git a/Function/BNClearTypeLibraryPlatforms.cs b/Function/BNClearTypeLibraryPlatforms.cs new file mode 100644 index 0000000..5bff2a6 --- /dev/null +++ b/Function/BNClearTypeLibraryPlatforms.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNClearTypeLibraryPlatforms(BNTypeLibrary* lib) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNClearTypeLibraryPlatforms" + )] + internal static extern void BNClearTypeLibraryPlatforms( + + // BNTypeLibrary* lib + IntPtr lib + ); + } +} \ No newline at end of file diff --git a/Function/BNClearUndoEntries.cs b/Function/BNClearUndoEntries.cs new file mode 100644 index 0000000..7af6e01 --- /dev/null +++ b/Function/BNClearUndoEntries.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNClearUndoEntries(BNFileMetadata* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNClearUndoEntries" + )] + internal static extern void BNClearUndoEntries( + + // BNFileMetadata* file + IntPtr file + ); + } +} \ No newline at end of file diff --git a/Function/BNClearUserGlobalPointerValue.cs b/Function/BNClearUserGlobalPointerValue.cs new file mode 100644 index 0000000..d653f0a --- /dev/null +++ b/Function/BNClearUserGlobalPointerValue.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNClearUserGlobalPointerValue(BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNClearUserGlobalPointerValue" + )] + internal static extern void BNClearUserGlobalPointerValue( + + // BNBinaryView* view + IntPtr view + ); + } +} \ No newline at end of file diff --git a/Function/BNClearUserVariableValue.cs b/Function/BNClearUserVariableValue.cs new file mode 100644 index 0000000..ed475b6 --- /dev/null +++ b/Function/BNClearUserVariableValue.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNClearUserVariableValue(BNFunction* func, BNVariable* var, BNArchitectureAndAddress* defSite, bool after) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNClearUserVariableValue" + )] + internal static extern void BNClearUserVariableValue( + + // BNFunction* func + IntPtr func , + + // BNVariable* _var + in BNVariable _var , + + // BNArchitectureAndAddress* defSite + in BNArchitectureAndAddress defSite , + + // bool after + bool after + ); + } +} \ No newline at end of file diff --git a/Function/BNCloseFile.cs b/Function/BNCloseFile.cs new file mode 100644 index 0000000..aad0228 --- /dev/null +++ b/Function/BNCloseFile.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNCloseFile(BNFileMetadata* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCloseFile" + )] + internal static extern void BNCloseFile( + + // BNFileMetadata* file + IntPtr file + ); + } +} \ No newline at end of file diff --git a/Function/BNCloseLogs.cs b/Function/BNCloseLogs.cs new file mode 100644 index 0000000..a101fce --- /dev/null +++ b/Function/BNCloseLogs.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNCloseLogs() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCloseLogs" + )] + public static extern void BNCloseLogs(); + } +} \ No newline at end of file diff --git a/Function/BNCloseTypeArchive.cs b/Function/BNCloseTypeArchive.cs new file mode 100644 index 0000000..aba72eb --- /dev/null +++ b/Function/BNCloseTypeArchive.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNCloseTypeArchive(BNTypeArchive* archive) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCloseTypeArchive" + )] + internal static extern void BNCloseTypeArchive( + + // BNTypeArchive* archive + IntPtr archive + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationAssignSnapshotMap.cs b/Function/BNCollaborationAssignSnapshotMap.cs new file mode 100644 index 0000000..63be09f --- /dev/null +++ b/Function/BNCollaborationAssignSnapshotMap.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNCollaborationAssignSnapshotMap(BNSnapshot* localSnapshot, BNCollaborationSnapshot* remoteSnapshot) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationAssignSnapshotMap" + )] + internal static extern bool BNCollaborationAssignSnapshotMap( + + // BNSnapshot* localSnapshot + IntPtr localSnapshot , + + // BNCollaborationSnapshot* remoteSnapshot + IntPtr remoteSnapshot + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationChangesetGetAuthor.cs b/Function/BNCollaborationChangesetGetAuthor.cs new file mode 100644 index 0000000..85332ca --- /dev/null +++ b/Function/BNCollaborationChangesetGetAuthor.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNCollaborationUser* BNCollaborationChangesetGetAuthor(BNCollaborationChangeset* changeset) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationChangesetGetAuthor" + )] + internal static extern IntPtr BNCollaborationChangesetGetAuthor( + + // BNCollaborationChangeset* changeset + IntPtr changeset + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationChangesetGetDatabase.cs b/Function/BNCollaborationChangesetGetDatabase.cs new file mode 100644 index 0000000..f9ef5a2 --- /dev/null +++ b/Function/BNCollaborationChangesetGetDatabase.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDatabase* BNCollaborationChangesetGetDatabase(BNCollaborationChangeset* changeset) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationChangesetGetDatabase" + )] + internal static extern IntPtr BNCollaborationChangesetGetDatabase( + + // BNCollaborationChangeset* changeset + IntPtr changeset + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationChangesetGetFile.cs b/Function/BNCollaborationChangesetGetFile.cs new file mode 100644 index 0000000..47c5293 --- /dev/null +++ b/Function/BNCollaborationChangesetGetFile.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRemoteFile* BNCollaborationChangesetGetFile(BNCollaborationChangeset* changeset) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationChangesetGetFile" + )] + internal static extern IntPtr BNCollaborationChangesetGetFile( + + // BNCollaborationChangeset* changeset + IntPtr changeset + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationChangesetGetName.cs b/Function/BNCollaborationChangesetGetName.cs new file mode 100644 index 0000000..65c4955 --- /dev/null +++ b/Function/BNCollaborationChangesetGetName.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNCollaborationChangesetGetName(BNCollaborationChangeset* changeset) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationChangesetGetName" + )] + internal static extern IntPtr BNCollaborationChangesetGetName( + + // BNCollaborationChangeset* changeset + IntPtr changeset + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationChangesetGetSnapshotIds.cs b/Function/BNCollaborationChangesetGetSnapshotIds.cs new file mode 100644 index 0000000..e523243 --- /dev/null +++ b/Function/BNCollaborationChangesetGetSnapshotIds.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// int64_t* BNCollaborationChangesetGetSnapshotIds(BNCollaborationChangeset* changeset, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationChangesetGetSnapshotIds" + )] + internal static extern IntPtr BNCollaborationChangesetGetSnapshotIds( + + // BNCollaborationChangeset* changeset + IntPtr changeset , + + // uint64_t* count + IntPtr count + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationChangesetSetName.cs b/Function/BNCollaborationChangesetSetName.cs new file mode 100644 index 0000000..e2d4adf --- /dev/null +++ b/Function/BNCollaborationChangesetSetName.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNCollaborationChangesetSetName(BNCollaborationChangeset* changeset, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCollaborationChangesetSetName" + )] + internal static extern bool BNCollaborationChangesetSetName( + + // BNCollaborationChangeset* changeset + IntPtr changeset , + + // const char* name + string name + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationCreateRemote.cs b/Function/BNCollaborationCreateRemote.cs new file mode 100644 index 0000000..3423957 --- /dev/null +++ b/Function/BNCollaborationCreateRemote.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRemote* BNCollaborationCreateRemote(const char* name, const char* address) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCollaborationCreateRemote" + )] + internal static extern IntPtr BNCollaborationCreateRemote( + + // const char* name + string name , + + // const char* address + string address + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationDefaultFilePath.cs b/Function/BNCollaborationDefaultFilePath.cs new file mode 100644 index 0000000..cd09063 --- /dev/null +++ b/Function/BNCollaborationDefaultFilePath.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNCollaborationDefaultFilePath(BNRemoteFile* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationDefaultFilePath" + )] + internal static extern IntPtr BNCollaborationDefaultFilePath( + + // BNRemoteFile* file + IntPtr file + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationDefaultProjectPath.cs b/Function/BNCollaborationDefaultProjectPath.cs new file mode 100644 index 0000000..4365861 --- /dev/null +++ b/Function/BNCollaborationDefaultProjectPath.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNCollaborationDefaultProjectPath(BNRemoteProject* project) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationDefaultProjectPath" + )] + internal static extern IntPtr BNCollaborationDefaultProjectPath( + + // BNRemoteProject* project + IntPtr project + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationDeleteDataFromKeychain.cs b/Function/BNCollaborationDeleteDataFromKeychain.cs new file mode 100644 index 0000000..3115527 --- /dev/null +++ b/Function/BNCollaborationDeleteDataFromKeychain.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNCollaborationDeleteDataFromKeychain(const char* key) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCollaborationDeleteDataFromKeychain" + )] + internal static extern bool BNCollaborationDeleteDataFromKeychain( + + // const char* key + string key + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationDownloadDatabaseForFile.cs b/Function/BNCollaborationDownloadDatabaseForFile.cs new file mode 100644 index 0000000..0eb1b03 --- /dev/null +++ b/Function/BNCollaborationDownloadDatabaseForFile.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNCollaborationDownloadDatabaseForFile(BNRemoteFile* file, const char* dbPath, bool force, void** progress, void* progressContext) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCollaborationDownloadDatabaseForFile" + )] + internal static extern bool BNCollaborationDownloadDatabaseForFile( + + // BNRemoteFile* file + IntPtr file , + + // const char* dbPath + string dbPath , + + // bool force + bool force , + + // void** progress + IntPtr progress , + + // void* progressContext + IntPtr progressContext + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationDownloadFile.cs b/Function/BNCollaborationDownloadFile.cs new file mode 100644 index 0000000..cc3f87f --- /dev/null +++ b/Function/BNCollaborationDownloadFile.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFileMetadata* BNCollaborationDownloadFile(BNRemoteFile* file, const char* dbPath, void** progress, void* progressContext) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCollaborationDownloadFile" + )] + internal static extern IntPtr BNCollaborationDownloadFile( + + // BNRemoteFile* file + IntPtr file , + + // const char* dbPath + string dbPath , + + // void** progress + IntPtr progress , + + // void* progressContext + IntPtr progressContext + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationDownloadTypeArchive.cs b/Function/BNCollaborationDownloadTypeArchive.cs new file mode 100644 index 0000000..c261b66 --- /dev/null +++ b/Function/BNCollaborationDownloadTypeArchive.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNCollaborationDownloadTypeArchive(BNRemoteFile* file, const char* dbPath, void** progress, void* progressContext, BNTypeArchive** result) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCollaborationDownloadTypeArchive" + )] + internal static extern bool BNCollaborationDownloadTypeArchive( + + // BNRemoteFile* file + IntPtr file , + + // const char* dbPath + string dbPath , + + // void** progress + IntPtr progress , + + // void* progressContext + IntPtr progressContext , + + // BNTypeArchive** result + IntPtr result + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationDumpDatabase.cs b/Function/BNCollaborationDumpDatabase.cs new file mode 100644 index 0000000..fe026a5 --- /dev/null +++ b/Function/BNCollaborationDumpDatabase.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNCollaborationDumpDatabase(BNDatabase* database) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationDumpDatabase" + )] + internal static extern bool BNCollaborationDumpDatabase( + + // BNDatabase* database + IntPtr database + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationFreeIdList.cs b/Function/BNCollaborationFreeIdList.cs new file mode 100644 index 0000000..13bee50 --- /dev/null +++ b/Function/BNCollaborationFreeIdList.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNCollaborationFreeIdList(uint64_t* ids, uint64_t size) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationFreeIdList" + )] + internal static extern void BNCollaborationFreeIdList( + + // uint64_t* ids + IntPtr ids , + + // uint64_t size + ulong size + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationFreeLazyT.cs b/Function/BNCollaborationFreeLazyT.cs new file mode 100644 index 0000000..7b28997 --- /dev/null +++ b/Function/BNCollaborationFreeLazyT.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNCollaborationFreeLazyT(BNCollaborationLazyT* lazyT) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationFreeLazyT" + )] + internal static extern void BNCollaborationFreeLazyT( + + // BNCollaborationLazyT* lazyT + IntPtr lazyT + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationFreeSnapshotIdList.cs b/Function/BNCollaborationFreeSnapshotIdList.cs new file mode 100644 index 0000000..0bc6eb5 --- /dev/null +++ b/Function/BNCollaborationFreeSnapshotIdList.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNCollaborationFreeSnapshotIdList(int64_t* ids, uint64_t size) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationFreeSnapshotIdList" + )] + internal static extern void BNCollaborationFreeSnapshotIdList( + + // int64_t* ids + IntPtr ids , + + // uint64_t size + ulong size + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationGetActiveRemote.cs b/Function/BNCollaborationGetActiveRemote.cs new file mode 100644 index 0000000..28957c0 --- /dev/null +++ b/Function/BNCollaborationGetActiveRemote.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRemote* BNCollaborationGetActiveRemote() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationGetActiveRemote" + )] + internal static extern IntPtr BNCollaborationGetActiveRemote(); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationGetDataFromKeychain.cs b/Function/BNCollaborationGetDataFromKeychain.cs new file mode 100644 index 0000000..885c228 --- /dev/null +++ b/Function/BNCollaborationGetDataFromKeychain.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNCollaborationGetDataFromKeychain(const char* key, const char*** foundKeys, const char*** foundValues) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCollaborationGetDataFromKeychain" + )] + internal static extern ulong BNCollaborationGetDataFromKeychain( + + // const char* key + string key , + + // const char*** foundKeys + IntPtr foundKeys , + + // const char*** foundValues + IntPtr foundValues + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationGetLocalSnapshotFromRemote.cs b/Function/BNCollaborationGetLocalSnapshotFromRemote.cs new file mode 100644 index 0000000..6a5849c --- /dev/null +++ b/Function/BNCollaborationGetLocalSnapshotFromRemote.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNCollaborationGetLocalSnapshotFromRemote(BNCollaborationSnapshot* snapshot, BNDatabase* database, BNSnapshot** result) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + + EntryPoint = "BNCollaborationGetLocalSnapshotFromRemote" + )] + internal static extern bool BNCollaborationGetLocalSnapshotFromRemote( + + // BNCollaborationSnapshot* snapshot + IntPtr snapshot , + + // BNDatabase* database + IntPtr database , + + // BNSnapshot** result + IntPtr result + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationGetLocalSnapshotFromRemoteTypeArchive.cs b/Function/BNCollaborationGetLocalSnapshotFromRemoteTypeArchive.cs new file mode 100644 index 0000000..8f7dd53 --- /dev/null +++ b/Function/BNCollaborationGetLocalSnapshotFromRemoteTypeArchive.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNCollaborationGetLocalSnapshotFromRemoteTypeArchive(BNCollaborationSnapshot* snapshot, BNTypeArchive* archive) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationGetLocalSnapshotFromRemoteTypeArchive" + )] + internal static extern IntPtr BNCollaborationGetLocalSnapshotFromRemoteTypeArchive( + + // BNCollaborationSnapshot* snapshot + IntPtr snapshot , + + // BNTypeArchive* archive + IntPtr archive + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationGetRemoteByAddress.cs b/Function/BNCollaborationGetRemoteByAddress.cs new file mode 100644 index 0000000..2511bd2 --- /dev/null +++ b/Function/BNCollaborationGetRemoteByAddress.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRemote* BNCollaborationGetRemoteByAddress(const char* remoteAddress) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCollaborationGetRemoteByAddress" + )] + internal static extern IntPtr BNCollaborationGetRemoteByAddress( + + // const char* remoteAddress + string remoteAddress + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationGetRemoteById.cs b/Function/BNCollaborationGetRemoteById.cs new file mode 100644 index 0000000..6dea9b4 --- /dev/null +++ b/Function/BNCollaborationGetRemoteById.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRemote* BNCollaborationGetRemoteById(const char* remoteId) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCollaborationGetRemoteById" + )] + internal static extern IntPtr BNCollaborationGetRemoteById( + + // const char* remoteId + string remoteId + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationGetRemoteByName.cs b/Function/BNCollaborationGetRemoteByName.cs new file mode 100644 index 0000000..1377a89 --- /dev/null +++ b/Function/BNCollaborationGetRemoteByName.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRemote* BNCollaborationGetRemoteByName(const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCollaborationGetRemoteByName" + )] + internal static extern IntPtr BNCollaborationGetRemoteByName( + + // const char* name + string name + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationGetRemoteFileForLocalDatabase.cs b/Function/BNCollaborationGetRemoteFileForLocalDatabase.cs new file mode 100644 index 0000000..c782da8 --- /dev/null +++ b/Function/BNCollaborationGetRemoteFileForLocalDatabase.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNCollaborationGetRemoteFileForLocalDatabase(BNDatabase* database, BNRemoteFile** result) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationGetRemoteFileForLocalDatabase" + )] + internal static extern bool BNCollaborationGetRemoteFileForLocalDatabase( + + // BNDatabase* database + IntPtr database , + + // BNRemoteFile** result + IntPtr result + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationGetRemoteFileForLocalTypeArchive.cs b/Function/BNCollaborationGetRemoteFileForLocalTypeArchive.cs new file mode 100644 index 0000000..8360d9e --- /dev/null +++ b/Function/BNCollaborationGetRemoteFileForLocalTypeArchive.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRemoteFile* BNCollaborationGetRemoteFileForLocalTypeArchive(BNTypeArchive* archive) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationGetRemoteFileForLocalTypeArchive" + )] + internal static extern IntPtr BNCollaborationGetRemoteFileForLocalTypeArchive( + + // BNTypeArchive* archive + IntPtr archive + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationGetRemoteForLocalDatabase.cs b/Function/BNCollaborationGetRemoteForLocalDatabase.cs new file mode 100644 index 0000000..92aa3dc --- /dev/null +++ b/Function/BNCollaborationGetRemoteForLocalDatabase.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNCollaborationGetRemoteForLocalDatabase(BNDatabase* database, BNRemote** result) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationGetRemoteForLocalDatabase" + )] + internal static extern bool BNCollaborationGetRemoteForLocalDatabase( + + // BNDatabase* database + IntPtr database , + + // BNRemote** result + IntPtr result + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationGetRemoteForLocalTypeArchive.cs b/Function/BNCollaborationGetRemoteForLocalTypeArchive.cs new file mode 100644 index 0000000..47235aa --- /dev/null +++ b/Function/BNCollaborationGetRemoteForLocalTypeArchive.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRemote* BNCollaborationGetRemoteForLocalTypeArchive(BNTypeArchive* archive) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationGetRemoteForLocalTypeArchive" + )] + internal static extern IntPtr BNCollaborationGetRemoteForLocalTypeArchive( + + // BNTypeArchive* archive + IntPtr archive + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationGetRemoteProjectForLocalDatabase.cs b/Function/BNCollaborationGetRemoteProjectForLocalDatabase.cs new file mode 100644 index 0000000..2836190 --- /dev/null +++ b/Function/BNCollaborationGetRemoteProjectForLocalDatabase.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNCollaborationGetRemoteProjectForLocalDatabase(BNDatabase* database, BNRemoteProject** result) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationGetRemoteProjectForLocalDatabase" + )] + internal static extern bool BNCollaborationGetRemoteProjectForLocalDatabase( + + // BNDatabase* database + IntPtr database , + + // BNRemoteProject** result + IntPtr result + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationGetRemoteProjectForLocalTypeArchive.cs b/Function/BNCollaborationGetRemoteProjectForLocalTypeArchive.cs new file mode 100644 index 0000000..28ee958 --- /dev/null +++ b/Function/BNCollaborationGetRemoteProjectForLocalTypeArchive.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRemoteProject* BNCollaborationGetRemoteProjectForLocalTypeArchive(BNTypeArchive* archive) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationGetRemoteProjectForLocalTypeArchive" + )] + internal static extern IntPtr BNCollaborationGetRemoteProjectForLocalTypeArchive( + + // BNTypeArchive* archive + IntPtr archive + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationGetRemoteSnapshotFromLocal.cs b/Function/BNCollaborationGetRemoteSnapshotFromLocal.cs new file mode 100644 index 0000000..7562818 --- /dev/null +++ b/Function/BNCollaborationGetRemoteSnapshotFromLocal.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNCollaborationGetRemoteSnapshotFromLocal(BNSnapshot* snapshot, BNCollaborationSnapshot** result) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationGetRemoteSnapshotFromLocal" + )] + internal static extern bool BNCollaborationGetRemoteSnapshotFromLocal( + + // BNSnapshot* snapshot + IntPtr snapshot , + + // BNCollaborationSnapshot** result + IntPtr result + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationGetRemoteSnapshotFromLocalTypeArchive.cs b/Function/BNCollaborationGetRemoteSnapshotFromLocalTypeArchive.cs new file mode 100644 index 0000000..be24c8f --- /dev/null +++ b/Function/BNCollaborationGetRemoteSnapshotFromLocalTypeArchive.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNCollaborationSnapshot* BNCollaborationGetRemoteSnapshotFromLocalTypeArchive(BNTypeArchive* archive, const char* snapshotId) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCollaborationGetRemoteSnapshotFromLocalTypeArchive" + )] + internal static extern IntPtr BNCollaborationGetRemoteSnapshotFromLocalTypeArchive( + + // BNTypeArchive* archive + IntPtr archive , + + // const char* snapshotId + string snapshotId + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationGetRemotes.cs b/Function/BNCollaborationGetRemotes.cs new file mode 100644 index 0000000..7f42c37 --- /dev/null +++ b/Function/BNCollaborationGetRemotes.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRemote** BNCollaborationGetRemotes(uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationGetRemotes" + )] + internal static extern IntPtr BNCollaborationGetRemotes( + + // uint64_t* count + IntPtr count + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationGetSnapshotAuthor.cs b/Function/BNCollaborationGetSnapshotAuthor.cs new file mode 100644 index 0000000..4c526af --- /dev/null +++ b/Function/BNCollaborationGetSnapshotAuthor.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNCollaborationGetSnapshotAuthor(BNDatabase* database, BNSnapshot* snapshot, const char** result) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCollaborationGetSnapshotAuthor" + )] + internal static extern bool BNCollaborationGetSnapshotAuthor( + + // BNDatabase* database + IntPtr database , + + // BNSnapshot* snapshot + IntPtr snapshot , + + // const char** result + string[] result + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationGroupContainsUser.cs b/Function/BNCollaborationGroupContainsUser.cs new file mode 100644 index 0000000..75df279 --- /dev/null +++ b/Function/BNCollaborationGroupContainsUser.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNCollaborationGroupContainsUser(BNCollaborationGroup* group, const char* username) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCollaborationGroupContainsUser" + )] + internal static extern bool BNCollaborationGroupContainsUser( + + // BNCollaborationGroup* _group + IntPtr _group , + + // const char* username + string username + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationGroupGetId.cs b/Function/BNCollaborationGroupGetId.cs new file mode 100644 index 0000000..945a96b --- /dev/null +++ b/Function/BNCollaborationGroupGetId.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNCollaborationGroupGetId(BNCollaborationGroup* group) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationGroupGetId" + )] + internal static extern ulong BNCollaborationGroupGetId( + + // BNCollaborationGroup* _group + IntPtr _group + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationGroupGetName.cs b/Function/BNCollaborationGroupGetName.cs new file mode 100644 index 0000000..a1c9128 --- /dev/null +++ b/Function/BNCollaborationGroupGetName.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNCollaborationGroupGetName(BNCollaborationGroup* group) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationGroupGetName" + )] + internal static extern IntPtr BNCollaborationGroupGetName( + + // BNCollaborationGroup* _group + IntPtr _group + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationGroupGetRemote.cs b/Function/BNCollaborationGroupGetRemote.cs new file mode 100644 index 0000000..7a399d0 --- /dev/null +++ b/Function/BNCollaborationGroupGetRemote.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRemote* BNCollaborationGroupGetRemote(BNCollaborationGroup* group) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationGroupGetRemote" + )] + internal static extern IntPtr BNCollaborationGroupGetRemote( + + // BNCollaborationGroup* _group + IntPtr _group + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationGroupGetUrl.cs b/Function/BNCollaborationGroupGetUrl.cs new file mode 100644 index 0000000..1c9cad1 --- /dev/null +++ b/Function/BNCollaborationGroupGetUrl.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNCollaborationGroupGetUrl(BNCollaborationGroup* group) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationGroupGetUrl" + )] + internal static extern IntPtr BNCollaborationGroupGetUrl( + + // BNCollaborationGroup* _group + IntPtr _group + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationGroupGetUsers.cs b/Function/BNCollaborationGroupGetUsers.cs new file mode 100644 index 0000000..95242cb --- /dev/null +++ b/Function/BNCollaborationGroupGetUsers.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNCollaborationGroupGetUsers(BNCollaborationGroup* group, const char*** userIds, const char*** usernames, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCollaborationGroupGetUsers" + )] + internal static extern bool BNCollaborationGroupGetUsers( + + // BNCollaborationGroup* _group + IntPtr _group , + + // const char*** userIds + IntPtr userIds , + + // const char*** usernames + IntPtr usernames , + + // uint64_t* count + IntPtr count + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationGroupSetName.cs b/Function/BNCollaborationGroupSetName.cs new file mode 100644 index 0000000..948b381 --- /dev/null +++ b/Function/BNCollaborationGroupSetName.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNCollaborationGroupSetName(BNCollaborationGroup* group, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCollaborationGroupSetName" + )] + internal static extern void BNCollaborationGroupSetName( + + // BNCollaborationGroup* _group + IntPtr _group , + + // const char* name + string name + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationGroupSetUsernames.cs b/Function/BNCollaborationGroupSetUsernames.cs new file mode 100644 index 0000000..3ce46cd --- /dev/null +++ b/Function/BNCollaborationGroupSetUsernames.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNCollaborationGroupSetUsernames(BNCollaborationGroup* group, const char** names, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCollaborationGroupSetUsernames" + )] + internal static extern bool BNCollaborationGroupSetUsernames( + + // BNCollaborationGroup* _group + IntPtr _group , + + // const char** names + string[] names , + + // uint64_t count + ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationHasDataInKeychain.cs b/Function/BNCollaborationHasDataInKeychain.cs new file mode 100644 index 0000000..4c5f844 --- /dev/null +++ b/Function/BNCollaborationHasDataInKeychain.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNCollaborationHasDataInKeychain(const char* key) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCollaborationHasDataInKeychain" + )] + internal static extern bool BNCollaborationHasDataInKeychain( + + // const char* key + string key + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationIgnoreSnapshot.cs b/Function/BNCollaborationIgnoreSnapshot.cs new file mode 100644 index 0000000..712cbe4 --- /dev/null +++ b/Function/BNCollaborationIgnoreSnapshot.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNCollaborationIgnoreSnapshot(BNDatabase* database, BNSnapshot* snapshot) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationIgnoreSnapshot" + )] + internal static extern bool BNCollaborationIgnoreSnapshot( + + // BNDatabase* database + IntPtr database , + + // BNSnapshot* snapshot + IntPtr snapshot + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationIsCollaborationDatabase.cs b/Function/BNCollaborationIsCollaborationDatabase.cs new file mode 100644 index 0000000..2517ce8 --- /dev/null +++ b/Function/BNCollaborationIsCollaborationDatabase.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNCollaborationIsCollaborationDatabase(BNDatabase* database) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationIsCollaborationDatabase" + )] + internal static extern bool BNCollaborationIsCollaborationDatabase( + + // BNDatabase* database + IntPtr database + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationIsCollaborationTypeArchive.cs b/Function/BNCollaborationIsCollaborationTypeArchive.cs new file mode 100644 index 0000000..af9b756 --- /dev/null +++ b/Function/BNCollaborationIsCollaborationTypeArchive.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNCollaborationIsCollaborationTypeArchive(BNTypeArchive* archive) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationIsCollaborationTypeArchive" + )] + internal static extern bool BNCollaborationIsCollaborationTypeArchive( + + // BNTypeArchive* archive + IntPtr archive + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationIsSnapshotIgnored.cs b/Function/BNCollaborationIsSnapshotIgnored.cs new file mode 100644 index 0000000..9e89a1f --- /dev/null +++ b/Function/BNCollaborationIsSnapshotIgnored.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNCollaborationIsSnapshotIgnored(BNDatabase* database, BNSnapshot* snapshot) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationIsSnapshotIgnored" + )] + internal static extern bool BNCollaborationIsSnapshotIgnored( + + // BNDatabase* database + IntPtr database , + + // BNSnapshot* snapshot + IntPtr snapshot + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationIsTypeArchiveSnapshotIgnored.cs b/Function/BNCollaborationIsTypeArchiveSnapshotIgnored.cs new file mode 100644 index 0000000..ff04c37 --- /dev/null +++ b/Function/BNCollaborationIsTypeArchiveSnapshotIgnored.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNCollaborationIsTypeArchiveSnapshotIgnored(BNTypeArchive* archive, const char* snapshot) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCollaborationIsTypeArchiveSnapshotIgnored" + )] + internal static extern bool BNCollaborationIsTypeArchiveSnapshotIgnored( + + // BNTypeArchive* archive + IntPtr archive , + + // const char* snapshot + string snapshot + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationLazyTCreate.cs b/Function/BNCollaborationLazyTCreate.cs new file mode 100644 index 0000000..5f451cb --- /dev/null +++ b/Function/BNCollaborationLazyTCreate.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNCollaborationLazyT* BNCollaborationLazyTCreate(void** ctor, void* context) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationLazyTCreate" + )] + internal static extern IntPtr BNCollaborationLazyTCreate( + + // void** ctor + IntPtr ctor , + + // void* context + IntPtr context + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationLazyTDereference.cs b/Function/BNCollaborationLazyTDereference.cs new file mode 100644 index 0000000..9583aac --- /dev/null +++ b/Function/BNCollaborationLazyTDereference.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void* BNCollaborationLazyTDereference(BNCollaborationLazyT* lazyT) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationLazyTDereference" + )] + internal static extern IntPtr BNCollaborationLazyTDereference( + + // BNCollaborationLazyT* lazyT + IntPtr lazyT + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationLoadRemotes.cs b/Function/BNCollaborationLoadRemotes.cs new file mode 100644 index 0000000..6a990c6 --- /dev/null +++ b/Function/BNCollaborationLoadRemotes.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNCollaborationLoadRemotes() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationLoadRemotes" + )] + public static extern bool BNCollaborationLoadRemotes(); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationMergeDatabase.cs b/Function/BNCollaborationMergeDatabase.cs new file mode 100644 index 0000000..b41fe19 --- /dev/null +++ b/Function/BNCollaborationMergeDatabase.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNCollaborationMergeDatabase(BNDatabase* database, void** conflictHandler, void* conflictHandlerCtxt, void** progress, void* progressContext) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationMergeDatabase" + )] + internal static extern bool BNCollaborationMergeDatabase( + + // BNDatabase* database + IntPtr database , + + // void** conflictHandler + IntPtr conflictHandler , + + // void* conflictHandlerCtxt + IntPtr conflictHandlerCtxt , + + // void** progress + IntPtr progress , + + // void* progressContext + IntPtr progressContext + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationMergeSnapshots.cs b/Function/BNCollaborationMergeSnapshots.cs new file mode 100644 index 0000000..232eafb --- /dev/null +++ b/Function/BNCollaborationMergeSnapshots.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNSnapshot* BNCollaborationMergeSnapshots(BNSnapshot* first, BNSnapshot* second, void** conflictHandler, void* conflictHandlerCtxt, void** progress, void* progressContext) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationMergeSnapshots" + )] + internal static extern IntPtr BNCollaborationMergeSnapshots( + + // BNSnapshot* first + IntPtr first , + + // BNSnapshot* second + IntPtr second , + + // void** conflictHandler + IntPtr conflictHandler , + + // void* conflictHandlerCtxt + IntPtr conflictHandlerCtxt , + + // void** progress + IntPtr progress , + + // void* progressContext + IntPtr progressContext + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationPermissionCanAdmin.cs b/Function/BNCollaborationPermissionCanAdmin.cs new file mode 100644 index 0000000..c90a93f --- /dev/null +++ b/Function/BNCollaborationPermissionCanAdmin.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNCollaborationPermissionCanAdmin(BNCollaborationPermission* permission) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationPermissionCanAdmin" + )] + internal static extern bool BNCollaborationPermissionCanAdmin( + + // BNCollaborationPermission* permission + IntPtr permission + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationPermissionCanEdit.cs b/Function/BNCollaborationPermissionCanEdit.cs new file mode 100644 index 0000000..9db637f --- /dev/null +++ b/Function/BNCollaborationPermissionCanEdit.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNCollaborationPermissionCanEdit(BNCollaborationPermission* permission) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationPermissionCanEdit" + )] + internal static extern bool BNCollaborationPermissionCanEdit( + + // BNCollaborationPermission* permission + IntPtr permission + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationPermissionCanView.cs b/Function/BNCollaborationPermissionCanView.cs new file mode 100644 index 0000000..0cf0089 --- /dev/null +++ b/Function/BNCollaborationPermissionCanView.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNCollaborationPermissionCanView(BNCollaborationPermission* permission) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationPermissionCanView" + )] + internal static extern bool BNCollaborationPermissionCanView( + + // BNCollaborationPermission* permission + IntPtr permission + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationPermissionGetGroupId.cs b/Function/BNCollaborationPermissionGetGroupId.cs new file mode 100644 index 0000000..5532230 --- /dev/null +++ b/Function/BNCollaborationPermissionGetGroupId.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNCollaborationPermissionGetGroupId(BNCollaborationPermission* permission) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationPermissionGetGroupId" + )] + internal static extern ulong BNCollaborationPermissionGetGroupId( + + // BNCollaborationPermission* permission + IntPtr permission + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationPermissionGetGroupName.cs b/Function/BNCollaborationPermissionGetGroupName.cs new file mode 100644 index 0000000..4952420 --- /dev/null +++ b/Function/BNCollaborationPermissionGetGroupName.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNCollaborationPermissionGetGroupName(BNCollaborationPermission* permission) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationPermissionGetGroupName" + )] + internal static extern IntPtr BNCollaborationPermissionGetGroupName( + + // BNCollaborationPermission* permission + IntPtr permission + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationPermissionGetId.cs b/Function/BNCollaborationPermissionGetId.cs new file mode 100644 index 0000000..f69b9d1 --- /dev/null +++ b/Function/BNCollaborationPermissionGetId.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNCollaborationPermissionGetId(BNCollaborationPermission* permission) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationPermissionGetId" + )] + internal static extern IntPtr BNCollaborationPermissionGetId( + + // BNCollaborationPermission* permission + IntPtr permission + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationPermissionGetLevel.cs b/Function/BNCollaborationPermissionGetLevel.cs new file mode 100644 index 0000000..9dac168 --- /dev/null +++ b/Function/BNCollaborationPermissionGetLevel.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNCollaborationPermissionLevel BNCollaborationPermissionGetLevel(BNCollaborationPermission* permission) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationPermissionGetLevel" + )] + internal static extern CollaborationPermissionLevel BNCollaborationPermissionGetLevel( + + // BNCollaborationPermission* permission + IntPtr permission + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationPermissionGetProject.cs b/Function/BNCollaborationPermissionGetProject.cs new file mode 100644 index 0000000..8415feb --- /dev/null +++ b/Function/BNCollaborationPermissionGetProject.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRemoteProject* BNCollaborationPermissionGetProject(BNCollaborationPermission* permission) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationPermissionGetProject" + )] + internal static extern IntPtr BNCollaborationPermissionGetProject( + + // BNCollaborationPermission* permission + IntPtr permission + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationPermissionGetRemote.cs b/Function/BNCollaborationPermissionGetRemote.cs new file mode 100644 index 0000000..58238f9 --- /dev/null +++ b/Function/BNCollaborationPermissionGetRemote.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRemote* BNCollaborationPermissionGetRemote(BNCollaborationPermission* permission) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationPermissionGetRemote" + )] + internal static extern IntPtr BNCollaborationPermissionGetRemote( + + // BNCollaborationPermission* permission + IntPtr permission + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationPermissionGetUrl.cs b/Function/BNCollaborationPermissionGetUrl.cs new file mode 100644 index 0000000..1950e69 --- /dev/null +++ b/Function/BNCollaborationPermissionGetUrl.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNCollaborationPermissionGetUrl(BNCollaborationPermission* permission) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationPermissionGetUrl" + )] + internal static extern IntPtr BNCollaborationPermissionGetUrl( + + // BNCollaborationPermission* permission + IntPtr permission + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationPermissionGetUserId.cs b/Function/BNCollaborationPermissionGetUserId.cs new file mode 100644 index 0000000..ded99c3 --- /dev/null +++ b/Function/BNCollaborationPermissionGetUserId.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNCollaborationPermissionGetUserId(BNCollaborationPermission* permission) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationPermissionGetUserId" + )] + internal static extern IntPtr BNCollaborationPermissionGetUserId( + + // BNCollaborationPermission* permission + IntPtr permission + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationPermissionGetUsername.cs b/Function/BNCollaborationPermissionGetUsername.cs new file mode 100644 index 0000000..ef52286 --- /dev/null +++ b/Function/BNCollaborationPermissionGetUsername.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNCollaborationPermissionGetUsername(BNCollaborationPermission* permission) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationPermissionGetUsername" + )] + internal static extern IntPtr BNCollaborationPermissionGetUsername( + + // BNCollaborationPermission* permission + IntPtr permission + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationPermissionSetLevel.cs b/Function/BNCollaborationPermissionSetLevel.cs new file mode 100644 index 0000000..7edc223 --- /dev/null +++ b/Function/BNCollaborationPermissionSetLevel.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNCollaborationPermissionSetLevel(BNCollaborationPermission* permission, BNCollaborationPermissionLevel level) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationPermissionSetLevel" + )] + internal static extern void BNCollaborationPermissionSetLevel( + + // BNCollaborationPermission* permission + IntPtr permission , + + // BNCollaborationPermissionLevel level + CollaborationPermissionLevel level + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationPullDatabase.cs b/Function/BNCollaborationPullDatabase.cs new file mode 100644 index 0000000..e4605e7 --- /dev/null +++ b/Function/BNCollaborationPullDatabase.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNCollaborationPullDatabase(BNDatabase* database, BNRemoteFile* file, uint64_t* count, void** conflictHandler, void* conflictHandlerCtxt, void** progress, void* progressContext, void** nameChangeset, void* nameChangesetContext) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationPullDatabase" + )] + internal static extern bool BNCollaborationPullDatabase( + + // BNDatabase* database + IntPtr database , + + // BNRemoteFile* file + IntPtr file , + + // uint64_t* count + IntPtr count , + + // void** conflictHandler + IntPtr conflictHandler , + + // void* conflictHandlerCtxt + IntPtr conflictHandlerCtxt , + + // void** progress + IntPtr progress , + + // void* progressContext + IntPtr progressContext , + + // void** nameChangeset + IntPtr nameChangeset , + + // void* nameChangesetContext + IntPtr nameChangesetContext + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationPullTypeArchive.cs b/Function/BNCollaborationPullTypeArchive.cs new file mode 100644 index 0000000..bae4653 --- /dev/null +++ b/Function/BNCollaborationPullTypeArchive.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNCollaborationPullTypeArchive(BNTypeArchive* archive, BNRemoteFile* file, uint64_t* count, void** conflictHandler, void* conflictHandlerCtxt, void** progress, void* progressCtxt) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationPullTypeArchive" + )] + internal static extern bool BNCollaborationPullTypeArchive( + + // BNTypeArchive* archive + IntPtr archive , + + // BNRemoteFile* file + IntPtr file , + + // uint64_t* count + IntPtr count , + + // void** conflictHandler + IntPtr conflictHandler , + + // void* conflictHandlerCtxt + IntPtr conflictHandlerCtxt , + + // void** progress + IntPtr progress , + + // void* progressCtxt + IntPtr progressCtxt + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationPushDatabase.cs b/Function/BNCollaborationPushDatabase.cs new file mode 100644 index 0000000..51693cf --- /dev/null +++ b/Function/BNCollaborationPushDatabase.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNCollaborationPushDatabase(BNDatabase* database, BNRemoteFile* file, uint64_t* count, void** progress, void* progressContext) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationPushDatabase" + )] + internal static extern bool BNCollaborationPushDatabase( + + // BNDatabase* database + IntPtr database , + + // BNRemoteFile* file + IntPtr file , + + // uint64_t* count + IntPtr count , + + // void** progress + IntPtr progress , + + // void* progressContext + IntPtr progressContext + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationPushTypeArchive.cs b/Function/BNCollaborationPushTypeArchive.cs new file mode 100644 index 0000000..2177fbe --- /dev/null +++ b/Function/BNCollaborationPushTypeArchive.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNCollaborationPushTypeArchive(BNTypeArchive* archive, BNRemoteFile* file, uint64_t* count, void** progress, void* progressCtxt) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationPushTypeArchive" + )] + internal static extern bool BNCollaborationPushTypeArchive( + + // BNTypeArchive* archive + IntPtr archive , + + // BNRemoteFile* file + IntPtr file , + + // uint64_t* count + IntPtr count , + + // void** progress + IntPtr progress , + + // void* progressCtxt + IntPtr progressCtxt + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationRemoveRemote.cs b/Function/BNCollaborationRemoveRemote.cs new file mode 100644 index 0000000..c813005 --- /dev/null +++ b/Function/BNCollaborationRemoveRemote.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNCollaborationRemoveRemote(BNRemote* remote) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationRemoveRemote" + )] + internal static extern void BNCollaborationRemoveRemote( + + // BNRemote* remote + IntPtr remote + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationSaveRemotes.cs b/Function/BNCollaborationSaveRemotes.cs new file mode 100644 index 0000000..05469e9 --- /dev/null +++ b/Function/BNCollaborationSaveRemotes.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNCollaborationSaveRemotes() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationSaveRemotes" + )] + public static extern void BNCollaborationSaveRemotes(); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationSetActiveRemote.cs b/Function/BNCollaborationSetActiveRemote.cs new file mode 100644 index 0000000..be738e8 --- /dev/null +++ b/Function/BNCollaborationSetActiveRemote.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNCollaborationSetActiveRemote(BNRemote* remote) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationSetActiveRemote" + )] + internal static extern void BNCollaborationSetActiveRemote( + + // BNRemote* remote + IntPtr remote + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationSetSnapshotAuthor.cs b/Function/BNCollaborationSetSnapshotAuthor.cs new file mode 100644 index 0000000..9a4bf17 --- /dev/null +++ b/Function/BNCollaborationSetSnapshotAuthor.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNCollaborationSetSnapshotAuthor(BNDatabase* database, BNSnapshot* snapshot, const char* author) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCollaborationSetSnapshotAuthor" + )] + internal static extern bool BNCollaborationSetSnapshotAuthor( + + // BNDatabase* database + IntPtr database , + + // BNSnapshot* snapshot + IntPtr snapshot , + + // const char* author + string author + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationSnapshotCreateUndoEntry.cs b/Function/BNCollaborationSnapshotCreateUndoEntry.cs new file mode 100644 index 0000000..f82a314 --- /dev/null +++ b/Function/BNCollaborationSnapshotCreateUndoEntry.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNCollaborationUndoEntry* BNCollaborationSnapshotCreateUndoEntry(BNCollaborationSnapshot* snapshot, bool hasParent, uint64_t parent, const char* data) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCollaborationSnapshotCreateUndoEntry" + )] + internal static extern IntPtr BNCollaborationSnapshotCreateUndoEntry( + + // BNCollaborationSnapshot* snapshot + IntPtr snapshot , + + // bool hasParent + bool hasParent , + + // uint64_t parent + ulong parent , + + // const char* data + string data + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationSnapshotDownload.cs b/Function/BNCollaborationSnapshotDownload.cs new file mode 100644 index 0000000..220b552 --- /dev/null +++ b/Function/BNCollaborationSnapshotDownload.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNCollaborationSnapshotDownload(BNCollaborationSnapshot* snapshot, void** progress, void* progressContext, uint8_t** data, uint64_t* size) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationSnapshotDownload" + )] + internal static extern bool BNCollaborationSnapshotDownload( + + // BNCollaborationSnapshot* snapshot + IntPtr snapshot , + + // void** progress + IntPtr progress , + + // void* progressContext + IntPtr progressContext , + + // uint8_t** data + IntPtr data , + + // uint64_t* size + IntPtr size + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationSnapshotDownloadAnalysisCache.cs b/Function/BNCollaborationSnapshotDownloadAnalysisCache.cs new file mode 100644 index 0000000..1566962 --- /dev/null +++ b/Function/BNCollaborationSnapshotDownloadAnalysisCache.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNCollaborationSnapshotDownloadAnalysisCache(BNCollaborationSnapshot* snapshot, void** progress, void* progressContext, uint8_t** data, uint64_t* size) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationSnapshotDownloadAnalysisCache" + )] + internal static extern bool BNCollaborationSnapshotDownloadAnalysisCache( + + // BNCollaborationSnapshot* snapshot + IntPtr snapshot , + + // void** progress + IntPtr progress , + + // void* progressContext + IntPtr progressContext , + + // uint8_t** data + IntPtr data , + + // uint64_t* size + IntPtr size + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationSnapshotDownloadSnapshotFile.cs b/Function/BNCollaborationSnapshotDownloadSnapshotFile.cs new file mode 100644 index 0000000..d1a159e --- /dev/null +++ b/Function/BNCollaborationSnapshotDownloadSnapshotFile.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNCollaborationSnapshotDownloadSnapshotFile(BNCollaborationSnapshot* snapshot, void** progress, void* progressContext, uint8_t** data, uint64_t* size) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationSnapshotDownloadSnapshotFile" + )] + internal static extern bool BNCollaborationSnapshotDownloadSnapshotFile( + + // BNCollaborationSnapshot* snapshot + IntPtr snapshot , + + // void** progress + IntPtr progress , + + // void* progressContext + IntPtr progressContext , + + // uint8_t** data + IntPtr data , + + // uint64_t* size + IntPtr size + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationSnapshotFinalize.cs b/Function/BNCollaborationSnapshotFinalize.cs new file mode 100644 index 0000000..89596db --- /dev/null +++ b/Function/BNCollaborationSnapshotFinalize.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNCollaborationSnapshotFinalize(BNCollaborationSnapshot* snapshot) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationSnapshotFinalize" + )] + internal static extern bool BNCollaborationSnapshotFinalize( + + // BNCollaborationSnapshot* snapshot + IntPtr snapshot + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationSnapshotGetAnalysisCacheBuildId.cs b/Function/BNCollaborationSnapshotGetAnalysisCacheBuildId.cs new file mode 100644 index 0000000..827b464 --- /dev/null +++ b/Function/BNCollaborationSnapshotGetAnalysisCacheBuildId.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNCollaborationSnapshotGetAnalysisCacheBuildId(BNCollaborationSnapshot* snapshot) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationSnapshotGetAnalysisCacheBuildId" + )] + internal static extern ulong BNCollaborationSnapshotGetAnalysisCacheBuildId( + + // BNCollaborationSnapshot* snapshot + IntPtr snapshot + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationSnapshotGetAuthor.cs b/Function/BNCollaborationSnapshotGetAuthor.cs new file mode 100644 index 0000000..c3828ac --- /dev/null +++ b/Function/BNCollaborationSnapshotGetAuthor.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNCollaborationSnapshotGetAuthor(BNCollaborationSnapshot* snapshot) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationSnapshotGetAuthor" + )] + internal static extern IntPtr BNCollaborationSnapshotGetAuthor( + + // BNCollaborationSnapshot* snapshot + IntPtr snapshot + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationSnapshotGetAuthorUsername.cs b/Function/BNCollaborationSnapshotGetAuthorUsername.cs new file mode 100644 index 0000000..a8d2b2d --- /dev/null +++ b/Function/BNCollaborationSnapshotGetAuthorUsername.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNCollaborationSnapshotGetAuthorUsername(BNCollaborationSnapshot* snapshot) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationSnapshotGetAuthorUsername" + )] + internal static extern IntPtr BNCollaborationSnapshotGetAuthorUsername( + + // BNCollaborationSnapshot* snapshot + IntPtr snapshot + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationSnapshotGetChildIds.cs b/Function/BNCollaborationSnapshotGetChildIds.cs new file mode 100644 index 0000000..0270255 --- /dev/null +++ b/Function/BNCollaborationSnapshotGetChildIds.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char** BNCollaborationSnapshotGetChildIds(BNCollaborationSnapshot* snapshot, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationSnapshotGetChildIds" + )] + internal static extern IntPtr BNCollaborationSnapshotGetChildIds( + + // BNCollaborationSnapshot* snapshot + IntPtr snapshot , + + // uint64_t* count + IntPtr count + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationSnapshotGetChildren.cs b/Function/BNCollaborationSnapshotGetChildren.cs new file mode 100644 index 0000000..618517f --- /dev/null +++ b/Function/BNCollaborationSnapshotGetChildren.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNCollaborationSnapshot** BNCollaborationSnapshotGetChildren(BNCollaborationSnapshot* snapshot, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationSnapshotGetChildren" + )] + internal static extern IntPtr BNCollaborationSnapshotGetChildren( + + // BNCollaborationSnapshot* snapshot + IntPtr snapshot , + + // uint64_t* count + IntPtr count + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationSnapshotGetCreated.cs b/Function/BNCollaborationSnapshotGetCreated.cs new file mode 100644 index 0000000..d5348f4 --- /dev/null +++ b/Function/BNCollaborationSnapshotGetCreated.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// int64_t BNCollaborationSnapshotGetCreated(BNCollaborationSnapshot* snapshot) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationSnapshotGetCreated" + )] + internal static extern long BNCollaborationSnapshotGetCreated( + + // BNCollaborationSnapshot* snapshot + IntPtr snapshot + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationSnapshotGetDescription.cs b/Function/BNCollaborationSnapshotGetDescription.cs new file mode 100644 index 0000000..b7aceed --- /dev/null +++ b/Function/BNCollaborationSnapshotGetDescription.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNCollaborationSnapshotGetDescription(BNCollaborationSnapshot* snapshot) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationSnapshotGetDescription" + )] + internal static extern IntPtr BNCollaborationSnapshotGetDescription( + + // BNCollaborationSnapshot* snapshot + IntPtr snapshot + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationSnapshotGetFile.cs b/Function/BNCollaborationSnapshotGetFile.cs new file mode 100644 index 0000000..6911964 --- /dev/null +++ b/Function/BNCollaborationSnapshotGetFile.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRemoteFile* BNCollaborationSnapshotGetFile(BNCollaborationSnapshot* snapshot) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationSnapshotGetFile" + )] + internal static extern IntPtr BNCollaborationSnapshotGetFile( + + // BNCollaborationSnapshot* snapshot + IntPtr snapshot + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationSnapshotGetHash.cs b/Function/BNCollaborationSnapshotGetHash.cs new file mode 100644 index 0000000..cd85237 --- /dev/null +++ b/Function/BNCollaborationSnapshotGetHash.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNCollaborationSnapshotGetHash(BNCollaborationSnapshot* snapshot) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationSnapshotGetHash" + )] + internal static extern IntPtr BNCollaborationSnapshotGetHash( + + // BNCollaborationSnapshot* snapshot + IntPtr snapshot + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationSnapshotGetId.cs b/Function/BNCollaborationSnapshotGetId.cs new file mode 100644 index 0000000..29fd109 --- /dev/null +++ b/Function/BNCollaborationSnapshotGetId.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNCollaborationSnapshotGetId(BNCollaborationSnapshot* snapshot) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationSnapshotGetId" + )] + internal static extern IntPtr BNCollaborationSnapshotGetId( + + // BNCollaborationSnapshot* snapshot + IntPtr snapshot + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationSnapshotGetLastModified.cs b/Function/BNCollaborationSnapshotGetLastModified.cs new file mode 100644 index 0000000..ab4c3be --- /dev/null +++ b/Function/BNCollaborationSnapshotGetLastModified.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// int64_t BNCollaborationSnapshotGetLastModified(BNCollaborationSnapshot* snapshot) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationSnapshotGetLastModified" + )] + internal static extern long BNCollaborationSnapshotGetLastModified( + + // BNCollaborationSnapshot* snapshot + IntPtr snapshot + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationSnapshotGetName.cs b/Function/BNCollaborationSnapshotGetName.cs new file mode 100644 index 0000000..55b6e11 --- /dev/null +++ b/Function/BNCollaborationSnapshotGetName.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNCollaborationSnapshotGetName(BNCollaborationSnapshot* snapshot) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationSnapshotGetName" + )] + internal static extern IntPtr BNCollaborationSnapshotGetName( + + // BNCollaborationSnapshot* snapshot + IntPtr snapshot + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationSnapshotGetParentIds.cs b/Function/BNCollaborationSnapshotGetParentIds.cs new file mode 100644 index 0000000..2c7746f --- /dev/null +++ b/Function/BNCollaborationSnapshotGetParentIds.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char** BNCollaborationSnapshotGetParentIds(BNCollaborationSnapshot* snapshot, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationSnapshotGetParentIds" + )] + internal static extern IntPtr BNCollaborationSnapshotGetParentIds( + + // BNCollaborationSnapshot* snapshot + IntPtr snapshot , + + // uint64_t* count + IntPtr count + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationSnapshotGetParents.cs b/Function/BNCollaborationSnapshotGetParents.cs new file mode 100644 index 0000000..0b9d633 --- /dev/null +++ b/Function/BNCollaborationSnapshotGetParents.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNCollaborationSnapshot** BNCollaborationSnapshotGetParents(BNCollaborationSnapshot* snapshot, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationSnapshotGetParents" + )] + internal static extern IntPtr BNCollaborationSnapshotGetParents( + + // BNCollaborationSnapshot* snapshot + IntPtr snapshot , + + // uint64_t* count + IntPtr count + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationSnapshotGetProject.cs b/Function/BNCollaborationSnapshotGetProject.cs new file mode 100644 index 0000000..1bcc83a --- /dev/null +++ b/Function/BNCollaborationSnapshotGetProject.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRemoteProject* BNCollaborationSnapshotGetProject(BNCollaborationSnapshot* snapshot) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationSnapshotGetProject" + )] + internal static extern IntPtr BNCollaborationSnapshotGetProject( + + // BNCollaborationSnapshot* snapshot + IntPtr snapshot + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationSnapshotGetRemote.cs b/Function/BNCollaborationSnapshotGetRemote.cs new file mode 100644 index 0000000..fad926a --- /dev/null +++ b/Function/BNCollaborationSnapshotGetRemote.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRemote* BNCollaborationSnapshotGetRemote(BNCollaborationSnapshot* snapshot) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationSnapshotGetRemote" + )] + internal static extern IntPtr BNCollaborationSnapshotGetRemote( + + // BNCollaborationSnapshot* snapshot + IntPtr snapshot + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationSnapshotGetSnapshotFileHash.cs b/Function/BNCollaborationSnapshotGetSnapshotFileHash.cs new file mode 100644 index 0000000..825bee0 --- /dev/null +++ b/Function/BNCollaborationSnapshotGetSnapshotFileHash.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNCollaborationSnapshotGetSnapshotFileHash(BNCollaborationSnapshot* snapshot) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationSnapshotGetSnapshotFileHash" + )] + internal static extern IntPtr BNCollaborationSnapshotGetSnapshotFileHash( + + // BNCollaborationSnapshot* snapshot + IntPtr snapshot + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationSnapshotGetTitle.cs b/Function/BNCollaborationSnapshotGetTitle.cs new file mode 100644 index 0000000..7f64f01 --- /dev/null +++ b/Function/BNCollaborationSnapshotGetTitle.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNCollaborationSnapshotGetTitle(BNCollaborationSnapshot* snapshot) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationSnapshotGetTitle" + )] + internal static extern IntPtr BNCollaborationSnapshotGetTitle( + + // BNCollaborationSnapshot* snapshot + IntPtr snapshot + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationSnapshotGetUndoEntries.cs b/Function/BNCollaborationSnapshotGetUndoEntries.cs new file mode 100644 index 0000000..c9b7964 --- /dev/null +++ b/Function/BNCollaborationSnapshotGetUndoEntries.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNCollaborationUndoEntry** BNCollaborationSnapshotGetUndoEntries(BNCollaborationSnapshot* snapshot, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationSnapshotGetUndoEntries" + )] + internal static extern IntPtr BNCollaborationSnapshotGetUndoEntries( + + // BNCollaborationSnapshot* snapshot + IntPtr snapshot , + + // uint64_t* count + IntPtr count + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationSnapshotGetUndoEntryById.cs b/Function/BNCollaborationSnapshotGetUndoEntryById.cs new file mode 100644 index 0000000..6a2f011 --- /dev/null +++ b/Function/BNCollaborationSnapshotGetUndoEntryById.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNCollaborationUndoEntry* BNCollaborationSnapshotGetUndoEntryById(BNCollaborationSnapshot* snapshot, uint64_t id) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationSnapshotGetUndoEntryById" + )] + internal static extern IntPtr BNCollaborationSnapshotGetUndoEntryById( + + // BNCollaborationSnapshot* snapshot + IntPtr snapshot , + + // uint64_t id + ulong id + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationSnapshotGetUrl.cs b/Function/BNCollaborationSnapshotGetUrl.cs new file mode 100644 index 0000000..309df2a --- /dev/null +++ b/Function/BNCollaborationSnapshotGetUrl.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNCollaborationSnapshotGetUrl(BNCollaborationSnapshot* snapshot) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationSnapshotGetUrl" + )] + internal static extern IntPtr BNCollaborationSnapshotGetUrl( + + // BNCollaborationSnapshot* snapshot + IntPtr snapshot + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationSnapshotHasPulledUndoEntries.cs b/Function/BNCollaborationSnapshotHasPulledUndoEntries.cs new file mode 100644 index 0000000..5d31437 --- /dev/null +++ b/Function/BNCollaborationSnapshotHasPulledUndoEntries.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNCollaborationSnapshotHasPulledUndoEntries(BNCollaborationSnapshot* snapshot) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationSnapshotHasPulledUndoEntries" + )] + internal static extern bool BNCollaborationSnapshotHasPulledUndoEntries( + + // BNCollaborationSnapshot* snapshot + IntPtr snapshot + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationSnapshotIsFinalized.cs b/Function/BNCollaborationSnapshotIsFinalized.cs new file mode 100644 index 0000000..152a10a --- /dev/null +++ b/Function/BNCollaborationSnapshotIsFinalized.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNCollaborationSnapshotIsFinalized(BNCollaborationSnapshot* snapshot) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationSnapshotIsFinalized" + )] + internal static extern bool BNCollaborationSnapshotIsFinalized( + + // BNCollaborationSnapshot* snapshot + IntPtr snapshot + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationSnapshotPullUndoEntries.cs b/Function/BNCollaborationSnapshotPullUndoEntries.cs new file mode 100644 index 0000000..e976470 --- /dev/null +++ b/Function/BNCollaborationSnapshotPullUndoEntries.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNCollaborationSnapshotPullUndoEntries(BNCollaborationSnapshot* snapshot, void** progress, void* progressContext) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationSnapshotPullUndoEntries" + )] + internal static extern bool BNCollaborationSnapshotPullUndoEntries( + + // BNCollaborationSnapshot* snapshot + IntPtr snapshot , + + // void** progress + IntPtr progress , + + // void* progressContext + IntPtr progressContext + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationStoreDataInKeychain.cs b/Function/BNCollaborationStoreDataInKeychain.cs new file mode 100644 index 0000000..dda8b51 --- /dev/null +++ b/Function/BNCollaborationStoreDataInKeychain.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNCollaborationStoreDataInKeychain(const char* key, const char** dataKeys, const char** dataValues, uint64_t dataCount) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCollaborationStoreDataInKeychain" + )] + internal static extern bool BNCollaborationStoreDataInKeychain( + + // const char* key + string key , + + // const char** dataKeys + string[] dataKeys , + + // const char** dataValues + string[] dataValues , + + // uint64_t dataCount + ulong dataCount + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationSyncDatabase.cs b/Function/BNCollaborationSyncDatabase.cs new file mode 100644 index 0000000..05f05c4 --- /dev/null +++ b/Function/BNCollaborationSyncDatabase.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNCollaborationSyncDatabase(BNDatabase* database, BNRemoteFile* file, void** conflictHandler, void* conflictHandlerCtxt, void** progress, void* progressCtxt, void** nameChangeset, void* nameChangesetCtxt) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationSyncDatabase" + )] + internal static extern bool BNCollaborationSyncDatabase( + + // BNDatabase* database + IntPtr database , + + // BNRemoteFile* file + IntPtr file , + + // void** conflictHandler + IntPtr conflictHandler , + + // void* conflictHandlerCtxt + IntPtr conflictHandlerCtxt , + + // void** progress + IntPtr progress , + + // void* progressCtxt + IntPtr progressCtxt , + + // void** nameChangeset + IntPtr nameChangeset , + + // void* nameChangesetCtxt + IntPtr nameChangesetCtxt + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationSyncTypeArchive.cs b/Function/BNCollaborationSyncTypeArchive.cs new file mode 100644 index 0000000..333379a --- /dev/null +++ b/Function/BNCollaborationSyncTypeArchive.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNCollaborationSyncTypeArchive(BNTypeArchive* archive, BNRemoteFile* file, void** conflictHandler, void* conflictHandlerCtxt, void** progress, void* progressCtxt) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationSyncTypeArchive" + )] + internal static extern bool BNCollaborationSyncTypeArchive( + + // BNTypeArchive* archive + IntPtr archive , + + // BNRemoteFile* file + IntPtr file , + + // void** conflictHandler + IntPtr conflictHandler , + + // void* conflictHandlerCtxt + IntPtr conflictHandlerCtxt , + + // void** progress + IntPtr progress , + + // void* progressCtxt + IntPtr progressCtxt + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationUndoEntryGetData.cs b/Function/BNCollaborationUndoEntryGetData.cs new file mode 100644 index 0000000..86db540 --- /dev/null +++ b/Function/BNCollaborationUndoEntryGetData.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNCollaborationUndoEntryGetData(BNCollaborationUndoEntry* undoEntry, const char** data) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCollaborationUndoEntryGetData" + )] + internal static extern bool BNCollaborationUndoEntryGetData( + + // BNCollaborationUndoEntry* undoEntry + IntPtr undoEntry , + + // const char** data + string[] data + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationUndoEntryGetFile.cs b/Function/BNCollaborationUndoEntryGetFile.cs new file mode 100644 index 0000000..e6299d5 --- /dev/null +++ b/Function/BNCollaborationUndoEntryGetFile.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRemoteFile* BNCollaborationUndoEntryGetFile(BNCollaborationUndoEntry* undoEntry) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationUndoEntryGetFile" + )] + internal static extern IntPtr BNCollaborationUndoEntryGetFile( + + // BNCollaborationUndoEntry* undoEntry + IntPtr undoEntry + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationUndoEntryGetId.cs b/Function/BNCollaborationUndoEntryGetId.cs new file mode 100644 index 0000000..e12108f --- /dev/null +++ b/Function/BNCollaborationUndoEntryGetId.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNCollaborationUndoEntryGetId(BNCollaborationUndoEntry* undoEntry) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationUndoEntryGetId" + )] + internal static extern ulong BNCollaborationUndoEntryGetId( + + // BNCollaborationUndoEntry* undoEntry + IntPtr undoEntry + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationUndoEntryGetParent.cs b/Function/BNCollaborationUndoEntryGetParent.cs new file mode 100644 index 0000000..972c695 --- /dev/null +++ b/Function/BNCollaborationUndoEntryGetParent.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNCollaborationUndoEntry* BNCollaborationUndoEntryGetParent(BNCollaborationUndoEntry* undoEntry) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationUndoEntryGetParent" + )] + internal static extern IntPtr BNCollaborationUndoEntryGetParent( + + // BNCollaborationUndoEntry* undoEntry + IntPtr undoEntry + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationUndoEntryGetParentId.cs b/Function/BNCollaborationUndoEntryGetParentId.cs new file mode 100644 index 0000000..6c79e23 --- /dev/null +++ b/Function/BNCollaborationUndoEntryGetParentId.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNCollaborationUndoEntryGetParentId(BNCollaborationUndoEntry* undoEntry, uint64_t* parentId) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationUndoEntryGetParentId" + )] + internal static extern bool BNCollaborationUndoEntryGetParentId( + + // BNCollaborationUndoEntry* undoEntry + IntPtr undoEntry , + + // uint64_t* parentId + IntPtr parentId + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationUndoEntryGetProject.cs b/Function/BNCollaborationUndoEntryGetProject.cs new file mode 100644 index 0000000..74fd236 --- /dev/null +++ b/Function/BNCollaborationUndoEntryGetProject.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRemoteProject* BNCollaborationUndoEntryGetProject(BNCollaborationUndoEntry* undoEntry) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationUndoEntryGetProject" + )] + internal static extern IntPtr BNCollaborationUndoEntryGetProject( + + // BNCollaborationUndoEntry* undoEntry + IntPtr undoEntry + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationUndoEntryGetRemote.cs b/Function/BNCollaborationUndoEntryGetRemote.cs new file mode 100644 index 0000000..884bd7c --- /dev/null +++ b/Function/BNCollaborationUndoEntryGetRemote.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRemote* BNCollaborationUndoEntryGetRemote(BNCollaborationUndoEntry* undoEntry) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationUndoEntryGetRemote" + )] + internal static extern IntPtr BNCollaborationUndoEntryGetRemote( + + // BNCollaborationUndoEntry* undoEntry + IntPtr undoEntry + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationUndoEntryGetSnapshot.cs b/Function/BNCollaborationUndoEntryGetSnapshot.cs new file mode 100644 index 0000000..a27e455 --- /dev/null +++ b/Function/BNCollaborationUndoEntryGetSnapshot.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNCollaborationSnapshot* BNCollaborationUndoEntryGetSnapshot(BNCollaborationUndoEntry* undoEntry) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationUndoEntryGetSnapshot" + )] + internal static extern IntPtr BNCollaborationUndoEntryGetSnapshot( + + // BNCollaborationUndoEntry* undoEntry + IntPtr undoEntry + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationUndoEntryGetUrl.cs b/Function/BNCollaborationUndoEntryGetUrl.cs new file mode 100644 index 0000000..82dc51b --- /dev/null +++ b/Function/BNCollaborationUndoEntryGetUrl.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNCollaborationUndoEntryGetUrl(BNCollaborationUndoEntry* undoEntry) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationUndoEntryGetUrl" + )] + internal static extern IntPtr BNCollaborationUndoEntryGetUrl( + + // BNCollaborationUndoEntry* undoEntry + IntPtr undoEntry + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationUploadDatabase.cs b/Function/BNCollaborationUploadDatabase.cs new file mode 100644 index 0000000..aad1fda --- /dev/null +++ b/Function/BNCollaborationUploadDatabase.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRemoteFile* BNCollaborationUploadDatabase(BNFileMetadata* metadata, BNRemoteProject* project, BNRemoteFolder* folder, void** progress, void* progressContext, void** nameChangeset, void* nameChangesetContext) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationUploadDatabase" + )] + internal static extern IntPtr BNCollaborationUploadDatabase( + + // BNFileMetadata* metadata + IntPtr metadata , + + // BNRemoteProject* project + IntPtr project , + + // BNRemoteFolder* folder + IntPtr folder , + + // void** progress + IntPtr progress , + + // void* progressContext + IntPtr progressContext , + + // void** nameChangeset + IntPtr nameChangeset , + + // void* nameChangesetContext + IntPtr nameChangesetContext + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationUploadTypeArchive.cs b/Function/BNCollaborationUploadTypeArchive.cs new file mode 100644 index 0000000..ead9c94 --- /dev/null +++ b/Function/BNCollaborationUploadTypeArchive.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNCollaborationUploadTypeArchive(BNTypeArchive* archive, BNRemoteProject* project, BNRemoteFolder* folder, void** progress, void* progressContext, BNProjectFile* coreFile, BNRemoteFile** result) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationUploadTypeArchive" + )] + internal static extern bool BNCollaborationUploadTypeArchive( + + // BNTypeArchive* archive + IntPtr archive , + + // BNRemoteProject* project + IntPtr project , + + // BNRemoteFolder* folder + IntPtr folder , + + // void** progress + IntPtr progress , + + // void* progressContext + IntPtr progressContext , + + // BNProjectFile* coreFile + IntPtr coreFile , + + // BNRemoteFile** result + IntPtr result + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationUserGetEmail.cs b/Function/BNCollaborationUserGetEmail.cs new file mode 100644 index 0000000..c70e61a --- /dev/null +++ b/Function/BNCollaborationUserGetEmail.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNCollaborationUserGetEmail(BNCollaborationUser* user) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationUserGetEmail" + )] + internal static extern IntPtr BNCollaborationUserGetEmail( + + // BNCollaborationUser* user + IntPtr user + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationUserGetId.cs b/Function/BNCollaborationUserGetId.cs new file mode 100644 index 0000000..3495f5c --- /dev/null +++ b/Function/BNCollaborationUserGetId.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNCollaborationUserGetId(BNCollaborationUser* user) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationUserGetId" + )] + internal static extern IntPtr BNCollaborationUserGetId( + + // BNCollaborationUser* user + IntPtr user + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationUserGetLastLogin.cs b/Function/BNCollaborationUserGetLastLogin.cs new file mode 100644 index 0000000..d052209 --- /dev/null +++ b/Function/BNCollaborationUserGetLastLogin.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNCollaborationUserGetLastLogin(BNCollaborationUser* user) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationUserGetLastLogin" + )] + internal static extern IntPtr BNCollaborationUserGetLastLogin( + + // BNCollaborationUser* user + IntPtr user + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationUserGetRemote.cs b/Function/BNCollaborationUserGetRemote.cs new file mode 100644 index 0000000..5fd8704 --- /dev/null +++ b/Function/BNCollaborationUserGetRemote.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRemote* BNCollaborationUserGetRemote(BNCollaborationUser* user) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationUserGetRemote" + )] + internal static extern IntPtr BNCollaborationUserGetRemote( + + // BNCollaborationUser* user + IntPtr user + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationUserGetUrl.cs b/Function/BNCollaborationUserGetUrl.cs new file mode 100644 index 0000000..f9fc711 --- /dev/null +++ b/Function/BNCollaborationUserGetUrl.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNCollaborationUserGetUrl(BNCollaborationUser* user) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationUserGetUrl" + )] + internal static extern IntPtr BNCollaborationUserGetUrl( + + // BNCollaborationUser* user + IntPtr user + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationUserGetUsername.cs b/Function/BNCollaborationUserGetUsername.cs new file mode 100644 index 0000000..819d311 --- /dev/null +++ b/Function/BNCollaborationUserGetUsername.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNCollaborationUserGetUsername(BNCollaborationUser* user) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationUserGetUsername" + )] + internal static extern IntPtr BNCollaborationUserGetUsername( + + // BNCollaborationUser* user + IntPtr user + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationUserIsActive.cs b/Function/BNCollaborationUserIsActive.cs new file mode 100644 index 0000000..9226940 --- /dev/null +++ b/Function/BNCollaborationUserIsActive.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNCollaborationUserIsActive(BNCollaborationUser* user) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationUserIsActive" + )] + internal static extern bool BNCollaborationUserIsActive( + + // BNCollaborationUser* user + IntPtr user + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationUserSetEmail.cs b/Function/BNCollaborationUserSetEmail.cs new file mode 100644 index 0000000..efe26ad --- /dev/null +++ b/Function/BNCollaborationUserSetEmail.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNCollaborationUserSetEmail(BNCollaborationUser* user, const char* email) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCollaborationUserSetEmail" + )] + internal static extern bool BNCollaborationUserSetEmail( + + // BNCollaborationUser* user + IntPtr user , + + // const char* email + string email + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationUserSetIsActive.cs b/Function/BNCollaborationUserSetIsActive.cs new file mode 100644 index 0000000..c2aef88 --- /dev/null +++ b/Function/BNCollaborationUserSetIsActive.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNCollaborationUserSetIsActive(BNCollaborationUser* user, bool isActive) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCollaborationUserSetIsActive" + )] + internal static extern bool BNCollaborationUserSetIsActive( + + // BNCollaborationUser* user + IntPtr user , + + // bool isActive + bool isActive + ); + } +} \ No newline at end of file diff --git a/Function/BNCollaborationUserSetUsername.cs b/Function/BNCollaborationUserSetUsername.cs new file mode 100644 index 0000000..2c316c2 --- /dev/null +++ b/Function/BNCollaborationUserSetUsername.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNCollaborationUserSetUsername(BNCollaborationUser* user, const char* username) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCollaborationUserSetUsername" + )] + internal static extern bool BNCollaborationUserSetUsername( + + // BNCollaborationUser* user + IntPtr user , + + // const char* username + string username + ); + } +} \ No newline at end of file diff --git a/Function/BNCommitUndoActions.cs b/Function/BNCommitUndoActions.cs new file mode 100644 index 0000000..a7d0b7b --- /dev/null +++ b/Function/BNCommitUndoActions.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNCommitUndoActions(BNFileMetadata* file, const char* id) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCommitUndoActions" + )] + internal static extern void BNCommitUndoActions( + + // BNFileMetadata* file + IntPtr file , + + // const char* id + string id + ); + } +} \ No newline at end of file diff --git a/Function/BNCompareLinearViewCursors.cs b/Function/BNCompareLinearViewCursors.cs new file mode 100644 index 0000000..612166f --- /dev/null +++ b/Function/BNCompareLinearViewCursors.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// int32_t BNCompareLinearViewCursors(BNLinearViewCursor* a, BNLinearViewCursor* b) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCompareLinearViewCursors" + )] + internal static extern int BNCompareLinearViewCursors( + + // BNLinearViewCursor* a + IntPtr a , + + // BNLinearViewCursor* b + IntPtr b + ); + } +} \ No newline at end of file diff --git a/Function/BNCompareLinearViewObjectChildren.cs b/Function/BNCompareLinearViewObjectChildren.cs new file mode 100644 index 0000000..7baa268 --- /dev/null +++ b/Function/BNCompareLinearViewObjectChildren.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// int32_t BNCompareLinearViewObjectChildren(BNLinearViewObject* obj, BNLinearViewObject* a, BNLinearViewObject* b) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCompareLinearViewObjectChildren" + )] + internal static extern int BNCompareLinearViewObjectChildren( + + // BNLinearViewObject* obj + IntPtr obj , + + // BNLinearViewObject* a + IntPtr a , + + // BNLinearViewObject* b + IntPtr b + ); + } +} \ No newline at end of file diff --git a/Function/BNComponentAddAllMembersFromComponent.cs b/Function/BNComponentAddAllMembersFromComponent.cs new file mode 100644 index 0000000..ef3eaf0 --- /dev/null +++ b/Function/BNComponentAddAllMembersFromComponent.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNComponentAddAllMembersFromComponent(BNComponent* component, BNComponent* fromComponent) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNComponentAddAllMembersFromComponent" + )] + internal static extern void BNComponentAddAllMembersFromComponent( + + // BNComponent* component + IntPtr component , + + // BNComponent* fromComponent + IntPtr fromComponent + ); + } +} \ No newline at end of file diff --git a/Function/BNComponentAddComponent.cs b/Function/BNComponentAddComponent.cs new file mode 100644 index 0000000..19f2b86 --- /dev/null +++ b/Function/BNComponentAddComponent.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNComponentAddComponent(BNComponent* parent, BNComponent* component) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNComponentAddComponent" + )] + internal static extern bool BNComponentAddComponent( + + // BNComponent* parent + IntPtr parent , + + // BNComponent* component + IntPtr component + ); + } +} \ No newline at end of file diff --git a/Function/BNComponentAddDataVariable.cs b/Function/BNComponentAddDataVariable.cs new file mode 100644 index 0000000..cbf606a --- /dev/null +++ b/Function/BNComponentAddDataVariable.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNComponentAddDataVariable(BNComponent* component, uint64_t address) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNComponentAddDataVariable" + )] + internal static extern bool BNComponentAddDataVariable( + + // BNComponent* component + IntPtr component , + + // uint64_t address + ulong address + ); + } +} \ No newline at end of file diff --git a/Function/BNComponentAddFunctionReference.cs b/Function/BNComponentAddFunctionReference.cs new file mode 100644 index 0000000..6ca0da1 --- /dev/null +++ b/Function/BNComponentAddFunctionReference.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNComponentAddFunctionReference(BNComponent* component, BNFunction* function) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNComponentAddFunctionReference" + )] + internal static extern bool BNComponentAddFunctionReference( + + // BNComponent* component + IntPtr component , + + // BNFunction* function + IntPtr function + ); + } +} \ No newline at end of file diff --git a/Function/BNComponentContainsComponent.cs b/Function/BNComponentContainsComponent.cs new file mode 100644 index 0000000..f379793 --- /dev/null +++ b/Function/BNComponentContainsComponent.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNComponentContainsComponent(BNComponent* parent, BNComponent* component) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNComponentContainsComponent" + )] + internal static extern bool BNComponentContainsComponent( + + // BNComponent* parent + IntPtr parent , + + // BNComponent* component + IntPtr component + ); + } +} \ No newline at end of file diff --git a/Function/BNComponentContainsDataVariable.cs b/Function/BNComponentContainsDataVariable.cs new file mode 100644 index 0000000..5a752b4 --- /dev/null +++ b/Function/BNComponentContainsDataVariable.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNComponentContainsDataVariable(BNComponent* component, uint64_t address) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNComponentContainsDataVariable" + )] + internal static extern bool BNComponentContainsDataVariable( + + // BNComponent* component + IntPtr component , + + // uint64_t address + ulong address + ); + } +} \ No newline at end of file diff --git a/Function/BNComponentContainsFunction.cs b/Function/BNComponentContainsFunction.cs new file mode 100644 index 0000000..4dbdbdf --- /dev/null +++ b/Function/BNComponentContainsFunction.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNComponentContainsFunction(BNComponent* component, BNFunction* function) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNComponentContainsFunction" + )] + internal static extern bool BNComponentContainsFunction( + + // BNComponent* component + IntPtr component , + + // BNFunction* function + IntPtr function + ); + } +} \ No newline at end of file diff --git a/Function/BNComponentFreeReferencedTypes.cs b/Function/BNComponentFreeReferencedTypes.cs new file mode 100644 index 0000000..3d2af4e --- /dev/null +++ b/Function/BNComponentFreeReferencedTypes.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNComponentFreeReferencedTypes(BNType** types, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNComponentFreeReferencedTypes" + )] + internal static extern void BNComponentFreeReferencedTypes( + + // BNType** types + IntPtr types , + + // uint64_t count + ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNComponentGetContainedComponents.cs b/Function/BNComponentGetContainedComponents.cs new file mode 100644 index 0000000..677eddc --- /dev/null +++ b/Function/BNComponentGetContainedComponents.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNComponent** BNComponentGetContainedComponents(BNComponent* component, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNComponentGetContainedComponents" + )] + internal static extern IntPtr BNComponentGetContainedComponents( + + // BNComponent* component + IntPtr component , + + // uint64_t* count + IntPtr count + ); + } +} \ No newline at end of file diff --git a/Function/BNComponentGetContainedDataVariables.cs b/Function/BNComponentGetContainedDataVariables.cs new file mode 100644 index 0000000..4c7b9b6 --- /dev/null +++ b/Function/BNComponentGetContainedDataVariables.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDataVariable* BNComponentGetContainedDataVariables(BNComponent* component, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNComponentGetContainedDataVariables" + )] + internal static extern IntPtr BNComponentGetContainedDataVariables( + + // BNComponent* component + IntPtr component , + + // uint64_t* count + IntPtr count + ); + } +} \ No newline at end of file diff --git a/Function/BNComponentGetContainedFunctions.cs b/Function/BNComponentGetContainedFunctions.cs new file mode 100644 index 0000000..18cb4c3 --- /dev/null +++ b/Function/BNComponentGetContainedFunctions.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFunction** BNComponentGetContainedFunctions(BNComponent* component, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNComponentGetContainedFunctions" + )] + internal static extern IntPtr BNComponentGetContainedFunctions( + + // BNComponent* component + IntPtr component , + + // uint64_t* count + IntPtr count + ); + } +} \ No newline at end of file diff --git a/Function/BNComponentGetDisplayName.cs b/Function/BNComponentGetDisplayName.cs new file mode 100644 index 0000000..565358a --- /dev/null +++ b/Function/BNComponentGetDisplayName.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNComponentGetDisplayName(BNComponent* component) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNComponentGetDisplayName" + )] + internal static extern IntPtr BNComponentGetDisplayName( + + // BNComponent* component + IntPtr component + ); + } +} \ No newline at end of file diff --git a/Function/BNComponentGetGuid.cs b/Function/BNComponentGetGuid.cs new file mode 100644 index 0000000..4c7815e --- /dev/null +++ b/Function/BNComponentGetGuid.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNComponentGetGuid(BNComponent* component) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNComponentGetGuid" + )] + internal static extern IntPtr BNComponentGetGuid( + + // BNComponent* component + IntPtr component + ); + } +} \ No newline at end of file diff --git a/Function/BNComponentGetOriginalName.cs b/Function/BNComponentGetOriginalName.cs new file mode 100644 index 0000000..6549a4b --- /dev/null +++ b/Function/BNComponentGetOriginalName.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNComponentGetOriginalName(BNComponent* component) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNComponentGetOriginalName" + )] + internal static extern IntPtr BNComponentGetOriginalName( + + // BNComponent* component + IntPtr component + ); + } +} \ No newline at end of file diff --git a/Function/BNComponentGetParent.cs b/Function/BNComponentGetParent.cs new file mode 100644 index 0000000..4ee4a72 --- /dev/null +++ b/Function/BNComponentGetParent.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNComponent* BNComponentGetParent(BNComponent* component) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNComponentGetParent" + )] + internal static extern IntPtr BNComponentGetParent( + + // BNComponent* component + IntPtr component + ); + } +} \ No newline at end of file diff --git a/Function/BNComponentGetReferencedDataVariables.cs b/Function/BNComponentGetReferencedDataVariables.cs new file mode 100644 index 0000000..3e7baee --- /dev/null +++ b/Function/BNComponentGetReferencedDataVariables.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDataVariable* BNComponentGetReferencedDataVariables(BNComponent* component, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNComponentGetReferencedDataVariables" + )] + internal static extern IntPtr BNComponentGetReferencedDataVariables( + + // BNComponent* component + IntPtr component , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNComponentGetReferencedDataVariablesRecursive.cs b/Function/BNComponentGetReferencedDataVariablesRecursive.cs new file mode 100644 index 0000000..bc5a1b9 --- /dev/null +++ b/Function/BNComponentGetReferencedDataVariablesRecursive.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDataVariable* BNComponentGetReferencedDataVariablesRecursive(BNComponent* component, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNComponentGetReferencedDataVariablesRecursive" + )] + internal static extern IntPtr BNComponentGetReferencedDataVariablesRecursive( + + // BNComponent* component + IntPtr component , + + // uint64_t* count + IntPtr count + ); + } +} \ No newline at end of file diff --git a/Function/BNComponentGetReferencedTypes.cs b/Function/BNComponentGetReferencedTypes.cs new file mode 100644 index 0000000..a6ed59a --- /dev/null +++ b/Function/BNComponentGetReferencedTypes.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNType** BNComponentGetReferencedTypes(BNComponent* component, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNComponentGetReferencedTypes" + )] + internal static extern IntPtr BNComponentGetReferencedTypes( + + // BNComponent* component + IntPtr component , + + // uint64_t* count + IntPtr count + ); + } +} \ No newline at end of file diff --git a/Function/BNComponentGetReferencedTypesRecursive.cs b/Function/BNComponentGetReferencedTypesRecursive.cs new file mode 100644 index 0000000..03fed7e --- /dev/null +++ b/Function/BNComponentGetReferencedTypesRecursive.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNType** BNComponentGetReferencedTypesRecursive(BNComponent* component, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNComponentGetReferencedTypesRecursive" + )] + internal static extern IntPtr BNComponentGetReferencedTypesRecursive( + + // BNComponent* component + IntPtr component , + + // uint64_t* count + IntPtr count + ); + } +} \ No newline at end of file diff --git a/Function/BNComponentGetView.cs b/Function/BNComponentGetView.cs new file mode 100644 index 0000000..cd2bdc0 --- /dev/null +++ b/Function/BNComponentGetView.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBinaryView* BNComponentGetView(BNComponent* component) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNComponentGetView" + )] + internal static extern IntPtr BNComponentGetView( + + // BNComponent* component + IntPtr component + ); + } +} \ No newline at end of file diff --git a/Function/BNComponentRemoveAllFunctions.cs b/Function/BNComponentRemoveAllFunctions.cs new file mode 100644 index 0000000..bbb59c8 --- /dev/null +++ b/Function/BNComponentRemoveAllFunctions.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNComponentRemoveAllFunctions(BNComponent* component) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNComponentRemoveAllFunctions" + )] + internal static extern void BNComponentRemoveAllFunctions( + + // BNComponent* component + IntPtr component + ); + } +} \ No newline at end of file diff --git a/Function/BNComponentRemoveComponent.cs b/Function/BNComponentRemoveComponent.cs new file mode 100644 index 0000000..c756c69 --- /dev/null +++ b/Function/BNComponentRemoveComponent.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNComponentRemoveComponent(BNComponent* component) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNComponentRemoveComponent" + )] + internal static extern bool BNComponentRemoveComponent( + + // BNComponent* component + IntPtr component + ); + } +} \ No newline at end of file diff --git a/Function/BNComponentRemoveDataVariable.cs b/Function/BNComponentRemoveDataVariable.cs new file mode 100644 index 0000000..73544a5 --- /dev/null +++ b/Function/BNComponentRemoveDataVariable.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNComponentRemoveDataVariable(BNComponent* component, uint64_t address) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNComponentRemoveDataVariable" + )] + internal static extern bool BNComponentRemoveDataVariable( + + // BNComponent* component + IntPtr component , + + // uint64_t address + ulong address + ); + } +} \ No newline at end of file diff --git a/Function/BNComponentRemoveFunctionReference.cs b/Function/BNComponentRemoveFunctionReference.cs new file mode 100644 index 0000000..b2a4aef --- /dev/null +++ b/Function/BNComponentRemoveFunctionReference.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNComponentRemoveFunctionReference(BNComponent* component, BNFunction* function) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNComponentRemoveFunctionReference" + )] + internal static extern bool BNComponentRemoveFunctionReference( + + // BNComponent* component + IntPtr component , + + // BNFunction* function + IntPtr function + ); + } +} \ No newline at end of file diff --git a/Function/BNComponentSetName.cs b/Function/BNComponentSetName.cs new file mode 100644 index 0000000..0534ef5 --- /dev/null +++ b/Function/BNComponentSetName.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNComponentSetName(BNComponent* component, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNComponentSetName" + )] + internal static extern void BNComponentSetName( + + // BNComponent* component + IntPtr component , + + // const char* name + string name + ); + } +} \ No newline at end of file diff --git a/Function/BNComponentsEqual.cs b/Function/BNComponentsEqual.cs new file mode 100644 index 0000000..d8e3c72 --- /dev/null +++ b/Function/BNComponentsEqual.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNComponentsEqual(BNComponent* a, BNComponent* b) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNComponentsEqual" + )] + internal static extern bool BNComponentsEqual( + + // BNComponent* a + IntPtr a , + + // BNComponent* b + IntPtr b + ); + } +} \ No newline at end of file diff --git a/Function/BNComponentsNotEqual.cs b/Function/BNComponentsNotEqual.cs new file mode 100644 index 0000000..8bcb270 --- /dev/null +++ b/Function/BNComponentsNotEqual.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNComponentsNotEqual(BNComponent* a, BNComponent* b) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNComponentsNotEqual" + )] + internal static extern bool BNComponentsNotEqual( + + // BNComponent* a + IntPtr a , + + // BNComponent* b + IntPtr b + ); + } +} \ No newline at end of file diff --git a/Function/BNConnectEnterpriseServer.cs b/Function/BNConnectEnterpriseServer.cs new file mode 100644 index 0000000..e3cb570 --- /dev/null +++ b/Function/BNConnectEnterpriseServer.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNConnectEnterpriseServer() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNConnectEnterpriseServer" + )] + public static extern bool BNConnectEnterpriseServer(); + } +} \ No newline at end of file diff --git a/Function/BNConnectWebsocketClient.cs b/Function/BNConnectWebsocketClient.cs new file mode 100644 index 0000000..e154479 --- /dev/null +++ b/Function/BNConnectWebsocketClient.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNConnectWebsocketClient(BNWebsocketClient* client, const char* url, uint64_t headerCount, const char** headerKeys, const char** headerValues, BNWebsocketClientOutputCallbacks* callbacks) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNConnectWebsocketClient" + )] + internal static extern bool BNConnectWebsocketClient( + + // BNWebsocketClient* client + IntPtr client , + + // const char* url + string url , + + // uint64_t headerCount + ulong headerCount , + + // const char** headerKeys + string[] headerKeys , + + // const char** headerValues + string[] headerValues , + + // BNWebsocketClientOutputCallbacks* callbacks + IntPtr callbacks + ); + } +} \ No newline at end of file diff --git a/Function/BNConvertToNop.cs b/Function/BNConvertToNop.cs new file mode 100644 index 0000000..89fb7fd --- /dev/null +++ b/Function/BNConvertToNop.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNConvertToNop(BNBinaryView* view, BNArchitecture* arch, uint64_t addr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNConvertToNop" + )] + internal static extern bool BNConvertToNop( + + // BNBinaryView* view + IntPtr view , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t addr + ulong addr + ); + } +} \ No newline at end of file diff --git a/Function/BNCopyFile.cs b/Function/BNCopyFile.cs new file mode 100644 index 0000000..552af8f --- /dev/null +++ b/Function/BNCopyFile.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNCopyFile(const char* source, const char* dest) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCopyFile" + )] + internal static extern bool BNCopyFile( + + // const char* source + string source , + + // const char* dest + string dest + ); + } +} \ No newline at end of file diff --git a/Function/BNCoreEnumFromString.cs b/Function/BNCoreEnumFromString.cs new file mode 100644 index 0000000..3e9c773 --- /dev/null +++ b/Function/BNCoreEnumFromString.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNCoreEnumFromString(const char* enumName, const char* value, uint64_t* result) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCoreEnumFromString" + )] + internal static extern bool BNCoreEnumFromString( + + // const char* enumName + string enumName , + + // const char* _value + string _value , + + // uint64_t* result + IntPtr result + ); + } +} \ No newline at end of file diff --git a/Function/BNCoreEnumToString.cs b/Function/BNCoreEnumToString.cs new file mode 100644 index 0000000..5412839 --- /dev/null +++ b/Function/BNCoreEnumToString.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNCoreEnumToString(const char* enumName, uint64_t value, const char** result) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCoreEnumToString" + )] + internal static extern bool BNCoreEnumToString( + + // const char* enumName + string enumName , + + // uint64_t _value + ulong _value , + + // const char** result + string[] result + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateActivity.cs b/Function/BNCreateActivity.cs new file mode 100644 index 0000000..6e4e5cf --- /dev/null +++ b/Function/BNCreateActivity.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNActivity* BNCreateActivity(const char* configuration, void* ctxt, void** action) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCreateActivity" + )] + internal static extern IntPtr BNCreateActivity( + + // const char* configuration + string configuration , + + // void* ctxt + IntPtr ctxt , + + // void** action + IntPtr action + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateActivityWithEligibility.cs b/Function/BNCreateActivityWithEligibility.cs new file mode 100644 index 0000000..f8d3b07 --- /dev/null +++ b/Function/BNCreateActivityWithEligibility.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNActivity* BNCreateActivityWithEligibility(const char* configuration, void* ctxt, void** action, void** eligibilityHandler) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCreateActivityWithEligibility" + )] + internal static extern IntPtr BNCreateActivityWithEligibility( + + // const char* configuration + string configuration , + + // void* ctxt + IntPtr ctxt , + + // void** action + IntPtr action , + + // void** eligibilityHandler + IntPtr eligibilityHandler + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateAnalysisContext.cs b/Function/BNCreateAnalysisContext.cs new file mode 100644 index 0000000..bc0347d --- /dev/null +++ b/Function/BNCreateAnalysisContext.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNAnalysisContext* BNCreateAnalysisContext() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateAnalysisContext" + )] + internal static extern IntPtr BNCreateAnalysisContext(); + } +} \ No newline at end of file diff --git a/Function/BNCreateArrayType.cs b/Function/BNCreateArrayType.cs new file mode 100644 index 0000000..b1d7674 --- /dev/null +++ b/Function/BNCreateArrayType.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNType* BNCreateArrayType(BNTypeWithConfidence* type, uint64_t elem) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateArrayType" + )] + internal static extern IntPtr BNCreateArrayType( + + // BNTypeWithConfidence* type + in BNTypeWithConfidence type , + + // uint64_t elem + ulong elem + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateArrayTypeBuilder.cs b/Function/BNCreateArrayTypeBuilder.cs new file mode 100644 index 0000000..d916acb --- /dev/null +++ b/Function/BNCreateArrayTypeBuilder.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeBuilder* BNCreateArrayTypeBuilder(BNTypeWithConfidence* type, uint64_t elem) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateArrayTypeBuilder" + )] + internal static extern IntPtr BNCreateArrayTypeBuilder( + + // BNTypeWithConfidence* type + in BNTypeWithConfidence type , + + // uint64_t elem + ulong elem + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateAutoStackVariable.cs b/Function/BNCreateAutoStackVariable.cs new file mode 100644 index 0000000..7b17900 --- /dev/null +++ b/Function/BNCreateAutoStackVariable.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNCreateAutoStackVariable(BNFunction* func, int64_t offset, BNTypeWithConfidence* type, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCreateAutoStackVariable" + )] + internal static extern void BNCreateAutoStackVariable( + + // BNFunction* func + IntPtr func , + + // int64_t offset + long offset , + + // BNTypeWithConfidence* type + IntPtr type , + + // const char* name + string name + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateAutoVariable.cs b/Function/BNCreateAutoVariable.cs new file mode 100644 index 0000000..20a7dd2 --- /dev/null +++ b/Function/BNCreateAutoVariable.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNCreateAutoVariable(BNFunction* func, BNVariable* var, BNTypeWithConfidence* type, const char* name, bool ignoreDisjointUses) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCreateAutoVariable" + )] + internal static extern void BNCreateAutoVariable( + + // BNFunction* func + IntPtr func , + + // BNVariable* _var + IntPtr _var , + + // BNTypeWithConfidence* type + IntPtr type , + + // const char* name + string name , + + // bool ignoreDisjointUses + bool ignoreDisjointUses + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateBaseAddressDetection.cs b/Function/BNCreateBaseAddressDetection.cs new file mode 100644 index 0000000..d7ba7e0 --- /dev/null +++ b/Function/BNCreateBaseAddressDetection.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBaseAddressDetection* BNCreateBaseAddressDetection(BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateBaseAddressDetection" + )] + internal static extern IntPtr BNCreateBaseAddressDetection( + + // BNBinaryView* view + IntPtr view + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateBinaryDataView.cs b/Function/BNCreateBinaryDataView.cs new file mode 100644 index 0000000..7ecfa10 --- /dev/null +++ b/Function/BNCreateBinaryDataView.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBinaryView* BNCreateBinaryDataView(BNFileMetadata* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateBinaryDataView" + )] + internal static extern IntPtr BNCreateBinaryDataView( + + // BNFileMetadata* file + IntPtr file + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateBinaryDataViewFromBuffer.cs b/Function/BNCreateBinaryDataViewFromBuffer.cs new file mode 100644 index 0000000..a05d832 --- /dev/null +++ b/Function/BNCreateBinaryDataViewFromBuffer.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBinaryView* BNCreateBinaryDataViewFromBuffer(BNFileMetadata* file, BNDataBuffer* buf) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateBinaryDataViewFromBuffer" + )] + internal static extern IntPtr BNCreateBinaryDataViewFromBuffer( + + // BNFileMetadata* file + IntPtr file , + + // BNDataBuffer* buf + IntPtr buf + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateBinaryDataViewFromData.cs b/Function/BNCreateBinaryDataViewFromData.cs new file mode 100644 index 0000000..fa4989b --- /dev/null +++ b/Function/BNCreateBinaryDataViewFromData.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBinaryView* BNCreateBinaryDataViewFromData(BNFileMetadata* file, void* data, uint64_t len) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateBinaryDataViewFromData" + )] + internal static extern IntPtr BNCreateBinaryDataViewFromData( + + // BNFileMetadata* file + IntPtr file , + + // void* data + byte[] data , + + // uint64_t len + ulong len + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateBinaryDataViewFromFile.cs b/Function/BNCreateBinaryDataViewFromFile.cs new file mode 100644 index 0000000..4b4386d --- /dev/null +++ b/Function/BNCreateBinaryDataViewFromFile.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBinaryView* BNCreateBinaryDataViewFromFile(BNFileMetadata* file, BNFileAccessor* accessor) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateBinaryDataViewFromFile" + )] + internal static extern IntPtr BNCreateBinaryDataViewFromFile( + + // BNFileMetadata* file + IntPtr file , + + // BNFileAccessor* accessor + IntPtr accessor + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateBinaryDataViewFromFilename.cs b/Function/BNCreateBinaryDataViewFromFilename.cs new file mode 100644 index 0000000..627a5c6 --- /dev/null +++ b/Function/BNCreateBinaryDataViewFromFilename.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBinaryView* BNCreateBinaryDataViewFromFilename(BNFileMetadata* file, const char* filename) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCreateBinaryDataViewFromFilename" + )] + internal static extern IntPtr BNCreateBinaryDataViewFromFilename( + + // BNFileMetadata* file + IntPtr file , + + // const char* filename + string filename + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateBinaryReader.cs b/Function/BNCreateBinaryReader.cs new file mode 100644 index 0000000..43bf6a3 --- /dev/null +++ b/Function/BNCreateBinaryReader.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBinaryReader* BNCreateBinaryReader(BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateBinaryReader" + )] + internal static extern IntPtr BNCreateBinaryReader( + + // BNBinaryView* view + IntPtr view + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateBinaryViewOfType.cs b/Function/BNCreateBinaryViewOfType.cs new file mode 100644 index 0000000..ab74960 --- /dev/null +++ b/Function/BNCreateBinaryViewOfType.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBinaryView* BNCreateBinaryViewOfType(BNBinaryViewType* type, BNBinaryView* data) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateBinaryViewOfType" + )] + internal static extern IntPtr BNCreateBinaryViewOfType( + + // BNBinaryViewType* type + IntPtr type , + + // BNBinaryView* data + IntPtr data + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateBinaryWriter.cs b/Function/BNCreateBinaryWriter.cs new file mode 100644 index 0000000..4f97f16 --- /dev/null +++ b/Function/BNCreateBinaryWriter.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBinaryWriter* BNCreateBinaryWriter(BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateBinaryWriter" + )] + internal static extern IntPtr BNCreateBinaryWriter( + + // BNBinaryView* view + IntPtr view + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateBoolType.cs b/Function/BNCreateBoolType.cs new file mode 100644 index 0000000..be11ebb --- /dev/null +++ b/Function/BNCreateBoolType.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNType* BNCreateBoolType() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateBoolType" + )] + internal static extern IntPtr BNCreateBoolType(); + } +} \ No newline at end of file diff --git a/Function/BNCreateBoolTypeBuilder.cs b/Function/BNCreateBoolTypeBuilder.cs new file mode 100644 index 0000000..bd4508a --- /dev/null +++ b/Function/BNCreateBoolTypeBuilder.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeBuilder* BNCreateBoolTypeBuilder() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateBoolTypeBuilder" + )] + internal static extern IntPtr BNCreateBoolTypeBuilder(); + } +} \ No newline at end of file diff --git a/Function/BNCreateCallingConvention.cs b/Function/BNCreateCallingConvention.cs new file mode 100644 index 0000000..7c9d830 --- /dev/null +++ b/Function/BNCreateCallingConvention.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNCallingConvention* BNCreateCallingConvention(BNArchitecture* arch, const char* name, BNCustomCallingConvention* cc) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCreateCallingConvention" + )] + internal static extern IntPtr BNCreateCallingConvention( + + // BNArchitecture* arch + IntPtr arch , + + // const char* name + string name , + + // BNCustomCallingConvention* cc + IntPtr cc + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateComponent.cs b/Function/BNCreateComponent.cs new file mode 100644 index 0000000..8974278 --- /dev/null +++ b/Function/BNCreateComponent.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNComponent* BNCreateComponent(BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateComponent" + )] + internal static extern IntPtr BNCreateComponent( + + // BNBinaryView* view + IntPtr view + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateComponentWithName.cs b/Function/BNCreateComponentWithName.cs new file mode 100644 index 0000000..67a59a5 --- /dev/null +++ b/Function/BNCreateComponentWithName.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNComponent* BNCreateComponentWithName(BNBinaryView* view, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCreateComponentWithName" + )] + internal static extern IntPtr BNCreateComponentWithName( + + // BNBinaryView* view + IntPtr view , + + // const char* name + string name + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateComponentWithParent.cs b/Function/BNCreateComponentWithParent.cs new file mode 100644 index 0000000..87a12a4 --- /dev/null +++ b/Function/BNCreateComponentWithParent.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNComponent* BNCreateComponentWithParent(BNBinaryView* view, const char* parentGUID) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCreateComponentWithParent" + )] + internal static extern IntPtr BNCreateComponentWithParent( + + // BNBinaryView* view + IntPtr view , + + // const char* parentGUID + string parentGUID + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateComponentWithParentAndName.cs b/Function/BNCreateComponentWithParentAndName.cs new file mode 100644 index 0000000..a2e3745 --- /dev/null +++ b/Function/BNCreateComponentWithParentAndName.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNComponent* BNCreateComponentWithParentAndName(BNBinaryView* view, const char* parentGUID, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCreateComponentWithParentAndName" + )] + internal static extern IntPtr BNCreateComponentWithParentAndName( + + // BNBinaryView* view + IntPtr view , + + // const char* parentGUID + string parentGUID , + + // const char* name + string name + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateCustomBinaryView.cs b/Function/BNCreateCustomBinaryView.cs new file mode 100644 index 0000000..0486b6b --- /dev/null +++ b/Function/BNCreateCustomBinaryView.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBinaryView* BNCreateCustomBinaryView(const char* name, BNFileMetadata* file, BNBinaryView* parent, BNCustomBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateCustomBinaryView" + )] + internal static extern IntPtr BNCreateCustomBinaryView( + + // const char* name + string name , + + // BNFileMetadata* file + IntPtr file , + + // BNBinaryView* parent + IntPtr parent , + + // BNCustomBinaryView* view + in BNCustomBinaryView view + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateCustomFlowGraph.cs b/Function/BNCreateCustomFlowGraph.cs new file mode 100644 index 0000000..f2e4f05 --- /dev/null +++ b/Function/BNCreateCustomFlowGraph.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFlowGraph* BNCreateCustomFlowGraph(BNCustomFlowGraph* callbacks) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateCustomFlowGraph" + )] + internal static extern IntPtr BNCreateCustomFlowGraph( + + // BNCustomFlowGraph* callbacks + IntPtr callbacks + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateCustomLanguageRepresentationFunction.cs b/Function/BNCreateCustomLanguageRepresentationFunction.cs new file mode 100644 index 0000000..d431031 --- /dev/null +++ b/Function/BNCreateCustomLanguageRepresentationFunction.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLanguageRepresentationFunction* BNCreateCustomLanguageRepresentationFunction(BNLanguageRepresentationFunctionType* type, BNArchitecture* arch, BNFunction* func, BNHighLevelILFunction* highLevelIL, BNCustomLanguageRepresentationFunction* callbacks) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateCustomLanguageRepresentationFunction" + )] + internal static extern IntPtr BNCreateCustomLanguageRepresentationFunction( + + // BNLanguageRepresentationFunctionType* type + IntPtr type , + + // BNArchitecture* arch + IntPtr arch , + + // BNFunction* func + IntPtr func , + + // BNHighLevelILFunction* highLevelIL + IntPtr highLevelIL , + + // BNCustomLanguageRepresentationFunction* callbacks + IntPtr callbacks + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateCustomPlatform.cs b/Function/BNCreateCustomPlatform.cs new file mode 100644 index 0000000..7aa6ce5 --- /dev/null +++ b/Function/BNCreateCustomPlatform.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNPlatform* BNCreateCustomPlatform(BNArchitecture* arch, const char* name, BNCustomPlatform* impl) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCreateCustomPlatform" + )] + internal static extern IntPtr BNCreateCustomPlatform( + + // BNArchitecture* arch + IntPtr arch , + + // const char* name + string name , + + // BNCustomPlatform* impl + IntPtr impl + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateCustomPlatformWithTypes.cs b/Function/BNCreateCustomPlatformWithTypes.cs new file mode 100644 index 0000000..f506698 --- /dev/null +++ b/Function/BNCreateCustomPlatformWithTypes.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNPlatform* BNCreateCustomPlatformWithTypes(BNArchitecture* arch, const char* name, BNCustomPlatform* impl, const char* typeFile, const char** includeDirs, uint64_t includeDirCount) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCreateCustomPlatformWithTypes" + )] + internal static extern IntPtr BNCreateCustomPlatformWithTypes( + + // BNArchitecture* arch + IntPtr arch , + + // const char* name + string name , + + // BNCustomPlatform* impl + IntPtr impl , + + // const char* typeFile + string typeFile , + + // const char** includeDirs + string[] includeDirs , + + // uint64_t includeDirCount + ulong includeDirCount + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateDataBuffer.cs b/Function/BNCreateDataBuffer.cs new file mode 100644 index 0000000..81e81fe --- /dev/null +++ b/Function/BNCreateDataBuffer.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDataBuffer* BNCreateDataBuffer(void* data, uint64_t len) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateDataBuffer" + )] + internal static extern IntPtr BNCreateDataBuffer( + + // void* data + byte[] data , + + // uint64_t len + ulong len + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateDataRenderer.cs b/Function/BNCreateDataRenderer.cs new file mode 100644 index 0000000..8855389 --- /dev/null +++ b/Function/BNCreateDataRenderer.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDataRenderer* BNCreateDataRenderer(BNCustomDataRenderer* renderer) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateDataRenderer" + )] + internal static extern IntPtr BNCreateDataRenderer( + + // BNCustomDataRenderer* renderer + IntPtr renderer + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateDatabase.cs b/Function/BNCreateDatabase.cs new file mode 100644 index 0000000..cd6a520 --- /dev/null +++ b/Function/BNCreateDatabase.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNCreateDatabase(BNBinaryView* data, const char* path, BNSaveSettings* settings) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCreateDatabase" + )] + internal static extern bool BNCreateDatabase( + + // BNBinaryView* data + IntPtr data , + + // const char* path + string path , + + // BNSaveSettings* settings + IntPtr settings + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateDatabaseWithProgress.cs b/Function/BNCreateDatabaseWithProgress.cs new file mode 100644 index 0000000..7be0f51 --- /dev/null +++ b/Function/BNCreateDatabaseWithProgress.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNCreateDatabaseWithProgress(BNBinaryView* data, const char* path, void* ctxt, void** progress, BNSaveSettings* settings) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCreateDatabaseWithProgress" + )] + internal static extern bool BNCreateDatabaseWithProgress( + + // BNBinaryView* data + IntPtr data , + + // const char* path + string path , + + // void* ctxt + IntPtr ctxt , + + // void* progress + IntPtr progress , + + // BNSaveSettings* settings + IntPtr settings + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateDirectory.cs b/Function/BNCreateDirectory.cs new file mode 100644 index 0000000..4e87b4a --- /dev/null +++ b/Function/BNCreateDirectory.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNCreateDirectory(const char* path, bool createSubdirectories) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCreateDirectory" + )] + internal static extern bool BNCreateDirectory( + + // const char* path + string path , + + // bool createSubdirectories + bool createSubdirectories + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateDisassemblySettings.cs b/Function/BNCreateDisassemblySettings.cs new file mode 100644 index 0000000..68b29e4 --- /dev/null +++ b/Function/BNCreateDisassemblySettings.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDisassemblySettings* BNCreateDisassemblySettings() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateDisassemblySettings" + )] + internal static extern IntPtr BNCreateDisassemblySettings(); + } +} \ No newline at end of file diff --git a/Function/BNCreateDisassemblyTextRenderer.cs b/Function/BNCreateDisassemblyTextRenderer.cs new file mode 100644 index 0000000..52fe4cf --- /dev/null +++ b/Function/BNCreateDisassemblyTextRenderer.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDisassemblyTextRenderer* BNCreateDisassemblyTextRenderer(BNFunction* func, BNDisassemblySettings* settings) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateDisassemblyTextRenderer" + )] + internal static extern IntPtr BNCreateDisassemblyTextRenderer( + + // BNFunction* func + IntPtr func , + + // BNDisassemblySettings* settings + IntPtr settings + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateDownloadProviderInstance.cs b/Function/BNCreateDownloadProviderInstance.cs new file mode 100644 index 0000000..b52319c --- /dev/null +++ b/Function/BNCreateDownloadProviderInstance.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDownloadInstance* BNCreateDownloadProviderInstance(BNDownloadProvider* provider) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateDownloadProviderInstance" + )] + internal static extern IntPtr BNCreateDownloadProviderInstance( + + // BNDownloadProvider* provider + IntPtr provider + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateEnumerationBuilder.cs b/Function/BNCreateEnumerationBuilder.cs new file mode 100644 index 0000000..83c10ed --- /dev/null +++ b/Function/BNCreateEnumerationBuilder.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNEnumerationBuilder* BNCreateEnumerationBuilder() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateEnumerationBuilder" + )] + internal static extern IntPtr BNCreateEnumerationBuilder(); + } +} \ No newline at end of file diff --git a/Function/BNCreateEnumerationBuilderFromEnumeration.cs b/Function/BNCreateEnumerationBuilderFromEnumeration.cs new file mode 100644 index 0000000..2e5319d --- /dev/null +++ b/Function/BNCreateEnumerationBuilderFromEnumeration.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNEnumerationBuilder* BNCreateEnumerationBuilderFromEnumeration(BNEnumeration* e) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateEnumerationBuilderFromEnumeration" + )] + internal static extern IntPtr BNCreateEnumerationBuilderFromEnumeration( + + // BNEnumeration* e + IntPtr e + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateEnumerationType.cs b/Function/BNCreateEnumerationType.cs new file mode 100644 index 0000000..211a15f --- /dev/null +++ b/Function/BNCreateEnumerationType.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNType* BNCreateEnumerationType(BNArchitecture* arch, BNEnumeration* e, uint64_t width, BNBoolWithConfidence* isSigned) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateEnumerationType" + )] + internal static extern IntPtr BNCreateEnumerationType( + + // BNArchitecture* arch + IntPtr arch , + + // BNEnumeration* e + IntPtr e , + + // uint64_t width + ulong width , + + // BNBoolWithConfidence* isSigned + IntPtr isSigned + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateEnumerationTypeBuilder.cs b/Function/BNCreateEnumerationTypeBuilder.cs new file mode 100644 index 0000000..397d640 --- /dev/null +++ b/Function/BNCreateEnumerationTypeBuilder.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeBuilder* BNCreateEnumerationTypeBuilder(BNArchitecture* arch, BNEnumeration* e, uint64_t width, BNBoolWithConfidence* isSigned) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateEnumerationTypeBuilder" + )] + internal static extern IntPtr BNCreateEnumerationTypeBuilder( + + // BNArchitecture* arch + IntPtr arch , + + // BNEnumeration* e + IntPtr e , + + // uint64_t width + ulong width , + + // BNBoolWithConfidence* isSigned + IntPtr isSigned + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateEnumerationTypeBuilderWithBuilder.cs b/Function/BNCreateEnumerationTypeBuilderWithBuilder.cs new file mode 100644 index 0000000..172f45c --- /dev/null +++ b/Function/BNCreateEnumerationTypeBuilderWithBuilder.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeBuilder* BNCreateEnumerationTypeBuilderWithBuilder(BNArchitecture* arch, BNEnumerationBuilder* e, uint64_t width, BNBoolWithConfidence* isSigned) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateEnumerationTypeBuilderWithBuilder" + )] + internal static extern IntPtr BNCreateEnumerationTypeBuilderWithBuilder( + + // BNArchitecture* arch + IntPtr arch , + + // BNEnumerationBuilder* e + IntPtr e , + + // uint64_t width + ulong width , + + // BNBoolWithConfidence* isSigned + IntPtr isSigned + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateEnumerationTypeOfWidth.cs b/Function/BNCreateEnumerationTypeOfWidth.cs new file mode 100644 index 0000000..20e526a --- /dev/null +++ b/Function/BNCreateEnumerationTypeOfWidth.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNType* BNCreateEnumerationTypeOfWidth(BNEnumeration* e, uint64_t width, BNBoolWithConfidence* isSigned) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateEnumerationTypeOfWidth" + )] + internal static extern IntPtr BNCreateEnumerationTypeOfWidth( + + // BNEnumeration* e + IntPtr e , + + // uint64_t width + ulong width , + + // BNBoolWithConfidence* isSigned + in BNBoolWithConfidence isSigned + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateFileMetadata.cs b/Function/BNCreateFileMetadata.cs new file mode 100644 index 0000000..660d23c --- /dev/null +++ b/Function/BNCreateFileMetadata.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFileMetadata* BNCreateFileMetadata() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateFileMetadata" + )] + internal static extern IntPtr BNCreateFileMetadata(); + } +} \ No newline at end of file diff --git a/Function/BNCreateFirmwareNinja.cs b/Function/BNCreateFirmwareNinja.cs new file mode 100644 index 0000000..c3d1d78 --- /dev/null +++ b/Function/BNCreateFirmwareNinja.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFirmwareNinja* BNCreateFirmwareNinja(BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateFirmwareNinja" + )] + internal static extern IntPtr BNCreateFirmwareNinja( + + // BNBinaryView* view + IntPtr view + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateFirmwareNinjaRelationship.cs b/Function/BNCreateFirmwareNinjaRelationship.cs new file mode 100644 index 0000000..11d559c --- /dev/null +++ b/Function/BNCreateFirmwareNinjaRelationship.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFirmwareNinjaRelationship* BNCreateFirmwareNinjaRelationship(BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateFirmwareNinjaRelationship" + )] + internal static extern IntPtr BNCreateFirmwareNinjaRelationship( + + // BNBinaryView* view + IntPtr view + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateFloatType.cs b/Function/BNCreateFloatType.cs new file mode 100644 index 0000000..458f1e2 --- /dev/null +++ b/Function/BNCreateFloatType.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNType* BNCreateFloatType(uint64_t width, const char* altName) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCreateFloatType" + )] + internal static extern IntPtr BNCreateFloatType( + + // uint64_t width + ulong width , + + // const char* altName + string altName + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateFloatTypeBuilder.cs b/Function/BNCreateFloatTypeBuilder.cs new file mode 100644 index 0000000..f9e9f56 --- /dev/null +++ b/Function/BNCreateFloatTypeBuilder.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeBuilder* BNCreateFloatTypeBuilder(uint64_t width, const char* altName) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCreateFloatTypeBuilder" + )] + internal static extern IntPtr BNCreateFloatTypeBuilder( + + // uint64_t width + ulong width , + + // const char* altName + string altName + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateFlowGraph.cs b/Function/BNCreateFlowGraph.cs new file mode 100644 index 0000000..37d22d6 --- /dev/null +++ b/Function/BNCreateFlowGraph.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFlowGraph* BNCreateFlowGraph() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateFlowGraph" + )] + internal static extern IntPtr BNCreateFlowGraph(); + } +} \ No newline at end of file diff --git a/Function/BNCreateFlowGraphNode.cs b/Function/BNCreateFlowGraphNode.cs new file mode 100644 index 0000000..9c13f35 --- /dev/null +++ b/Function/BNCreateFlowGraphNode.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFlowGraphNode* BNCreateFlowGraphNode(BNFlowGraph* graph) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateFlowGraphNode" + )] + internal static extern IntPtr BNCreateFlowGraphNode( + + // BNFlowGraph* graph + IntPtr graph + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateForcedVariableVersion.cs b/Function/BNCreateForcedVariableVersion.cs new file mode 100644 index 0000000..0455942 --- /dev/null +++ b/Function/BNCreateForcedVariableVersion.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNCreateForcedVariableVersion(BNFunction* func, BNVariable* var, BNArchitectureAndAddress* defSite) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateForcedVariableVersion" + )] + internal static extern void BNCreateForcedVariableVersion( + + // BNFunction* func + IntPtr func , + + // BNVariable* _var + IntPtr _var , + + // BNArchitectureAndAddress* defSite + IntPtr defSite + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateFunctionGraph.cs b/Function/BNCreateFunctionGraph.cs new file mode 100644 index 0000000..8c5d34d --- /dev/null +++ b/Function/BNCreateFunctionGraph.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFlowGraph* BNCreateFunctionGraph(BNFunction* func, BNFunctionViewType type, BNDisassemblySettings* settings) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateFunctionGraph" + )] + internal static extern IntPtr BNCreateFunctionGraph( + + // BNFunction* func + IntPtr func , + + // BNFunctionViewType type + FunctionViewType type , + + // BNDisassemblySettings* settings + IntPtr settings + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateFunctionType.cs b/Function/BNCreateFunctionType.cs new file mode 100644 index 0000000..bb7b531 --- /dev/null +++ b/Function/BNCreateFunctionType.cs @@ -0,0 +1,60 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNType* BNCreateFunctionType(BNTypeWithConfidence* returnValue, BNCallingConventionWithConfidence* callingConvention, BNFunctionParameter* @params, uint64_t paramCount, BNBoolWithConfidence* varArg, BNBoolWithConfidence* canReturn, BNOffsetWithConfidence* stackAdjust, uint32_t* regStackAdjustRegs, BNOffsetWithConfidence* regStackAdjustValues, uint64_t regStackAdjustCount, BNRegisterSetWithConfidence* returnRegs, BNNameType ft, BNBoolWithConfidence* pure) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateFunctionType" + )] + internal static extern IntPtr BNCreateFunctionType( + + // BNTypeWithConfidence* returnValue + in BNTypeWithConfidence returnValue , + + // BNCallingConventionWithConfidence* callingConvention + in BNCallingConventionWithConfidence callingConvention , + + // BNFunctionParameter* _params + BNFunctionParameter[] _params , + + // uint64_t paramCount + ulong paramCount , + + // BNBoolWithConfidence* varArg + in BNBoolWithConfidence varArg , + + // BNBoolWithConfidence* canReturn + in BNBoolWithConfidence canReturn , + + // BNOffsetWithConfidence* stackAdjust + in BNOffsetWithConfidence stackAdjust , + + // uint32_t* regStackAdjustRegs + uint[] regStackAdjustRegs , + + // BNOffsetWithConfidence* regStackAdjustValues + BNOffsetWithConfidence[] regStackAdjustValues , + + // uint64_t regStackAdjustCount + ulong regStackAdjustCount , + + // BNRegisterSetWithConfidence* returnRegs + in BNRegisterSetWithConfidence returnRegs , + + // BNNameType ft + NameType ft , + + // BNBoolWithConfidence* pure + in BNBoolWithConfidence pure + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateFunctionTypeBuilder.cs b/Function/BNCreateFunctionTypeBuilder.cs new file mode 100644 index 0000000..78943db --- /dev/null +++ b/Function/BNCreateFunctionTypeBuilder.cs @@ -0,0 +1,60 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeBuilder* BNCreateFunctionTypeBuilder(BNTypeWithConfidence* returnValue, BNCallingConventionWithConfidence* callingConvention, BNFunctionParameter* @params, uint64_t paramCount, BNBoolWithConfidence* varArg, BNBoolWithConfidence* canReturn, BNOffsetWithConfidence* stackAdjust, uint32_t* regStackAdjustRegs, BNOffsetWithConfidence* regStackAdjustValues, uint64_t regStackAdjustCount, BNRegisterSetWithConfidence* returnRegs, BNNameType ft, BNBoolWithConfidence* pure) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateFunctionTypeBuilder" + )] + internal static extern IntPtr BNCreateFunctionTypeBuilder( + + // BNTypeWithConfidence* returnValue + in BNTypeWithConfidence returnValue , + + // BNCallingConventionWithConfidence* callingConvention + in BNCallingConventionWithConfidence callingConvention , + + // BNFunctionParameter* _params + BNFunctionParameter[] _params , + + // uint64_t paramCount + ulong paramCount , + + // BNBoolWithConfidence* varArg + in BNBoolWithConfidence varArg , + + // BNBoolWithConfidence* canReturn + in BNBoolWithConfidence canReturn , + + // BNOffsetWithConfidence* stackAdjust + in BNOffsetWithConfidence stackAdjust , + + // uint32_t* regStackAdjustRegs + in uint[] regStackAdjustRegs , + + // BNOffsetWithConfidence* regStackAdjustValues + BNOffsetWithConfidence[] regStackAdjustValues , + + // uint64_t regStackAdjustCount + ulong regStackAdjustCount , + + // BNRegisterSetWithConfidence* returnRegs + in BNRegisterSetWithConfidence returnRegs , + + // BNNameType ft + NameType ft , + + // BNBoolWithConfidence* pure + in BNBoolWithConfidence pure + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateHighLevelILDisassemblyTextRenderer.cs b/Function/BNCreateHighLevelILDisassemblyTextRenderer.cs new file mode 100644 index 0000000..44dcd2a --- /dev/null +++ b/Function/BNCreateHighLevelILDisassemblyTextRenderer.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDisassemblyTextRenderer* BNCreateHighLevelILDisassemblyTextRenderer(BNHighLevelILFunction* func, BNDisassemblySettings* settings) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateHighLevelILDisassemblyTextRenderer" + )] + internal static extern IntPtr BNCreateHighLevelILDisassemblyTextRenderer( + + // BNHighLevelILFunction* func + IntPtr func , + + // BNDisassemblySettings* settings + IntPtr settings + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateHighLevelILFunction.cs b/Function/BNCreateHighLevelILFunction.cs new file mode 100644 index 0000000..f9fe73c --- /dev/null +++ b/Function/BNCreateHighLevelILFunction.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNHighLevelILFunction* BNCreateHighLevelILFunction(BNArchitecture* arch, BNFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateHighLevelILFunction" + )] + internal static extern IntPtr BNCreateHighLevelILFunction( + + // BNArchitecture* arch + IntPtr arch , + + // BNFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateHighLevelILFunctionGraph.cs b/Function/BNCreateHighLevelILFunctionGraph.cs new file mode 100644 index 0000000..dc94961 --- /dev/null +++ b/Function/BNCreateHighLevelILFunctionGraph.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFlowGraph* BNCreateHighLevelILFunctionGraph(BNHighLevelILFunction* func, BNDisassemblySettings* settings) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateHighLevelILFunctionGraph" + )] + internal static extern IntPtr BNCreateHighLevelILFunctionGraph( + + // BNHighLevelILFunction* func + IntPtr func , + + // BNDisassemblySettings* settings + IntPtr settings + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateHighLevelILImmediateFunctionGraph.cs b/Function/BNCreateHighLevelILImmediateFunctionGraph.cs new file mode 100644 index 0000000..1c58376 --- /dev/null +++ b/Function/BNCreateHighLevelILImmediateFunctionGraph.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFlowGraph* BNCreateHighLevelILImmediateFunctionGraph(BNHighLevelILFunction* func, BNDisassemblySettings* settings) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateHighLevelILImmediateFunctionGraph" + )] + internal static extern IntPtr BNCreateHighLevelILImmediateFunctionGraph( + + // BNHighLevelILFunction* func + IntPtr func , + + // BNDisassemblySettings* settings + IntPtr settings + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateImmediateFunctionGraph.cs b/Function/BNCreateImmediateFunctionGraph.cs new file mode 100644 index 0000000..43425ba --- /dev/null +++ b/Function/BNCreateImmediateFunctionGraph.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFlowGraph* BNCreateImmediateFunctionGraph(BNFunction* func, BNFunctionViewType type, BNDisassemblySettings* settings) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateImmediateFunctionGraph" + )] + internal static extern IntPtr BNCreateImmediateFunctionGraph( + + // BNFunction* func + IntPtr func , + + // BNFunctionViewType type + FunctionViewType type , + + // BNDisassemblySettings* settings + IntPtr settings + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateIntegerType.cs b/Function/BNCreateIntegerType.cs new file mode 100644 index 0000000..261c230 --- /dev/null +++ b/Function/BNCreateIntegerType.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNType* BNCreateIntegerType(uint64_t width, BNBoolWithConfidence* sign, const char* altName) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCreateIntegerType" + )] + internal static extern IntPtr BNCreateIntegerType( + + // uint64_t width + ulong width , + + // BNBoolWithConfidence* sign + in BNBoolWithConfidence sign , + + // const char* altName + string altName + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateIntegerTypeBuilder.cs b/Function/BNCreateIntegerTypeBuilder.cs new file mode 100644 index 0000000..ba9a28e --- /dev/null +++ b/Function/BNCreateIntegerTypeBuilder.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeBuilder* BNCreateIntegerTypeBuilder(uint64_t width, BNBoolWithConfidence* sign, const char* altName) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCreateIntegerTypeBuilder" + )] + internal static extern IntPtr BNCreateIntegerTypeBuilder( + + // uint64_t width + ulong width , + + // BNBoolWithConfidence* sign + in BNBoolWithConfidence sign , + + // const char* altName + string altName + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateKeyValueStore.cs b/Function/BNCreateKeyValueStore.cs new file mode 100644 index 0000000..06ee41b --- /dev/null +++ b/Function/BNCreateKeyValueStore.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNKeyValueStore* BNCreateKeyValueStore() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateKeyValueStore" + )] + internal static extern IntPtr BNCreateKeyValueStore(); + } +} \ No newline at end of file diff --git a/Function/BNCreateKeyValueStoreFromDataBuffer.cs b/Function/BNCreateKeyValueStoreFromDataBuffer.cs new file mode 100644 index 0000000..12a833f --- /dev/null +++ b/Function/BNCreateKeyValueStoreFromDataBuffer.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNKeyValueStore* BNCreateKeyValueStoreFromDataBuffer(BNDataBuffer* buffer) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateKeyValueStoreFromDataBuffer" + )] + internal static extern IntPtr BNCreateKeyValueStoreFromDataBuffer( + + // BNDataBuffer* buffer + IntPtr buffer + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateLanguageRepresentationFunction.cs b/Function/BNCreateLanguageRepresentationFunction.cs new file mode 100644 index 0000000..6786d70 --- /dev/null +++ b/Function/BNCreateLanguageRepresentationFunction.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLanguageRepresentationFunction* BNCreateLanguageRepresentationFunction(BNLanguageRepresentationFunctionType* type, BNArchitecture* arch, BNFunction* func, BNHighLevelILFunction* highLevelIL) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateLanguageRepresentationFunction" + )] + internal static extern IntPtr BNCreateLanguageRepresentationFunction( + + // BNLanguageRepresentationFunctionType* type + IntPtr type , + + // BNArchitecture* arch + IntPtr arch , + + // BNFunction* func + IntPtr func , + + // BNHighLevelILFunction* highLevelIL + IntPtr highLevelIL + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateLinearViewCursor.cs b/Function/BNCreateLinearViewCursor.cs new file mode 100644 index 0000000..db579dc --- /dev/null +++ b/Function/BNCreateLinearViewCursor.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLinearViewCursor* BNCreateLinearViewCursor(BNLinearViewObject* root) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateLinearViewCursor" + )] + internal static extern IntPtr BNCreateLinearViewCursor( + + // BNLinearViewObject* root + IntPtr root + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateLinearViewDataOnly.cs b/Function/BNCreateLinearViewDataOnly.cs new file mode 100644 index 0000000..f21f0ba --- /dev/null +++ b/Function/BNCreateLinearViewDataOnly.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLinearViewObject* BNCreateLinearViewDataOnly(BNBinaryView* view, BNDisassemblySettings* settings) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateLinearViewDataOnly" + )] + internal static extern IntPtr BNCreateLinearViewDataOnly( + + // BNBinaryView* view + IntPtr view , + + // BNDisassemblySettings* settings + IntPtr settings + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateLinearViewDisassembly.cs b/Function/BNCreateLinearViewDisassembly.cs new file mode 100644 index 0000000..be854f2 --- /dev/null +++ b/Function/BNCreateLinearViewDisassembly.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLinearViewObject* BNCreateLinearViewDisassembly(BNBinaryView* view, BNDisassemblySettings* settings) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateLinearViewDisassembly" + )] + internal static extern IntPtr BNCreateLinearViewDisassembly( + + // BNBinaryView* view + IntPtr view , + + // BNDisassemblySettings* settings + IntPtr settings + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateLinearViewHighLevelIL.cs b/Function/BNCreateLinearViewHighLevelIL.cs new file mode 100644 index 0000000..708c8ea --- /dev/null +++ b/Function/BNCreateLinearViewHighLevelIL.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLinearViewObject* BNCreateLinearViewHighLevelIL(BNBinaryView* view, BNDisassemblySettings* settings) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateLinearViewHighLevelIL" + )] + internal static extern IntPtr BNCreateLinearViewHighLevelIL( + + // BNBinaryView* view + IntPtr view , + + // BNDisassemblySettings* settings + IntPtr settings + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateLinearViewHighLevelILSSAForm.cs b/Function/BNCreateLinearViewHighLevelILSSAForm.cs new file mode 100644 index 0000000..e10c584 --- /dev/null +++ b/Function/BNCreateLinearViewHighLevelILSSAForm.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLinearViewObject* BNCreateLinearViewHighLevelILSSAForm(BNBinaryView* view, BNDisassemblySettings* settings) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateLinearViewHighLevelILSSAForm" + )] + internal static extern IntPtr BNCreateLinearViewHighLevelILSSAForm( + + // BNBinaryView* view + IntPtr view , + + // BNDisassemblySettings* settings + IntPtr settings + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateLinearViewLanguageRepresentation.cs b/Function/BNCreateLinearViewLanguageRepresentation.cs new file mode 100644 index 0000000..97b8069 --- /dev/null +++ b/Function/BNCreateLinearViewLanguageRepresentation.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLinearViewObject* BNCreateLinearViewLanguageRepresentation(BNBinaryView* view, BNDisassemblySettings* settings, const char* language) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCreateLinearViewLanguageRepresentation" + )] + internal static extern IntPtr BNCreateLinearViewLanguageRepresentation( + + // BNBinaryView* view + IntPtr view , + + // BNDisassemblySettings* settings + IntPtr settings , + + // const char* language + string language + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateLinearViewLiftedIL.cs b/Function/BNCreateLinearViewLiftedIL.cs new file mode 100644 index 0000000..873b50e --- /dev/null +++ b/Function/BNCreateLinearViewLiftedIL.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLinearViewObject* BNCreateLinearViewLiftedIL(BNBinaryView* view, BNDisassemblySettings* settings) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateLinearViewLiftedIL" + )] + internal static extern IntPtr BNCreateLinearViewLiftedIL( + + // BNBinaryView* view + IntPtr view , + + // BNDisassemblySettings* settings + IntPtr settings + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateLinearViewLowLevelIL.cs b/Function/BNCreateLinearViewLowLevelIL.cs new file mode 100644 index 0000000..56eb2c0 --- /dev/null +++ b/Function/BNCreateLinearViewLowLevelIL.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLinearViewObject* BNCreateLinearViewLowLevelIL(BNBinaryView* view, BNDisassemblySettings* settings) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateLinearViewLowLevelIL" + )] + internal static extern IntPtr BNCreateLinearViewLowLevelIL( + + // BNBinaryView* view + IntPtr view , + + // BNDisassemblySettings* settings + IntPtr settings + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateLinearViewLowLevelILSSAForm.cs b/Function/BNCreateLinearViewLowLevelILSSAForm.cs new file mode 100644 index 0000000..8b4819d --- /dev/null +++ b/Function/BNCreateLinearViewLowLevelILSSAForm.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLinearViewObject* BNCreateLinearViewLowLevelILSSAForm(BNBinaryView* view, BNDisassemblySettings* settings) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateLinearViewLowLevelILSSAForm" + )] + internal static extern IntPtr BNCreateLinearViewLowLevelILSSAForm( + + // BNBinaryView* view + IntPtr view , + + // BNDisassemblySettings* settings + IntPtr settings + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateLinearViewMappedMediumLevelIL.cs b/Function/BNCreateLinearViewMappedMediumLevelIL.cs new file mode 100644 index 0000000..d0d3d4e --- /dev/null +++ b/Function/BNCreateLinearViewMappedMediumLevelIL.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLinearViewObject* BNCreateLinearViewMappedMediumLevelIL(BNBinaryView* view, BNDisassemblySettings* settings) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateLinearViewMappedMediumLevelIL" + )] + internal static extern IntPtr BNCreateLinearViewMappedMediumLevelIL( + + // BNBinaryView* view + IntPtr view , + + // BNDisassemblySettings* settings + IntPtr settings + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateLinearViewMappedMediumLevelILSSAForm.cs b/Function/BNCreateLinearViewMappedMediumLevelILSSAForm.cs new file mode 100644 index 0000000..037bcf2 --- /dev/null +++ b/Function/BNCreateLinearViewMappedMediumLevelILSSAForm.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLinearViewObject* BNCreateLinearViewMappedMediumLevelILSSAForm(BNBinaryView* view, BNDisassemblySettings* settings) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateLinearViewMappedMediumLevelILSSAForm" + )] + internal static extern IntPtr BNCreateLinearViewMappedMediumLevelILSSAForm( + + // BNBinaryView* view + IntPtr view , + + // BNDisassemblySettings* settings + IntPtr settings + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateLinearViewMediumLevelIL.cs b/Function/BNCreateLinearViewMediumLevelIL.cs new file mode 100644 index 0000000..9788d8e --- /dev/null +++ b/Function/BNCreateLinearViewMediumLevelIL.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLinearViewObject* BNCreateLinearViewMediumLevelIL(BNBinaryView* view, BNDisassemblySettings* settings) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateLinearViewMediumLevelIL" + )] + internal static extern IntPtr BNCreateLinearViewMediumLevelIL( + + // BNBinaryView* view + IntPtr view , + + // BNDisassemblySettings* settings + IntPtr settings + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateLinearViewMediumLevelILSSAForm.cs b/Function/BNCreateLinearViewMediumLevelILSSAForm.cs new file mode 100644 index 0000000..610a905 --- /dev/null +++ b/Function/BNCreateLinearViewMediumLevelILSSAForm.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLinearViewObject* BNCreateLinearViewMediumLevelILSSAForm(BNBinaryView* view, BNDisassemblySettings* settings) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateLinearViewMediumLevelILSSAForm" + )] + internal static extern IntPtr BNCreateLinearViewMediumLevelILSSAForm( + + // BNBinaryView* view + IntPtr view , + + // BNDisassemblySettings* settings + IntPtr settings + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateLinearViewSingleFunctionDisassembly.cs b/Function/BNCreateLinearViewSingleFunctionDisassembly.cs new file mode 100644 index 0000000..6980064 --- /dev/null +++ b/Function/BNCreateLinearViewSingleFunctionDisassembly.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLinearViewObject* BNCreateLinearViewSingleFunctionDisassembly(BNFunction* func, BNDisassemblySettings* settings) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateLinearViewSingleFunctionDisassembly" + )] + internal static extern IntPtr BNCreateLinearViewSingleFunctionDisassembly( + + // BNFunction* func + IntPtr func , + + // BNDisassemblySettings* settings + IntPtr settings + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateLinearViewSingleFunctionHighLevelIL.cs b/Function/BNCreateLinearViewSingleFunctionHighLevelIL.cs new file mode 100644 index 0000000..5c0a1a9 --- /dev/null +++ b/Function/BNCreateLinearViewSingleFunctionHighLevelIL.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLinearViewObject* BNCreateLinearViewSingleFunctionHighLevelIL(BNFunction* func, BNDisassemblySettings* settings) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateLinearViewSingleFunctionHighLevelIL" + )] + internal static extern IntPtr BNCreateLinearViewSingleFunctionHighLevelIL( + + // BNFunction* func + IntPtr func , + + // BNDisassemblySettings* settings + IntPtr settings + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateLinearViewSingleFunctionHighLevelILSSAForm.cs b/Function/BNCreateLinearViewSingleFunctionHighLevelILSSAForm.cs new file mode 100644 index 0000000..5ab78a6 --- /dev/null +++ b/Function/BNCreateLinearViewSingleFunctionHighLevelILSSAForm.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLinearViewObject* BNCreateLinearViewSingleFunctionHighLevelILSSAForm(BNFunction* func, BNDisassemblySettings* settings) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateLinearViewSingleFunctionHighLevelILSSAForm" + )] + internal static extern IntPtr BNCreateLinearViewSingleFunctionHighLevelILSSAForm( + + // BNFunction* func + IntPtr func , + + // BNDisassemblySettings* settings + IntPtr settings + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateLinearViewSingleFunctionLanguageRepresentation.cs b/Function/BNCreateLinearViewSingleFunctionLanguageRepresentation.cs new file mode 100644 index 0000000..fb2d3e2 --- /dev/null +++ b/Function/BNCreateLinearViewSingleFunctionLanguageRepresentation.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLinearViewObject* BNCreateLinearViewSingleFunctionLanguageRepresentation(BNFunction* func, BNDisassemblySettings* settings, const char* language) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCreateLinearViewSingleFunctionLanguageRepresentation" + )] + internal static extern IntPtr BNCreateLinearViewSingleFunctionLanguageRepresentation( + + // BNFunction* func + IntPtr func , + + // BNDisassemblySettings* settings + IntPtr settings , + + // const char* language + string language + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateLinearViewSingleFunctionLiftedIL.cs b/Function/BNCreateLinearViewSingleFunctionLiftedIL.cs new file mode 100644 index 0000000..e8a2f03 --- /dev/null +++ b/Function/BNCreateLinearViewSingleFunctionLiftedIL.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLinearViewObject* BNCreateLinearViewSingleFunctionLiftedIL(BNFunction* func, BNDisassemblySettings* settings) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateLinearViewSingleFunctionLiftedIL" + )] + internal static extern IntPtr BNCreateLinearViewSingleFunctionLiftedIL( + + // BNFunction* func + IntPtr func , + + // BNDisassemblySettings* settings + IntPtr settings + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateLinearViewSingleFunctionLowLevelIL.cs b/Function/BNCreateLinearViewSingleFunctionLowLevelIL.cs new file mode 100644 index 0000000..3e5ea3f --- /dev/null +++ b/Function/BNCreateLinearViewSingleFunctionLowLevelIL.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLinearViewObject* BNCreateLinearViewSingleFunctionLowLevelIL(BNFunction* func, BNDisassemblySettings* settings) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateLinearViewSingleFunctionLowLevelIL" + )] + internal static extern IntPtr BNCreateLinearViewSingleFunctionLowLevelIL( + + // BNFunction* func + IntPtr func , + + // BNDisassemblySettings* settings + IntPtr settings + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateLinearViewSingleFunctionLowLevelILSSAForm.cs b/Function/BNCreateLinearViewSingleFunctionLowLevelILSSAForm.cs new file mode 100644 index 0000000..7c85aa0 --- /dev/null +++ b/Function/BNCreateLinearViewSingleFunctionLowLevelILSSAForm.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLinearViewObject* BNCreateLinearViewSingleFunctionLowLevelILSSAForm(BNFunction* func, BNDisassemblySettings* settings) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateLinearViewSingleFunctionLowLevelILSSAForm" + )] + internal static extern IntPtr BNCreateLinearViewSingleFunctionLowLevelILSSAForm( + + // BNFunction* func + IntPtr func , + + // BNDisassemblySettings* settings + IntPtr settings + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateLinearViewSingleFunctionMappedMediumLevelIL.cs b/Function/BNCreateLinearViewSingleFunctionMappedMediumLevelIL.cs new file mode 100644 index 0000000..899a812 --- /dev/null +++ b/Function/BNCreateLinearViewSingleFunctionMappedMediumLevelIL.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLinearViewObject* BNCreateLinearViewSingleFunctionMappedMediumLevelIL(BNFunction* func, BNDisassemblySettings* settings) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateLinearViewSingleFunctionMappedMediumLevelIL" + )] + internal static extern IntPtr BNCreateLinearViewSingleFunctionMappedMediumLevelIL( + + // BNFunction* func + IntPtr func , + + // BNDisassemblySettings* settings + IntPtr settings + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateLinearViewSingleFunctionMappedMediumLevelILSSAForm.cs b/Function/BNCreateLinearViewSingleFunctionMappedMediumLevelILSSAForm.cs new file mode 100644 index 0000000..7c1025b --- /dev/null +++ b/Function/BNCreateLinearViewSingleFunctionMappedMediumLevelILSSAForm.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLinearViewObject* BNCreateLinearViewSingleFunctionMappedMediumLevelILSSAForm(BNFunction* func, BNDisassemblySettings* settings) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateLinearViewSingleFunctionMappedMediumLevelILSSAForm" + )] + internal static extern IntPtr BNCreateLinearViewSingleFunctionMappedMediumLevelILSSAForm( + + // BNFunction* func + IntPtr func , + + // BNDisassemblySettings* settings + IntPtr settings + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateLinearViewSingleFunctionMediumLevelIL.cs b/Function/BNCreateLinearViewSingleFunctionMediumLevelIL.cs new file mode 100644 index 0000000..900a9c1 --- /dev/null +++ b/Function/BNCreateLinearViewSingleFunctionMediumLevelIL.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLinearViewObject* BNCreateLinearViewSingleFunctionMediumLevelIL(BNFunction* func, BNDisassemblySettings* settings) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateLinearViewSingleFunctionMediumLevelIL" + )] + internal static extern IntPtr BNCreateLinearViewSingleFunctionMediumLevelIL( + + // BNFunction* func + IntPtr func , + + // BNDisassemblySettings* settings + IntPtr settings + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateLinearViewSingleFunctionMediumLevelILSSAForm.cs b/Function/BNCreateLinearViewSingleFunctionMediumLevelILSSAForm.cs new file mode 100644 index 0000000..1cfe3eb --- /dev/null +++ b/Function/BNCreateLinearViewSingleFunctionMediumLevelILSSAForm.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLinearViewObject* BNCreateLinearViewSingleFunctionMediumLevelILSSAForm(BNFunction* func, BNDisassemblySettings* settings) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateLinearViewSingleFunctionMediumLevelILSSAForm" + )] + internal static extern IntPtr BNCreateLinearViewSingleFunctionMediumLevelILSSAForm( + + // BNFunction* func + IntPtr func , + + // BNDisassemblySettings* settings + IntPtr settings + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateLowLevelILDisassemblyTextRenderer.cs b/Function/BNCreateLowLevelILDisassemblyTextRenderer.cs new file mode 100644 index 0000000..65e82ae --- /dev/null +++ b/Function/BNCreateLowLevelILDisassemblyTextRenderer.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDisassemblyTextRenderer* BNCreateLowLevelILDisassemblyTextRenderer(BNLowLevelILFunction* func, BNDisassemblySettings* settings) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateLowLevelILDisassemblyTextRenderer" + )] + internal static extern IntPtr BNCreateLowLevelILDisassemblyTextRenderer( + + // BNLowLevelILFunction* func + IntPtr func , + + // BNDisassemblySettings* settings + IntPtr settings + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateLowLevelILFunction.cs b/Function/BNCreateLowLevelILFunction.cs new file mode 100644 index 0000000..2a35ba7 --- /dev/null +++ b/Function/BNCreateLowLevelILFunction.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLowLevelILFunction* BNCreateLowLevelILFunction(BNArchitecture* arch, BNFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateLowLevelILFunction" + )] + internal static extern IntPtr BNCreateLowLevelILFunction( + + // BNArchitecture* arch + IntPtr arch , + + // BNFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateLowLevelILFunctionGraph.cs b/Function/BNCreateLowLevelILFunctionGraph.cs new file mode 100644 index 0000000..f34e502 --- /dev/null +++ b/Function/BNCreateLowLevelILFunctionGraph.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFlowGraph* BNCreateLowLevelILFunctionGraph(BNLowLevelILFunction* func, BNDisassemblySettings* settings) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateLowLevelILFunctionGraph" + )] + internal static extern IntPtr BNCreateLowLevelILFunctionGraph( + + // BNLowLevelILFunction* func + IntPtr func , + + // BNDisassemblySettings* settings + IntPtr settings + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateLowLevelILImmediateFunctionGraph.cs b/Function/BNCreateLowLevelILImmediateFunctionGraph.cs new file mode 100644 index 0000000..e162d56 --- /dev/null +++ b/Function/BNCreateLowLevelILImmediateFunctionGraph.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFlowGraph* BNCreateLowLevelILImmediateFunctionGraph(BNLowLevelILFunction* func, BNDisassemblySettings* settings) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateLowLevelILImmediateFunctionGraph" + )] + internal static extern IntPtr BNCreateLowLevelILImmediateFunctionGraph( + + // BNLowLevelILFunction* func + IntPtr func , + + // BNDisassemblySettings* settings + IntPtr settings + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateMediumLevelILDisassemblyTextRenderer.cs b/Function/BNCreateMediumLevelILDisassemblyTextRenderer.cs new file mode 100644 index 0000000..2e295f9 --- /dev/null +++ b/Function/BNCreateMediumLevelILDisassemblyTextRenderer.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDisassemblyTextRenderer* BNCreateMediumLevelILDisassemblyTextRenderer(BNMediumLevelILFunction* func, BNDisassemblySettings* settings) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateMediumLevelILDisassemblyTextRenderer" + )] + internal static extern IntPtr BNCreateMediumLevelILDisassemblyTextRenderer( + + // BNMediumLevelILFunction* func + IntPtr func , + + // BNDisassemblySettings* settings + IntPtr settings + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateMediumLevelILFunction.cs b/Function/BNCreateMediumLevelILFunction.cs new file mode 100644 index 0000000..b7de4e4 --- /dev/null +++ b/Function/BNCreateMediumLevelILFunction.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNMediumLevelILFunction* BNCreateMediumLevelILFunction(BNArchitecture* arch, BNFunction* func, BNLowLevelILFunction* lowLevelIL) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateMediumLevelILFunction" + )] + internal static extern IntPtr BNCreateMediumLevelILFunction( + + // BNArchitecture* arch + IntPtr arch , + + // BNFunction* func + IntPtr func , + + // BNLowLevelILFunction* lowLevelIL + IntPtr lowLevelIL + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateMediumLevelILFunctionGraph.cs b/Function/BNCreateMediumLevelILFunctionGraph.cs new file mode 100644 index 0000000..6198656 --- /dev/null +++ b/Function/BNCreateMediumLevelILFunctionGraph.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFlowGraph* BNCreateMediumLevelILFunctionGraph(BNMediumLevelILFunction* func, BNDisassemblySettings* settings) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateMediumLevelILFunctionGraph" + )] + internal static extern IntPtr BNCreateMediumLevelILFunctionGraph( + + // BNMediumLevelILFunction* func + IntPtr func , + + // BNDisassemblySettings* settings + IntPtr settings + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateMediumLevelILImmediateFunctionGraph.cs b/Function/BNCreateMediumLevelILImmediateFunctionGraph.cs new file mode 100644 index 0000000..5fca3b5 --- /dev/null +++ b/Function/BNCreateMediumLevelILImmediateFunctionGraph.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFlowGraph* BNCreateMediumLevelILImmediateFunctionGraph(BNMediumLevelILFunction* func, BNDisassemblySettings* settings) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateMediumLevelILImmediateFunctionGraph" + )] + internal static extern IntPtr BNCreateMediumLevelILImmediateFunctionGraph( + + // BNMediumLevelILFunction* func + IntPtr func , + + // BNDisassemblySettings* settings + IntPtr settings + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateMetadataArray.cs b/Function/BNCreateMetadataArray.cs new file mode 100644 index 0000000..919f72f --- /dev/null +++ b/Function/BNCreateMetadataArray.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNMetadata* BNCreateMetadataArray(BNMetadata** data, uint64_t size) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateMetadataArray" + )] + internal static extern IntPtr BNCreateMetadataArray( + + // BNMetadata** data + IntPtr[] data , + + // uint64_t size + ulong size + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateMetadataBooleanData.cs b/Function/BNCreateMetadataBooleanData.cs new file mode 100644 index 0000000..1e8efb2 --- /dev/null +++ b/Function/BNCreateMetadataBooleanData.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNMetadata* BNCreateMetadataBooleanData(bool data) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateMetadataBooleanData" + )] + internal static extern IntPtr BNCreateMetadataBooleanData( + + // bool data + bool data + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateMetadataBooleanListData.cs b/Function/BNCreateMetadataBooleanListData.cs new file mode 100644 index 0000000..76c865f --- /dev/null +++ b/Function/BNCreateMetadataBooleanListData.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNMetadata* BNCreateMetadataBooleanListData(bool* data, uint64_t size) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateMetadataBooleanListData" + )] + internal static extern IntPtr BNCreateMetadataBooleanListData( + + // bool* data + bool[] data , + + // uint64_t size + ulong size + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateMetadataDoubleData.cs b/Function/BNCreateMetadataDoubleData.cs new file mode 100644 index 0000000..4632a3d --- /dev/null +++ b/Function/BNCreateMetadataDoubleData.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNMetadata* BNCreateMetadataDoubleData(double data) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateMetadataDoubleData" + )] + internal static extern IntPtr BNCreateMetadataDoubleData( + + // double data + double data + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateMetadataDoubleListData.cs b/Function/BNCreateMetadataDoubleListData.cs new file mode 100644 index 0000000..c1556a9 --- /dev/null +++ b/Function/BNCreateMetadataDoubleListData.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNMetadata* BNCreateMetadataDoubleListData(double* data, uint64_t size) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateMetadataDoubleListData" + )] + internal static extern IntPtr BNCreateMetadataDoubleListData( + + // double* data + double[] data , + + // uint64_t size + ulong size + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateMetadataOfType.cs b/Function/BNCreateMetadataOfType.cs new file mode 100644 index 0000000..16ef419 --- /dev/null +++ b/Function/BNCreateMetadataOfType.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNMetadata* BNCreateMetadataOfType(BNMetadataType type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateMetadataOfType" + )] + internal static extern IntPtr BNCreateMetadataOfType( + + // BNMetadataType type + MetadataType type + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateMetadataRawData.cs b/Function/BNCreateMetadataRawData.cs new file mode 100644 index 0000000..91dbf38 --- /dev/null +++ b/Function/BNCreateMetadataRawData.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNMetadata* BNCreateMetadataRawData(uint8_t* data, uint64_t size) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateMetadataRawData" + )] + internal static extern IntPtr BNCreateMetadataRawData( + + // uint8_t* data + byte[] data , + + // uint64_t size + ulong size + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateMetadataSignedIntegerData.cs b/Function/BNCreateMetadataSignedIntegerData.cs new file mode 100644 index 0000000..62cf4fb --- /dev/null +++ b/Function/BNCreateMetadataSignedIntegerData.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNMetadata* BNCreateMetadataSignedIntegerData(int64_t data) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateMetadataSignedIntegerData" + )] + internal static extern IntPtr BNCreateMetadataSignedIntegerData( + + // int64_t data + long data + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateMetadataSignedIntegerListData.cs b/Function/BNCreateMetadataSignedIntegerListData.cs new file mode 100644 index 0000000..7506886 --- /dev/null +++ b/Function/BNCreateMetadataSignedIntegerListData.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNMetadata* BNCreateMetadataSignedIntegerListData(int64_t* data, uint64_t size) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateMetadataSignedIntegerListData" + )] + internal static extern IntPtr BNCreateMetadataSignedIntegerListData( + + // int64_t* data + long[] data , + + // uint64_t size + ulong size + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateMetadataStringData.cs b/Function/BNCreateMetadataStringData.cs new file mode 100644 index 0000000..b95a534 --- /dev/null +++ b/Function/BNCreateMetadataStringData.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNMetadata* BNCreateMetadataStringData(const char* data) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCreateMetadataStringData" + )] + internal static extern IntPtr BNCreateMetadataStringData( + + // const char* data + string data + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateMetadataStringListData.cs b/Function/BNCreateMetadataStringListData.cs new file mode 100644 index 0000000..15a99a8 --- /dev/null +++ b/Function/BNCreateMetadataStringListData.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNMetadata* BNCreateMetadataStringListData(const char** data, uint64_t size) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCreateMetadataStringListData" + )] + internal static extern IntPtr BNCreateMetadataStringListData( + + // const char** data + string[] data , + + // uint64_t size + ulong size + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateMetadataUnsignedIntegerData.cs b/Function/BNCreateMetadataUnsignedIntegerData.cs new file mode 100644 index 0000000..c8ff720 --- /dev/null +++ b/Function/BNCreateMetadataUnsignedIntegerData.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNMetadata* BNCreateMetadataUnsignedIntegerData(uint64_t data) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateMetadataUnsignedIntegerData" + )] + internal static extern IntPtr BNCreateMetadataUnsignedIntegerData( + + // uint64_t data + ulong data + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateMetadataUnsignedIntegerListData.cs b/Function/BNCreateMetadataUnsignedIntegerListData.cs new file mode 100644 index 0000000..5967fb0 --- /dev/null +++ b/Function/BNCreateMetadataUnsignedIntegerListData.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNMetadata* BNCreateMetadataUnsignedIntegerListData(uint64_t* data, uint64_t size) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateMetadataUnsignedIntegerListData" + )] + internal static extern IntPtr BNCreateMetadataUnsignedIntegerListData( + + // uint64_t* data + ulong[] data , + + // uint64_t size + ulong size + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateMetadataValueStore.cs b/Function/BNCreateMetadataValueStore.cs new file mode 100644 index 0000000..8dfdd2f --- /dev/null +++ b/Function/BNCreateMetadataValueStore.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNMetadata* BNCreateMetadataValueStore(const char** keys, BNMetadata** values, uint64_t size) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCreateMetadataValueStore" + )] + internal static extern IntPtr BNCreateMetadataValueStore( + + // const char** keys + string[] keys , + + // BNMetadata** values + IntPtr[] values , + + // uint64_t size + ulong size + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateNamedType.cs b/Function/BNCreateNamedType.cs new file mode 100644 index 0000000..b9c3f8e --- /dev/null +++ b/Function/BNCreateNamedType.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNNamedTypeReference* BNCreateNamedType(BNNamedTypeReferenceClass cls, const char* id, BNQualifiedName* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCreateNamedType" + )] + internal static extern IntPtr BNCreateNamedType( + + // BNNamedTypeReferenceClass cls + NamedTypeReferenceClass cls , + + // const char* id + string id , + + // BNQualifiedName* name + in BNQualifiedName name + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateNamedTypeBuilder.cs b/Function/BNCreateNamedTypeBuilder.cs new file mode 100644 index 0000000..5ecd302 --- /dev/null +++ b/Function/BNCreateNamedTypeBuilder.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNNamedTypeReferenceBuilder* BNCreateNamedTypeBuilder(BNNamedTypeReferenceClass cls, const char* id, BNQualifiedName* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCreateNamedTypeBuilder" + )] + internal static extern IntPtr BNCreateNamedTypeBuilder( + + // BNNamedTypeReferenceClass cls + NamedTypeReferenceClass cls , + + // const char* id + string id , + + // BNQualifiedName* name + IntPtr name + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateNamedTypeReference.cs b/Function/BNCreateNamedTypeReference.cs new file mode 100644 index 0000000..0a12dfa --- /dev/null +++ b/Function/BNCreateNamedTypeReference.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNType* BNCreateNamedTypeReference(BNNamedTypeReference* nt, uint64_t width, uint64_t align, BNBoolWithConfidence* cnst, BNBoolWithConfidence* vltl) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateNamedTypeReference" + )] + internal static extern IntPtr BNCreateNamedTypeReference( + + // BNNamedTypeReference* nt + IntPtr nt , + + // uint64_t width + ulong width , + + // uint64_t align + ulong align , + + // BNBoolWithConfidence* cnst + in BNBoolWithConfidence cnst , + + // BNBoolWithConfidence* vltl + in BNBoolWithConfidence vltl + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateNamedTypeReferenceBuilder.cs b/Function/BNCreateNamedTypeReferenceBuilder.cs new file mode 100644 index 0000000..7f1e9e5 --- /dev/null +++ b/Function/BNCreateNamedTypeReferenceBuilder.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeBuilder* BNCreateNamedTypeReferenceBuilder(BNNamedTypeReference* nt, uint64_t width, uint64_t align, BNBoolWithConfidence* cnst, BNBoolWithConfidence* vltl) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateNamedTypeReferenceBuilder" + )] + internal static extern IntPtr BNCreateNamedTypeReferenceBuilder( + + // BNNamedTypeReference* nt + IntPtr nt , + + // uint64_t width + ulong width , + + // uint64_t align + ulong align , + + // BNBoolWithConfidence* cnst + in BNBoolWithConfidence cnst , + + // BNBoolWithConfidence* vltl + in BNBoolWithConfidence vltl + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateNamedTypeReferenceBuilderFromType.cs b/Function/BNCreateNamedTypeReferenceBuilderFromType.cs new file mode 100644 index 0000000..97f848c --- /dev/null +++ b/Function/BNCreateNamedTypeReferenceBuilderFromType.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeBuilder* BNCreateNamedTypeReferenceBuilderFromType(BNBinaryView* view, BNQualifiedName* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateNamedTypeReferenceBuilderFromType" + )] + internal static extern IntPtr BNCreateNamedTypeReferenceBuilderFromType( + + // BNBinaryView* view + IntPtr view , + + // BNQualifiedName* name + IntPtr name + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateNamedTypeReferenceBuilderFromTypeAndId.cs b/Function/BNCreateNamedTypeReferenceBuilderFromTypeAndId.cs new file mode 100644 index 0000000..dfb3b12 --- /dev/null +++ b/Function/BNCreateNamedTypeReferenceBuilderFromTypeAndId.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeBuilder* BNCreateNamedTypeReferenceBuilderFromTypeAndId(const char* id, BNQualifiedName* name, BNType* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCreateNamedTypeReferenceBuilderFromTypeAndId" + )] + internal static extern IntPtr BNCreateNamedTypeReferenceBuilderFromTypeAndId( + + // const char* id + string id , + + // BNQualifiedName* name + IntPtr name , + + // BNType* type + IntPtr type + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateNamedTypeReferenceBuilderWithBuilder.cs b/Function/BNCreateNamedTypeReferenceBuilderWithBuilder.cs new file mode 100644 index 0000000..e6fdbd9 --- /dev/null +++ b/Function/BNCreateNamedTypeReferenceBuilderWithBuilder.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeBuilder* BNCreateNamedTypeReferenceBuilderWithBuilder(BNNamedTypeReferenceBuilder* nt, uint64_t width, uint64_t align, BNBoolWithConfidence* cnst, BNBoolWithConfidence* vltl) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateNamedTypeReferenceBuilderWithBuilder" + )] + internal static extern IntPtr BNCreateNamedTypeReferenceBuilderWithBuilder( + + // BNNamedTypeReferenceBuilder* nt + IntPtr nt , + + // uint64_t width + ulong width , + + // uint64_t align + ulong align , + + // BNBoolWithConfidence* cnst + IntPtr cnst , + + // BNBoolWithConfidence* vltl + IntPtr vltl + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateNamedTypeReferenceFromType.cs b/Function/BNCreateNamedTypeReferenceFromType.cs new file mode 100644 index 0000000..9ad9aa8 --- /dev/null +++ b/Function/BNCreateNamedTypeReferenceFromType.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNType* BNCreateNamedTypeReferenceFromType(BNBinaryView* view, BNQualifiedName* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateNamedTypeReferenceFromType" + )] + internal static extern IntPtr BNCreateNamedTypeReferenceFromType( + + // BNBinaryView* view + IntPtr view , + + // BNQualifiedName* name + IntPtr name + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateNamedTypeReferenceFromTypeAndId.cs b/Function/BNCreateNamedTypeReferenceFromTypeAndId.cs new file mode 100644 index 0000000..660c83a --- /dev/null +++ b/Function/BNCreateNamedTypeReferenceFromTypeAndId.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNType* BNCreateNamedTypeReferenceFromTypeAndId(const char* id, BNQualifiedName* name, BNType* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCreateNamedTypeReferenceFromTypeAndId" + )] + internal static extern IntPtr BNCreateNamedTypeReferenceFromTypeAndId( + + // const char* id + string id , + + // BNQualifiedName* name + IntPtr name , + + // BNType* type + IntPtr type + ); + } +} \ No newline at end of file diff --git a/Function/BNCreatePlatform.cs b/Function/BNCreatePlatform.cs new file mode 100644 index 0000000..a0ab4b3 --- /dev/null +++ b/Function/BNCreatePlatform.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNPlatform* BNCreatePlatform(BNArchitecture* arch, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCreatePlatform" + )] + internal static extern IntPtr BNCreatePlatform( + + // BNArchitecture* arch + IntPtr arch , + + // const char* name + string name + ); + } +} \ No newline at end of file diff --git a/Function/BNCreatePlatformWithTypes.cs b/Function/BNCreatePlatformWithTypes.cs new file mode 100644 index 0000000..5e345ec --- /dev/null +++ b/Function/BNCreatePlatformWithTypes.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNPlatform* BNCreatePlatformWithTypes(BNArchitecture* arch, const char* name, const char* typeFile, const char** includeDirs, uint64_t includeDirCount) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCreatePlatformWithTypes" + )] + internal static extern IntPtr BNCreatePlatformWithTypes( + + // BNArchitecture* arch + IntPtr arch , + + // const char* name + string name , + + // const char* typeFile + string typeFile , + + // const char** includeDirs + string[] includeDirs , + + // uint64_t includeDirCount + ulong includeDirCount + ); + } +} \ No newline at end of file diff --git a/Function/BNCreatePointerType.cs b/Function/BNCreatePointerType.cs new file mode 100644 index 0000000..0c0d765 --- /dev/null +++ b/Function/BNCreatePointerType.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNType* BNCreatePointerType(BNArchitecture* arch, BNTypeWithConfidence* type, BNBoolWithConfidence* cnst, BNBoolWithConfidence* vltl, BNReferenceType refType) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreatePointerType" + )] + internal static extern IntPtr BNCreatePointerType( + + // BNArchitecture* arch + IntPtr arch , + + // BNTypeWithConfidence* type + IntPtr type , + + // BNBoolWithConfidence* cnst + IntPtr cnst , + + // BNBoolWithConfidence* vltl + IntPtr vltl , + + // BNReferenceType refType + ReferenceType refType + ); + } +} \ No newline at end of file diff --git a/Function/BNCreatePointerTypeBuilder.cs b/Function/BNCreatePointerTypeBuilder.cs new file mode 100644 index 0000000..83d1618 --- /dev/null +++ b/Function/BNCreatePointerTypeBuilder.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeBuilder* BNCreatePointerTypeBuilder(BNArchitecture* arch, BNTypeWithConfidence* type, BNBoolWithConfidence* cnst, BNBoolWithConfidence* vltl, BNReferenceType refType) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreatePointerTypeBuilder" + )] + internal static extern IntPtr BNCreatePointerTypeBuilder( + + // BNArchitecture* arch + IntPtr arch , + + // BNTypeWithConfidence* type + IntPtr type , + + // BNBoolWithConfidence* cnst + IntPtr cnst , + + // BNBoolWithConfidence* vltl + IntPtr vltl , + + // BNReferenceType refType + ReferenceType refType + ); + } +} \ No newline at end of file diff --git a/Function/BNCreatePointerTypeBuilderOfWidth.cs b/Function/BNCreatePointerTypeBuilderOfWidth.cs new file mode 100644 index 0000000..cafef19 --- /dev/null +++ b/Function/BNCreatePointerTypeBuilderOfWidth.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeBuilder* BNCreatePointerTypeBuilderOfWidth(uint64_t width, BNTypeWithConfidence* type, BNBoolWithConfidence* cnst, BNBoolWithConfidence* vltl, BNReferenceType refType) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreatePointerTypeBuilderOfWidth" + )] + internal static extern IntPtr BNCreatePointerTypeBuilderOfWidth( + + // uint64_t width + ulong width , + + // BNTypeWithConfidence* type + in BNTypeWithConfidence type , + + // BNBoolWithConfidence* cnst + in BNBoolWithConfidence cnst , + + // BNBoolWithConfidence* vltl + in BNBoolWithConfidence vltl , + + // BNReferenceType refType + ReferenceType refType + ); + } +} \ No newline at end of file diff --git a/Function/BNCreatePointerTypeOfWidth.cs b/Function/BNCreatePointerTypeOfWidth.cs new file mode 100644 index 0000000..6527b03 --- /dev/null +++ b/Function/BNCreatePointerTypeOfWidth.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNType* BNCreatePointerTypeOfWidth(uint64_t width, BNTypeWithConfidence* type, BNBoolWithConfidence* cnst, BNBoolWithConfidence* vltl, BNReferenceType refType) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreatePointerTypeOfWidth" + )] + internal static extern IntPtr BNCreatePointerTypeOfWidth( + + // uint64_t width + ulong width , + + // BNTypeWithConfidence* type + in BNTypeWithConfidence type , + + // BNBoolWithConfidence* cnst + in BNBoolWithConfidence cnst , + + // BNBoolWithConfidence* vltl + // volatile + in BNBoolWithConfidence vltl , + + // BNReferenceType refType + ReferenceType refType + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateProject.cs b/Function/BNCreateProject.cs new file mode 100644 index 0000000..94edd70 --- /dev/null +++ b/Function/BNCreateProject.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNProject* BNCreateProject(const char* path, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCreateProject" + )] + internal static extern IntPtr BNCreateProject( + + // const char* path + string path , + + // const char* name + string name + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateRelocationHandler.cs b/Function/BNCreateRelocationHandler.cs new file mode 100644 index 0000000..7a50d37 --- /dev/null +++ b/Function/BNCreateRelocationHandler.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRelocationHandler* BNCreateRelocationHandler(BNCustomRelocationHandler* handler) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateRelocationHandler" + )] + internal static extern IntPtr BNCreateRelocationHandler( + + // BNCustomRelocationHandler* handler + IntPtr handler + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateReportCollection.cs b/Function/BNCreateReportCollection.cs new file mode 100644 index 0000000..285517a --- /dev/null +++ b/Function/BNCreateReportCollection.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNReportCollection* BNCreateReportCollection() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateReportCollection" + )] + internal static extern IntPtr BNCreateReportCollection(); + } +} \ No newline at end of file diff --git a/Function/BNCreateRepositoryManager.cs b/Function/BNCreateRepositoryManager.cs new file mode 100644 index 0000000..b78e9d8 --- /dev/null +++ b/Function/BNCreateRepositoryManager.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRepositoryManager* BNCreateRepositoryManager(const char* enabledPluginsPath) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCreateRepositoryManager" + )] + internal static extern IntPtr BNCreateRepositoryManager( + + // const char* enabledPluginsPath + string enabledPluginsPath + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateSaveSettings.cs b/Function/BNCreateSaveSettings.cs new file mode 100644 index 0000000..4521550 --- /dev/null +++ b/Function/BNCreateSaveSettings.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNSaveSettings* BNCreateSaveSettings() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateSaveSettings" + )] + internal static extern IntPtr BNCreateSaveSettings(); + } +} \ No newline at end of file diff --git a/Function/BNCreateScriptingProviderInstance.cs b/Function/BNCreateScriptingProviderInstance.cs new file mode 100644 index 0000000..4ce8b51 --- /dev/null +++ b/Function/BNCreateScriptingProviderInstance.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNScriptingInstance* BNCreateScriptingProviderInstance(BNScriptingProvider* provider) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateScriptingProviderInstance" + )] + internal static extern IntPtr BNCreateScriptingProviderInstance( + + // BNScriptingProvider* provider + IntPtr provider + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateSegment.cs b/Function/BNCreateSegment.cs new file mode 100644 index 0000000..744a01e --- /dev/null +++ b/Function/BNCreateSegment.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNSegment* BNCreateSegment(uint64_t start, uint64_t length, uint64_t dataOffset, uint64_t dataLength, uint32_t flags, bool autoDefined) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateSegment" + )] + internal static extern IntPtr BNCreateSegment( + + // uint64_t start + ulong start , + + // uint64_t length + ulong length , + + // uint64_t dataOffset + ulong dataOffset , + + // uint64_t dataLength + ulong dataLength , + + // uint32_t flags + uint flags , + + // bool autoDefined + bool autoDefined + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateSettings.cs b/Function/BNCreateSettings.cs new file mode 100644 index 0000000..e59d5ba --- /dev/null +++ b/Function/BNCreateSettings.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNSettings* BNCreateSettings(const char* schemaId) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCreateSettings" + )] + internal static extern IntPtr BNCreateSettings( + + // const char* schemaId + string schemaId + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateSnapshotedView.cs b/Function/BNCreateSnapshotedView.cs new file mode 100644 index 0000000..d7f7d61 --- /dev/null +++ b/Function/BNCreateSnapshotedView.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNCreateSnapshotedView(BNBinaryView* data, const char* viewName) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCreateSnapshotedView" + )] + internal static extern bool BNCreateSnapshotedView( + + // BNBinaryView* data + IntPtr data , + + // const char* viewName + string viewName + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateSnapshotedViewWithProgress.cs b/Function/BNCreateSnapshotedViewWithProgress.cs new file mode 100644 index 0000000..504724a --- /dev/null +++ b/Function/BNCreateSnapshotedViewWithProgress.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNCreateSnapshotedViewWithProgress(BNBinaryView* data, const char* viewName, void* ctxt, void** progress) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCreateSnapshotedViewWithProgress" + )] + internal static extern bool BNCreateSnapshotedViewWithProgress( + + // BNBinaryView* data + IntPtr data , + + // const char* viewName + string viewName , + + // void* ctxt + IntPtr ctxt , + + // void** progress + IntPtr progress + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateStructureBuilder.cs b/Function/BNCreateStructureBuilder.cs new file mode 100644 index 0000000..d9608dc --- /dev/null +++ b/Function/BNCreateStructureBuilder.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNStructureBuilder* BNCreateStructureBuilder() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateStructureBuilder" + )] + internal static extern IntPtr BNCreateStructureBuilder(); + } +} \ No newline at end of file diff --git a/Function/BNCreateStructureBuilderFromStructure.cs b/Function/BNCreateStructureBuilderFromStructure.cs new file mode 100644 index 0000000..cba3864 --- /dev/null +++ b/Function/BNCreateStructureBuilderFromStructure.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNStructureBuilder* BNCreateStructureBuilderFromStructure(BNStructure* s) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateStructureBuilderFromStructure" + )] + internal static extern IntPtr BNCreateStructureBuilderFromStructure( + + // BNStructure* s + IntPtr s + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateStructureBuilderWithOptions.cs b/Function/BNCreateStructureBuilderWithOptions.cs new file mode 100644 index 0000000..8047d87 --- /dev/null +++ b/Function/BNCreateStructureBuilderWithOptions.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNStructureBuilder* BNCreateStructureBuilderWithOptions(BNStructureVariant type, bool packed) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateStructureBuilderWithOptions" + )] + internal static extern IntPtr BNCreateStructureBuilderWithOptions( + + // BNStructureVariant type + StructureVariant type , + + // bool packed + bool packed + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateStructureFromOffsetAccess.cs b/Function/BNCreateStructureFromOffsetAccess.cs new file mode 100644 index 0000000..e5b9076 --- /dev/null +++ b/Function/BNCreateStructureFromOffsetAccess.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNStructure* BNCreateStructureFromOffsetAccess(BNBinaryView* view, BNQualifiedName* name, bool* newMember) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateStructureFromOffsetAccess" + )] + internal static extern IntPtr BNCreateStructureFromOffsetAccess( + + // BNBinaryView* view + IntPtr view , + + // BNQualifiedName* name + in BNQualifiedName name , + + // bool* newMember + out bool newMember + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateStructureMemberFromAccess.cs b/Function/BNCreateStructureMemberFromAccess.cs new file mode 100644 index 0000000..cc3d202 --- /dev/null +++ b/Function/BNCreateStructureMemberFromAccess.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeWithConfidence BNCreateStructureMemberFromAccess(BNBinaryView* view, BNQualifiedName* name, uint64_t offset) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateStructureMemberFromAccess" + )] + internal static extern BNTypeWithConfidence BNCreateStructureMemberFromAccess( + + // BNBinaryView* view + IntPtr view , + + // BNQualifiedName* name + in BNQualifiedName name , + + // uint64_t offset + ulong offset + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateStructureType.cs b/Function/BNCreateStructureType.cs new file mode 100644 index 0000000..03ea344 --- /dev/null +++ b/Function/BNCreateStructureType.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNType* BNCreateStructureType(BNStructure* s) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateStructureType" + )] + internal static extern IntPtr BNCreateStructureType( + + // BNStructure* s + IntPtr s + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateStructureTypeBuilder.cs b/Function/BNCreateStructureTypeBuilder.cs new file mode 100644 index 0000000..e2a8de4 --- /dev/null +++ b/Function/BNCreateStructureTypeBuilder.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeBuilder* BNCreateStructureTypeBuilder(BNStructure* s) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateStructureTypeBuilder" + )] + internal static extern IntPtr BNCreateStructureTypeBuilder( + + // BNStructure* s + IntPtr s + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateStructureTypeBuilderWithBuilder.cs b/Function/BNCreateStructureTypeBuilderWithBuilder.cs new file mode 100644 index 0000000..3afa6aa --- /dev/null +++ b/Function/BNCreateStructureTypeBuilderWithBuilder.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeBuilder* BNCreateStructureTypeBuilderWithBuilder(BNStructureBuilder* s) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateStructureTypeBuilderWithBuilder" + )] + internal static extern IntPtr BNCreateStructureTypeBuilderWithBuilder( + + // BNStructureBuilder* s + IntPtr s + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateSymbol.cs b/Function/BNCreateSymbol.cs new file mode 100644 index 0000000..b27f65a --- /dev/null +++ b/Function/BNCreateSymbol.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNSymbol* BNCreateSymbol(BNSymbolType type, const char* shortName, const char* fullName, const char* rawName, uint64_t addr, BNSymbolBinding binding, BNNameSpace* nameSpace, uint64_t ordinal) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCreateSymbol" + )] + internal static extern IntPtr BNCreateSymbol( + + // BNSymbolType type + SymbolType type , + + // const char* shortName + string shortName , + + // const char* fullName + string fullName , + + // const char* rawName + string rawName , + + // uint64_t addr + ulong addr , + + // BNSymbolBinding binding + SymbolBinding binding , + + // BNNameSpace* _nameSpace + IntPtr _nameSpace , + + // uint64_t ordinal + ulong ordinal + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateSymbolQueue.cs b/Function/BNCreateSymbolQueue.cs new file mode 100644 index 0000000..873fec8 --- /dev/null +++ b/Function/BNCreateSymbolQueue.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNSymbolQueue* BNCreateSymbolQueue() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateSymbolQueue" + )] + internal static extern IntPtr BNCreateSymbolQueue(); + } +} \ No newline at end of file diff --git a/Function/BNCreateTag.cs b/Function/BNCreateTag.cs new file mode 100644 index 0000000..e13fe6a --- /dev/null +++ b/Function/BNCreateTag.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTag* BNCreateTag(BNTagType* type, const char* data) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCreateTag" + )] + internal static extern IntPtr BNCreateTag( + + // BNTagType* type + IntPtr type , + + // const char* data + string data + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateTagType.cs b/Function/BNCreateTagType.cs new file mode 100644 index 0000000..ffa4172 --- /dev/null +++ b/Function/BNCreateTagType.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTagType* BNCreateTagType(BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateTagType" + )] + internal static extern IntPtr BNCreateTagType( + + // BNBinaryView* view + IntPtr view + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateTemporaryFile.cs b/Function/BNCreateTemporaryFile.cs new file mode 100644 index 0000000..4ebf7c8 --- /dev/null +++ b/Function/BNCreateTemporaryFile.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTemporaryFile* BNCreateTemporaryFile() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateTemporaryFile" + )] + internal static extern IntPtr BNCreateTemporaryFile(); + } +} \ No newline at end of file diff --git a/Function/BNCreateTemporaryFileWithContents.cs b/Function/BNCreateTemporaryFileWithContents.cs new file mode 100644 index 0000000..36f001f --- /dev/null +++ b/Function/BNCreateTemporaryFileWithContents.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTemporaryFile* BNCreateTemporaryFileWithContents(BNDataBuffer* data) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateTemporaryFileWithContents" + )] + internal static extern IntPtr BNCreateTemporaryFileWithContents( + + // BNDataBuffer* data + IntPtr data + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateTransformSession.cs b/Function/BNCreateTransformSession.cs new file mode 100644 index 0000000..0d8f902 --- /dev/null +++ b/Function/BNCreateTransformSession.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTransformSession* BNCreateTransformSession(const char* filename) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCreateTransformSession" + )] + internal static extern IntPtr BNCreateTransformSession( + + // const char* filename + string filename + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateTransformSessionFromBinaryView.cs b/Function/BNCreateTransformSessionFromBinaryView.cs new file mode 100644 index 0000000..2bfd6f2 --- /dev/null +++ b/Function/BNCreateTransformSessionFromBinaryView.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTransformSession* BNCreateTransformSessionFromBinaryView(BNBinaryView* initialView) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateTransformSessionFromBinaryView" + )] + internal static extern IntPtr BNCreateTransformSessionFromBinaryView( + + // BNBinaryView* initialView + IntPtr initialView + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateTransformSessionFromBinaryViewWithMode.cs b/Function/BNCreateTransformSessionFromBinaryViewWithMode.cs new file mode 100644 index 0000000..fdb3863 --- /dev/null +++ b/Function/BNCreateTransformSessionFromBinaryViewWithMode.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTransformSession* BNCreateTransformSessionFromBinaryViewWithMode(BNBinaryView* initialView, BNTransformSessionMode mode) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateTransformSessionFromBinaryViewWithMode" + )] + internal static extern IntPtr BNCreateTransformSessionFromBinaryViewWithMode( + + // BNBinaryView* initialView + IntPtr initialView , + + // BNTransformSessionMode mode + TransformSessionMode mode + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateTransformSessionWithMode.cs b/Function/BNCreateTransformSessionWithMode.cs new file mode 100644 index 0000000..eebc9fb --- /dev/null +++ b/Function/BNCreateTransformSessionWithMode.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTransformSession* BNCreateTransformSessionWithMode(const char* filename, BNTransformSessionMode mode) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCreateTransformSessionWithMode" + )] + internal static extern IntPtr BNCreateTransformSessionWithMode( + + // const char* filename + string filename , + + // BNTransformSessionMode mode + TransformSessionMode mode + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateTypeArchive.cs b/Function/BNCreateTypeArchive.cs new file mode 100644 index 0000000..190f32b --- /dev/null +++ b/Function/BNCreateTypeArchive.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeArchive* BNCreateTypeArchive(const char* path, BNPlatform* platform) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCreateTypeArchive" + )] + internal static extern IntPtr BNCreateTypeArchive( + + // const char* path + string path , + + // BNPlatform* platform + IntPtr platform + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateTypeArchiveWithId.cs b/Function/BNCreateTypeArchiveWithId.cs new file mode 100644 index 0000000..effd711 --- /dev/null +++ b/Function/BNCreateTypeArchiveWithId.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeArchive* BNCreateTypeArchiveWithId(const char* path, BNPlatform* platform, const char* id) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCreateTypeArchiveWithId" + )] + internal static extern IntPtr BNCreateTypeArchiveWithId( + + // const char* path + string path , + + // BNPlatform* platform + IntPtr platform , + + // const char* id + string id + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateTypeBuilderFromType.cs b/Function/BNCreateTypeBuilderFromType.cs new file mode 100644 index 0000000..8b56d3d --- /dev/null +++ b/Function/BNCreateTypeBuilderFromType.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeBuilder* BNCreateTypeBuilderFromType(BNType* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateTypeBuilderFromType" + )] + internal static extern IntPtr BNCreateTypeBuilderFromType( + + // BNType* type + IntPtr type + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateUserFunction.cs b/Function/BNCreateUserFunction.cs new file mode 100644 index 0000000..cab6245 --- /dev/null +++ b/Function/BNCreateUserFunction.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFunction* BNCreateUserFunction(BNBinaryView* view, BNPlatform* platform, uint64_t addr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateUserFunction" + )] + internal static extern IntPtr BNCreateUserFunction( + + // BNBinaryView* view + IntPtr view , + + // BNPlatform* platform + IntPtr platform , + + // uint64_t addr + ulong addr + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateUserStackVariable.cs b/Function/BNCreateUserStackVariable.cs new file mode 100644 index 0000000..328364b --- /dev/null +++ b/Function/BNCreateUserStackVariable.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNCreateUserStackVariable(BNFunction* func, int64_t offset, BNTypeWithConfidence* type, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCreateUserStackVariable" + )] + internal static extern void BNCreateUserStackVariable( + + // BNFunction* func + IntPtr func , + + // int64_t offset + long offset , + + // BNTypeWithConfidence* type + IntPtr type , + + // const char* name + string name + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateUserVariable.cs b/Function/BNCreateUserVariable.cs new file mode 100644 index 0000000..0aa2095 --- /dev/null +++ b/Function/BNCreateUserVariable.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNCreateUserVariable(BNFunction* func, BNVariable* var, BNTypeWithConfidence* type, const char* name, bool ignoreDisjointUses) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCreateUserVariable" + )] + internal static extern void BNCreateUserVariable( + + // BNFunction* func + IntPtr func , + + // BNVariable* _var + IntPtr _var , + + // BNTypeWithConfidence* type + IntPtr type , + + // const char* name + string name , + + // bool ignoreDisjointUses + bool ignoreDisjointUses + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateValueType.cs b/Function/BNCreateValueType.cs new file mode 100644 index 0000000..bf64ba8 --- /dev/null +++ b/Function/BNCreateValueType.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNType* BNCreateValueType(const char* value) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCreateValueType" + )] + internal static extern IntPtr BNCreateValueType( + + // const char* _value + string _value + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateValueTypeBuilder.cs b/Function/BNCreateValueTypeBuilder.cs new file mode 100644 index 0000000..2c3ea8c --- /dev/null +++ b/Function/BNCreateValueTypeBuilder.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeBuilder* BNCreateValueTypeBuilder(const char* value) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCreateValueTypeBuilder" + )] + internal static extern IntPtr BNCreateValueTypeBuilder( + + // const char* _value + string _value + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateVarArgsType.cs b/Function/BNCreateVarArgsType.cs new file mode 100644 index 0000000..9199745 --- /dev/null +++ b/Function/BNCreateVarArgsType.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNType* BNCreateVarArgsType() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateVarArgsType" + )] + internal static extern IntPtr BNCreateVarArgsType(); + } +} \ No newline at end of file diff --git a/Function/BNCreateVarArgsTypeBuilder.cs b/Function/BNCreateVarArgsTypeBuilder.cs new file mode 100644 index 0000000..9f44d10 --- /dev/null +++ b/Function/BNCreateVarArgsTypeBuilder.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeBuilder* BNCreateVarArgsTypeBuilder() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateVarArgsTypeBuilder" + )] + internal static extern IntPtr BNCreateVarArgsTypeBuilder(); + } +} \ No newline at end of file diff --git a/Function/BNCreateVoidType.cs b/Function/BNCreateVoidType.cs new file mode 100644 index 0000000..9d01e72 --- /dev/null +++ b/Function/BNCreateVoidType.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNType* BNCreateVoidType() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCreateVoidType" + )] + internal static extern IntPtr BNCreateVoidType( + + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateVoidTypeBuilder.cs b/Function/BNCreateVoidTypeBuilder.cs new file mode 100644 index 0000000..06431e6 --- /dev/null +++ b/Function/BNCreateVoidTypeBuilder.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeBuilder* BNCreateVoidTypeBuilder() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateVoidTypeBuilder" + )] + internal static extern IntPtr BNCreateVoidTypeBuilder(); + } +} \ No newline at end of file diff --git a/Function/BNCreateWebsocketProviderClient.cs b/Function/BNCreateWebsocketProviderClient.cs new file mode 100644 index 0000000..faf43c7 --- /dev/null +++ b/Function/BNCreateWebsocketProviderClient.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNWebsocketClient* BNCreateWebsocketProviderClient(BNWebsocketProvider* provider) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNCreateWebsocketProviderClient" + )] + internal static extern IntPtr BNCreateWebsocketProviderClient( + + // BNWebsocketProvider* provider + IntPtr provider + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateWideCharType.cs b/Function/BNCreateWideCharType.cs new file mode 100644 index 0000000..8111e88 --- /dev/null +++ b/Function/BNCreateWideCharType.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNType* BNCreateWideCharType(uint64_t width, const char* altName) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCreateWideCharType" + )] + internal static extern IntPtr BNCreateWideCharType( + + // uint64_t width + ulong width , + + // const char* altName + string altName + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateWideCharTypeBuilder.cs b/Function/BNCreateWideCharTypeBuilder.cs new file mode 100644 index 0000000..4bc6b27 --- /dev/null +++ b/Function/BNCreateWideCharTypeBuilder.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeBuilder* BNCreateWideCharTypeBuilder(uint64_t width, const char* altName) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCreateWideCharTypeBuilder" + )] + internal static extern IntPtr BNCreateWideCharTypeBuilder( + + // uint64_t width + ulong width , + + // const char* altName + string altName + ); + } +} \ No newline at end of file diff --git a/Function/BNCreateWorkflow.cs b/Function/BNCreateWorkflow.cs new file mode 100644 index 0000000..5946570 --- /dev/null +++ b/Function/BNCreateWorkflow.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNWorkflow* BNCreateWorkflow(const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNCreateWorkflow" + )] + internal static extern IntPtr BNCreateWorkflow( + + // const char* name + string name + ); + } +} \ No newline at end of file diff --git a/Function/BNDataBufferToBase64.cs b/Function/BNDataBufferToBase64.cs new file mode 100644 index 0000000..a7fa761 --- /dev/null +++ b/Function/BNDataBufferToBase64.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// char* BNDataBufferToBase64(BNDataBuffer* buf) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNDataBufferToBase64" + )] + internal static extern IntPtr BNDataBufferToBase64( + + // BNDataBuffer* buf + IntPtr buf + ); + } +} \ No newline at end of file diff --git a/Function/BNDataBufferToEscapedString.cs b/Function/BNDataBufferToEscapedString.cs new file mode 100644 index 0000000..0a7531a --- /dev/null +++ b/Function/BNDataBufferToEscapedString.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNDataBufferToEscapedString(BNDataBuffer* buf, bool nullTerminates, bool escapePrintable) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNDataBufferToEscapedString" + )] + internal static extern IntPtr BNDataBufferToEscapedString( + + // BNDataBuffer* buf + IntPtr buf , + + // bool nullTerminates + bool nullTerminates , + + // bool escapePrintable + bool escapePrintable + ); + } +} \ No newline at end of file diff --git a/Function/BNDatabaseHasGlobal.cs b/Function/BNDatabaseHasGlobal.cs new file mode 100644 index 0000000..5887561 --- /dev/null +++ b/Function/BNDatabaseHasGlobal.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// int32_t BNDatabaseHasGlobal(BNDatabase* database, const char* key) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNDatabaseHasGlobal" + )] + internal static extern int BNDatabaseHasGlobal( + + // BNDatabase* database + IntPtr database , + + // const char* key + string key + ); + } +} \ No newline at end of file diff --git a/Function/BNDatabaseReloadConnection.cs b/Function/BNDatabaseReloadConnection.cs new file mode 100644 index 0000000..faae7ce --- /dev/null +++ b/Function/BNDatabaseReloadConnection.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNDatabaseReloadConnection(BNDatabase* database) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNDatabaseReloadConnection" + )] + internal static extern void BNDatabaseReloadConnection( + + // BNDatabase* database + IntPtr database + ); + } +} \ No newline at end of file diff --git a/Function/BNDeauthenticateEnterpriseServer.cs b/Function/BNDeauthenticateEnterpriseServer.cs new file mode 100644 index 0000000..8427feb --- /dev/null +++ b/Function/BNDeauthenticateEnterpriseServer.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNDeauthenticateEnterpriseServer() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNDeauthenticateEnterpriseServer" + )] + internal static extern bool BNDeauthenticateEnterpriseServer(); + } +} \ No newline at end of file diff --git a/Function/BNDecode.cs b/Function/BNDecode.cs new file mode 100644 index 0000000..a7865f4 --- /dev/null +++ b/Function/BNDecode.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNDecode(BNTransform* xform, BNDataBuffer* input, BNDataBuffer* output, BNTransformParameter* @params, uint64_t paramCount) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNDecode" + )] + internal static extern bool BNDecode( + + // BNTransform* xform + IntPtr xform , + + // BNDataBuffer* input + IntPtr input , + + // BNDataBuffer* output + IntPtr output , + + // BNTransformParameter* _params + BNTransformParameter[] _params , + + // uint64_t paramCount + ulong paramCount + ); + } +} \ No newline at end of file diff --git a/Function/BNDecodeBase64.cs b/Function/BNDecodeBase64.cs new file mode 100644 index 0000000..3d4368d --- /dev/null +++ b/Function/BNDecodeBase64.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDataBuffer* BNDecodeBase64(const char* str) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNDecodeBase64" + )] + internal static extern IntPtr BNDecodeBase64( + + // const char* str + string str + ); + } +} \ No newline at end of file diff --git a/Function/BNDecodeEscapedString.cs b/Function/BNDecodeEscapedString.cs new file mode 100644 index 0000000..6be9ce3 --- /dev/null +++ b/Function/BNDecodeEscapedString.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDataBuffer* BNDecodeEscapedString(const char* str) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNDecodeEscapedString" + )] + internal static extern IntPtr BNDecodeEscapedString( + + // const char* str + string str + + ); + } +} \ No newline at end of file diff --git a/Function/BNDecodeWithContext.cs b/Function/BNDecodeWithContext.cs new file mode 100644 index 0000000..172e2b6 --- /dev/null +++ b/Function/BNDecodeWithContext.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNDecodeWithContext(BNTransform* xform, BNTransformContext* context, BNTransformParameter* @params, uint64_t paramCount) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNDecodeWithContext" + )] + internal static extern bool BNDecodeWithContext( + + // BNTransform* xform + IntPtr xform , + + // BNTransformContext* context + IntPtr context , + + // BNTransformParameter* _params + BNTransformParameter[] _params , + + // uint64_t paramCount + ulong paramCount + ); + } +} \ No newline at end of file diff --git a/Function/BNDefaultDisassemblySettings.cs b/Function/BNDefaultDisassemblySettings.cs new file mode 100644 index 0000000..51af175 --- /dev/null +++ b/Function/BNDefaultDisassemblySettings.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDisassemblySettings* BNDefaultDisassemblySettings() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNDefaultDisassemblySettings" + )] + internal static extern IntPtr BNDefaultDisassemblySettings(); + } +} \ No newline at end of file diff --git a/Function/BNDefaultGraphDisassemblySettings.cs b/Function/BNDefaultGraphDisassemblySettings.cs new file mode 100644 index 0000000..0997941 --- /dev/null +++ b/Function/BNDefaultGraphDisassemblySettings.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDisassemblySettings* BNDefaultGraphDisassemblySettings() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNDefaultGraphDisassemblySettings" + )] + internal static extern IntPtr BNDefaultGraphDisassemblySettings(); + } +} \ No newline at end of file diff --git a/Function/BNDefaultLinearDisassemblySettings.cs b/Function/BNDefaultLinearDisassemblySettings.cs new file mode 100644 index 0000000..d17a515 --- /dev/null +++ b/Function/BNDefaultLinearDisassemblySettings.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDisassemblySettings* BNDefaultLinearDisassemblySettings() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNDefaultLinearDisassemblySettings" + )] + internal static extern IntPtr BNDefaultLinearDisassemblySettings(); + } +} \ No newline at end of file diff --git a/Function/BNDefineAnalysisType.cs b/Function/BNDefineAnalysisType.cs new file mode 100644 index 0000000..d2a122b --- /dev/null +++ b/Function/BNDefineAnalysisType.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNQualifiedName BNDefineAnalysisType(BNBinaryView* view, const char* id, BNQualifiedName* defaultName, BNType* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNDefineAnalysisType" + )] + internal static extern BNQualifiedName BNDefineAnalysisType( + + // BNBinaryView* view + IntPtr view , + + // const char* id + string id , + + // BNQualifiedName* defaultName + in BNQualifiedName defaultName , + + // BNType* type + IntPtr type + ); + } +} \ No newline at end of file diff --git a/Function/BNDefineAnalysisTypes.cs b/Function/BNDefineAnalysisTypes.cs new file mode 100644 index 0000000..a5a4514 --- /dev/null +++ b/Function/BNDefineAnalysisTypes.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNDefineAnalysisTypes(BNBinaryView* view, BNQualifiedNameTypeAndId* types, uint64_t count, void** progress, void* progressContext, const char*** resultIds, BNQualifiedName** resultNames) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNDefineAnalysisTypes" + )] + internal static extern ulong BNDefineAnalysisTypes( + + // BNBinaryView* view + IntPtr view , + + // BNQualifiedNameTypeAndId* types + in BNQualifiedNameTypeAndId[] types , + + // uint64_t count + ulong count , + + // void* progress + IntPtr progress , + + // void* progressContext + IntPtr progressContext , + + // char** resultIds + out IntPtr resultIds , + + // BNQualifiedName** resultNames + out IntPtr resultNames + ); + } +} \ No newline at end of file diff --git a/Function/BNDefineAutoSymbol.cs b/Function/BNDefineAutoSymbol.cs new file mode 100644 index 0000000..5d35400 --- /dev/null +++ b/Function/BNDefineAutoSymbol.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNDefineAutoSymbol(BNBinaryView* view, BNSymbol* sym) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNDefineAutoSymbol" + )] + internal static extern void BNDefineAutoSymbol( + + // BNBinaryView* view + IntPtr view , + + // BNSymbol* sym + IntPtr sym + ); + } +} \ No newline at end of file diff --git a/Function/BNDefineAutoSymbolAndVariableOrFunction.cs b/Function/BNDefineAutoSymbolAndVariableOrFunction.cs new file mode 100644 index 0000000..5ff9e25 --- /dev/null +++ b/Function/BNDefineAutoSymbolAndVariableOrFunction.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNSymbol* BNDefineAutoSymbolAndVariableOrFunction(BNBinaryView* view, BNPlatform* platform, BNSymbol* sym, BNTypeWithConfidence* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNDefineAutoSymbolAndVariableOrFunction" + )] + internal static extern IntPtr BNDefineAutoSymbolAndVariableOrFunction( + + // BNBinaryView* view + IntPtr view , + + // BNPlatform* platform + IntPtr platform , + + // BNSymbol* sym + IntPtr sym , + + // BNTypeWithConfidence* type + IntPtr type + ); + } +} \ No newline at end of file diff --git a/Function/BNDefineDataVariable.cs b/Function/BNDefineDataVariable.cs new file mode 100644 index 0000000..77dda2a --- /dev/null +++ b/Function/BNDefineDataVariable.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNDefineDataVariable(BNBinaryView* view, uint64_t addr, BNTypeWithConfidence* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNDefineDataVariable" + )] + internal static extern void BNDefineDataVariable( + + // BNBinaryView* view + IntPtr view , + + // uint64_t addr + ulong addr , + + // BNTypeWithConfidence* type + in BNTypeWithConfidence type + ); + } +} \ No newline at end of file diff --git a/Function/BNDefineImportedFunction.cs b/Function/BNDefineImportedFunction.cs new file mode 100644 index 0000000..8c02216 --- /dev/null +++ b/Function/BNDefineImportedFunction.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNDefineImportedFunction(BNBinaryView* view, BNSymbol* importAddressSym, BNFunction* func, BNType* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNDefineImportedFunction" + )] + internal static extern void BNDefineImportedFunction( + + // BNBinaryView* view + IntPtr view , + + // BNSymbol* importAddressSym + IntPtr importAddressSym , + + // BNFunction* func + IntPtr func , + + // BNType* type + IntPtr type + ); + } +} \ No newline at end of file diff --git a/Function/BNDefineRelocation.cs b/Function/BNDefineRelocation.cs new file mode 100644 index 0000000..7034597 --- /dev/null +++ b/Function/BNDefineRelocation.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNDefineRelocation(BNBinaryView* view, BNArchitecture* arch, BNRelocationInfo* info, uint64_t target, uint64_t reloc) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNDefineRelocation" + )] + internal static extern void BNDefineRelocation( + + // BNBinaryView* view + IntPtr view , + + // BNArchitecture* arch + IntPtr arch , + + // BNRelocationInfo* info + IntPtr info , + + // uint64_t target + ulong target , + + // uint64_t reloc + ulong reloc + ); + } +} \ No newline at end of file diff --git a/Function/BNDefineSymbolRelocation.cs b/Function/BNDefineSymbolRelocation.cs new file mode 100644 index 0000000..14018bb --- /dev/null +++ b/Function/BNDefineSymbolRelocation.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNDefineSymbolRelocation(BNBinaryView* view, BNArchitecture* arch, BNRelocationInfo* info, BNSymbol* target, uint64_t reloc) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNDefineSymbolRelocation" + )] + internal static extern void BNDefineSymbolRelocation( + + // BNBinaryView* view + IntPtr view , + + // BNArchitecture* arch + IntPtr arch , + + // BNRelocationInfo* info + IntPtr info , + + // BNSymbol* target + IntPtr target , + + // uint64_t reloc + ulong reloc + + ); + } +} \ No newline at end of file diff --git a/Function/BNDefineUserAnalysisType.cs b/Function/BNDefineUserAnalysisType.cs new file mode 100644 index 0000000..2d2f18b --- /dev/null +++ b/Function/BNDefineUserAnalysisType.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNDefineUserAnalysisType(BNBinaryView* view, BNQualifiedName* name, BNType* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNDefineUserAnalysisType" + )] + internal static extern void BNDefineUserAnalysisType( + + // BNBinaryView* view + IntPtr view , + + // BNQualifiedName* name + in BNQualifiedName name , + + // BNType* type + IntPtr type + ); + } +} \ No newline at end of file diff --git a/Function/BNDefineUserAnalysisTypes.cs b/Function/BNDefineUserAnalysisTypes.cs new file mode 100644 index 0000000..9a527ab --- /dev/null +++ b/Function/BNDefineUserAnalysisTypes.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNDefineUserAnalysisTypes(BNBinaryView* view, BNQualifiedNameAndType* types, uint64_t count, void** progress, void* progressContext) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNDefineUserAnalysisTypes" + )] + internal static extern void BNDefineUserAnalysisTypes( + + // BNBinaryView* view + IntPtr view , + + // BNQualifiedNameAndType* types + BNQualifiedNameAndType[] types , + + // uint64_t count + ulong count , + + // void* progress + IntPtr progress , + + // void* progressContext + IntPtr progressContext + ); + } +} \ No newline at end of file diff --git a/Function/BNDefineUserDataVariable.cs b/Function/BNDefineUserDataVariable.cs new file mode 100644 index 0000000..484d15e --- /dev/null +++ b/Function/BNDefineUserDataVariable.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNDefineUserDataVariable(BNBinaryView* view, uint64_t addr, BNTypeWithConfidence* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNDefineUserDataVariable" + )] + internal static extern void BNDefineUserDataVariable( + + // BNBinaryView* view + IntPtr view , + + // uint64_t addr + ulong addr , + + // BNTypeWithConfidence* type + in BNTypeWithConfidence type + ); + } +} \ No newline at end of file diff --git a/Function/BNDefineUserSymbol.cs b/Function/BNDefineUserSymbol.cs new file mode 100644 index 0000000..0fef66a --- /dev/null +++ b/Function/BNDefineUserSymbol.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNDefineUserSymbol(BNBinaryView* view, BNSymbol* sym) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNDefineUserSymbol" + )] + internal static extern void BNDefineUserSymbol( + + // BNBinaryView* view + IntPtr view , + + // BNSymbol* sym + IntPtr sym + ); + } +} \ No newline at end of file diff --git a/Function/BNDeleteAutoStackVariable.cs b/Function/BNDeleteAutoStackVariable.cs new file mode 100644 index 0000000..72ee2cc --- /dev/null +++ b/Function/BNDeleteAutoStackVariable.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNDeleteAutoStackVariable(BNFunction* func, int64_t offset) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNDeleteAutoStackVariable" + )] + internal static extern void BNDeleteAutoStackVariable( + + // BNFunction* func + IntPtr func , + + // int64_t offset + long offset + + ); + } +} \ No newline at end of file diff --git a/Function/BNDeleteDirectory.cs b/Function/BNDeleteDirectory.cs new file mode 100644 index 0000000..39f722e --- /dev/null +++ b/Function/BNDeleteDirectory.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNDeleteDirectory(const char* path) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNDeleteDirectory" + )] + internal static extern bool BNDeleteDirectory( + + // const char* path + string path + + ); + } +} \ No newline at end of file diff --git a/Function/BNDeleteFile.cs b/Function/BNDeleteFile.cs new file mode 100644 index 0000000..84e27a3 --- /dev/null +++ b/Function/BNDeleteFile.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNDeleteFile(const char* path) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNDeleteFile" + )] + internal static extern bool BNDeleteFile( + + // const char* path + string path + + ); + } +} \ No newline at end of file diff --git a/Function/BNDeleteSecretsProviderData.cs b/Function/BNDeleteSecretsProviderData.cs new file mode 100644 index 0000000..b6b9cf6 --- /dev/null +++ b/Function/BNDeleteSecretsProviderData.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNDeleteSecretsProviderData(BNSecretsProvider* provider, const char* key) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNDeleteSecretsProviderData" + )] + internal static extern bool BNDeleteSecretsProviderData( + + // BNSecretsProvider* provider + IntPtr provider , + + // const char* key + string key + + ); + } +} \ No newline at end of file diff --git a/Function/BNDeleteTypeArchiveType.cs b/Function/BNDeleteTypeArchiveType.cs new file mode 100644 index 0000000..10f3b90 --- /dev/null +++ b/Function/BNDeleteTypeArchiveType.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNDeleteTypeArchiveType(BNTypeArchive* archive, const char* id) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNDeleteTypeArchiveType" + )] + internal static extern bool BNDeleteTypeArchiveType( + + // BNTypeArchive* archive + IntPtr archive , + + // const char* id + string id + + ); + } +} \ No newline at end of file diff --git a/Function/BNDeleteUserStackVariable.cs b/Function/BNDeleteUserStackVariable.cs new file mode 100644 index 0000000..88e3c1e --- /dev/null +++ b/Function/BNDeleteUserStackVariable.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNDeleteUserStackVariable(BNFunction* func, int64_t offset) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNDeleteUserStackVariable" + )] + internal static extern void BNDeleteUserStackVariable( + + // BNFunction* func + IntPtr func , + + // int64_t offset + long offset + + ); + } +} \ No newline at end of file diff --git a/Function/BNDeleteUserVariable.cs b/Function/BNDeleteUserVariable.cs new file mode 100644 index 0000000..e2e4c47 --- /dev/null +++ b/Function/BNDeleteUserVariable.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNDeleteUserVariable(BNFunction* func, BNVariable* var) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNDeleteUserVariable" + )] + internal static extern void BNDeleteUserVariable( + + // BNFunction* func + IntPtr func , + + // BNVariable* _var + IntPtr _var + + ); + } +} \ No newline at end of file diff --git a/Function/BNDemangleGNU3.cs b/Function/BNDemangleGNU3.cs new file mode 100644 index 0000000..c9627b1 --- /dev/null +++ b/Function/BNDemangleGNU3.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNDemangleGNU3(BNArchitecture* arch, const char* mangledName, BNType** outType, const char*** outVarName, uint64_t* outVarNameElements, bool simplify) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNDemangleGNU3" + )] + internal static extern bool BNDemangleGNU3( + + // BNArchitecture* arch + IntPtr arch , + + // const char* mangledName + string mangledName , + + // BNType** outType + IntPtr outType , + + // const char*** outVarName + IntPtr outVarName , + + // uint64_t* outVarNameElements + IntPtr outVarNameElements , + + // bool simplify + bool simplify + + ); + } +} \ No newline at end of file diff --git a/Function/BNDemangleGNU3WithOptions.cs b/Function/BNDemangleGNU3WithOptions.cs new file mode 100644 index 0000000..659d019 --- /dev/null +++ b/Function/BNDemangleGNU3WithOptions.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNDemangleGNU3WithOptions(BNArchitecture* arch, const char* mangledName, BNType** outType, const char*** outVarName, uint64_t* outVarNameElements, BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNDemangleGNU3WithOptions" + )] + internal static extern bool BNDemangleGNU3WithOptions( + + // BNArchitecture* arch + IntPtr arch , + + // const char* mangledName + string mangledName , + + // BNType** outType + IntPtr outType , + + // const char*** outVarName + IntPtr outVarName , + + // uint64_t* outVarNameElements + IntPtr outVarNameElements , + + // BNBinaryView* view + IntPtr view + + ); + } +} \ No newline at end of file diff --git a/Function/BNDemangleGeneric.cs b/Function/BNDemangleGeneric.cs new file mode 100644 index 0000000..9f9d57f --- /dev/null +++ b/Function/BNDemangleGeneric.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNDemangleGeneric(BNArchitecture* arch, const char* name, BNType** outType, BNQualifiedName* outVarName, BNBinaryView* view, bool simplify) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNDemangleGeneric" + )] + internal static extern bool BNDemangleGeneric( + + // BNArchitecture* arch + IntPtr arch , + + // const char* name + string name , + + // BNType** outType + IntPtr outType , + + // BNQualifiedName* outVarName + IntPtr outVarName , + + // BNBinaryView* view + IntPtr view , + + // bool simplify + bool simplify + + ); + } +} \ No newline at end of file diff --git a/Function/BNDemangleLLVM.cs b/Function/BNDemangleLLVM.cs new file mode 100644 index 0000000..f1f127c --- /dev/null +++ b/Function/BNDemangleLLVM.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNDemangleLLVM(const char* mangledName, const char*** outVarName, uint64_t* outVarNameElements, bool simplify) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNDemangleLLVM" + )] + internal static extern bool BNDemangleLLVM( + + // const char* mangledName + string mangledName , + + // const char*** outVarName + IntPtr outVarName , + + // uint64_t* outVarNameElements + IntPtr outVarNameElements , + + // bool simplify + bool simplify + + ); + } +} \ No newline at end of file diff --git a/Function/BNDemangleLLVMWithOptions.cs b/Function/BNDemangleLLVMWithOptions.cs new file mode 100644 index 0000000..b488acc --- /dev/null +++ b/Function/BNDemangleLLVMWithOptions.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNDemangleLLVMWithOptions(const char* mangledName, const char*** outVarName, uint64_t* outVarNameElements, BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNDemangleLLVMWithOptions" + )] + internal static extern bool BNDemangleLLVMWithOptions( + + // const char* mangledName + string mangledName , + + // const char*** outVarName + IntPtr outVarName , + + // uint64_t* outVarNameElements + IntPtr outVarNameElements , + + // BNBinaryView* view + IntPtr view + + ); + } +} \ No newline at end of file diff --git a/Function/BNDemangleMS.cs b/Function/BNDemangleMS.cs new file mode 100644 index 0000000..04895cd --- /dev/null +++ b/Function/BNDemangleMS.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNDemangleMS(BNArchitecture* arch, const char* mangledName, BNType** outType, const char*** outVarName, uint64_t* outVarNameElements, bool simplify) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNDemangleMS" + )] + internal static extern bool BNDemangleMS( + + // BNArchitecture* arch + IntPtr arch , + + // const char* mangledName + string mangledName , + + // BNType** outType + IntPtr outType , + + // const char*** outVarName + IntPtr outVarName , + + // uint64_t* outVarNameElements + IntPtr outVarNameElements , + + // bool simplify + bool simplify + + ); + } +} \ No newline at end of file diff --git a/Function/BNDemangleMSPlatform.cs b/Function/BNDemangleMSPlatform.cs new file mode 100644 index 0000000..6c027ae --- /dev/null +++ b/Function/BNDemangleMSPlatform.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNDemangleMSPlatform(BNPlatform* platform, const char* mangledName, BNType** outType, const char*** outVarName, uint64_t* outVarNameElements, bool simplify) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNDemangleMSPlatform" + )] + internal static extern bool BNDemangleMSPlatform( + + // BNPlatform* platform + IntPtr platform , + + // const char* mangledName + string mangledName , + + // BNType** outType + IntPtr outType , + + // const char*** outVarName + IntPtr outVarName , + + // uint64_t* outVarNameElements + IntPtr outVarNameElements , + + // bool simplify + bool simplify + + ); + } +} \ No newline at end of file diff --git a/Function/BNDemangleMSWithOptions.cs b/Function/BNDemangleMSWithOptions.cs new file mode 100644 index 0000000..5c5ee0c --- /dev/null +++ b/Function/BNDemangleMSWithOptions.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNDemangleMSWithOptions(BNArchitecture* arch, const char* mangledName, BNType** outType, const char*** outVarName, uint64_t* outVarNameElements, BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNDemangleMSWithOptions" + )] + internal static extern bool BNDemangleMSWithOptions( + + // BNArchitecture* arch + IntPtr arch , + + // const char* mangledName + string mangledName , + + // BNType** outType + IntPtr outType , + + // const char*** outVarName + IntPtr outVarName , + + // uint64_t* outVarNameElements + IntPtr outVarNameElements , + + // BNBinaryView* view + IntPtr view + + ); + } +} \ No newline at end of file diff --git a/Function/BNDemanglerDemangle.cs b/Function/BNDemanglerDemangle.cs new file mode 100644 index 0000000..4243b75 --- /dev/null +++ b/Function/BNDemanglerDemangle.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNDemanglerDemangle(BNDemangler* demangler, BNArchitecture* arch, const char* name, BNType** outType, BNQualifiedName* outVarName, BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNDemanglerDemangle" + )] + internal static extern bool BNDemanglerDemangle( + + // BNDemangler* demangler + IntPtr demangler , + + // BNArchitecture* arch + IntPtr arch , + + // const char* name + string name , + + // BNType** outType + IntPtr outType , + + // BNQualifiedName* outVarName + IntPtr outVarName , + + // BNBinaryView* view + IntPtr view + + ); + } +} \ No newline at end of file diff --git a/Function/BNDeserializeSettings.cs b/Function/BNDeserializeSettings.cs new file mode 100644 index 0000000..bcafc34 --- /dev/null +++ b/Function/BNDeserializeSettings.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNDeserializeSettings(BNSettings* settings, const char* contents, BNBinaryView* view, BNFunction* func, BNSettingsScope scope) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNDeserializeSettings" + )] + internal static extern bool BNDeserializeSettings( + + // BNSettings* settings + IntPtr settings , + + // const char* contents + string contents , + + // BNBinaryView* view + IntPtr view , + + // BNFunction* func + IntPtr func , + + // BNSettingsScope scope + SettingsScope scope + ); + } +} \ No newline at end of file diff --git a/Function/BNDestroySymbolQueue.cs b/Function/BNDestroySymbolQueue.cs new file mode 100644 index 0000000..3519549 --- /dev/null +++ b/Function/BNDestroySymbolQueue.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNDestroySymbolQueue(BNSymbolQueue* queue) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNDestroySymbolQueue" + )] + internal static extern void BNDestroySymbolQueue( + + // BNSymbolQueue* queue + IntPtr queue + + ); + } +} \ No newline at end of file diff --git a/Function/BNDetectBaseAddress.cs b/Function/BNDetectBaseAddress.cs new file mode 100644 index 0000000..339cd06 --- /dev/null +++ b/Function/BNDetectBaseAddress.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNDetectBaseAddress(BNBaseAddressDetection* bad, BNBaseAddressDetectionSettings* settings) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNDetectBaseAddress" + )] + internal static extern bool BNDetectBaseAddress( + + // BNBaseAddressDetection* bad + IntPtr bad , + + // BNBaseAddressDetectionSettings* settings + IntPtr settings + + ); + } +} \ No newline at end of file diff --git a/Function/BNDetectSearchMode.cs b/Function/BNDetectSearchMode.cs new file mode 100644 index 0000000..e0f925d --- /dev/null +++ b/Function/BNDetectSearchMode.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + + public static partial class Core + { + public static string DetectSearchMode(string query) + { + return UnsafeUtils.TakeAnsiString( + NativeMethods.BNDetectSearchMode(query) + ); + } + } + + internal static partial class NativeMethods + { + /// + /// const char* BNDetectSearchMode(const char* query) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNDetectSearchMode" + )] + internal static extern IntPtr BNDetectSearchMode( + + // const char* query + string query + ); + } +} \ No newline at end of file diff --git a/Function/BNDisablePlugins.cs b/Function/BNDisablePlugins.cs new file mode 100644 index 0000000..7d8dd40 --- /dev/null +++ b/Function/BNDisablePlugins.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public static partial class Core + { + public static void DisablePlugins() + { + NativeMethods.BNDisablePlugins(); + } + } + + internal static partial class NativeMethods + { + /// + /// void BNDisablePlugins() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNDisablePlugins" + )] + public static extern void BNDisablePlugins(); + } +} \ No newline at end of file diff --git a/Function/BNDisassemblyTextRendererHasDataFlow.cs b/Function/BNDisassemblyTextRendererHasDataFlow.cs new file mode 100644 index 0000000..c52eb47 --- /dev/null +++ b/Function/BNDisassemblyTextRendererHasDataFlow.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNDisassemblyTextRendererHasDataFlow(BNDisassemblyTextRenderer* renderer) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNDisassemblyTextRendererHasDataFlow" + )] + internal static extern bool BNDisassemblyTextRendererHasDataFlow( + + // BNDisassemblyTextRenderer* renderer + IntPtr renderer + + ); + } +} \ No newline at end of file diff --git a/Function/BNDisassemblyTextRendererWrapComment.cs b/Function/BNDisassemblyTextRendererWrapComment.cs new file mode 100644 index 0000000..e6133b3 --- /dev/null +++ b/Function/BNDisassemblyTextRendererWrapComment.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDisassemblyTextLine* BNDisassemblyTextRendererWrapComment(BNDisassemblyTextRenderer* renderer, BNDisassemblyTextLine* inLine, uint64_t* outLineCount, const char* comment, bool hasAutoAnnotations, const char* leadingSpaces, const char* indentSpaces) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNDisassemblyTextRendererWrapComment" + )] + internal static extern IntPtr BNDisassemblyTextRendererWrapComment( + + // BNDisassemblyTextRenderer* renderer + IntPtr renderer , + + // BNDisassemblyTextLine* inLine + IntPtr inLine , + + // uint64_t* outLineCount + IntPtr outLineCount , + + // const char* comment + string comment , + + // bool hasAutoAnnotations + bool hasAutoAnnotations , + + // const char* leadingSpaces + string leadingSpaces , + + // const char* indentSpaces + string indentSpaces + + ); + } +} \ No newline at end of file diff --git a/Function/BNDisconnectWebsocketClient.cs b/Function/BNDisconnectWebsocketClient.cs new file mode 100644 index 0000000..f5acf9d --- /dev/null +++ b/Function/BNDisconnectWebsocketClient.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNDisconnectWebsocketClient(BNWebsocketClient* client) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNDisconnectWebsocketClient" + )] + internal static extern bool BNDisconnectWebsocketClient( + + // BNWebsocketClient* client + IntPtr client + + ); + } +} \ No newline at end of file diff --git a/Function/BNDuplicateDataBuffer.cs b/Function/BNDuplicateDataBuffer.cs new file mode 100644 index 0000000..8ee2820 --- /dev/null +++ b/Function/BNDuplicateDataBuffer.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDataBuffer* BNDuplicateDataBuffer(BNDataBuffer* buf) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNDuplicateDataBuffer" + )] + internal static extern IntPtr BNDuplicateDataBuffer( + + // BNDataBuffer* buf + IntPtr buf + + ); + } +} \ No newline at end of file diff --git a/Function/BNDuplicateDisassemblySettings.cs b/Function/BNDuplicateDisassemblySettings.cs new file mode 100644 index 0000000..e01ec7e --- /dev/null +++ b/Function/BNDuplicateDisassemblySettings.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDisassemblySettings* BNDuplicateDisassemblySettings(BNDisassemblySettings* settings) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNDuplicateDisassemblySettings" + )] + internal static extern IntPtr BNDuplicateDisassemblySettings( + + // BNDisassemblySettings* settings + IntPtr settings + + ); + } +} \ No newline at end of file diff --git a/Function/BNDuplicateEnumerationBuilder.cs b/Function/BNDuplicateEnumerationBuilder.cs new file mode 100644 index 0000000..6932f77 --- /dev/null +++ b/Function/BNDuplicateEnumerationBuilder.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNEnumerationBuilder* BNDuplicateEnumerationBuilder(BNEnumerationBuilder* e) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNDuplicateEnumerationBuilder" + )] + internal static extern IntPtr BNDuplicateEnumerationBuilder( + + // BNEnumerationBuilder* e + IntPtr e + + ); + } +} \ No newline at end of file diff --git a/Function/BNDuplicateLinearViewCursor.cs b/Function/BNDuplicateLinearViewCursor.cs new file mode 100644 index 0000000..90191f7 --- /dev/null +++ b/Function/BNDuplicateLinearViewCursor.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLinearViewCursor* BNDuplicateLinearViewCursor(BNLinearViewCursor* cursor) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNDuplicateLinearViewCursor" + )] + internal static extern IntPtr BNDuplicateLinearViewCursor( + + // BNLinearViewCursor* cursor + IntPtr cursor + ); + } +} \ No newline at end of file diff --git a/Function/BNDuplicateStringRef.cs b/Function/BNDuplicateStringRef.cs new file mode 100644 index 0000000..c6d2ff7 --- /dev/null +++ b/Function/BNDuplicateStringRef.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNStringRef* BNDuplicateStringRef(BNStringRef* @ref) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNDuplicateStringRef" + )] + internal static extern IntPtr BNDuplicateStringRef( + + // BNStringRef* _ref + IntPtr _ref + + ); + } +} \ No newline at end of file diff --git a/Function/BNDuplicateStructureBuilder.cs b/Function/BNDuplicateStructureBuilder.cs new file mode 100644 index 0000000..961bcfc --- /dev/null +++ b/Function/BNDuplicateStructureBuilder.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNStructureBuilder* BNDuplicateStructureBuilder(BNStructureBuilder* s) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNDuplicateStructureBuilder" + )] + internal static extern IntPtr BNDuplicateStructureBuilder( + + // BNStructureBuilder* s + IntPtr s + + ); + } +} \ No newline at end of file diff --git a/Function/BNDuplicateType.cs b/Function/BNDuplicateType.cs new file mode 100644 index 0000000..6442056 --- /dev/null +++ b/Function/BNDuplicateType.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNType* BNDuplicateType(BNType* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNDuplicateType" + )] + internal static extern IntPtr BNDuplicateType( + + // BNType* type + IntPtr type + + ); + } +} \ No newline at end of file diff --git a/Function/BNDuplicateTypeBuilder.cs b/Function/BNDuplicateTypeBuilder.cs new file mode 100644 index 0000000..152978a --- /dev/null +++ b/Function/BNDuplicateTypeBuilder.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeBuilder* BNDuplicateTypeBuilder(BNTypeBuilder* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNDuplicateTypeBuilder" + )] + internal static extern IntPtr BNDuplicateTypeBuilder( + + // BNTypeBuilder* type + IntPtr type + + ); + } +} \ No newline at end of file diff --git a/Function/BNDuplicateTypeContainer.cs b/Function/BNDuplicateTypeContainer.cs new file mode 100644 index 0000000..64b62ae --- /dev/null +++ b/Function/BNDuplicateTypeContainer.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeContainer* BNDuplicateTypeContainer(BNTypeContainer* container) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNDuplicateTypeContainer" + )] + internal static extern IntPtr BNDuplicateTypeContainer( + + // BNTypeContainer* container + IntPtr container + ); + } +} \ No newline at end of file diff --git a/Function/BNDuplicateTypeLibrary.cs b/Function/BNDuplicateTypeLibrary.cs new file mode 100644 index 0000000..464dff8 --- /dev/null +++ b/Function/BNDuplicateTypeLibrary.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeLibrary* BNDuplicateTypeLibrary(BNTypeLibrary* lib) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNDuplicateTypeLibrary" + )] + internal static extern IntPtr BNDuplicateTypeLibrary( + + // BNTypeLibrary* lib + IntPtr lib + + ); + } +} \ No newline at end of file diff --git a/Function/BNEncode.cs b/Function/BNEncode.cs new file mode 100644 index 0000000..96ea66c --- /dev/null +++ b/Function/BNEncode.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNEncode(BNTransform* xform, BNDataBuffer* input, BNDataBuffer* output, BNTransformParameter* @params, uint64_t paramCount) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNEncode" + )] + internal static extern bool BNEncode( + + // BNTransform* xform + IntPtr xform , + + // BNDataBuffer* input + IntPtr input , + + // BNDataBuffer* output + IntPtr output , + + // BNTransformParameter* _params + BNTransformParameter[] _params , + + // uint64_t paramCount + ulong paramCount + ); + } +} \ No newline at end of file diff --git a/Function/BNEndBulkAddSegments.cs b/Function/BNEndBulkAddSegments.cs new file mode 100644 index 0000000..ffe3d95 --- /dev/null +++ b/Function/BNEndBulkAddSegments.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNEndBulkAddSegments(BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNEndBulkAddSegments" + )] + internal static extern void BNEndBulkAddSegments( + + // BNBinaryView* view + IntPtr view + ); + } +} \ No newline at end of file diff --git a/Function/BNEndBulkModifySymbols.cs b/Function/BNEndBulkModifySymbols.cs new file mode 100644 index 0000000..dbc7650 --- /dev/null +++ b/Function/BNEndBulkModifySymbols.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNEndBulkModifySymbols(BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNEndBulkModifySymbols" + )] + internal static extern void BNEndBulkModifySymbols( + + // BNBinaryView* view + IntPtr view + ); + } +} \ No newline at end of file diff --git a/Function/BNEndKeyValueStoreNamespace.cs b/Function/BNEndKeyValueStoreNamespace.cs new file mode 100644 index 0000000..4c52ed3 --- /dev/null +++ b/Function/BNEndKeyValueStoreNamespace.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNEndKeyValueStoreNamespace(BNKeyValueStore* store) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNEndKeyValueStoreNamespace" + )] + internal static extern void BNEndKeyValueStoreNamespace( + + // BNKeyValueStore* store + IntPtr store + ); + } +} \ No newline at end of file diff --git a/Function/BNEnumerateTypesForAccess.cs b/Function/BNEnumerateTypesForAccess.cs new file mode 100644 index 0000000..3f9339d --- /dev/null +++ b/Function/BNEnumerateTypesForAccess.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNEnumerateTypesForAccess(BNType* type, BNBinaryView* data, uint64_t offset, uint64_t size, uint8_t baseConfidence, void** terminal, void* ctxt) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNEnumerateTypesForAccess" + )] + internal static extern bool BNEnumerateTypesForAccess( + + // BNType* type + IntPtr type , + + // BNBinaryView* data + IntPtr data , + + // uint64_t offset + ulong offset , + + // uint64_t size + ulong size , + + // uint8_t baseConfidence + byte baseConfidence , + + // void** terminal + IntPtr terminal , + + // void* ctxt + IntPtr ctxt + + ); + } +} \ No newline at end of file diff --git a/Function/BNEscapeTypeName.cs b/Function/BNEscapeTypeName.cs new file mode 100644 index 0000000..6721251 --- /dev/null +++ b/Function/BNEscapeTypeName.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNEscapeTypeName(const char* name, BNTokenEscapingType escaping) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNEscapeTypeName" + )] + internal static extern IntPtr BNEscapeTypeName( + + // const char* name + string name , + + // BNTokenEscapingType escaping + TokenEscapingType escaping + + ); + } +} \ No newline at end of file diff --git a/Function/BNExecuteMainThreadAction.cs b/Function/BNExecuteMainThreadAction.cs new file mode 100644 index 0000000..0b15ae1 --- /dev/null +++ b/Function/BNExecuteMainThreadAction.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNExecuteMainThreadAction(BNMainThreadAction* action) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNExecuteMainThreadAction" + )] + internal static extern void BNExecuteMainThreadAction( + + // BNMainThreadAction* action + IntPtr action + + ); + } +} \ No newline at end of file diff --git a/Function/BNExecuteOnMainThread.cs b/Function/BNExecuteOnMainThread.cs new file mode 100644 index 0000000..005575a --- /dev/null +++ b/Function/BNExecuteOnMainThread.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNMainThreadAction* BNExecuteOnMainThread(void* ctxt, void** func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNExecuteOnMainThread" + )] + internal static extern IntPtr BNExecuteOnMainThread( + + // void* ctxt + IntPtr ctxt , + + // void** func + IntPtr func + + ); + } +} \ No newline at end of file diff --git a/Function/BNExecuteOnMainThreadAndWait.cs b/Function/BNExecuteOnMainThreadAndWait.cs new file mode 100644 index 0000000..e6a2663 --- /dev/null +++ b/Function/BNExecuteOnMainThreadAndWait.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNExecuteOnMainThreadAndWait(void* ctxt, void** func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNExecuteOnMainThreadAndWait" + )] + internal static extern void BNExecuteOnMainThreadAndWait( + + // void* ctxt + IntPtr ctxt , + + // void** func + IntPtr func + + ); + } +} \ No newline at end of file diff --git a/Function/BNExecuteScriptInput.cs b/Function/BNExecuteScriptInput.cs new file mode 100644 index 0000000..bb54699 --- /dev/null +++ b/Function/BNExecuteScriptInput.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNScriptingProviderExecuteResult BNExecuteScriptInput(BNScriptingInstance* instance, const char* input) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNExecuteScriptInput" + )] + internal static extern ScriptingProviderExecuteResult BNExecuteScriptInput( + + // BNScriptingInstance* instance + IntPtr instance , + + // const char* input + string input + + ); + } +} \ No newline at end of file diff --git a/Function/BNExecuteScriptInputFromFilename.cs b/Function/BNExecuteScriptInputFromFilename.cs new file mode 100644 index 0000000..b9d69cd --- /dev/null +++ b/Function/BNExecuteScriptInputFromFilename.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNScriptingProviderExecuteResult BNExecuteScriptInputFromFilename(BNScriptingInstance* instance, const char* filename) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNExecuteScriptInputFromFilename" + )] + internal static extern ScriptingProviderExecuteResult BNExecuteScriptInputFromFilename( + + // BNScriptingInstance* instance + IntPtr instance , + + // const char* filename + string filename + + ); + } +} \ No newline at end of file diff --git a/Function/BNExecuteWorkerProcess.cs b/Function/BNExecuteWorkerProcess.cs new file mode 100644 index 0000000..d8c929b --- /dev/null +++ b/Function/BNExecuteWorkerProcess.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNExecuteWorkerProcess(const char* path, const char** args, BNDataBuffer* input, const char** output, const char** error, bool stdoutIsText, bool stderrIsText) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNExecuteWorkerProcess" + )] + internal static extern bool BNExecuteWorkerProcess( + + // const char* path + string path , + + // const char** args + string[] args , + + // BNDataBuffer* input + IntPtr input , + + // const char** output + string[] output , + + // const char** error + string[] error , + + // bool stdoutIsText + bool stdoutIsText , + + // bool stderrIsText + bool stderrIsText + + ); + } +} \ No newline at end of file diff --git a/Function/BNExternalLibraryGetBackingFile.cs b/Function/BNExternalLibraryGetBackingFile.cs new file mode 100644 index 0000000..4c2b8cc --- /dev/null +++ b/Function/BNExternalLibraryGetBackingFile.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNProjectFile* BNExternalLibraryGetBackingFile(BNExternalLibrary* lib) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNExternalLibraryGetBackingFile" + )] + internal static extern IntPtr BNExternalLibraryGetBackingFile( + + // BNExternalLibrary* lib + IntPtr lib + + ); + } +} \ No newline at end of file diff --git a/Function/BNExternalLibraryGetName.cs b/Function/BNExternalLibraryGetName.cs new file mode 100644 index 0000000..835f708 --- /dev/null +++ b/Function/BNExternalLibraryGetName.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// char* BNExternalLibraryGetName(BNExternalLibrary* lib) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNExternalLibraryGetName" + )] + internal static extern IntPtr BNExternalLibraryGetName( + + // BNExternalLibrary* lib + IntPtr lib + ); + } +} \ No newline at end of file diff --git a/Function/BNExternalLibrarySetBackingFile.cs b/Function/BNExternalLibrarySetBackingFile.cs new file mode 100644 index 0000000..90998fb --- /dev/null +++ b/Function/BNExternalLibrarySetBackingFile.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNExternalLibrarySetBackingFile(BNExternalLibrary* lib, BNProjectFile* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNExternalLibrarySetBackingFile" + )] + internal static extern void BNExternalLibrarySetBackingFile( + + // BNExternalLibrary* lib + IntPtr lib , + + // BNProjectFile* file + IntPtr file + + ); + } +} \ No newline at end of file diff --git a/Function/BNExternalLocationGetExternalLibrary.cs b/Function/BNExternalLocationGetExternalLibrary.cs new file mode 100644 index 0000000..9bdefd1 --- /dev/null +++ b/Function/BNExternalLocationGetExternalLibrary.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNExternalLibrary* BNExternalLocationGetExternalLibrary(BNExternalLocation* loc) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNExternalLocationGetExternalLibrary" + )] + internal static extern IntPtr BNExternalLocationGetExternalLibrary( + + // BNExternalLocation* loc + IntPtr loc + + ); + } +} \ No newline at end of file diff --git a/Function/BNExternalLocationGetSourceSymbol.cs b/Function/BNExternalLocationGetSourceSymbol.cs new file mode 100644 index 0000000..75168a2 --- /dev/null +++ b/Function/BNExternalLocationGetSourceSymbol.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNSymbol* BNExternalLocationGetSourceSymbol(BNExternalLocation* loc) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNExternalLocationGetSourceSymbol" + )] + internal static extern IntPtr BNExternalLocationGetSourceSymbol( + + // BNExternalLocation* loc + IntPtr loc + + ); + } +} \ No newline at end of file diff --git a/Function/BNExternalLocationGetTargetAddress.cs b/Function/BNExternalLocationGetTargetAddress.cs new file mode 100644 index 0000000..dec7e2f --- /dev/null +++ b/Function/BNExternalLocationGetTargetAddress.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNExternalLocationGetTargetAddress(BNExternalLocation* loc) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNExternalLocationGetTargetAddress" + )] + internal static extern ulong BNExternalLocationGetTargetAddress( + + // BNExternalLocation* loc + IntPtr loc + + ); + } +} \ No newline at end of file diff --git a/Function/BNExternalLocationGetTargetSymbol.cs b/Function/BNExternalLocationGetTargetSymbol.cs new file mode 100644 index 0000000..65a7c1f --- /dev/null +++ b/Function/BNExternalLocationGetTargetSymbol.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNExternalLocationGetTargetSymbol(BNExternalLocation* loc) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNExternalLocationGetTargetSymbol" + )] + internal static extern IntPtr BNExternalLocationGetTargetSymbol( + + // BNExternalLocation* loc + IntPtr loc + + ); + } +} \ No newline at end of file diff --git a/Function/BNExternalLocationHasTargetAddress.cs b/Function/BNExternalLocationHasTargetAddress.cs new file mode 100644 index 0000000..e1ae5b8 --- /dev/null +++ b/Function/BNExternalLocationHasTargetAddress.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNExternalLocationHasTargetAddress(BNExternalLocation* loc) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNExternalLocationHasTargetAddress" + )] + internal static extern bool BNExternalLocationHasTargetAddress( + + // BNExternalLocation* loc + IntPtr loc + + ); + } +} \ No newline at end of file diff --git a/Function/BNExternalLocationHasTargetSymbol.cs b/Function/BNExternalLocationHasTargetSymbol.cs new file mode 100644 index 0000000..c39fd0a --- /dev/null +++ b/Function/BNExternalLocationHasTargetSymbol.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNExternalLocationHasTargetSymbol(BNExternalLocation* loc) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNExternalLocationHasTargetSymbol" + )] + internal static extern bool BNExternalLocationHasTargetSymbol( + + // BNExternalLocation* loc + IntPtr loc + + ); + } +} \ No newline at end of file diff --git a/Function/BNExternalLocationSetExternalLibrary.cs b/Function/BNExternalLocationSetExternalLibrary.cs new file mode 100644 index 0000000..343c664 --- /dev/null +++ b/Function/BNExternalLocationSetExternalLibrary.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNExternalLocationSetExternalLibrary(BNExternalLocation* loc, BNExternalLibrary* library) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNExternalLocationSetExternalLibrary" + )] + internal static extern void BNExternalLocationSetExternalLibrary( + + // BNExternalLocation* loc + IntPtr loc , + + // BNExternalLibrary* library + IntPtr library + + ); + } +} \ No newline at end of file diff --git a/Function/BNExternalLocationSetTargetAddress.cs b/Function/BNExternalLocationSetTargetAddress.cs new file mode 100644 index 0000000..55e4aea --- /dev/null +++ b/Function/BNExternalLocationSetTargetAddress.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNExternalLocationSetTargetAddress(BNExternalLocation* loc, uint64_t* address) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNExternalLocationSetTargetAddress" + )] + internal static extern bool BNExternalLocationSetTargetAddress( + + // BNExternalLocation* loc + IntPtr loc , + + // uint64_t* address + IntPtr address + + ); + } +} \ No newline at end of file diff --git a/Function/BNExternalLocationSetTargetSymbol.cs b/Function/BNExternalLocationSetTargetSymbol.cs new file mode 100644 index 0000000..ed6cf80 --- /dev/null +++ b/Function/BNExternalLocationSetTargetSymbol.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNExternalLocationSetTargetSymbol(BNExternalLocation* loc, const char* symbol) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNExternalLocationSetTargetSymbol" + )] + internal static extern bool BNExternalLocationSetTargetSymbol( + + // BNExternalLocation* loc + IntPtr loc , + + // const char* symbol + string symbol + + ); + } +} \ No newline at end of file diff --git a/Function/BNFileMetadataGetSessionId.cs b/Function/BNFileMetadataGetSessionId.cs new file mode 100644 index 0000000..d2b8211 --- /dev/null +++ b/Function/BNFileMetadataGetSessionId.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNFileMetadataGetSessionId(BNFileMetadata* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFileMetadataGetSessionId" + )] + internal static extern ulong BNFileMetadataGetSessionId( + + // BNFileMetadata* file + IntPtr file + ); + } +} \ No newline at end of file diff --git a/Function/BNFileSize.cs b/Function/BNFileSize.cs new file mode 100644 index 0000000..832b436 --- /dev/null +++ b/Function/BNFileSize.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNFileSize(const char* path, uint64_t* size) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFileSize" + )] + internal static extern bool BNFileSize( + + // const char* path + string path , + + // uint64_t* size + IntPtr size + + ); + } +} \ No newline at end of file diff --git a/Function/BNFinalizeArchitectureHook.cs b/Function/BNFinalizeArchitectureHook.cs new file mode 100644 index 0000000..68a9460 --- /dev/null +++ b/Function/BNFinalizeArchitectureHook.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFinalizeArchitectureHook(BNArchitecture* @base) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFinalizeArchitectureHook" + )] + internal static extern void BNFinalizeArchitectureHook( + + // BNArchitecture* _base + IntPtr _base + ); + } +} \ No newline at end of file diff --git a/Function/BNFinalizeEnumerationBuilder.cs b/Function/BNFinalizeEnumerationBuilder.cs new file mode 100644 index 0000000..114afc8 --- /dev/null +++ b/Function/BNFinalizeEnumerationBuilder.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNEnumeration* BNFinalizeEnumerationBuilder(BNEnumerationBuilder* e) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFinalizeEnumerationBuilder" + )] + internal static extern IntPtr BNFinalizeEnumerationBuilder( + + // BNEnumerationBuilder* e + IntPtr e + ); + } +} \ No newline at end of file diff --git a/Function/BNFinalizeHighLevelILFunction.cs b/Function/BNFinalizeHighLevelILFunction.cs new file mode 100644 index 0000000..cd4d390 --- /dev/null +++ b/Function/BNFinalizeHighLevelILFunction.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFinalizeHighLevelILFunction(BNHighLevelILFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFinalizeHighLevelILFunction" + )] + internal static extern void BNFinalizeHighLevelILFunction( + + // BNHighLevelILFunction* func + IntPtr func + + ); + } +} \ No newline at end of file diff --git a/Function/BNFinalizeLowLevelILFunction.cs b/Function/BNFinalizeLowLevelILFunction.cs new file mode 100644 index 0000000..dd54229 --- /dev/null +++ b/Function/BNFinalizeLowLevelILFunction.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFinalizeLowLevelILFunction(BNLowLevelILFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFinalizeLowLevelILFunction" + )] + internal static extern void BNFinalizeLowLevelILFunction( + + // BNLowLevelILFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNFinalizeMediumLevelILFunction.cs b/Function/BNFinalizeMediumLevelILFunction.cs new file mode 100644 index 0000000..c0cd21a --- /dev/null +++ b/Function/BNFinalizeMediumLevelILFunction.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFinalizeMediumLevelILFunction(BNMediumLevelILFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFinalizeMediumLevelILFunction" + )] + internal static extern void BNFinalizeMediumLevelILFunction( + + // BNMediumLevelILFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNFinalizeNamedTypeReferenceBuilder.cs b/Function/BNFinalizeNamedTypeReferenceBuilder.cs new file mode 100644 index 0000000..cb03a80 --- /dev/null +++ b/Function/BNFinalizeNamedTypeReferenceBuilder.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNNamedTypeReference* BNFinalizeNamedTypeReferenceBuilder(BNNamedTypeReferenceBuilder* s) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFinalizeNamedTypeReferenceBuilder" + )] + internal static extern IntPtr BNFinalizeNamedTypeReferenceBuilder( + + // BNNamedTypeReferenceBuilder* s + IntPtr s + + ); + } +} \ No newline at end of file diff --git a/Function/BNFinalizeStructureBuilder.cs b/Function/BNFinalizeStructureBuilder.cs new file mode 100644 index 0000000..d56430b --- /dev/null +++ b/Function/BNFinalizeStructureBuilder.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNStructure* BNFinalizeStructureBuilder(BNStructureBuilder* s) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFinalizeStructureBuilder" + )] + internal static extern IntPtr BNFinalizeStructureBuilder( + + // BNStructureBuilder* s + IntPtr s + ); + } +} \ No newline at end of file diff --git a/Function/BNFinalizeTypeBuilder.cs b/Function/BNFinalizeTypeBuilder.cs new file mode 100644 index 0000000..7d70789 --- /dev/null +++ b/Function/BNFinalizeTypeBuilder.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNType* BNFinalizeTypeBuilder(BNTypeBuilder* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFinalizeTypeBuilder" + )] + internal static extern IntPtr BNFinalizeTypeBuilder( + + // BNTypeBuilder* type + IntPtr type + ); + } +} \ No newline at end of file diff --git a/Function/BNFinalizeTypeLibrary.cs b/Function/BNFinalizeTypeLibrary.cs new file mode 100644 index 0000000..098275e --- /dev/null +++ b/Function/BNFinalizeTypeLibrary.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNFinalizeTypeLibrary(BNTypeLibrary* lib) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFinalizeTypeLibrary" + )] + internal static extern bool BNFinalizeTypeLibrary( + + // BNTypeLibrary* lib + IntPtr lib + ); + } +} \ No newline at end of file diff --git a/Function/BNFindAllConstantWithProgress.cs b/Function/BNFindAllConstantWithProgress.cs new file mode 100644 index 0000000..7d6c19b --- /dev/null +++ b/Function/BNFindAllConstantWithProgress.cs @@ -0,0 +1,51 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNFindAllConstantWithProgress(BNBinaryView* view, uint64_t start, uint64_t end, uint64_t constant, BNDisassemblySettings* settings, BNFunctionViewType viewType, void* ctxt, void** progress, void* matchCtxt, void** matchCallback) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFindAllConstantWithProgress" + )] + internal static extern bool BNFindAllConstantWithProgress( + + // BNBinaryView* view + IntPtr view , + + // uint64_t start + ulong start , + + // uint64_t end + ulong end , + + // uint64_t constant + ulong constant , + + // BNDisassemblySettings* settings + IntPtr settings , + + // BNFunctionViewType viewType + in BNFunctionViewType viewType , + + // void* ctxt + IntPtr ctxt , + + // void** progress + IntPtr progress , + + // void* matchCtxt + IntPtr matchCtxt , + + // void** matchCallback + IntPtr matchCallback + ); + } +} \ No newline at end of file diff --git a/Function/BNFindAllDataWithProgress.cs b/Function/BNFindAllDataWithProgress.cs new file mode 100644 index 0000000..5e06d24 --- /dev/null +++ b/Function/BNFindAllDataWithProgress.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNFindAllDataWithProgress(BNBinaryView* view, uint64_t start, uint64_t end, BNDataBuffer* data, BNFindFlag flags, void* ctxt, void** progress, void* matchCtxt, void** matchCallback) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFindAllDataWithProgress" + )] + internal static extern bool BNFindAllDataWithProgress( + + // BNBinaryView* view + IntPtr view , + + // uint64_t start + ulong start , + + // uint64_t end + ulong end , + + // BNDataBuffer* data + IntPtr data , + + // BNFindFlag flags + FindFlag flags , + + // void* ctxt + IntPtr ctxt , + + // void* progress + IntPtr progress , + + // void* matchCtxt + IntPtr matchCtxt , + + // void* matchCallback + IntPtr matchCallback + ); + } +} \ No newline at end of file diff --git a/Function/BNFindAllTextWithProgress.cs b/Function/BNFindAllTextWithProgress.cs new file mode 100644 index 0000000..80f3b23 --- /dev/null +++ b/Function/BNFindAllTextWithProgress.cs @@ -0,0 +1,55 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNFindAllTextWithProgress(BNBinaryView* view, uint64_t start, uint64_t end, const char* data, BNDisassemblySettings* settings, BNFindFlag flags, BNFunctionViewType viewType, void* ctxt, void** progress, void* matchCtxt, void** matchCallback) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFindAllTextWithProgress" + )] + internal static extern bool BNFindAllTextWithProgress( + + // BNBinaryView* view + IntPtr view , + + // uint64_t start + ulong start , + + // uint64_t end + ulong end , + + // const char* data + string data , + + // BNDisassemblySettings* settings + IntPtr settings , + + // BNFindFlag flags + FindFlag flags , + + // BNFunctionViewType viewType + in BNFunctionViewType viewType , + + // void* ctxt + IntPtr ctxt , + + // void** progress + IntPtr progress , + + // void* matchCtxt + IntPtr matchCtxt , + + // void** matchCallback + IntPtr matchCallback + ); + } +} \ No newline at end of file diff --git a/Function/BNFindNextConstant.cs b/Function/BNFindNextConstant.cs new file mode 100644 index 0000000..dfc2c17 --- /dev/null +++ b/Function/BNFindNextConstant.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNFindNextConstant(BNBinaryView* view, uint64_t start, uint64_t constant, uint64_t* result, BNDisassemblySettings* settings, BNFunctionViewType viewType) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFindNextConstant" + )] + internal static extern bool BNFindNextConstant( + + // BNBinaryView* view + IntPtr view , + + // uint64_t start + ulong start , + + // uint64_t constant + ulong constant , + + // uint64_t* result + out ulong result , + + // BNDisassemblySettings* settings + IntPtr settings , + + // BNFunctionViewType viewType + in BNFunctionViewType viewType + ); + } +} \ No newline at end of file diff --git a/Function/BNFindNextConstantWithProgress.cs b/Function/BNFindNextConstantWithProgress.cs new file mode 100644 index 0000000..7f43efb --- /dev/null +++ b/Function/BNFindNextConstantWithProgress.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNFindNextConstantWithProgress(BNBinaryView* view, uint64_t start, uint64_t end, uint64_t constant, uint64_t* result, BNDisassemblySettings* settings, BNFunctionViewType viewType, void* ctxt, void** progress) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFindNextConstantWithProgress" + )] + internal static extern bool BNFindNextConstantWithProgress( + + // BNBinaryView* view + IntPtr view , + + // uint64_t start + ulong start , + + // uint64_t end + ulong end , + + // uint64_t constant + ulong constant , + + // uint64_t* result + out ulong result , + + // BNDisassemblySettings* settings + IntPtr settings , + + // BNFunctionViewType viewType + in BNFunctionViewType viewType , + + // void* ctxt + IntPtr ctxt , + + // void* progress + IntPtr progress + ); + } +} \ No newline at end of file diff --git a/Function/BNFindNextData.cs b/Function/BNFindNextData.cs new file mode 100644 index 0000000..64fe091 --- /dev/null +++ b/Function/BNFindNextData.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNFindNextData(BNBinaryView* view, uint64_t start, BNDataBuffer* data, uint64_t* result, BNFindFlag flags) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFindNextData" + )] + internal static extern bool BNFindNextData( + + // BNBinaryView* view + IntPtr view , + + // uint64_t start + ulong start , + + // BNDataBuffer* data + IntPtr data , + + // uint64_t* result + out ulong result , + + // BNFindFlag flags + FindFlag flags + ); + } +} \ No newline at end of file diff --git a/Function/BNFindNextDataWithProgress.cs b/Function/BNFindNextDataWithProgress.cs new file mode 100644 index 0000000..bb200b1 --- /dev/null +++ b/Function/BNFindNextDataWithProgress.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNFindNextDataWithProgress(BNBinaryView* view, uint64_t start, uint64_t end, BNDataBuffer* data, uint64_t* result, BNFindFlag flags, void* ctxt, void** progress) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFindNextDataWithProgress" + )] + internal static extern bool BNFindNextDataWithProgress( + + // BNBinaryView* view + IntPtr view , + + // uint64_t start + ulong start , + + // uint64_t end + ulong end , + + // BNDataBuffer* data + IntPtr data , + + // uint64_t* result + out ulong result , + + // BNFindFlag flags + FindFlag flags , + + // void* ctxt + IntPtr ctxt , + + // void* progress + IntPtr progress + ); + } +} \ No newline at end of file diff --git a/Function/BNFindNextText.cs b/Function/BNFindNextText.cs new file mode 100644 index 0000000..d196b71 --- /dev/null +++ b/Function/BNFindNextText.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNFindNextText(BNBinaryView* view, uint64_t start, const char* data, uint64_t* result, BNDisassemblySettings* settings, BNFindFlag flags, BNFunctionViewType viewType) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFindNextText" + )] + internal static extern bool BNFindNextText( + + // BNBinaryView* view + IntPtr view , + + // uint64_t start + ulong start , + + // const char* data + string data , + + // uint64_t* result + out ulong result , + + // BNDisassemblySettings* settings + IntPtr settings , + + // BNFindFlag flags + FindFlag flags , + + // BNFunctionViewType viewType + in BNFunctionViewType viewType + ); + } +} \ No newline at end of file diff --git a/Function/BNFindNextTextWithProgress.cs b/Function/BNFindNextTextWithProgress.cs new file mode 100644 index 0000000..ce17534 --- /dev/null +++ b/Function/BNFindNextTextWithProgress.cs @@ -0,0 +1,52 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNFindNextTextWithProgress(BNBinaryView* view, uint64_t start, uint64_t end, const char* data, uint64_t* result, BNDisassemblySettings* settings, BNFindFlag flags, BNFunctionViewType viewType, void* ctxt, void** progress) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFindNextTextWithProgress" + )] + internal static extern bool BNFindNextTextWithProgress( + + // BNBinaryView* view + IntPtr view , + + // uint64_t start + ulong start , + + // uint64_t end + ulong end , + + // const char* data + string data , + + // uint64_t* result + out ulong result , + + // BNDisassemblySettings* settings + IntPtr settings , + + // BNFindFlag flags + FindFlag flags , + + // BNFunctionViewType viewType + in BNFunctionViewType viewType , + + // void* ctxt + IntPtr ctxt , + + // void* progress + IntPtr progress + ); + } +} \ No newline at end of file diff --git a/Function/BNFinishBackgroundTask.cs b/Function/BNFinishBackgroundTask.cs new file mode 100644 index 0000000..c030bd3 --- /dev/null +++ b/Function/BNFinishBackgroundTask.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFinishBackgroundTask(BNBackgroundTask* task) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFinishBackgroundTask" + )] + internal static extern void BNFinishBackgroundTask( + + // BNBackgroundTask* task + IntPtr task + ); + } +} \ No newline at end of file diff --git a/Function/BNFinishPrepareForLayout.cs b/Function/BNFinishPrepareForLayout.cs new file mode 100644 index 0000000..d073c97 --- /dev/null +++ b/Function/BNFinishPrepareForLayout.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFinishPrepareForLayout(BNFlowGraph* graph) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFinishPrepareForLayout" + )] + internal static extern void BNFinishPrepareForLayout( + + // BNFlowGraph* graph + IntPtr graph + + ); + } +} \ No newline at end of file diff --git a/Function/BNFirmwareNinjaAddRelationship.cs b/Function/BNFirmwareNinjaAddRelationship.cs new file mode 100644 index 0000000..9a1970e --- /dev/null +++ b/Function/BNFirmwareNinjaAddRelationship.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFirmwareNinjaAddRelationship(BNFirmwareNinja* fn, BNFirmwareNinjaRelationship* rel) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFirmwareNinjaAddRelationship" + )] + internal static extern void BNFirmwareNinjaAddRelationship( + + // BNFirmwareNinja* fn + IntPtr fn , + + // BNFirmwareNinjaRelationship* rel + IntPtr rel + + ); + } +} \ No newline at end of file diff --git a/Function/BNFirmwareNinjaFindSectionsWithEntropy.cs b/Function/BNFirmwareNinjaFindSectionsWithEntropy.cs new file mode 100644 index 0000000..d6d0f17 --- /dev/null +++ b/Function/BNFirmwareNinjaFindSectionsWithEntropy.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// int32_t BNFirmwareNinjaFindSectionsWithEntropy(BNFirmwareNinja* fn, BNFirmwareNinjaSection** sections, float highCodeEntropyThreshold, float lowCodeEntropyThreshold, uint64_t blockSize, BNFirmwareNinjaSectionAnalysisMode mode) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFirmwareNinjaFindSectionsWithEntropy" + )] + internal static extern int BNFirmwareNinjaFindSectionsWithEntropy( + + // BNFirmwareNinja* fn + IntPtr fn , + + // BNFirmwareNinjaSection** sections + IntPtr sections , + + // float highCodeEntropyThreshold + float highCodeEntropyThreshold , + + // float lowCodeEntropyThreshold + float lowCodeEntropyThreshold , + + // uint64_t blockSize + ulong blockSize , + + // BNFirmwareNinjaSectionAnalysisMode mode + FirmwareNinjaSectionAnalysisMode mode + + ); + } +} \ No newline at end of file diff --git a/Function/BNFirmwareNinjaFreeBoardDeviceAccesses.cs b/Function/BNFirmwareNinjaFreeBoardDeviceAccesses.cs new file mode 100644 index 0000000..d91bf4b --- /dev/null +++ b/Function/BNFirmwareNinjaFreeBoardDeviceAccesses.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFirmwareNinjaFreeBoardDeviceAccesses(BNFirmwareNinjaDeviceAccesses* accesses, int32_t size) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFirmwareNinjaFreeBoardDeviceAccesses" + )] + internal static extern void BNFirmwareNinjaFreeBoardDeviceAccesses( + + // BNFirmwareNinjaDeviceAccesses* accesses + IntPtr accesses , + + // int32_t size + int size + + ); + } +} \ No newline at end of file diff --git a/Function/BNFirmwareNinjaFreeBoardNames.cs b/Function/BNFirmwareNinjaFreeBoardNames.cs new file mode 100644 index 0000000..ccb7ee0 --- /dev/null +++ b/Function/BNFirmwareNinjaFreeBoardNames.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFirmwareNinjaFreeBoardNames(const char** boards, int32_t size) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFirmwareNinjaFreeBoardNames" + )] + internal static extern void BNFirmwareNinjaFreeBoardNames( + + // const char** boards + string[] boards , + + // int32_t size + int size + + ); + } +} \ No newline at end of file diff --git a/Function/BNFirmwareNinjaFreeDevices.cs b/Function/BNFirmwareNinjaFreeDevices.cs new file mode 100644 index 0000000..b687071 --- /dev/null +++ b/Function/BNFirmwareNinjaFreeDevices.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFirmwareNinjaFreeDevices(BNFirmwareNinjaDevice* devices, int32_t size) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFirmwareNinjaFreeDevices" + )] + internal static extern void BNFirmwareNinjaFreeDevices( + + // BNFirmwareNinjaDevice* devices + IntPtr devices , + + // int32_t size + int size + + ); + } +} \ No newline at end of file diff --git a/Function/BNFirmwareNinjaFreeFunctionMemoryAccesses.cs b/Function/BNFirmwareNinjaFreeFunctionMemoryAccesses.cs new file mode 100644 index 0000000..aaa84f5 --- /dev/null +++ b/Function/BNFirmwareNinjaFreeFunctionMemoryAccesses.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFirmwareNinjaFreeFunctionMemoryAccesses(BNFirmwareNinjaFunctionMemoryAccesses** fma, int32_t size) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFirmwareNinjaFreeFunctionMemoryAccesses" + )] + internal static extern void BNFirmwareNinjaFreeFunctionMemoryAccesses( + + // BNFirmwareNinjaFunctionMemoryAccesses** fma + IntPtr fma , + + // int32_t size + int size + + ); + } +} \ No newline at end of file diff --git a/Function/BNFirmwareNinjaFreeRelationships.cs b/Function/BNFirmwareNinjaFreeRelationships.cs new file mode 100644 index 0000000..f4c7545 --- /dev/null +++ b/Function/BNFirmwareNinjaFreeRelationships.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFirmwareNinjaFreeRelationships(BNFirmwareNinjaRelationship** relationships, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFirmwareNinjaFreeRelationships" + )] + internal static extern void BNFirmwareNinjaFreeRelationships( + + // BNFirmwareNinjaRelationship** relationships + IntPtr relationships , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNFirmwareNinjaFreeSections.cs b/Function/BNFirmwareNinjaFreeSections.cs new file mode 100644 index 0000000..9dd686c --- /dev/null +++ b/Function/BNFirmwareNinjaFreeSections.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFirmwareNinjaFreeSections(BNFirmwareNinjaSection* sections, int32_t size) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFirmwareNinjaFreeSections" + )] + internal static extern void BNFirmwareNinjaFreeSections( + + // BNFirmwareNinjaSection* sections + IntPtr sections , + + // int32_t size + int size + + ); + } +} \ No newline at end of file diff --git a/Function/BNFirmwareNinjaGetAddressReferenceTree.cs b/Function/BNFirmwareNinjaGetAddressReferenceTree.cs new file mode 100644 index 0000000..647976b --- /dev/null +++ b/Function/BNFirmwareNinjaGetAddressReferenceTree.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFirmwareNinjaReferenceNode* BNFirmwareNinjaGetAddressReferenceTree(BNFirmwareNinja* fn, uint64_t address, BNFirmwareNinjaFunctionMemoryAccesses** fma, int32_t size, uint64_t* value) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFirmwareNinjaGetAddressReferenceTree" + )] + internal static extern IntPtr BNFirmwareNinjaGetAddressReferenceTree( + + // BNFirmwareNinja* fn + IntPtr fn , + + // uint64_t address + ulong address , + + // BNFirmwareNinjaFunctionMemoryAccesses** fma + IntPtr fma , + + // int32_t size + int size , + + // uint64_t* _value + IntPtr _value + + ); + } +} \ No newline at end of file diff --git a/Function/BNFirmwareNinjaGetBoardDeviceAccesses.cs b/Function/BNFirmwareNinjaGetBoardDeviceAccesses.cs new file mode 100644 index 0000000..932a157 --- /dev/null +++ b/Function/BNFirmwareNinjaGetBoardDeviceAccesses.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// int32_t BNFirmwareNinjaGetBoardDeviceAccesses(BNFirmwareNinja* fn, BNFirmwareNinjaFunctionMemoryAccesses** fma, int32_t size, BNFirmwareNinjaDeviceAccesses** accesses, BNArchitecture* arch) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFirmwareNinjaGetBoardDeviceAccesses" + )] + internal static extern int BNFirmwareNinjaGetBoardDeviceAccesses( + + // BNFirmwareNinja* fn + IntPtr fn , + + // BNFirmwareNinjaFunctionMemoryAccesses** fma + IntPtr fma , + + // int32_t size + int size , + + // BNFirmwareNinjaDeviceAccesses** accesses + IntPtr accesses , + + // BNArchitecture* arch + IntPtr arch + + ); + } +} \ No newline at end of file diff --git a/Function/BNFirmwareNinjaGetFunctionMemoryAccesses.cs b/Function/BNFirmwareNinjaGetFunctionMemoryAccesses.cs new file mode 100644 index 0000000..37c630c --- /dev/null +++ b/Function/BNFirmwareNinjaGetFunctionMemoryAccesses.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// int32_t BNFirmwareNinjaGetFunctionMemoryAccesses(BNFirmwareNinja* fn, BNFirmwareNinjaFunctionMemoryAccesses*** fma, void** progress, void* progressContext) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFirmwareNinjaGetFunctionMemoryAccesses" + )] + internal static extern int BNFirmwareNinjaGetFunctionMemoryAccesses( + + // BNFirmwareNinja* fn + IntPtr fn , + + // BNFirmwareNinjaFunctionMemoryAccesses*** fma + IntPtr fma , + + // void** progress + IntPtr progress , + + // void* progressContext + IntPtr progressContext + + ); + } +} \ No newline at end of file diff --git a/Function/BNFirmwareNinjaGetMemoryRegionReferenceTree.cs b/Function/BNFirmwareNinjaGetMemoryRegionReferenceTree.cs new file mode 100644 index 0000000..00ed750 --- /dev/null +++ b/Function/BNFirmwareNinjaGetMemoryRegionReferenceTree.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFirmwareNinjaReferenceNode* BNFirmwareNinjaGetMemoryRegionReferenceTree(BNFirmwareNinja* fn, uint64_t start, uint64_t end, BNFirmwareNinjaFunctionMemoryAccesses** fma, int32_t size, uint64_t* value) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFirmwareNinjaGetMemoryRegionReferenceTree" + )] + internal static extern IntPtr BNFirmwareNinjaGetMemoryRegionReferenceTree( + + // BNFirmwareNinja* fn + IntPtr fn , + + // uint64_t start + ulong start , + + // uint64_t end + ulong end , + + // BNFirmwareNinjaFunctionMemoryAccesses** fma + IntPtr fma , + + // int32_t size + int size , + + // uint64_t* _value + IntPtr _value + + ); + } +} \ No newline at end of file diff --git a/Function/BNFirmwareNinjaGetRelationshipByGuid.cs b/Function/BNFirmwareNinjaGetRelationshipByGuid.cs new file mode 100644 index 0000000..b0cd9c4 --- /dev/null +++ b/Function/BNFirmwareNinjaGetRelationshipByGuid.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFirmwareNinjaRelationship* BNFirmwareNinjaGetRelationshipByGuid(BNFirmwareNinja* fn, const char* guid) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFirmwareNinjaGetRelationshipByGuid" + )] + internal static extern IntPtr BNFirmwareNinjaGetRelationshipByGuid( + + // BNFirmwareNinja* fn + IntPtr fn , + + // const char* guid + string guid + + ); + } +} \ No newline at end of file diff --git a/Function/BNFirmwareNinjaQueryBoardDevices.cs b/Function/BNFirmwareNinjaQueryBoardDevices.cs new file mode 100644 index 0000000..c917235 --- /dev/null +++ b/Function/BNFirmwareNinjaQueryBoardDevices.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// int32_t BNFirmwareNinjaQueryBoardDevices(BNFirmwareNinja* fn, BNArchitecture* arch, const char* board, BNFirmwareNinjaDevice** devices) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFirmwareNinjaQueryBoardDevices" + )] + internal static extern int BNFirmwareNinjaQueryBoardDevices( + + // BNFirmwareNinja* fn + IntPtr fn , + + // BNArchitecture* arch + IntPtr arch , + + // const char* board + string board , + + // BNFirmwareNinjaDevice** devices + IntPtr devices + + ); + } +} \ No newline at end of file diff --git a/Function/BNFirmwareNinjaQueryBoardNamesForArchitecture.cs b/Function/BNFirmwareNinjaQueryBoardNamesForArchitecture.cs new file mode 100644 index 0000000..da59e1c --- /dev/null +++ b/Function/BNFirmwareNinjaQueryBoardNamesForArchitecture.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// int32_t BNFirmwareNinjaQueryBoardNamesForArchitecture(BNFirmwareNinja* fn, BNArchitecture* arch, const char*** boards) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFirmwareNinjaQueryBoardNamesForArchitecture" + )] + internal static extern int BNFirmwareNinjaQueryBoardNamesForArchitecture( + + // BNFirmwareNinja* fn + IntPtr fn , + + // BNArchitecture* arch + IntPtr arch , + + // const char*** boards + IntPtr boards + + ); + } +} \ No newline at end of file diff --git a/Function/BNFirmwareNinjaQueryCustomDevices.cs b/Function/BNFirmwareNinjaQueryCustomDevices.cs new file mode 100644 index 0000000..b58ce82 --- /dev/null +++ b/Function/BNFirmwareNinjaQueryCustomDevices.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// int32_t BNFirmwareNinjaQueryCustomDevices(BNFirmwareNinja* fn, BNFirmwareNinjaDevice** devices) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFirmwareNinjaQueryCustomDevices" + )] + internal static extern int BNFirmwareNinjaQueryCustomDevices( + + // BNFirmwareNinja* fn + IntPtr fn , + + // BNFirmwareNinjaDevice** devices + IntPtr devices + + ); + } +} \ No newline at end of file diff --git a/Function/BNFirmwareNinjaQueryFunctionMemoryAccessesFromMetadata.cs b/Function/BNFirmwareNinjaQueryFunctionMemoryAccessesFromMetadata.cs new file mode 100644 index 0000000..772a7df --- /dev/null +++ b/Function/BNFirmwareNinjaQueryFunctionMemoryAccessesFromMetadata.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// int32_t BNFirmwareNinjaQueryFunctionMemoryAccessesFromMetadata(BNFirmwareNinja* fn, BNFirmwareNinjaFunctionMemoryAccesses*** fma) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFirmwareNinjaQueryFunctionMemoryAccessesFromMetadata" + )] + internal static extern int BNFirmwareNinjaQueryFunctionMemoryAccessesFromMetadata( + + // BNFirmwareNinja* fn + IntPtr fn , + + // BNFirmwareNinjaFunctionMemoryAccesses*** fma + IntPtr fma + + ); + } +} \ No newline at end of file diff --git a/Function/BNFirmwareNinjaQueryRelationships.cs b/Function/BNFirmwareNinjaQueryRelationships.cs new file mode 100644 index 0000000..fd4f839 --- /dev/null +++ b/Function/BNFirmwareNinjaQueryRelationships.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFirmwareNinjaRelationship** BNFirmwareNinjaQueryRelationships(BNFirmwareNinja* fn, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFirmwareNinjaQueryRelationships" + )] + internal static extern IntPtr BNFirmwareNinjaQueryRelationships( + + // BNFirmwareNinja* fn + IntPtr fn , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNFirmwareNinjaReferenceNodeGetChildren.cs b/Function/BNFirmwareNinjaReferenceNodeGetChildren.cs new file mode 100644 index 0000000..d8f4053 --- /dev/null +++ b/Function/BNFirmwareNinjaReferenceNodeGetChildren.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFirmwareNinjaReferenceNode** BNFirmwareNinjaReferenceNodeGetChildren(BNFirmwareNinjaReferenceNode* parent, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFirmwareNinjaReferenceNodeGetChildren" + )] + internal static extern IntPtr BNFirmwareNinjaReferenceNodeGetChildren( + + // BNFirmwareNinjaReferenceNode* parent + IntPtr parent , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNFirmwareNinjaReferenceNodeGetDataVariable.cs b/Function/BNFirmwareNinjaReferenceNodeGetDataVariable.cs new file mode 100644 index 0000000..1547c83 --- /dev/null +++ b/Function/BNFirmwareNinjaReferenceNodeGetDataVariable.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNFirmwareNinjaReferenceNodeGetDataVariable(BNFirmwareNinjaReferenceNode* node, BNDataVariable* dataVariable) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFirmwareNinjaReferenceNodeGetDataVariable" + )] + internal static extern bool BNFirmwareNinjaReferenceNodeGetDataVariable( + + // BNFirmwareNinjaReferenceNode* node + IntPtr node , + + // BNDataVariable* dataVariable + IntPtr dataVariable + + ); + } +} \ No newline at end of file diff --git a/Function/BNFirmwareNinjaReferenceNodeGetFunction.cs b/Function/BNFirmwareNinjaReferenceNodeGetFunction.cs new file mode 100644 index 0000000..efd92be --- /dev/null +++ b/Function/BNFirmwareNinjaReferenceNodeGetFunction.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFunction* BNFirmwareNinjaReferenceNodeGetFunction(BNFirmwareNinjaReferenceNode* node) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFirmwareNinjaReferenceNodeGetFunction" + )] + internal static extern IntPtr BNFirmwareNinjaReferenceNodeGetFunction( + + // BNFirmwareNinjaReferenceNode* node + IntPtr node + + ); + } +} \ No newline at end of file diff --git a/Function/BNFirmwareNinjaReferenceNodeHasChildren.cs b/Function/BNFirmwareNinjaReferenceNodeHasChildren.cs new file mode 100644 index 0000000..5b6b5f3 --- /dev/null +++ b/Function/BNFirmwareNinjaReferenceNodeHasChildren.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNFirmwareNinjaReferenceNodeHasChildren(BNFirmwareNinjaReferenceNode* node) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFirmwareNinjaReferenceNodeHasChildren" + )] + internal static extern bool BNFirmwareNinjaReferenceNodeHasChildren( + + // BNFirmwareNinjaReferenceNode* node + IntPtr node + + ); + } +} \ No newline at end of file diff --git a/Function/BNFirmwareNinjaReferenceNodeIsDataVariable.cs b/Function/BNFirmwareNinjaReferenceNodeIsDataVariable.cs new file mode 100644 index 0000000..91aaa15 --- /dev/null +++ b/Function/BNFirmwareNinjaReferenceNodeIsDataVariable.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNFirmwareNinjaReferenceNodeIsDataVariable(BNFirmwareNinjaReferenceNode* node) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFirmwareNinjaReferenceNodeIsDataVariable" + )] + internal static extern bool BNFirmwareNinjaReferenceNodeIsDataVariable( + + // BNFirmwareNinjaReferenceNode* node + IntPtr node + + ); + } +} \ No newline at end of file diff --git a/Function/BNFirmwareNinjaReferenceNodeIsFunction.cs b/Function/BNFirmwareNinjaReferenceNodeIsFunction.cs new file mode 100644 index 0000000..00b330e --- /dev/null +++ b/Function/BNFirmwareNinjaReferenceNodeIsFunction.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNFirmwareNinjaReferenceNodeIsFunction(BNFirmwareNinjaReferenceNode* node) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFirmwareNinjaReferenceNodeIsFunction" + )] + internal static extern bool BNFirmwareNinjaReferenceNodeIsFunction( + + // BNFirmwareNinjaReferenceNode* node + IntPtr node + + ); + } +} \ No newline at end of file diff --git a/Function/BNFirmwareNinjaRelationshipGetDescription.cs b/Function/BNFirmwareNinjaRelationshipGetDescription.cs new file mode 100644 index 0000000..f2a9abb --- /dev/null +++ b/Function/BNFirmwareNinjaRelationshipGetDescription.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNFirmwareNinjaRelationshipGetDescription(BNFirmwareNinjaRelationship* rel) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFirmwareNinjaRelationshipGetDescription" + )] + internal static extern IntPtr BNFirmwareNinjaRelationshipGetDescription( + + // BNFirmwareNinjaRelationship* rel + IntPtr rel + + ); + } +} \ No newline at end of file diff --git a/Function/BNFirmwareNinjaRelationshipGetGuid.cs b/Function/BNFirmwareNinjaRelationshipGetGuid.cs new file mode 100644 index 0000000..3c9ba41 --- /dev/null +++ b/Function/BNFirmwareNinjaRelationshipGetGuid.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNFirmwareNinjaRelationshipGetGuid(BNFirmwareNinjaRelationship* rel) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFirmwareNinjaRelationshipGetGuid" + )] + internal static extern IntPtr BNFirmwareNinjaRelationshipGetGuid( + + // BNFirmwareNinjaRelationship* rel + IntPtr rel + + ); + } +} \ No newline at end of file diff --git a/Function/BNFirmwareNinjaRelationshipGetPrimaryAddress.cs b/Function/BNFirmwareNinjaRelationshipGetPrimaryAddress.cs new file mode 100644 index 0000000..e3f1bcc --- /dev/null +++ b/Function/BNFirmwareNinjaRelationshipGetPrimaryAddress.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNFirmwareNinjaRelationshipGetPrimaryAddress(BNFirmwareNinjaRelationship* rel, uint64_t* result) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFirmwareNinjaRelationshipGetPrimaryAddress" + )] + internal static extern bool BNFirmwareNinjaRelationshipGetPrimaryAddress( + + // BNFirmwareNinjaRelationship* rel + IntPtr rel , + + // uint64_t* result + IntPtr result + + ); + } +} \ No newline at end of file diff --git a/Function/BNFirmwareNinjaRelationshipGetPrimaryDataVariable.cs b/Function/BNFirmwareNinjaRelationshipGetPrimaryDataVariable.cs new file mode 100644 index 0000000..8065199 --- /dev/null +++ b/Function/BNFirmwareNinjaRelationshipGetPrimaryDataVariable.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNFirmwareNinjaRelationshipGetPrimaryDataVariable(BNFirmwareNinjaRelationship* rel, BNDataVariable* dataVariable) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFirmwareNinjaRelationshipGetPrimaryDataVariable" + )] + internal static extern bool BNFirmwareNinjaRelationshipGetPrimaryDataVariable( + + // BNFirmwareNinjaRelationship* rel + IntPtr rel , + + // BNDataVariable* dataVariable + IntPtr dataVariable + + ); + } +} \ No newline at end of file diff --git a/Function/BNFirmwareNinjaRelationshipGetPrimaryFunction.cs b/Function/BNFirmwareNinjaRelationshipGetPrimaryFunction.cs new file mode 100644 index 0000000..1ac403d --- /dev/null +++ b/Function/BNFirmwareNinjaRelationshipGetPrimaryFunction.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFunction* BNFirmwareNinjaRelationshipGetPrimaryFunction(BNFirmwareNinjaRelationship* rel) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFirmwareNinjaRelationshipGetPrimaryFunction" + )] + internal static extern IntPtr BNFirmwareNinjaRelationshipGetPrimaryFunction( + + // BNFirmwareNinjaRelationship* rel + IntPtr rel + + ); + } +} \ No newline at end of file diff --git a/Function/BNFirmwareNinjaRelationshipGetProvenance.cs b/Function/BNFirmwareNinjaRelationshipGetProvenance.cs new file mode 100644 index 0000000..03e72e5 --- /dev/null +++ b/Function/BNFirmwareNinjaRelationshipGetProvenance.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNFirmwareNinjaRelationshipGetProvenance(BNFirmwareNinjaRelationship* rel) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFirmwareNinjaRelationshipGetProvenance" + )] + internal static extern IntPtr BNFirmwareNinjaRelationshipGetProvenance( + + // BNFirmwareNinjaRelationship* rel + IntPtr rel + + ); + } +} \ No newline at end of file diff --git a/Function/BNFirmwareNinjaRelationshipGetSecondaryAddress.cs b/Function/BNFirmwareNinjaRelationshipGetSecondaryAddress.cs new file mode 100644 index 0000000..a240af8 --- /dev/null +++ b/Function/BNFirmwareNinjaRelationshipGetSecondaryAddress.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNFirmwareNinjaRelationshipGetSecondaryAddress(BNFirmwareNinjaRelationship* rel, uint64_t* result) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFirmwareNinjaRelationshipGetSecondaryAddress" + )] + internal static extern bool BNFirmwareNinjaRelationshipGetSecondaryAddress( + + // BNFirmwareNinjaRelationship* rel + IntPtr rel , + + // uint64_t* result + IntPtr result + + ); + } +} \ No newline at end of file diff --git a/Function/BNFirmwareNinjaRelationshipGetSecondaryDataVariable.cs b/Function/BNFirmwareNinjaRelationshipGetSecondaryDataVariable.cs new file mode 100644 index 0000000..8687475 --- /dev/null +++ b/Function/BNFirmwareNinjaRelationshipGetSecondaryDataVariable.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNFirmwareNinjaRelationshipGetSecondaryDataVariable(BNFirmwareNinjaRelationship* rel, BNDataVariable* dataVariable) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFirmwareNinjaRelationshipGetSecondaryDataVariable" + )] + internal static extern bool BNFirmwareNinjaRelationshipGetSecondaryDataVariable( + + // BNFirmwareNinjaRelationship* rel + IntPtr rel , + + // BNDataVariable* dataVariable + IntPtr dataVariable + + ); + } +} \ No newline at end of file diff --git a/Function/BNFirmwareNinjaRelationshipGetSecondaryExternalProjectFile.cs b/Function/BNFirmwareNinjaRelationshipGetSecondaryExternalProjectFile.cs new file mode 100644 index 0000000..9f2fabe --- /dev/null +++ b/Function/BNFirmwareNinjaRelationshipGetSecondaryExternalProjectFile.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNProjectFile* BNFirmwareNinjaRelationshipGetSecondaryExternalProjectFile(BNFirmwareNinjaRelationship* rel) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFirmwareNinjaRelationshipGetSecondaryExternalProjectFile" + )] + internal static extern IntPtr BNFirmwareNinjaRelationshipGetSecondaryExternalProjectFile( + + // BNFirmwareNinjaRelationship* rel + IntPtr rel + + ); + } +} \ No newline at end of file diff --git a/Function/BNFirmwareNinjaRelationshipGetSecondaryExternalSymbol.cs b/Function/BNFirmwareNinjaRelationshipGetSecondaryExternalSymbol.cs new file mode 100644 index 0000000..2399ea4 --- /dev/null +++ b/Function/BNFirmwareNinjaRelationshipGetSecondaryExternalSymbol.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNFirmwareNinjaRelationshipGetSecondaryExternalSymbol(BNFirmwareNinjaRelationship* rel) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFirmwareNinjaRelationshipGetSecondaryExternalSymbol" + )] + internal static extern IntPtr BNFirmwareNinjaRelationshipGetSecondaryExternalSymbol( + + // BNFirmwareNinjaRelationship* rel + IntPtr rel + + ); + } +} \ No newline at end of file diff --git a/Function/BNFirmwareNinjaRelationshipGetSecondaryFunction.cs b/Function/BNFirmwareNinjaRelationshipGetSecondaryFunction.cs new file mode 100644 index 0000000..8a5115d --- /dev/null +++ b/Function/BNFirmwareNinjaRelationshipGetSecondaryFunction.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFunction* BNFirmwareNinjaRelationshipGetSecondaryFunction(BNFirmwareNinjaRelationship* rel) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFirmwareNinjaRelationshipGetSecondaryFunction" + )] + internal static extern IntPtr BNFirmwareNinjaRelationshipGetSecondaryFunction( + + // BNFirmwareNinjaRelationship* rel + IntPtr rel + + ); + } +} \ No newline at end of file diff --git a/Function/BNFirmwareNinjaRelationshipPrimaryIsAddress.cs b/Function/BNFirmwareNinjaRelationshipPrimaryIsAddress.cs new file mode 100644 index 0000000..aa2f312 --- /dev/null +++ b/Function/BNFirmwareNinjaRelationshipPrimaryIsAddress.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNFirmwareNinjaRelationshipPrimaryIsAddress(BNFirmwareNinjaRelationship* rel) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFirmwareNinjaRelationshipPrimaryIsAddress" + )] + internal static extern bool BNFirmwareNinjaRelationshipPrimaryIsAddress( + + // BNFirmwareNinjaRelationship* rel + IntPtr rel + + ); + } +} \ No newline at end of file diff --git a/Function/BNFirmwareNinjaRelationshipPrimaryIsDataVariable.cs b/Function/BNFirmwareNinjaRelationshipPrimaryIsDataVariable.cs new file mode 100644 index 0000000..75f89c7 --- /dev/null +++ b/Function/BNFirmwareNinjaRelationshipPrimaryIsDataVariable.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNFirmwareNinjaRelationshipPrimaryIsDataVariable(BNFirmwareNinjaRelationship* rel) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFirmwareNinjaRelationshipPrimaryIsDataVariable" + )] + internal static extern bool BNFirmwareNinjaRelationshipPrimaryIsDataVariable( + + // BNFirmwareNinjaRelationship* rel + IntPtr rel + + ); + } +} \ No newline at end of file diff --git a/Function/BNFirmwareNinjaRelationshipPrimaryIsFunction.cs b/Function/BNFirmwareNinjaRelationshipPrimaryIsFunction.cs new file mode 100644 index 0000000..a3c3bbe --- /dev/null +++ b/Function/BNFirmwareNinjaRelationshipPrimaryIsFunction.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNFirmwareNinjaRelationshipPrimaryIsFunction(BNFirmwareNinjaRelationship* rel) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFirmwareNinjaRelationshipPrimaryIsFunction" + )] + internal static extern bool BNFirmwareNinjaRelationshipPrimaryIsFunction( + + // BNFirmwareNinjaRelationship* rel + IntPtr rel + + ); + } +} \ No newline at end of file diff --git a/Function/BNFirmwareNinjaRelationshipSecondaryIsAddress.cs b/Function/BNFirmwareNinjaRelationshipSecondaryIsAddress.cs new file mode 100644 index 0000000..61672e8 --- /dev/null +++ b/Function/BNFirmwareNinjaRelationshipSecondaryIsAddress.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNFirmwareNinjaRelationshipSecondaryIsAddress(BNFirmwareNinjaRelationship* rel) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFirmwareNinjaRelationshipSecondaryIsAddress" + )] + internal static extern bool BNFirmwareNinjaRelationshipSecondaryIsAddress( + + // BNFirmwareNinjaRelationship* rel + IntPtr rel + + ); + } +} \ No newline at end of file diff --git a/Function/BNFirmwareNinjaRelationshipSecondaryIsDataVariable.cs b/Function/BNFirmwareNinjaRelationshipSecondaryIsDataVariable.cs new file mode 100644 index 0000000..02380ba --- /dev/null +++ b/Function/BNFirmwareNinjaRelationshipSecondaryIsDataVariable.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNFirmwareNinjaRelationshipSecondaryIsDataVariable(BNFirmwareNinjaRelationship* rel) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFirmwareNinjaRelationshipSecondaryIsDataVariable" + )] + internal static extern bool BNFirmwareNinjaRelationshipSecondaryIsDataVariable( + + // BNFirmwareNinjaRelationship* rel + IntPtr rel + + ); + } +} \ No newline at end of file diff --git a/Function/BNFirmwareNinjaRelationshipSecondaryIsExternalAddress.cs b/Function/BNFirmwareNinjaRelationshipSecondaryIsExternalAddress.cs new file mode 100644 index 0000000..48d6f0b --- /dev/null +++ b/Function/BNFirmwareNinjaRelationshipSecondaryIsExternalAddress.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNFirmwareNinjaRelationshipSecondaryIsExternalAddress(BNFirmwareNinjaRelationship* rel) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFirmwareNinjaRelationshipSecondaryIsExternalAddress" + )] + internal static extern bool BNFirmwareNinjaRelationshipSecondaryIsExternalAddress( + + // BNFirmwareNinjaRelationship* rel + IntPtr rel + + ); + } +} \ No newline at end of file diff --git a/Function/BNFirmwareNinjaRelationshipSecondaryIsExternalSymbol.cs b/Function/BNFirmwareNinjaRelationshipSecondaryIsExternalSymbol.cs new file mode 100644 index 0000000..9f92df3 --- /dev/null +++ b/Function/BNFirmwareNinjaRelationshipSecondaryIsExternalSymbol.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNFirmwareNinjaRelationshipSecondaryIsExternalSymbol(BNFirmwareNinjaRelationship* rel) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFirmwareNinjaRelationshipSecondaryIsExternalSymbol" + )] + internal static extern bool BNFirmwareNinjaRelationshipSecondaryIsExternalSymbol( + + // BNFirmwareNinjaRelationship* rel + IntPtr rel + + ); + } +} \ No newline at end of file diff --git a/Function/BNFirmwareNinjaRelationshipSecondaryIsFunction.cs b/Function/BNFirmwareNinjaRelationshipSecondaryIsFunction.cs new file mode 100644 index 0000000..1553798 --- /dev/null +++ b/Function/BNFirmwareNinjaRelationshipSecondaryIsFunction.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNFirmwareNinjaRelationshipSecondaryIsFunction(BNFirmwareNinjaRelationship* rel) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFirmwareNinjaRelationshipSecondaryIsFunction" + )] + internal static extern bool BNFirmwareNinjaRelationshipSecondaryIsFunction( + + // BNFirmwareNinjaRelationship* rel + IntPtr rel + + ); + } +} \ No newline at end of file diff --git a/Function/BNFirmwareNinjaRelationshipSetDescription.cs b/Function/BNFirmwareNinjaRelationshipSetDescription.cs new file mode 100644 index 0000000..a78b27c --- /dev/null +++ b/Function/BNFirmwareNinjaRelationshipSetDescription.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFirmwareNinjaRelationshipSetDescription(BNFirmwareNinjaRelationship* rel, const char* description) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFirmwareNinjaRelationshipSetDescription" + )] + internal static extern void BNFirmwareNinjaRelationshipSetDescription( + + // BNFirmwareNinjaRelationship* rel + IntPtr rel , + + // const char* description + string description + + ); + } +} \ No newline at end of file diff --git a/Function/BNFirmwareNinjaRelationshipSetPrimaryAddress.cs b/Function/BNFirmwareNinjaRelationshipSetPrimaryAddress.cs new file mode 100644 index 0000000..7984587 --- /dev/null +++ b/Function/BNFirmwareNinjaRelationshipSetPrimaryAddress.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFirmwareNinjaRelationshipSetPrimaryAddress(BNFirmwareNinjaRelationship* rel, uint64_t address) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFirmwareNinjaRelationshipSetPrimaryAddress" + )] + internal static extern void BNFirmwareNinjaRelationshipSetPrimaryAddress( + + // BNFirmwareNinjaRelationship* rel + IntPtr rel , + + // uint64_t address + ulong address + + ); + } +} \ No newline at end of file diff --git a/Function/BNFirmwareNinjaRelationshipSetPrimaryDataVariable.cs b/Function/BNFirmwareNinjaRelationshipSetPrimaryDataVariable.cs new file mode 100644 index 0000000..0c3e21d --- /dev/null +++ b/Function/BNFirmwareNinjaRelationshipSetPrimaryDataVariable.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFirmwareNinjaRelationshipSetPrimaryDataVariable(BNFirmwareNinjaRelationship* rel, uint64_t dataVariableAddress) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFirmwareNinjaRelationshipSetPrimaryDataVariable" + )] + internal static extern void BNFirmwareNinjaRelationshipSetPrimaryDataVariable( + + // BNFirmwareNinjaRelationship* rel + IntPtr rel , + + // uint64_t dataVariableAddress + ulong dataVariableAddress + + ); + } +} \ No newline at end of file diff --git a/Function/BNFirmwareNinjaRelationshipSetPrimaryFunction.cs b/Function/BNFirmwareNinjaRelationshipSetPrimaryFunction.cs new file mode 100644 index 0000000..a015e86 --- /dev/null +++ b/Function/BNFirmwareNinjaRelationshipSetPrimaryFunction.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFirmwareNinjaRelationshipSetPrimaryFunction(BNFirmwareNinjaRelationship* rel, BNFunction* function) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFirmwareNinjaRelationshipSetPrimaryFunction" + )] + internal static extern void BNFirmwareNinjaRelationshipSetPrimaryFunction( + + // BNFirmwareNinjaRelationship* rel + IntPtr rel , + + // BNFunction* function + IntPtr function + + ); + } +} \ No newline at end of file diff --git a/Function/BNFirmwareNinjaRelationshipSetProvenance.cs b/Function/BNFirmwareNinjaRelationshipSetProvenance.cs new file mode 100644 index 0000000..c93568c --- /dev/null +++ b/Function/BNFirmwareNinjaRelationshipSetProvenance.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFirmwareNinjaRelationshipSetProvenance(BNFirmwareNinjaRelationship* rel, const char* provenance) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFirmwareNinjaRelationshipSetProvenance" + )] + internal static extern void BNFirmwareNinjaRelationshipSetProvenance( + + // BNFirmwareNinjaRelationship* rel + IntPtr rel , + + // const char* provenance + string provenance + + ); + } +} \ No newline at end of file diff --git a/Function/BNFirmwareNinjaRelationshipSetSecondaryAddress.cs b/Function/BNFirmwareNinjaRelationshipSetSecondaryAddress.cs new file mode 100644 index 0000000..130e4c0 --- /dev/null +++ b/Function/BNFirmwareNinjaRelationshipSetSecondaryAddress.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFirmwareNinjaRelationshipSetSecondaryAddress(BNFirmwareNinjaRelationship* rel, uint64_t address) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFirmwareNinjaRelationshipSetSecondaryAddress" + )] + internal static extern void BNFirmwareNinjaRelationshipSetSecondaryAddress( + + // BNFirmwareNinjaRelationship* rel + IntPtr rel , + + // uint64_t address + ulong address + + ); + } +} \ No newline at end of file diff --git a/Function/BNFirmwareNinjaRelationshipSetSecondaryDataVariable.cs b/Function/BNFirmwareNinjaRelationshipSetSecondaryDataVariable.cs new file mode 100644 index 0000000..07de0d7 --- /dev/null +++ b/Function/BNFirmwareNinjaRelationshipSetSecondaryDataVariable.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFirmwareNinjaRelationshipSetSecondaryDataVariable(BNFirmwareNinjaRelationship* rel, uint64_t dataVariableAddress) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFirmwareNinjaRelationshipSetSecondaryDataVariable" + )] + internal static extern void BNFirmwareNinjaRelationshipSetSecondaryDataVariable( + + // BNFirmwareNinjaRelationship* rel + IntPtr rel , + + // uint64_t dataVariableAddress + ulong dataVariableAddress + + ); + } +} \ No newline at end of file diff --git a/Function/BNFirmwareNinjaRelationshipSetSecondaryExternalAddress.cs b/Function/BNFirmwareNinjaRelationshipSetSecondaryExternalAddress.cs new file mode 100644 index 0000000..54d5bb3 --- /dev/null +++ b/Function/BNFirmwareNinjaRelationshipSetSecondaryExternalAddress.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFirmwareNinjaRelationshipSetSecondaryExternalAddress(BNFirmwareNinjaRelationship* rel, BNProjectFile* projectFile, uint64_t address) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFirmwareNinjaRelationshipSetSecondaryExternalAddress" + )] + internal static extern void BNFirmwareNinjaRelationshipSetSecondaryExternalAddress( + + // BNFirmwareNinjaRelationship* rel + IntPtr rel , + + // BNProjectFile* projectFile + IntPtr projectFile , + + // uint64_t address + ulong address + + ); + } +} \ No newline at end of file diff --git a/Function/BNFirmwareNinjaRelationshipSetSecondaryExternalSymbol.cs b/Function/BNFirmwareNinjaRelationshipSetSecondaryExternalSymbol.cs new file mode 100644 index 0000000..d367bc4 --- /dev/null +++ b/Function/BNFirmwareNinjaRelationshipSetSecondaryExternalSymbol.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFirmwareNinjaRelationshipSetSecondaryExternalSymbol(BNFirmwareNinjaRelationship* rel, BNProjectFile* projectFile, const char* symbol) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFirmwareNinjaRelationshipSetSecondaryExternalSymbol" + )] + internal static extern void BNFirmwareNinjaRelationshipSetSecondaryExternalSymbol( + + // BNFirmwareNinjaRelationship* rel + IntPtr rel , + + // BNProjectFile* projectFile + IntPtr projectFile , + + // const char* symbol + string symbol + + ); + } +} \ No newline at end of file diff --git a/Function/BNFirmwareNinjaRelationshipSetSecondaryFunction.cs b/Function/BNFirmwareNinjaRelationshipSetSecondaryFunction.cs new file mode 100644 index 0000000..e397b86 --- /dev/null +++ b/Function/BNFirmwareNinjaRelationshipSetSecondaryFunction.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFirmwareNinjaRelationshipSetSecondaryFunction(BNFirmwareNinjaRelationship* rel, BNFunction* function) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFirmwareNinjaRelationshipSetSecondaryFunction" + )] + internal static extern void BNFirmwareNinjaRelationshipSetSecondaryFunction( + + // BNFirmwareNinjaRelationship* rel + IntPtr rel , + + // BNFunction* function + IntPtr function + + ); + } +} \ No newline at end of file diff --git a/Function/BNFirmwareNinjaRemoveCustomDevice.cs b/Function/BNFirmwareNinjaRemoveCustomDevice.cs new file mode 100644 index 0000000..aaf457b --- /dev/null +++ b/Function/BNFirmwareNinjaRemoveCustomDevice.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNFirmwareNinjaRemoveCustomDevice(BNFirmwareNinja* fn, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFirmwareNinjaRemoveCustomDevice" + )] + internal static extern bool BNFirmwareNinjaRemoveCustomDevice( + + // BNFirmwareNinja* fn + IntPtr fn , + + // const char* name + string name + + ); + } +} \ No newline at end of file diff --git a/Function/BNFirmwareNinjaRemoveRelationshipByGuid.cs b/Function/BNFirmwareNinjaRemoveRelationshipByGuid.cs new file mode 100644 index 0000000..beb723d --- /dev/null +++ b/Function/BNFirmwareNinjaRemoveRelationshipByGuid.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFirmwareNinjaRemoveRelationshipByGuid(BNFirmwareNinja* fn, const char* guid) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFirmwareNinjaRemoveRelationshipByGuid" + )] + internal static extern void BNFirmwareNinjaRemoveRelationshipByGuid( + + // BNFirmwareNinja* fn + IntPtr fn , + + // const char* guid + string guid + + ); + } +} \ No newline at end of file diff --git a/Function/BNFirmwareNinjaStoreCustomDevice.cs b/Function/BNFirmwareNinjaStoreCustomDevice.cs new file mode 100644 index 0000000..a9fee0a --- /dev/null +++ b/Function/BNFirmwareNinjaStoreCustomDevice.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNFirmwareNinjaStoreCustomDevice(BNFirmwareNinja* fn, const char* name, uint64_t start, uint64_t end, const char* info) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFirmwareNinjaStoreCustomDevice" + )] + internal static extern bool BNFirmwareNinjaStoreCustomDevice( + + // BNFirmwareNinja* fn + IntPtr fn , + + // const char* name + string name , + + // uint64_t start + ulong start , + + // uint64_t end + ulong end , + + // const char* info + string info + + ); + } +} \ No newline at end of file diff --git a/Function/BNFirmwareNinjaStoreFunctionMemoryAccessesToMetadata.cs b/Function/BNFirmwareNinjaStoreFunctionMemoryAccessesToMetadata.cs new file mode 100644 index 0000000..6658880 --- /dev/null +++ b/Function/BNFirmwareNinjaStoreFunctionMemoryAccessesToMetadata.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFirmwareNinjaStoreFunctionMemoryAccessesToMetadata(BNFirmwareNinja* fn, BNFirmwareNinjaFunctionMemoryAccesses** fma, int32_t size) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFirmwareNinjaStoreFunctionMemoryAccessesToMetadata" + )] + internal static extern void BNFirmwareNinjaStoreFunctionMemoryAccessesToMetadata( + + // BNFirmwareNinja* fn + IntPtr fn , + + // BNFirmwareNinjaFunctionMemoryAccesses** fma + IntPtr fma , + + // int32_t size + int size + + ); + } +} \ No newline at end of file diff --git a/Function/BNFlowGraphHasNodes.cs b/Function/BNFlowGraphHasNodes.cs new file mode 100644 index 0000000..78c4c3d --- /dev/null +++ b/Function/BNFlowGraphHasNodes.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNFlowGraphHasNodes(BNFlowGraph* graph) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFlowGraphHasNodes" + )] + internal static extern bool BNFlowGraphHasNodes( + + // BNFlowGraph* graph + IntPtr graph + ); + } +} \ No newline at end of file diff --git a/Function/BNFlowGraphHasUpdates.cs b/Function/BNFlowGraphHasUpdates.cs new file mode 100644 index 0000000..487e836 --- /dev/null +++ b/Function/BNFlowGraphHasUpdates.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNFlowGraphHasUpdates(BNFlowGraph* graph) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFlowGraphHasUpdates" + )] + internal static extern bool BNFlowGraphHasUpdates( + + // BNFlowGraph* graph + IntPtr graph + + ); + } +} \ No newline at end of file diff --git a/Function/BNFlowGraphLayoutLayout.cs b/Function/BNFlowGraphLayoutLayout.cs new file mode 100644 index 0000000..392108d --- /dev/null +++ b/Function/BNFlowGraphLayoutLayout.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNFlowGraphLayoutLayout(BNFlowGraphLayout* layout, BNFlowGraph* graph, BNFlowGraphNode** nodes, uint64_t nodeCount) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFlowGraphLayoutLayout" + )] + internal static extern bool BNFlowGraphLayoutLayout( + + // BNFlowGraphLayout* layout + IntPtr layout , + + // BNFlowGraph* graph + IntPtr graph , + + // BNFlowGraphNode** nodes + IntPtr nodes , + + // uint64_t nodeCount + ulong nodeCount + + ); + } +} \ No newline at end of file diff --git a/Function/BNFlowGraphNodeSetOutgoingEdgePoints.cs b/Function/BNFlowGraphNodeSetOutgoingEdgePoints.cs new file mode 100644 index 0000000..f076bcb --- /dev/null +++ b/Function/BNFlowGraphNodeSetOutgoingEdgePoints.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFlowGraphNodeSetOutgoingEdgePoints(BNFlowGraphNode* node, uint64_t edgeNum, BNPoint* points, uint64_t pointCount) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFlowGraphNodeSetOutgoingEdgePoints" + )] + internal static extern void BNFlowGraphNodeSetOutgoingEdgePoints( + + // BNFlowGraphNode* node + IntPtr node , + + // uint64_t edgeNum + ulong edgeNum , + + // BNPoint* points + BNPoint[] points , + + // uint64_t pointCount + ulong pointCount + ); + } +} \ No newline at end of file diff --git a/Function/BNFlowGraphNodeSetVisibilityRegion.cs b/Function/BNFlowGraphNodeSetVisibilityRegion.cs new file mode 100644 index 0000000..d03c0fc --- /dev/null +++ b/Function/BNFlowGraphNodeSetVisibilityRegion.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFlowGraphNodeSetVisibilityRegion(BNFlowGraphNode* node, int32_t x, int32_t y, int32_t w, int32_t h) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFlowGraphNodeSetVisibilityRegion" + )] + internal static extern void BNFlowGraphNodeSetVisibilityRegion( + + // BNFlowGraphNode* node + IntPtr node , + + // int32_t x + int x , + + // int32_t y + int y , + + // int32_t w + int width , + + // int32_t h + int height + ); + } +} \ No newline at end of file diff --git a/Function/BNFlowGraphNodeSetX.cs b/Function/BNFlowGraphNodeSetX.cs new file mode 100644 index 0000000..d23c747 --- /dev/null +++ b/Function/BNFlowGraphNodeSetX.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFlowGraphNodeSetX(BNFlowGraphNode* node, int32_t x) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFlowGraphNodeSetX" + )] + internal static extern void BNFlowGraphNodeSetX( + + // BNFlowGraphNode* node + IntPtr node , + + // int32_t x + int x + ); + } +} \ No newline at end of file diff --git a/Function/BNFlowGraphNodeSetY.cs b/Function/BNFlowGraphNodeSetY.cs new file mode 100644 index 0000000..07bd742 --- /dev/null +++ b/Function/BNFlowGraphNodeSetY.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFlowGraphNodeSetY(BNFlowGraphNode* node, int32_t y) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFlowGraphNodeSetY" + )] + internal static extern void BNFlowGraphNodeSetY( + + // BNFlowGraphNode* node + IntPtr node , + + // int32_t y + int y + ); + } +} \ No newline at end of file diff --git a/Function/BNFlowGraphSetHeight.cs b/Function/BNFlowGraphSetHeight.cs new file mode 100644 index 0000000..6b1ad82 --- /dev/null +++ b/Function/BNFlowGraphSetHeight.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFlowGraphSetHeight(BNFlowGraph* graph, int32_t height) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFlowGraphSetHeight" + )] + internal static extern void BNFlowGraphSetHeight( + + // BNFlowGraph* graph + IntPtr graph , + + // int32_t height + int height + ); + } +} \ No newline at end of file diff --git a/Function/BNFlowGraphSetWidth.cs b/Function/BNFlowGraphSetWidth.cs new file mode 100644 index 0000000..e288281 --- /dev/null +++ b/Function/BNFlowGraphSetWidth.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFlowGraphSetWidth(BNFlowGraph* graph, int32_t width) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFlowGraphSetWidth" + )] + internal static extern void BNFlowGraphSetWidth( + + // BNFlowGraph* graph + IntPtr graph , + + // int32_t width + int width + ); + } +} \ No newline at end of file diff --git a/Function/BNFlowGraphUpdateQueryMode.cs b/Function/BNFlowGraphUpdateQueryMode.cs new file mode 100644 index 0000000..27cf734 --- /dev/null +++ b/Function/BNFlowGraphUpdateQueryMode.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNFlowGraphUpdateQueryMode(BNFlowGraph* graph) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFlowGraphUpdateQueryMode" + )] + internal static extern bool BNFlowGraphUpdateQueryMode( + + // BNFlowGraph* graph + IntPtr graph + + ); + } +} \ No newline at end of file diff --git a/Function/BNForgetUndoActions.cs b/Function/BNForgetUndoActions.cs new file mode 100644 index 0000000..2861622 --- /dev/null +++ b/Function/BNForgetUndoActions.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNForgetUndoActions(BNFileMetadata* file, const char* id) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNForgetUndoActions" + )] + internal static extern void BNForgetUndoActions( + + // BNFileMetadata* file + IntPtr file , + + // const char* id + string id + ); + } +} \ No newline at end of file diff --git a/Function/BNFormatLines.cs b/Function/BNFormatLines.cs new file mode 100644 index 0000000..ed355bb --- /dev/null +++ b/Function/BNFormatLines.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDisassemblyTextLine* BNFormatLines(BNLineFormatter* formatter, BNDisassemblyTextLine* inLines, uint64_t inCount, BNLineFormatterSettings* settings, uint64_t* outCount) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFormatLines" + )] + internal static extern IntPtr BNFormatLines( + + // BNLineFormatter* formatter + IntPtr formatter , + + // BNDisassemblyTextLine* inLines + IntPtr inLines , + + // uint64_t inCount + ulong inCount , + + // BNLineFormatterSettings* settings + IntPtr settings , + + // uint64_t* outCount + IntPtr outCount + + ); + } +} \ No newline at end of file diff --git a/Function/BNFormatTypeParserParseErrors.cs b/Function/BNFormatTypeParserParseErrors.cs new file mode 100644 index 0000000..1c6729f --- /dev/null +++ b/Function/BNFormatTypeParserParseErrors.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNFormatTypeParserParseErrors(BNTypeParserError* errors, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFormatTypeParserParseErrors" + )] + internal static extern IntPtr BNFormatTypeParserParseErrors( + + // BNTypeParserError* errors + IntPtr errors , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeActivity.cs b/Function/BNFreeActivity.cs new file mode 100644 index 0000000..c2d71ff --- /dev/null +++ b/Function/BNFreeActivity.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeActivity(BNActivity* activity) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeActivity" + )] + internal static extern void BNFreeActivity( + + // BNActivity* activity + IntPtr activity + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeAddressList.cs b/Function/BNFreeAddressList.cs new file mode 100644 index 0000000..4f3e9b4 --- /dev/null +++ b/Function/BNFreeAddressList.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeAddressList(uint64_t* addrs) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreeAddressList" + )] + internal static extern void BNFreeAddressList( + + // uint64_t* addrs + IntPtr addrs + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeAddressRanges.cs b/Function/BNFreeAddressRanges.cs new file mode 100644 index 0000000..6a9584e --- /dev/null +++ b/Function/BNFreeAddressRanges.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeAddressRanges(BNAddressRange* ranges) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreeAddressRanges" + )] + internal static extern void BNFreeAddressRanges( + + // BNAddressRange* ranges + IntPtr ranges + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeAllTypeFieldReferences.cs b/Function/BNFreeAllTypeFieldReferences.cs new file mode 100644 index 0000000..d9d9391 --- /dev/null +++ b/Function/BNFreeAllTypeFieldReferences.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeAllTypeFieldReferences(BNAllTypeFieldReferences* refs) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeAllTypeFieldReferences" + )] + internal static extern void BNFreeAllTypeFieldReferences( + + // BNAllTypeFieldReferences* refs + IntPtr refs + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeAllTypeReferences.cs b/Function/BNFreeAllTypeReferences.cs new file mode 100644 index 0000000..0e4ee65 --- /dev/null +++ b/Function/BNFreeAllTypeReferences.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeAllTypeReferences(BNAllTypeReferences* refs) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeAllTypeReferences" + )] + internal static extern void BNFreeAllTypeReferences( + + // BNAllTypeReferences* refs + IntPtr refs + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeAnalysisCompletionEvent.cs b/Function/BNFreeAnalysisCompletionEvent.cs new file mode 100644 index 0000000..e59651a --- /dev/null +++ b/Function/BNFreeAnalysisCompletionEvent.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeAnalysisCompletionEvent(BNAnalysisCompletionEvent* @event) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeAnalysisCompletionEvent" + )] + internal static extern void BNFreeAnalysisCompletionEvent( + + // BNAnalysisCompletionEvent* _event + IntPtr _event + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeAnalysisContext.cs b/Function/BNFreeAnalysisContext.cs new file mode 100644 index 0000000..7bf589b --- /dev/null +++ b/Function/BNFreeAnalysisContext.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeAnalysisContext(BNAnalysisContext* analysisContext) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeAnalysisContext" + )] + internal static extern void BNFreeAnalysisContext( + + // BNAnalysisContext* analysisContext + IntPtr analysisContext + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeAnalysisInfo.cs b/Function/BNFreeAnalysisInfo.cs new file mode 100644 index 0000000..9dcd88b --- /dev/null +++ b/Function/BNFreeAnalysisInfo.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeAnalysisInfo(BNAnalysisInfo* info) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreeAnalysisInfo" + )] + internal static extern void BNFreeAnalysisInfo( + + // BNAnalysisInfo* info + IntPtr info + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeAnalysisMergeConflict.cs b/Function/BNFreeAnalysisMergeConflict.cs new file mode 100644 index 0000000..01117a4 --- /dev/null +++ b/Function/BNFreeAnalysisMergeConflict.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeAnalysisMergeConflict(BNAnalysisMergeConflict* conflict) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeAnalysisMergeConflict" + )] + internal static extern void BNFreeAnalysisMergeConflict( + + // BNAnalysisMergeConflict* conflict + IntPtr conflict + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeAnalysisMergeConflictList.cs b/Function/BNFreeAnalysisMergeConflictList.cs new file mode 100644 index 0000000..06cec9d --- /dev/null +++ b/Function/BNFreeAnalysisMergeConflictList.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeAnalysisMergeConflictList(BNAnalysisMergeConflict** conflicts, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeAnalysisMergeConflictList" + )] + internal static extern void BNFreeAnalysisMergeConflictList( + + // BNAnalysisMergeConflict** conflicts + IntPtr conflicts , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeAnalysisMergeConflictSplitterList.cs b/Function/BNFreeAnalysisMergeConflictSplitterList.cs new file mode 100644 index 0000000..a0a11f3 --- /dev/null +++ b/Function/BNFreeAnalysisMergeConflictSplitterList.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeAnalysisMergeConflictSplitterList(BNAnalysisMergeConflictSplitter** splitters, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeAnalysisMergeConflictSplitterList" + )] + internal static extern void BNFreeAnalysisMergeConflictSplitterList( + + // BNAnalysisMergeConflictSplitter** splitters + IntPtr splitters , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeAnalysisPerformanceInfo.cs b/Function/BNFreeAnalysisPerformanceInfo.cs new file mode 100644 index 0000000..bc84d15 --- /dev/null +++ b/Function/BNFreeAnalysisPerformanceInfo.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeAnalysisPerformanceInfo(BNPerformanceInfo* info, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeAnalysisPerformanceInfo" + )] + internal static extern void BNFreeAnalysisPerformanceInfo( + + // BNPerformanceInfo* info + IntPtr info , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeArchitectureAndAddressList.cs b/Function/BNFreeArchitectureAndAddressList.cs new file mode 100644 index 0000000..97ba445 --- /dev/null +++ b/Function/BNFreeArchitectureAndAddressList.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeArchitectureAndAddressList(BNArchitectureAndAddress* addresses) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreeArchitectureAndAddressList" + )] + internal static extern void BNFreeArchitectureAndAddressList( + + // BNArchitectureAndAddress* addresses + IntPtr addresses + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeArchitectureList.cs b/Function/BNFreeArchitectureList.cs new file mode 100644 index 0000000..67f521a --- /dev/null +++ b/Function/BNFreeArchitectureList.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeArchitectureList(BNArchitecture** archs) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeArchitectureList" + )] + internal static extern void BNFreeArchitectureList( + + // BNArchitecture** archs + IntPtr archs + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeBackgroundTask.cs b/Function/BNFreeBackgroundTask.cs new file mode 100644 index 0000000..8dd8b14 --- /dev/null +++ b/Function/BNFreeBackgroundTask.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeBackgroundTask(BNBackgroundTask* task) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeBackgroundTask" + )] + internal static extern void BNFreeBackgroundTask( + + // BNBackgroundTask* task + IntPtr task + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeBackgroundTaskList.cs b/Function/BNFreeBackgroundTaskList.cs new file mode 100644 index 0000000..bcd4eaa --- /dev/null +++ b/Function/BNFreeBackgroundTaskList.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeBackgroundTaskList(BNBackgroundTask** tasks, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreeBackgroundTaskList" + )] + internal static extern void BNFreeBackgroundTaskList( + + // BNBackgroundTask** tasks + IntPtr tasks , + + // uint64_t count + ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeBaseAddressDetection.cs b/Function/BNFreeBaseAddressDetection.cs new file mode 100644 index 0000000..57b813f --- /dev/null +++ b/Function/BNFreeBaseAddressDetection.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeBaseAddressDetection(BNBaseAddressDetection* bad) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeBaseAddressDetection" + )] + internal static extern void BNFreeBaseAddressDetection( + + // BNBaseAddressDetection* bad + IntPtr bad + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeBaseAddressDetectionReasons.cs b/Function/BNFreeBaseAddressDetectionReasons.cs new file mode 100644 index 0000000..b7146de --- /dev/null +++ b/Function/BNFreeBaseAddressDetectionReasons.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeBaseAddressDetectionReasons(BNBaseAddressDetectionReason* reasons) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeBaseAddressDetectionReasons" + )] + internal static extern void BNFreeBaseAddressDetectionReasons( + + // BNBaseAddressDetectionReason* reasons + IntPtr reasons + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeBaseStructureList.cs b/Function/BNFreeBaseStructureList.cs new file mode 100644 index 0000000..f1d7761 --- /dev/null +++ b/Function/BNFreeBaseStructureList.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeBaseStructureList(BNBaseStructure* bases, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreeBaseStructureList" + )] + internal static extern void BNFreeBaseStructureList( + + // BNBaseStructure* bases + IntPtr bases , + + // uint64_t count + ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeBasicBlock.cs b/Function/BNFreeBasicBlock.cs new file mode 100644 index 0000000..bc21a5c --- /dev/null +++ b/Function/BNFreeBasicBlock.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeBasicBlock(BNBasicBlock* block) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeBasicBlock" + )] + internal static extern void BNFreeBasicBlock( + + // BNBasicBlock* block + IntPtr block + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeBasicBlockEdgeList.cs b/Function/BNFreeBasicBlockEdgeList.cs new file mode 100644 index 0000000..da31354 --- /dev/null +++ b/Function/BNFreeBasicBlockEdgeList.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeBasicBlockEdgeList(BNBasicBlockEdge* edges, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreeBasicBlockEdgeList" + )] + internal static extern void BNFreeBasicBlockEdgeList( + + // BNBasicBlockEdge* edges + IntPtr edges , + + // uint64_t count + ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeBasicBlockList.cs b/Function/BNFreeBasicBlockList.cs new file mode 100644 index 0000000..1bbced9 --- /dev/null +++ b/Function/BNFreeBasicBlockList.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeBasicBlockList(BNBasicBlock** blocks, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreeBasicBlockList" + )] + internal static extern void BNFreeBasicBlockList( + + // BNBasicBlock** blocks + IntPtr blocks , + + // uint64_t count + ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeBinaryReader.cs b/Function/BNFreeBinaryReader.cs new file mode 100644 index 0000000..3526a43 --- /dev/null +++ b/Function/BNFreeBinaryReader.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeBinaryReader(BNBinaryReader* stream) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeBinaryReader" + )] + internal static extern void BNFreeBinaryReader( + + // BNBinaryReader* stream + IntPtr stream + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeBinaryView.cs b/Function/BNFreeBinaryView.cs new file mode 100644 index 0000000..0c0f597 --- /dev/null +++ b/Function/BNFreeBinaryView.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeBinaryView(BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeBinaryView" + )] + internal static extern void BNFreeBinaryView( + + // BNBinaryView* view + IntPtr view + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeBinaryViewTypeList.cs b/Function/BNFreeBinaryViewTypeList.cs new file mode 100644 index 0000000..2e84fbe --- /dev/null +++ b/Function/BNFreeBinaryViewTypeList.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeBinaryViewTypeList(BNBinaryViewType** types) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreeBinaryViewTypeList" + )] + internal static extern void BNFreeBinaryViewTypeList( + + // BNBinaryViewType** types + IntPtr types + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeBinaryWriter.cs b/Function/BNFreeBinaryWriter.cs new file mode 100644 index 0000000..2cb32e7 --- /dev/null +++ b/Function/BNFreeBinaryWriter.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeBinaryWriter(BNBinaryWriter* stream) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeBinaryWriter" + )] + internal static extern void BNFreeBinaryWriter( + + // BNBinaryWriter* stream + IntPtr stream + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeCallingConvention.cs b/Function/BNFreeCallingConvention.cs new file mode 100644 index 0000000..4354387 --- /dev/null +++ b/Function/BNFreeCallingConvention.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeCallingConvention(BNCallingConvention* cc) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeCallingConvention" + )] + internal static extern void BNFreeCallingConvention( + + // BNCallingConvention* cc + IntPtr cc + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeCallingConventionList.cs b/Function/BNFreeCallingConventionList.cs new file mode 100644 index 0000000..2de42dd --- /dev/null +++ b/Function/BNFreeCallingConventionList.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeCallingConventionList(BNCallingConvention** list, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreeCallingConventionList" + )] + internal static extern void BNFreeCallingConventionList( + + // BNCallingConvention** list + IntPtr list , + + // uint64_t count + ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeCodeReferences.cs b/Function/BNFreeCodeReferences.cs new file mode 100644 index 0000000..3a3b55b --- /dev/null +++ b/Function/BNFreeCodeReferences.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeCodeReferences(BNReferenceSource* refs, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreeCodeReferences" + )] + internal static extern void BNFreeCodeReferences( + + // BNReferenceSource* refs + IntPtr refs , + + // uint64_t count + ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeCollaborationChangeset.cs b/Function/BNFreeCollaborationChangeset.cs new file mode 100644 index 0000000..c03d3fd --- /dev/null +++ b/Function/BNFreeCollaborationChangeset.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeCollaborationChangeset(BNCollaborationChangeset* changeset) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeCollaborationChangeset" + )] + internal static extern void BNFreeCollaborationChangeset( + + // BNCollaborationChangeset* changeset + IntPtr changeset + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeCollaborationChangesetList.cs b/Function/BNFreeCollaborationChangesetList.cs new file mode 100644 index 0000000..f9a8840 --- /dev/null +++ b/Function/BNFreeCollaborationChangesetList.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeCollaborationChangesetList(BNCollaborationChangeset** changesets, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeCollaborationChangesetList" + )] + internal static extern void BNFreeCollaborationChangesetList( + + // BNCollaborationChangeset** changesets + IntPtr changesets , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeCollaborationGroup.cs b/Function/BNFreeCollaborationGroup.cs new file mode 100644 index 0000000..b5d87d6 --- /dev/null +++ b/Function/BNFreeCollaborationGroup.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeCollaborationGroup(BNCollaborationGroup* group) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeCollaborationGroup" + )] + internal static extern void BNFreeCollaborationGroup( + + // BNCollaborationGroup* _group + IntPtr _group + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeCollaborationGroupList.cs b/Function/BNFreeCollaborationGroupList.cs new file mode 100644 index 0000000..72043b6 --- /dev/null +++ b/Function/BNFreeCollaborationGroupList.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeCollaborationGroupList(BNCollaborationGroup** group, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeCollaborationGroupList" + )] + internal static extern void BNFreeCollaborationGroupList( + + // BNCollaborationGroup** _group + IntPtr _group , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeCollaborationPermission.cs b/Function/BNFreeCollaborationPermission.cs new file mode 100644 index 0000000..f926eef --- /dev/null +++ b/Function/BNFreeCollaborationPermission.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeCollaborationPermission(BNCollaborationPermission* permission) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeCollaborationPermission" + )] + internal static extern void BNFreeCollaborationPermission( + + // BNCollaborationPermission* permission + IntPtr permission + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeCollaborationPermissionList.cs b/Function/BNFreeCollaborationPermissionList.cs new file mode 100644 index 0000000..ff1392a --- /dev/null +++ b/Function/BNFreeCollaborationPermissionList.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeCollaborationPermissionList(BNCollaborationPermission** permissions, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeCollaborationPermissionList" + )] + internal static extern void BNFreeCollaborationPermissionList( + + // BNCollaborationPermission** permissions + IntPtr permissions , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeCollaborationSnapshot.cs b/Function/BNFreeCollaborationSnapshot.cs new file mode 100644 index 0000000..93e1c54 --- /dev/null +++ b/Function/BNFreeCollaborationSnapshot.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeCollaborationSnapshot(BNCollaborationSnapshot* snapshot) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeCollaborationSnapshot" + )] + internal static extern void BNFreeCollaborationSnapshot( + + // BNCollaborationSnapshot* snapshot + IntPtr snapshot + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeCollaborationSnapshotList.cs b/Function/BNFreeCollaborationSnapshotList.cs new file mode 100644 index 0000000..0344bef --- /dev/null +++ b/Function/BNFreeCollaborationSnapshotList.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeCollaborationSnapshotList(BNCollaborationSnapshot** snapshots, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeCollaborationSnapshotList" + )] + internal static extern void BNFreeCollaborationSnapshotList( + + // BNCollaborationSnapshot** snapshots + IntPtr snapshots , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeCollaborationUndoEntry.cs b/Function/BNFreeCollaborationUndoEntry.cs new file mode 100644 index 0000000..aa18666 --- /dev/null +++ b/Function/BNFreeCollaborationUndoEntry.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeCollaborationUndoEntry(BNCollaborationUndoEntry* entry) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeCollaborationUndoEntry" + )] + internal static extern void BNFreeCollaborationUndoEntry( + + // BNCollaborationUndoEntry* entry + IntPtr entry + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeCollaborationUndoEntryList.cs b/Function/BNFreeCollaborationUndoEntryList.cs new file mode 100644 index 0000000..fe39b58 --- /dev/null +++ b/Function/BNFreeCollaborationUndoEntryList.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeCollaborationUndoEntryList(BNCollaborationUndoEntry** entries, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeCollaborationUndoEntryList" + )] + internal static extern void BNFreeCollaborationUndoEntryList( + + // BNCollaborationUndoEntry** entries + IntPtr entries , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeCollaborationUser.cs b/Function/BNFreeCollaborationUser.cs new file mode 100644 index 0000000..4223b06 --- /dev/null +++ b/Function/BNFreeCollaborationUser.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeCollaborationUser(BNCollaborationUser* user) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeCollaborationUser" + )] + internal static extern void BNFreeCollaborationUser( + + // BNCollaborationUser* user + IntPtr user + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeCollaborationUserList.cs b/Function/BNFreeCollaborationUserList.cs new file mode 100644 index 0000000..8fcce64 --- /dev/null +++ b/Function/BNFreeCollaborationUserList.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeCollaborationUserList(BNCollaborationUser** users, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeCollaborationUserList" + )] + internal static extern void BNFreeCollaborationUserList( + + // BNCollaborationUser** users + IntPtr users , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeComponent.cs b/Function/BNFreeComponent.cs new file mode 100644 index 0000000..b60d9fa --- /dev/null +++ b/Function/BNFreeComponent.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeComponent(BNComponent* component) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeComponent" + )] + internal static extern void BNFreeComponent( + + // BNComponent* component + IntPtr component + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeComponents.cs b/Function/BNFreeComponents.cs new file mode 100644 index 0000000..fb282ab --- /dev/null +++ b/Function/BNFreeComponents.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeComponents(BNComponent** components, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreeComponents" + )] + internal static extern void BNFreeComponents( + + // BNComponent** components + IntPtr components , + + // uint64_t count + ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeConstantReferenceList.cs b/Function/BNFreeConstantReferenceList.cs new file mode 100644 index 0000000..b967799 --- /dev/null +++ b/Function/BNFreeConstantReferenceList.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeConstantReferenceList(BNConstantReference* refs) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeConstantReferenceList" + )] + internal static extern void BNFreeConstantReferenceList( + + // BNConstantReference* refs + IntPtr refs + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeDataBuffer.cs b/Function/BNFreeDataBuffer.cs new file mode 100644 index 0000000..96f7a6b --- /dev/null +++ b/Function/BNFreeDataBuffer.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeDataBuffer(BNDataBuffer* buf) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeDataBuffer" + )] + internal static extern void BNFreeDataBuffer( + + // BNDataBuffer* buf + IntPtr buf + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeDataReferences.cs b/Function/BNFreeDataReferences.cs new file mode 100644 index 0000000..9858684 --- /dev/null +++ b/Function/BNFreeDataReferences.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeDataReferences(uint64_t* refs) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreeDataReferences" + )] + internal static extern void BNFreeDataReferences( + + // uint64_t* refs + IntPtr refs + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeDataRenderer.cs b/Function/BNFreeDataRenderer.cs new file mode 100644 index 0000000..e40865e --- /dev/null +++ b/Function/BNFreeDataRenderer.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeDataRenderer(BNDataRenderer* renderer) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeDataRenderer" + )] + internal static extern void BNFreeDataRenderer( + + // BNDataRenderer* renderer + IntPtr renderer + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeDataVariable.cs b/Function/BNFreeDataVariable.cs new file mode 100644 index 0000000..c5ba358 --- /dev/null +++ b/Function/BNFreeDataVariable.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeDataVariable(BNDataVariable* var) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreeDataVariable" + )] + internal static extern void BNFreeDataVariable( + + // BNDataVariable* _var + in BNDataVariable _var + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeDataVariableAndName.cs b/Function/BNFreeDataVariableAndName.cs new file mode 100644 index 0000000..5351df0 --- /dev/null +++ b/Function/BNFreeDataVariableAndName.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeDataVariableAndName(BNDataVariableAndName* var) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeDataVariableAndName" + )] + internal static extern void BNFreeDataVariableAndName( + + // BNDataVariableAndName* _var + IntPtr _var + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeDataVariableAndNameAndDebugParserList.cs b/Function/BNFreeDataVariableAndNameAndDebugParserList.cs new file mode 100644 index 0000000..0024c35 --- /dev/null +++ b/Function/BNFreeDataVariableAndNameAndDebugParserList.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeDataVariableAndNameAndDebugParserList(BNDataVariableAndNameAndDebugParser* vars, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeDataVariableAndNameAndDebugParserList" + )] + internal static extern void BNFreeDataVariableAndNameAndDebugParserList( + + // BNDataVariableAndNameAndDebugParser* vars + IntPtr vars , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeDataVariables.cs b/Function/BNFreeDataVariables.cs new file mode 100644 index 0000000..f07e2bc --- /dev/null +++ b/Function/BNFreeDataVariables.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeDataVariables(BNDataVariable* vars, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreeDataVariables" + )] + internal static extern void BNFreeDataVariables( + + // BNDataVariable* vars + IntPtr vars , + + // uint64_t count + ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeDataVariablesAndName.cs b/Function/BNFreeDataVariablesAndName.cs new file mode 100644 index 0000000..36c8276 --- /dev/null +++ b/Function/BNFreeDataVariablesAndName.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeDataVariablesAndName(BNDataVariableAndName* vars, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeDataVariablesAndName" + )] + internal static extern void BNFreeDataVariablesAndName( + + // BNDataVariableAndName* vars + IntPtr vars , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeDatabase.cs b/Function/BNFreeDatabase.cs new file mode 100644 index 0000000..32dd892 --- /dev/null +++ b/Function/BNFreeDatabase.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeDatabase(BNDatabase* database) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeDatabase" + )] + internal static extern void BNFreeDatabase( + + // BNDatabase* database + IntPtr database + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeDebugFunctions.cs b/Function/BNFreeDebugFunctions.cs new file mode 100644 index 0000000..8632c11 --- /dev/null +++ b/Function/BNFreeDebugFunctions.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeDebugFunctions(BNDebugFunctionInfo* functions, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeDebugFunctions" + )] + internal static extern void BNFreeDebugFunctions( + + // BNDebugFunctionInfo* functions + IntPtr functions , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeDebugInfoParserList.cs b/Function/BNFreeDebugInfoParserList.cs new file mode 100644 index 0000000..6344f80 --- /dev/null +++ b/Function/BNFreeDebugInfoParserList.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeDebugInfoParserList(BNDebugInfoParser** parsers, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeDebugInfoParserList" + )] + internal static extern void BNFreeDebugInfoParserList( + + // BNDebugInfoParser** parsers + IntPtr parsers , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeDebugInfoParserReference.cs b/Function/BNFreeDebugInfoParserReference.cs new file mode 100644 index 0000000..e054dac --- /dev/null +++ b/Function/BNFreeDebugInfoParserReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeDebugInfoParserReference(BNDebugInfoParser* parser) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeDebugInfoParserReference" + )] + internal static extern void BNFreeDebugInfoParserReference( + + // BNDebugInfoParser* parser + IntPtr parser + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeDebugInfoReference.cs b/Function/BNFreeDebugInfoReference.cs new file mode 100644 index 0000000..fe638e6 --- /dev/null +++ b/Function/BNFreeDebugInfoReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeDebugInfoReference(BNDebugInfo* debugInfo) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeDebugInfoReference" + )] + internal static extern void BNFreeDebugInfoReference( + + // BNDebugInfo* debugInfo + IntPtr debugInfo + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeDebugTypes.cs b/Function/BNFreeDebugTypes.cs new file mode 100644 index 0000000..38a6fd6 --- /dev/null +++ b/Function/BNFreeDebugTypes.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeDebugTypes(BNNameAndType* types, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeDebugTypes" + )] + internal static extern void BNFreeDebugTypes( + + // BNNameAndType* types + IntPtr types , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeDemangledName.cs b/Function/BNFreeDemangledName.cs new file mode 100644 index 0000000..7205466 --- /dev/null +++ b/Function/BNFreeDemangledName.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeDemangledName(const char*** name, uint64_t nameElements) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeDemangledName" + )] + internal static extern void BNFreeDemangledName( + + // const char*** name + IntPtr name , + + // uint64_t nameElements + ulong nameElements + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeDemanglerList.cs b/Function/BNFreeDemanglerList.cs new file mode 100644 index 0000000..9b85a49 --- /dev/null +++ b/Function/BNFreeDemanglerList.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeDemanglerList(BNDemangler** demanglers) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeDemanglerList" + )] + internal static extern void BNFreeDemanglerList( + + // BNDemangler** demanglers + IntPtr demanglers + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeDisassemblySettings.cs b/Function/BNFreeDisassemblySettings.cs new file mode 100644 index 0000000..e98e5c2 --- /dev/null +++ b/Function/BNFreeDisassemblySettings.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeDisassemblySettings(BNDisassemblySettings* settings) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeDisassemblySettings" + )] + internal static extern void BNFreeDisassemblySettings( + + // BNDisassemblySettings* settings + IntPtr settings + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeDisassemblyTextLines.cs b/Function/BNFreeDisassemblyTextLines.cs new file mode 100644 index 0000000..e4b50b8 --- /dev/null +++ b/Function/BNFreeDisassemblyTextLines.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeDisassemblyTextLines(BNDisassemblyTextLine* lines, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeDisassemblyTextLines" + )] + internal static extern void BNFreeDisassemblyTextLines( + + // BNDisassemblyTextLine* lines + IntPtr lines , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeDisassemblyTextRenderer.cs b/Function/BNFreeDisassemblyTextRenderer.cs new file mode 100644 index 0000000..7e23fe3 --- /dev/null +++ b/Function/BNFreeDisassemblyTextRenderer.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeDisassemblyTextRenderer(BNDisassemblyTextRenderer* renderer) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeDisassemblyTextRenderer" + )] + internal static extern void BNFreeDisassemblyTextRenderer( + + // BNDisassemblyTextRenderer* renderer + IntPtr renderer + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeDownloadInstance.cs b/Function/BNFreeDownloadInstance.cs new file mode 100644 index 0000000..bd2f464 --- /dev/null +++ b/Function/BNFreeDownloadInstance.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeDownloadInstance(BNDownloadInstance* instance) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeDownloadInstance" + )] + internal static extern void BNFreeDownloadInstance( + + // BNDownloadInstance* instance + IntPtr instance + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeDownloadInstanceResponse.cs b/Function/BNFreeDownloadInstanceResponse.cs new file mode 100644 index 0000000..f787409 --- /dev/null +++ b/Function/BNFreeDownloadInstanceResponse.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeDownloadInstanceResponse(BNDownloadInstanceResponse* response) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeDownloadInstanceResponse" + )] + internal static extern void BNFreeDownloadInstanceResponse( + + // BNDownloadInstanceResponse* response + IntPtr response + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeDownloadProviderList.cs b/Function/BNFreeDownloadProviderList.cs new file mode 100644 index 0000000..5909c14 --- /dev/null +++ b/Function/BNFreeDownloadProviderList.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeDownloadProviderList(BNDownloadProvider** providers) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeDownloadProviderList" + )] + internal static extern void BNFreeDownloadProviderList( + + // BNDownloadProvider** providers + IntPtr providers + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeEnumeration.cs b/Function/BNFreeEnumeration.cs new file mode 100644 index 0000000..3ded331 --- /dev/null +++ b/Function/BNFreeEnumeration.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeEnumeration(BNEnumeration* e) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeEnumeration" + )] + internal static extern void BNFreeEnumeration( + + // BNEnumeration* e + IntPtr e + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeEnumerationBuilder.cs b/Function/BNFreeEnumerationBuilder.cs new file mode 100644 index 0000000..293e2c8 --- /dev/null +++ b/Function/BNFreeEnumerationBuilder.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeEnumerationBuilder(BNEnumerationBuilder* e) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeEnumerationBuilder" + )] + internal static extern void BNFreeEnumerationBuilder( + + // BNEnumerationBuilder* e + IntPtr e + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeEnumerationMemberList.cs b/Function/BNFreeEnumerationMemberList.cs new file mode 100644 index 0000000..742cb3b --- /dev/null +++ b/Function/BNFreeEnumerationMemberList.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeEnumerationMemberList(BNEnumerationMember* members, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreeEnumerationMemberList" + )] + internal static extern void BNFreeEnumerationMemberList( + + // BNEnumerationMember* members + IntPtr members , + + // uint64_t count + ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeExternalLibrary.cs b/Function/BNFreeExternalLibrary.cs new file mode 100644 index 0000000..30aea56 --- /dev/null +++ b/Function/BNFreeExternalLibrary.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeExternalLibrary(BNExternalLibrary* lib) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeExternalLibrary" + )] + internal static extern void BNFreeExternalLibrary( + + // BNExternalLibrary* lib + IntPtr lib + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeExternalLibraryList.cs b/Function/BNFreeExternalLibraryList.cs new file mode 100644 index 0000000..06bcf76 --- /dev/null +++ b/Function/BNFreeExternalLibraryList.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeExternalLibraryList(BNExternalLibrary** libs, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreeExternalLibraryList" + )] + internal static extern void BNFreeExternalLibraryList( + + // BNExternalLibrary** libs + IntPtr libs , + + // uint64_t count + ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeExternalLocation.cs b/Function/BNFreeExternalLocation.cs new file mode 100644 index 0000000..1bbff50 --- /dev/null +++ b/Function/BNFreeExternalLocation.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeExternalLocation(BNExternalLocation* loc) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeExternalLocation" + )] + internal static extern void BNFreeExternalLocation( + + // BNExternalLocation* loc + IntPtr loc + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeExternalLocationList.cs b/Function/BNFreeExternalLocationList.cs new file mode 100644 index 0000000..fe5d2ba --- /dev/null +++ b/Function/BNFreeExternalLocationList.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeExternalLocationList(BNExternalLocation** locs, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeExternalLocationList" + )] + internal static extern void BNFreeExternalLocationList( + + // BNExternalLocation** locs + IntPtr locs , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeFieldResolutionInfo.cs b/Function/BNFreeFieldResolutionInfo.cs new file mode 100644 index 0000000..7d0ab55 --- /dev/null +++ b/Function/BNFreeFieldResolutionInfo.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeFieldResolutionInfo(BNFieldResolutionInfo* info) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeFieldResolutionInfo" + )] + internal static extern void BNFreeFieldResolutionInfo( + + // BNFieldResolutionInfo* info + IntPtr info + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeFileMetadata.cs b/Function/BNFreeFileMetadata.cs new file mode 100644 index 0000000..a1ac9aa --- /dev/null +++ b/Function/BNFreeFileMetadata.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeFileMetadata(BNFileMetadata* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeFileMetadata" + )] + internal static extern void BNFreeFileMetadata( + + // BNFileMetadata* file + IntPtr file + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeFirmwareNinja.cs b/Function/BNFreeFirmwareNinja.cs new file mode 100644 index 0000000..88c66a0 --- /dev/null +++ b/Function/BNFreeFirmwareNinja.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeFirmwareNinja(BNFirmwareNinja* fn) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeFirmwareNinja" + )] + internal static extern void BNFreeFirmwareNinja( + + // BNFirmwareNinja* fn + IntPtr fn + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeFirmwareNinjaReferenceNode.cs b/Function/BNFreeFirmwareNinjaReferenceNode.cs new file mode 100644 index 0000000..03b49aa --- /dev/null +++ b/Function/BNFreeFirmwareNinjaReferenceNode.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeFirmwareNinjaReferenceNode(BNFirmwareNinjaReferenceNode* node) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeFirmwareNinjaReferenceNode" + )] + internal static extern void BNFreeFirmwareNinjaReferenceNode( + + // BNFirmwareNinjaReferenceNode* node + IntPtr node + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeFirmwareNinjaReferenceNodes.cs b/Function/BNFreeFirmwareNinjaReferenceNodes.cs new file mode 100644 index 0000000..5646230 --- /dev/null +++ b/Function/BNFreeFirmwareNinjaReferenceNodes.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeFirmwareNinjaReferenceNodes(BNFirmwareNinjaReferenceNode** nodes, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeFirmwareNinjaReferenceNodes" + )] + internal static extern void BNFreeFirmwareNinjaReferenceNodes( + + // BNFirmwareNinjaReferenceNode** nodes + IntPtr nodes , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeFirmwareNinjaRelationship.cs b/Function/BNFreeFirmwareNinjaRelationship.cs new file mode 100644 index 0000000..a616370 --- /dev/null +++ b/Function/BNFreeFirmwareNinjaRelationship.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeFirmwareNinjaRelationship(BNFirmwareNinjaRelationship* rel) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeFirmwareNinjaRelationship" + )] + internal static extern void BNFreeFirmwareNinjaRelationship( + + // BNFirmwareNinjaRelationship* rel + IntPtr rel + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeFlagConditionsForSemanticFlagGroup.cs b/Function/BNFreeFlagConditionsForSemanticFlagGroup.cs new file mode 100644 index 0000000..bcf5581 --- /dev/null +++ b/Function/BNFreeFlagConditionsForSemanticFlagGroup.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeFlagConditionsForSemanticFlagGroup(BNFlagConditionForSemanticClass* conditions) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeFlagConditionsForSemanticFlagGroup" + )] + internal static extern void BNFreeFlagConditionsForSemanticFlagGroup( + + // BNFlagConditionForSemanticClass* conditions + IntPtr conditions + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeFlowGraph.cs b/Function/BNFreeFlowGraph.cs new file mode 100644 index 0000000..ee3f302 --- /dev/null +++ b/Function/BNFreeFlowGraph.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeFlowGraph(BNFlowGraph* graph) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeFlowGraph" + )] + internal static extern void BNFreeFlowGraph( + + // BNFlowGraph* graph + IntPtr graph + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeFlowGraphLayoutList.cs b/Function/BNFreeFlowGraphLayoutList.cs new file mode 100644 index 0000000..0c9ac25 --- /dev/null +++ b/Function/BNFreeFlowGraphLayoutList.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeFlowGraphLayoutList(BNFlowGraphLayout** layouts) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeFlowGraphLayoutList" + )] + internal static extern void BNFreeFlowGraphLayoutList( + + // BNFlowGraphLayout** layouts + IntPtr layouts + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeFlowGraphLayoutRequest.cs b/Function/BNFreeFlowGraphLayoutRequest.cs new file mode 100644 index 0000000..5821828 --- /dev/null +++ b/Function/BNFreeFlowGraphLayoutRequest.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeFlowGraphLayoutRequest(BNFlowGraphLayoutRequest* layout) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeFlowGraphLayoutRequest" + )] + internal static extern void BNFreeFlowGraphLayoutRequest( + + // BNFlowGraphLayoutRequest* layout + IntPtr layout + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeFlowGraphNode.cs b/Function/BNFreeFlowGraphNode.cs new file mode 100644 index 0000000..a1a6695 --- /dev/null +++ b/Function/BNFreeFlowGraphNode.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeFlowGraphNode(BNFlowGraphNode* node) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeFlowGraphNode" + )] + internal static extern void BNFreeFlowGraphNode( + + // BNFlowGraphNode* node + IntPtr node + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeFlowGraphNodeEdgeList.cs b/Function/BNFreeFlowGraphNodeEdgeList.cs new file mode 100644 index 0000000..a66054b --- /dev/null +++ b/Function/BNFreeFlowGraphNodeEdgeList.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeFlowGraphNodeEdgeList(BNFlowGraphEdge* edges, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreeFlowGraphNodeEdgeList" + )] + internal static extern void BNFreeFlowGraphNodeEdgeList( + + // BNFlowGraphEdge* edges + IntPtr edges , + + // uint64_t count + ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeFlowGraphNodeList.cs b/Function/BNFreeFlowGraphNodeList.cs new file mode 100644 index 0000000..228a317 --- /dev/null +++ b/Function/BNFreeFlowGraphNodeList.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeFlowGraphNodeList(BNFlowGraphNode** nodes, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreeFlowGraphNodeList" + )] + internal static extern void BNFreeFlowGraphNodeList( + + // BNFlowGraphNode** nodes + IntPtr nodes , + + // uint64_t count + ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeFormInputResults.cs b/Function/BNFreeFormInputResults.cs new file mode 100644 index 0000000..6872fac --- /dev/null +++ b/Function/BNFreeFormInputResults.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeFormInputResults(BNFormInputField* fields, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreeFormInputResults" + )] + internal static extern void BNFreeFormInputResults( + + // BNFormInputField* fields + in BNFormInputField[] fields , + + // uint64_t count + ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeFullInfoUpdateChannels.cs b/Function/BNFreeFullInfoUpdateChannels.cs new file mode 100644 index 0000000..a817d12 --- /dev/null +++ b/Function/BNFreeFullInfoUpdateChannels.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeFullInfoUpdateChannels(BNUpdateChannelFullInfo* list, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeFullInfoUpdateChannels" + )] + internal static extern void BNFreeFullInfoUpdateChannels( + + // BNUpdateChannelFullInfo* list + IntPtr list , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeFunction.cs b/Function/BNFreeFunction.cs new file mode 100644 index 0000000..0e1d0ec --- /dev/null +++ b/Function/BNFreeFunction.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeFunction(BNFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeFunction" + )] + internal static extern void BNFreeFunction( + + // BNFunction* func + IntPtr func + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeFunctionList.cs b/Function/BNFreeFunctionList.cs new file mode 100644 index 0000000..421b884 --- /dev/null +++ b/Function/BNFreeFunctionList.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeFunctionList(BNFunction** funcs, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreeFunctionList" + )] + internal static extern void BNFreeFunctionList( + + // BNFunction** funcs + IntPtr funcs , + + // uint64_t count + ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeHighLevelILFunction.cs b/Function/BNFreeHighLevelILFunction.cs new file mode 100644 index 0000000..9b4e151 --- /dev/null +++ b/Function/BNFreeHighLevelILFunction.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeHighLevelILFunction(BNHighLevelILFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeHighLevelILFunction" + )] + internal static extern void BNFreeHighLevelILFunction( + + // BNHighLevelILFunction* func + IntPtr func + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeHighLevelILTokenEmitter.cs b/Function/BNFreeHighLevelILTokenEmitter.cs new file mode 100644 index 0000000..879bcd6 --- /dev/null +++ b/Function/BNFreeHighLevelILTokenEmitter.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeHighLevelILTokenEmitter(BNHighLevelILTokenEmitter* emitter) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeHighLevelILTokenEmitter" + )] + internal static extern void BNFreeHighLevelILTokenEmitter( + + // BNHighLevelILTokenEmitter* emitter + IntPtr emitter + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeILBranchDependenceList.cs b/Function/BNFreeILBranchDependenceList.cs new file mode 100644 index 0000000..cf2530b --- /dev/null +++ b/Function/BNFreeILBranchDependenceList.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeILBranchDependenceList(BNILBranchInstructionAndDependence* branches) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreeILBranchDependenceList" + )] + internal static extern void BNFreeILBranchDependenceList( + + // BNILBranchInstructionAndDependence* branches + IntPtr branches + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeILInstructionList.cs b/Function/BNFreeILInstructionList.cs new file mode 100644 index 0000000..5f6d0d4 --- /dev/null +++ b/Function/BNFreeILInstructionList.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeILInstructionList(uint64_t* list) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreeILInstructionList" + )] + internal static extern void BNFreeILInstructionList( + + // uint64_t* list + IntPtr list + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeILReferences.cs b/Function/BNFreeILReferences.cs new file mode 100644 index 0000000..d04adcb --- /dev/null +++ b/Function/BNFreeILReferences.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeILReferences(BNILReferenceSource* refs, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreeILReferences" + )] + internal static extern void BNFreeILReferences( + + // BNILReferenceSource* refs + IntPtr refs , + + // uint64_t count + ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeIndirectBranchList.cs b/Function/BNFreeIndirectBranchList.cs new file mode 100644 index 0000000..46adfe6 --- /dev/null +++ b/Function/BNFreeIndirectBranchList.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeIndirectBranchList(BNIndirectBranchInfo* branches) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreeIndirectBranchList" + )] + internal static extern void BNFreeIndirectBranchList( + + // BNIndirectBranchInfo* branches + IntPtr branches + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeInheritedStructureMember.cs b/Function/BNFreeInheritedStructureMember.cs new file mode 100644 index 0000000..f837244 --- /dev/null +++ b/Function/BNFreeInheritedStructureMember.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeInheritedStructureMember(BNInheritedStructureMember* members) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeInheritedStructureMember" + )] + internal static extern void BNFreeInheritedStructureMember( + + // BNInheritedStructureMember* members + IntPtr members + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeInheritedStructureMemberList.cs b/Function/BNFreeInheritedStructureMemberList.cs new file mode 100644 index 0000000..5081279 --- /dev/null +++ b/Function/BNFreeInheritedStructureMemberList.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeInheritedStructureMemberList(BNInheritedStructureMember* members, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeInheritedStructureMemberList" + )] + internal static extern void BNFreeInheritedStructureMemberList( + + // BNInheritedStructureMember* members + IntPtr members , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeInstructionText.cs b/Function/BNFreeInstructionText.cs new file mode 100644 index 0000000..2c61fc8 --- /dev/null +++ b/Function/BNFreeInstructionText.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeInstructionText(BNInstructionTextToken* tokens, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreeInstructionText" + )] + internal static extern void BNFreeInstructionText( + + // BNInstructionTextToken* tokens + IntPtr tokens , + + // uint64_t count + ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeInstructionTextLines.cs b/Function/BNFreeInstructionTextLines.cs new file mode 100644 index 0000000..0a86bab --- /dev/null +++ b/Function/BNFreeInstructionTextLines.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeInstructionTextLines(BNInstructionTextLine* lines, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeInstructionTextLines" + )] + internal static extern void BNFreeInstructionTextLines( + + // BNInstructionTextLine* lines + IntPtr lines , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeKeyValueStore.cs b/Function/BNFreeKeyValueStore.cs new file mode 100644 index 0000000..aac2d11 --- /dev/null +++ b/Function/BNFreeKeyValueStore.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeKeyValueStore(BNKeyValueStore* store) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeKeyValueStore" + )] + internal static extern void BNFreeKeyValueStore( + + // BNKeyValueStore* store + IntPtr store + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeLLILVariableVersionList.cs b/Function/BNFreeLLILVariableVersionList.cs new file mode 100644 index 0000000..7a6561e --- /dev/null +++ b/Function/BNFreeLLILVariableVersionList.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeLLILVariableVersionList(uint64_t* versions) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeLLILVariableVersionList" + )] + internal static extern void BNFreeLLILVariableVersionList( + + // uint64_t* versions + IntPtr versions + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeLLILVariablesList.cs b/Function/BNFreeLLILVariablesList.cs new file mode 100644 index 0000000..7bb35d3 --- /dev/null +++ b/Function/BNFreeLLILVariablesList.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeLLILVariablesList(uint32_t* vars) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeLLILVariablesList" + )] + internal static extern void BNFreeLLILVariablesList( + + // uint32_t* vars + IntPtr vars + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeLanguageRepresentationFunction.cs b/Function/BNFreeLanguageRepresentationFunction.cs new file mode 100644 index 0000000..04c4b8d --- /dev/null +++ b/Function/BNFreeLanguageRepresentationFunction.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeLanguageRepresentationFunction(BNLanguageRepresentationFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeLanguageRepresentationFunction" + )] + internal static extern void BNFreeLanguageRepresentationFunction( + + // BNLanguageRepresentationFunction* func + IntPtr func + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeLanguageRepresentationFunctionTypeList.cs b/Function/BNFreeLanguageRepresentationFunctionTypeList.cs new file mode 100644 index 0000000..b7035b4 --- /dev/null +++ b/Function/BNFreeLanguageRepresentationFunctionTypeList.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeLanguageRepresentationFunctionTypeList(BNLanguageRepresentationFunctionType** types) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeLanguageRepresentationFunctionTypeList" + )] + internal static extern void BNFreeLanguageRepresentationFunctionTypeList( + + // BNLanguageRepresentationFunctionType** types + IntPtr types + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeLineFormatterList.cs b/Function/BNFreeLineFormatterList.cs new file mode 100644 index 0000000..17326d1 --- /dev/null +++ b/Function/BNFreeLineFormatterList.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeLineFormatterList(BNLineFormatter** formatters) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeLineFormatterList" + )] + internal static extern void BNFreeLineFormatterList( + + // BNLineFormatter** formatters + IntPtr formatters + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeLineFormatterSettings.cs b/Function/BNFreeLineFormatterSettings.cs new file mode 100644 index 0000000..945554b --- /dev/null +++ b/Function/BNFreeLineFormatterSettings.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeLineFormatterSettings(BNLineFormatterSettings* settings) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeLineFormatterSettings" + )] + internal static extern void BNFreeLineFormatterSettings( + + // BNLineFormatterSettings* settings + IntPtr settings + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeLinearDisassemblyLines.cs b/Function/BNFreeLinearDisassemblyLines.cs new file mode 100644 index 0000000..c7509e0 --- /dev/null +++ b/Function/BNFreeLinearDisassemblyLines.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeLinearDisassemblyLines(BNLinearDisassemblyLine* lines, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreeLinearDisassemblyLines" + )] + internal static extern void BNFreeLinearDisassemblyLines( + + // BNLinearDisassemblyLine* lines + IntPtr lines , + + // uint64_t count + ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeLinearViewCursor.cs b/Function/BNFreeLinearViewCursor.cs new file mode 100644 index 0000000..5847185 --- /dev/null +++ b/Function/BNFreeLinearViewCursor.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeLinearViewCursor(BNLinearViewCursor* cursor) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeLinearViewCursor" + )] + internal static extern void BNFreeLinearViewCursor( + + // BNLinearViewCursor* cursor + IntPtr cursor + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeLinearViewCursorPath.cs b/Function/BNFreeLinearViewCursorPath.cs new file mode 100644 index 0000000..af602aa --- /dev/null +++ b/Function/BNFreeLinearViewCursorPath.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeLinearViewCursorPath(BNLinearViewObjectIdentifier* objs, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreeLinearViewCursorPath" + )] + internal static extern void BNFreeLinearViewCursorPath( + + // BNLinearViewObjectIdentifier* objs + IntPtr objs , + + // uint64_t count + ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeLinearViewCursorPathObjects.cs b/Function/BNFreeLinearViewCursorPathObjects.cs new file mode 100644 index 0000000..56c6733 --- /dev/null +++ b/Function/BNFreeLinearViewCursorPathObjects.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeLinearViewCursorPathObjects(BNLinearViewObject** objs, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeLinearViewCursorPathObjects" + )] + internal static extern void BNFreeLinearViewCursorPathObjects( + + // BNLinearViewObject** objs + IntPtr objs , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeLinearViewObject.cs b/Function/BNFreeLinearViewObject.cs new file mode 100644 index 0000000..a29b1b3 --- /dev/null +++ b/Function/BNFreeLinearViewObject.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeLinearViewObject(BNLinearViewObject* obj) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeLinearViewObject" + )] + internal static extern void BNFreeLinearViewObject( + + // BNLinearViewObject* obj + IntPtr obj + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeLinearViewObjectIdentifier.cs b/Function/BNFreeLinearViewObjectIdentifier.cs new file mode 100644 index 0000000..35baefd --- /dev/null +++ b/Function/BNFreeLinearViewObjectIdentifier.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeLinearViewObjectIdentifier(BNLinearViewObjectIdentifier* id) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreeLinearViewObjectIdentifier" + )] + internal static extern void BNFreeLinearViewObjectIdentifier( + + // BNLinearViewObjectIdentifier* id + in BNLinearViewObjectIdentifier id + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeLogger.cs b/Function/BNFreeLogger.cs new file mode 100644 index 0000000..257d283 --- /dev/null +++ b/Function/BNFreeLogger.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeLogger(BNLogger* logger) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeLogger" + )] + internal static extern void BNFreeLogger( + + // BNLogger* logger + IntPtr logger + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeLowLevelILFunction.cs b/Function/BNFreeLowLevelILFunction.cs new file mode 100644 index 0000000..dad3c93 --- /dev/null +++ b/Function/BNFreeLowLevelILFunction.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeLowLevelILFunction(BNLowLevelILFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeLowLevelILFunction" + )] + internal static extern void BNFreeLowLevelILFunction( + + // BNLowLevelILFunction* func + IntPtr func + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeMainThreadAction.cs b/Function/BNFreeMainThreadAction.cs new file mode 100644 index 0000000..fa59d63 --- /dev/null +++ b/Function/BNFreeMainThreadAction.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeMainThreadAction(BNMainThreadAction* action) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeMainThreadAction" + )] + internal static extern void BNFreeMainThreadAction( + + // BNMainThreadAction* action + IntPtr action + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeMediumLevelILFunction.cs b/Function/BNFreeMediumLevelILFunction.cs new file mode 100644 index 0000000..33dfcd4 --- /dev/null +++ b/Function/BNFreeMediumLevelILFunction.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeMediumLevelILFunction(BNMediumLevelILFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeMediumLevelILFunction" + )] + internal static extern void BNFreeMediumLevelILFunction( + + // BNMediumLevelILFunction* func + IntPtr func + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeMemoryUsageInfo.cs b/Function/BNFreeMemoryUsageInfo.cs new file mode 100644 index 0000000..8300d3d --- /dev/null +++ b/Function/BNFreeMemoryUsageInfo.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeMemoryUsageInfo(BNMemoryUsageInfo* info, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeMemoryUsageInfo" + )] + internal static extern void BNFreeMemoryUsageInfo( + + // BNMemoryUsageInfo* info + IntPtr info , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeMergedVariableList.cs b/Function/BNFreeMergedVariableList.cs new file mode 100644 index 0000000..2c0180c --- /dev/null +++ b/Function/BNFreeMergedVariableList.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeMergedVariableList(BNMergedVariable* vars, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeMergedVariableList" + )] + internal static extern void BNFreeMergedVariableList( + + // BNMergedVariable* vars + IntPtr vars , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeMetadata.cs b/Function/BNFreeMetadata.cs new file mode 100644 index 0000000..cdacd61 --- /dev/null +++ b/Function/BNFreeMetadata.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeMetadata(BNMetadata* data) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeMetadata" + )] + internal static extern void BNFreeMetadata( + + // BNMetadata* data + IntPtr data + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeMetadataArray.cs b/Function/BNFreeMetadataArray.cs new file mode 100644 index 0000000..eed6b44 --- /dev/null +++ b/Function/BNFreeMetadataArray.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeMetadataArray(BNMetadata** data) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreeMetadataArray" + )] + internal static extern void BNFreeMetadataArray( + + // BNMetadata** data + IntPtr data + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeMetadataBooleanList.cs b/Function/BNFreeMetadataBooleanList.cs new file mode 100644 index 0000000..a079fa4 --- /dev/null +++ b/Function/BNFreeMetadataBooleanList.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeMetadataBooleanList(bool* param1, uint64_t param2) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeMetadataBooleanList" + )] + internal static extern void BNFreeMetadataBooleanList( + + // bool* param1 + IntPtr param1 , + + // uint64_t param2 + ulong param2 + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeMetadataDoubleList.cs b/Function/BNFreeMetadataDoubleList.cs new file mode 100644 index 0000000..6a8ce06 --- /dev/null +++ b/Function/BNFreeMetadataDoubleList.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeMetadataDoubleList(double* param1, uint64_t param2) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreeMetadataDoubleList" + )] + internal static extern void BNFreeMetadataDoubleList( + + // double* param1 + IntPtr param1 , + + // uint64_t param2 + ulong param2 + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeMetadataRaw.cs b/Function/BNFreeMetadataRaw.cs new file mode 100644 index 0000000..019d713 --- /dev/null +++ b/Function/BNFreeMetadataRaw.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeMetadataRaw(uint8_t* data) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeMetadataRaw" + )] + internal static extern void BNFreeMetadataRaw( + + // uint8_t* data + IntPtr data + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeMetadataSignedIntegerList.cs b/Function/BNFreeMetadataSignedIntegerList.cs new file mode 100644 index 0000000..a34dfa5 --- /dev/null +++ b/Function/BNFreeMetadataSignedIntegerList.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeMetadataSignedIntegerList(int64_t* param1, uint64_t param2) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreeMetadataSignedIntegerList" + )] + internal static extern void BNFreeMetadataSignedIntegerList( + + // int64_t* param1 + IntPtr param1 , + + // uint64_t param2 + ulong param2 + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeMetadataStringList.cs b/Function/BNFreeMetadataStringList.cs new file mode 100644 index 0000000..2ca57a7 --- /dev/null +++ b/Function/BNFreeMetadataStringList.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeMetadataStringList(const char** param1, uint64_t param2) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreeMetadataStringList" + )] + internal static extern void BNFreeMetadataStringList( + + // const char** param1 + IntPtr param1 , + + // uint64_t param2 + ulong param2 + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeMetadataUnsignedIntegerList.cs b/Function/BNFreeMetadataUnsignedIntegerList.cs new file mode 100644 index 0000000..61a0369 --- /dev/null +++ b/Function/BNFreeMetadataUnsignedIntegerList.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeMetadataUnsignedIntegerList(uint64_t* param1, uint64_t param2) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreeMetadataUnsignedIntegerList" + )] + internal static extern void BNFreeMetadataUnsignedIntegerList( + + // uint64_t* param1 + IntPtr param1 , + + // uint64_t param2 + ulong param2 + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeMetadataValueStore.cs b/Function/BNFreeMetadataValueStore.cs new file mode 100644 index 0000000..190dd19 --- /dev/null +++ b/Function/BNFreeMetadataValueStore.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeMetadataValueStore(BNMetadataValueStore* data) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreeMetadataValueStore" + )] + internal static extern void BNFreeMetadataValueStore( + + // BNMetadataValueStore* data + IntPtr data + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeNameAndTypeList.cs b/Function/BNFreeNameAndTypeList.cs new file mode 100644 index 0000000..8b54da7 --- /dev/null +++ b/Function/BNFreeNameAndTypeList.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeNameAndTypeList(BNNameAndType* nt, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreeNameAndTypeList" + )] + internal static extern void BNFreeNameAndTypeList( + + // BNNameAndType* nt + IntPtr nt , + + // uint64_t count + ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeNameSpace.cs b/Function/BNFreeNameSpace.cs new file mode 100644 index 0000000..8f2d1c2 --- /dev/null +++ b/Function/BNFreeNameSpace.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeNameSpace(BNNameSpace* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreeNameSpace" + )] + internal static extern void BNFreeNameSpace( + + // BNNameSpace* name + in BNNameSpace name + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeNameSpaceList.cs b/Function/BNFreeNameSpaceList.cs new file mode 100644 index 0000000..2c7593e --- /dev/null +++ b/Function/BNFreeNameSpaceList.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeNameSpaceList(BNNameSpace* nameSpace, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeNameSpaceList" + )] + internal static extern void BNFreeNameSpaceList( + + // BNNameSpace* _nameSpace + IntPtr _nameSpace , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeNamedTypeReference.cs b/Function/BNFreeNamedTypeReference.cs new file mode 100644 index 0000000..85ade95 --- /dev/null +++ b/Function/BNFreeNamedTypeReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeNamedTypeReference(BNNamedTypeReference* nt) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeNamedTypeReference" + )] + internal static extern void BNFreeNamedTypeReference( + + // BNNamedTypeReference* nt + IntPtr nt + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeNamedTypeReferenceBuilder.cs b/Function/BNFreeNamedTypeReferenceBuilder.cs new file mode 100644 index 0000000..4a3bed7 --- /dev/null +++ b/Function/BNFreeNamedTypeReferenceBuilder.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeNamedTypeReferenceBuilder(BNNamedTypeReferenceBuilder* s) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeNamedTypeReferenceBuilder" + )] + internal static extern void BNFreeNamedTypeReferenceBuilder( + + // BNNamedTypeReferenceBuilder* s + IntPtr s + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeOutputTypeList.cs b/Function/BNFreeOutputTypeList.cs new file mode 100644 index 0000000..931e67d --- /dev/null +++ b/Function/BNFreeOutputTypeList.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeOutputTypeList(BNTypeWithConfidence* types, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreeOutputTypeList" + )] + internal static extern void BNFreeOutputTypeList( + + // BNTypeWithConfidence* types + IntPtr types , + + // uint64_t count + ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeParameterVariables.cs b/Function/BNFreeParameterVariables.cs new file mode 100644 index 0000000..40ac46d --- /dev/null +++ b/Function/BNFreeParameterVariables.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeParameterVariables(BNParameterVariablesWithConfidence* vars) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeParameterVariables" + )] + internal static extern void BNFreeParameterVariables( + + // BNParameterVariablesWithConfidence* vars + IntPtr vars + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeParseError.cs b/Function/BNFreeParseError.cs new file mode 100644 index 0000000..7d3cc32 --- /dev/null +++ b/Function/BNFreeParseError.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeParseError(const char* errorString) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreeParseError" + )] + internal static extern void BNFreeParseError( + + // char* errorString + IntPtr errorString + ); + } +} \ No newline at end of file diff --git a/Function/BNFreePath.cs b/Function/BNFreePath.cs new file mode 100644 index 0000000..dc29ec7 --- /dev/null +++ b/Function/BNFreePath.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreePath(const char* path) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreePath" + )] + internal static extern void BNFreePath( + + // const char* path + string path + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreePendingBasicBlockEdgeList.cs b/Function/BNFreePendingBasicBlockEdgeList.cs new file mode 100644 index 0000000..d6f4547 --- /dev/null +++ b/Function/BNFreePendingBasicBlockEdgeList.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreePendingBasicBlockEdgeList(BNPendingBasicBlockEdge* edges) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreePendingBasicBlockEdgeList" + )] + internal static extern void BNFreePendingBasicBlockEdgeList( + + // BNPendingBasicBlockEdge* edges + IntPtr edges + ); + } +} \ No newline at end of file diff --git a/Function/BNFreePlatform.cs b/Function/BNFreePlatform.cs new file mode 100644 index 0000000..8cb0674 --- /dev/null +++ b/Function/BNFreePlatform.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreePlatform(BNPlatform* platform) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreePlatform" + )] + internal static extern void BNFreePlatform( + + // BNPlatform* platform + IntPtr platform + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreePlatformList.cs b/Function/BNFreePlatformList.cs new file mode 100644 index 0000000..aa3559a --- /dev/null +++ b/Function/BNFreePlatformList.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreePlatformList(BNPlatform** platform, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreePlatformList" + )] + internal static extern void BNFreePlatformList( + + // BNPlatform** platform + IntPtr platform , + + // uint64_t count + ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNFreePlatformOSList.cs b/Function/BNFreePlatformOSList.cs new file mode 100644 index 0000000..ae0e6ff --- /dev/null +++ b/Function/BNFreePlatformOSList.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreePlatformOSList(const char** list, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreePlatformOSList" + )] + internal static extern void BNFreePlatformOSList( + + // char** list + IntPtr list , + + // uint64_t count + ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNFreePlugin.cs b/Function/BNFreePlugin.cs new file mode 100644 index 0000000..8d4deb0 --- /dev/null +++ b/Function/BNFreePlugin.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreePlugin(BNRepoPlugin* plugin) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreePlugin" + )] + internal static extern void BNFreePlugin( + + // BNRepoPlugin* plugin + IntPtr plugin + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreePluginCommandList.cs b/Function/BNFreePluginCommandList.cs new file mode 100644 index 0000000..6468045 --- /dev/null +++ b/Function/BNFreePluginCommandList.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreePluginCommandList(BNPluginCommand* commands) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreePluginCommandList" + )] + internal static extern void BNFreePluginCommandList( + + // BNPluginCommand* commands + IntPtr commands + ); + } +} \ No newline at end of file diff --git a/Function/BNFreePluginPlatforms.cs b/Function/BNFreePluginPlatforms.cs new file mode 100644 index 0000000..a49ca8c --- /dev/null +++ b/Function/BNFreePluginPlatforms.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreePluginPlatforms(const char** platforms, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreePluginPlatforms" + )] + internal static extern void BNFreePluginPlatforms( + + // const char** platforms + string[] platforms , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreePluginTypes.cs b/Function/BNFreePluginTypes.cs new file mode 100644 index 0000000..2794f52 --- /dev/null +++ b/Function/BNFreePluginTypes.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreePluginTypes(BNPluginType* r) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreePluginTypes" + )] + internal static extern void BNFreePluginTypes( + + // BNPluginType* r + IntPtr r + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreePointerSuffixList.cs b/Function/BNFreePointerSuffixList.cs new file mode 100644 index 0000000..101d553 --- /dev/null +++ b/Function/BNFreePointerSuffixList.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreePointerSuffixList(BNPointerSuffix* suffix, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreePointerSuffixList" + )] + internal static extern void BNFreePointerSuffixList( + + // BNPointerSuffix* suffix + IntPtr suffix , + + // uint64_t count + ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNFreePossibleValueSet.cs b/Function/BNFreePossibleValueSet.cs new file mode 100644 index 0000000..e01d611 --- /dev/null +++ b/Function/BNFreePossibleValueSet.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreePossibleValueSet(BNPossibleValueSet* value) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreePossibleValueSet" + )] + internal static extern void BNFreePossibleValueSet( + + // BNPossibleValueSet* value + in BNPossibleValueSet value + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeProject.cs b/Function/BNFreeProject.cs new file mode 100644 index 0000000..fd83a40 --- /dev/null +++ b/Function/BNFreeProject.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeProject(BNProject* project) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeProject" + )] + internal static extern void BNFreeProject( + + // BNProject* project + IntPtr project + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeProjectFile.cs b/Function/BNFreeProjectFile.cs new file mode 100644 index 0000000..a8573a5 --- /dev/null +++ b/Function/BNFreeProjectFile.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeProjectFile(BNProjectFile* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeProjectFile" + )] + internal static extern void BNFreeProjectFile( + + // BNProjectFile* file + IntPtr file + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeProjectFileList.cs b/Function/BNFreeProjectFileList.cs new file mode 100644 index 0000000..0053c42 --- /dev/null +++ b/Function/BNFreeProjectFileList.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeProjectFileList(BNProjectFile** files, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeProjectFileList" + )] + internal static extern void BNFreeProjectFileList( + + // BNProjectFile** files + IntPtr files , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeProjectFolder.cs b/Function/BNFreeProjectFolder.cs new file mode 100644 index 0000000..fb50945 --- /dev/null +++ b/Function/BNFreeProjectFolder.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeProjectFolder(BNProjectFolder* folder) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeProjectFolder" + )] + internal static extern void BNFreeProjectFolder( + + // BNProjectFolder* folder + IntPtr folder + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeProjectFolderList.cs b/Function/BNFreeProjectFolderList.cs new file mode 100644 index 0000000..69420a0 --- /dev/null +++ b/Function/BNFreeProjectFolderList.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeProjectFolderList(BNProjectFolder** folders, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeProjectFolderList" + )] + internal static extern void BNFreeProjectFolderList( + + // BNProjectFolder** folders + IntPtr folders , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeProjectList.cs b/Function/BNFreeProjectList.cs new file mode 100644 index 0000000..c2a9eb6 --- /dev/null +++ b/Function/BNFreeProjectList.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeProjectList(BNProject** projects, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeProjectList" + )] + internal static extern void BNFreeProjectList( + + // BNProject** projects + IntPtr projects , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeQualifiedName.cs b/Function/BNFreeQualifiedName.cs new file mode 100644 index 0000000..c50d326 --- /dev/null +++ b/Function/BNFreeQualifiedName.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeQualifiedName(BNQualifiedName* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreeQualifiedName" + )] + internal static extern void BNFreeQualifiedName( + + // BNQualifiedName* name + in BNQualifiedName name + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeQualifiedNameAndType.cs b/Function/BNFreeQualifiedNameAndType.cs new file mode 100644 index 0000000..fb13e68 --- /dev/null +++ b/Function/BNFreeQualifiedNameAndType.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeQualifiedNameAndType(BNQualifiedNameAndType* obj) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreeQualifiedNameAndType" + )] + internal static extern void BNFreeQualifiedNameAndType( + + // BNQualifiedNameAndType* obj + in BNQualifiedNameAndType obj + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeQualifiedNameAndTypeArray.cs b/Function/BNFreeQualifiedNameAndTypeArray.cs new file mode 100644 index 0000000..260fce3 --- /dev/null +++ b/Function/BNFreeQualifiedNameAndTypeArray.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeQualifiedNameAndTypeArray(BNQualifiedNameAndType* obj, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreeQualifiedNameAndTypeArray" + )] + internal static extern void BNFreeQualifiedNameAndTypeArray( + + // BNQualifiedNameAndType* obj + IntPtr obj , + + // uint64_t count + ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeQualifiedNameArray.cs b/Function/BNFreeQualifiedNameArray.cs new file mode 100644 index 0000000..0998052 --- /dev/null +++ b/Function/BNFreeQualifiedNameArray.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeQualifiedNameArray(BNQualifiedName* names, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeQualifiedNameArray" + )] + internal static extern void BNFreeQualifiedNameArray( + + // BNQualifiedName* names + IntPtr names , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeQualifiedNameTypeAndId.cs b/Function/BNFreeQualifiedNameTypeAndId.cs new file mode 100644 index 0000000..16ea0f8 --- /dev/null +++ b/Function/BNFreeQualifiedNameTypeAndId.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeQualifiedNameTypeAndId(BNQualifiedNameTypeAndId* obj) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeQualifiedNameTypeAndId" + )] + internal static extern void BNFreeQualifiedNameTypeAndId( + + // BNQualifiedNameTypeAndId* obj + IntPtr obj + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeRegisterList.cs b/Function/BNFreeRegisterList.cs new file mode 100644 index 0000000..fcf47bf --- /dev/null +++ b/Function/BNFreeRegisterList.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeRegisterList(uint32_t* regs) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreeRegisterList" + )] + internal static extern void BNFreeRegisterList( + + // uint32_t* regs + IntPtr regs + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeRegisterSet.cs b/Function/BNFreeRegisterSet.cs new file mode 100644 index 0000000..e8bbcb2 --- /dev/null +++ b/Function/BNFreeRegisterSet.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeRegisterSet(BNRegisterSetWithConfidence* regs) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeRegisterSet" + )] + internal static extern void BNFreeRegisterSet( + + // BNRegisterSetWithConfidence* regs + IntPtr regs + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeRegisterStackAdjustments.cs b/Function/BNFreeRegisterStackAdjustments.cs new file mode 100644 index 0000000..b63ee56 --- /dev/null +++ b/Function/BNFreeRegisterStackAdjustments.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeRegisterStackAdjustments(BNRegisterStackAdjustment* adjustments) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeRegisterStackAdjustments" + )] + internal static extern void BNFreeRegisterStackAdjustments( + + // BNRegisterStackAdjustment* adjustments + IntPtr adjustments + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeRelocation.cs b/Function/BNFreeRelocation.cs new file mode 100644 index 0000000..54f723c --- /dev/null +++ b/Function/BNFreeRelocation.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeRelocation(BNRelocation* reloc) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeRelocation" + )] + internal static extern void BNFreeRelocation( + + // BNRelocation* reloc + IntPtr reloc + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeRelocationHandler.cs b/Function/BNFreeRelocationHandler.cs new file mode 100644 index 0000000..0758fb4 --- /dev/null +++ b/Function/BNFreeRelocationHandler.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeRelocationHandler(BNRelocationHandler* handler) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeRelocationHandler" + )] + internal static extern void BNFreeRelocationHandler( + + // BNRelocationHandler* handler + IntPtr handler + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeRelocationList.cs b/Function/BNFreeRelocationList.cs new file mode 100644 index 0000000..1b63cea --- /dev/null +++ b/Function/BNFreeRelocationList.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeRelocationList(BNRelocation** relocations, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeRelocationList" + )] + internal static extern void BNFreeRelocationList( + + // BNRelocation** relocations + IntPtr relocations , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeRelocationRanges.cs b/Function/BNFreeRelocationRanges.cs new file mode 100644 index 0000000..a6d1fbd --- /dev/null +++ b/Function/BNFreeRelocationRanges.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeRelocationRanges(BNRange* ranges) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreeRelocationRanges" + )] + internal static extern void BNFreeRelocationRanges( + + // BNRange* ranges + IntPtr ranges + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeRemote.cs b/Function/BNFreeRemote.cs new file mode 100644 index 0000000..d9dad8f --- /dev/null +++ b/Function/BNFreeRemote.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeRemote(BNRemote* remote) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeRemote" + )] + internal static extern void BNFreeRemote( + + // BNRemote* remote + IntPtr remote + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeRemoteFile.cs b/Function/BNFreeRemoteFile.cs new file mode 100644 index 0000000..6d9a99a --- /dev/null +++ b/Function/BNFreeRemoteFile.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeRemoteFile(BNRemoteFile* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeRemoteFile" + )] + internal static extern void BNFreeRemoteFile( + + // BNRemoteFile* file + IntPtr file + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeRemoteFileList.cs b/Function/BNFreeRemoteFileList.cs new file mode 100644 index 0000000..f345c93 --- /dev/null +++ b/Function/BNFreeRemoteFileList.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeRemoteFileList(BNRemoteFile** files, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeRemoteFileList" + )] + internal static extern void BNFreeRemoteFileList( + + // BNRemoteFile** files + IntPtr files , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeRemoteFolder.cs b/Function/BNFreeRemoteFolder.cs new file mode 100644 index 0000000..626bbe9 --- /dev/null +++ b/Function/BNFreeRemoteFolder.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeRemoteFolder(BNRemoteFolder* folder) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeRemoteFolder" + )] + internal static extern void BNFreeRemoteFolder( + + // BNRemoteFolder* folder + IntPtr folder + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeRemoteFolderList.cs b/Function/BNFreeRemoteFolderList.cs new file mode 100644 index 0000000..750bbda --- /dev/null +++ b/Function/BNFreeRemoteFolderList.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeRemoteFolderList(BNRemoteFolder** folders, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeRemoteFolderList" + )] + internal static extern void BNFreeRemoteFolderList( + + // BNRemoteFolder** folders + IntPtr folders , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeRemoteList.cs b/Function/BNFreeRemoteList.cs new file mode 100644 index 0000000..ca3469c --- /dev/null +++ b/Function/BNFreeRemoteList.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeRemoteList(BNRemote** remotes, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeRemoteList" + )] + internal static extern void BNFreeRemoteList( + + // BNRemote** remotes + IntPtr remotes , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeRemoteProject.cs b/Function/BNFreeRemoteProject.cs new file mode 100644 index 0000000..3072e22 --- /dev/null +++ b/Function/BNFreeRemoteProject.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeRemoteProject(BNRemoteProject* project) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeRemoteProject" + )] + internal static extern void BNFreeRemoteProject( + + // BNRemoteProject* project + IntPtr project + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeRemoteProjectList.cs b/Function/BNFreeRemoteProjectList.cs new file mode 100644 index 0000000..c5fda79 --- /dev/null +++ b/Function/BNFreeRemoteProjectList.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeRemoteProjectList(BNRemoteProject** projects, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeRemoteProjectList" + )] + internal static extern void BNFreeRemoteProjectList( + + // BNRemoteProject** projects + IntPtr projects , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeRenderLayerList.cs b/Function/BNFreeRenderLayerList.cs new file mode 100644 index 0000000..4029390 --- /dev/null +++ b/Function/BNFreeRenderLayerList.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeRenderLayerList(BNRenderLayer** renderLayers) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreeRenderLayerList" + )] + internal static extern void BNFreeRenderLayerList( + + // BNRenderLayer** renderLayers + IntPtr renderLayers + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeReportCollection.cs b/Function/BNFreeReportCollection.cs new file mode 100644 index 0000000..f906f47 --- /dev/null +++ b/Function/BNFreeReportCollection.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeReportCollection(BNReportCollection* reports) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeReportCollection" + )] + internal static extern void BNFreeReportCollection( + + // BNReportCollection* reports + IntPtr reports + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeRepository.cs b/Function/BNFreeRepository.cs new file mode 100644 index 0000000..db7c023 --- /dev/null +++ b/Function/BNFreeRepository.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeRepository(BNRepository* r) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeRepository" + )] + internal static extern void BNFreeRepository( + + // BNRepository* r + IntPtr r + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeRepositoryManager.cs b/Function/BNFreeRepositoryManager.cs new file mode 100644 index 0000000..2692d6a --- /dev/null +++ b/Function/BNFreeRepositoryManager.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeRepositoryManager(BNRepositoryManager* r) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeRepositoryManager" + )] + internal static extern void BNFreeRepositoryManager( + + // BNRepositoryManager* r + IntPtr r + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeRepositoryManagerRepositoriesList.cs b/Function/BNFreeRepositoryManagerRepositoriesList.cs new file mode 100644 index 0000000..f5782a9 --- /dev/null +++ b/Function/BNFreeRepositoryManagerRepositoriesList.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeRepositoryManagerRepositoriesList(BNRepository** r) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeRepositoryManagerRepositoriesList" + )] + internal static extern void BNFreeRepositoryManagerRepositoriesList( + + // BNRepository** r + IntPtr r + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeRepositoryPluginList.cs b/Function/BNFreeRepositoryPluginList.cs new file mode 100644 index 0000000..a34caca --- /dev/null +++ b/Function/BNFreeRepositoryPluginList.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeRepositoryPluginList(BNRepoPlugin** r) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeRepositoryPluginList" + )] + internal static extern void BNFreeRepositoryPluginList( + + // BNRepoPlugin** r + IntPtr r + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeSaveSettings.cs b/Function/BNFreeSaveSettings.cs new file mode 100644 index 0000000..b375354 --- /dev/null +++ b/Function/BNFreeSaveSettings.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeSaveSettings(BNSaveSettings* settings) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeSaveSettings" + )] + internal static extern void BNFreeSaveSettings( + + // BNSaveSettings* settings + IntPtr settings + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeScriptingInstance.cs b/Function/BNFreeScriptingInstance.cs new file mode 100644 index 0000000..2080648 --- /dev/null +++ b/Function/BNFreeScriptingInstance.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeScriptingInstance(BNScriptingInstance* instance) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeScriptingInstance" + )] + internal static extern void BNFreeScriptingInstance( + + // BNScriptingInstance* instance + IntPtr instance + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeScriptingProviderList.cs b/Function/BNFreeScriptingProviderList.cs new file mode 100644 index 0000000..36d8fe9 --- /dev/null +++ b/Function/BNFreeScriptingProviderList.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeScriptingProviderList(BNScriptingProvider** providers) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeScriptingProviderList" + )] + internal static extern void BNFreeScriptingProviderList( + + // BNScriptingProvider** providers + IntPtr providers + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeSecretsProviderList.cs b/Function/BNFreeSecretsProviderList.cs new file mode 100644 index 0000000..2438a16 --- /dev/null +++ b/Function/BNFreeSecretsProviderList.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeSecretsProviderList(BNSecretsProvider** providers) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeSecretsProviderList" + )] + internal static extern void BNFreeSecretsProviderList( + + // BNSecretsProvider** providers + IntPtr providers + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeSection.cs b/Function/BNFreeSection.cs new file mode 100644 index 0000000..0ac5555 --- /dev/null +++ b/Function/BNFreeSection.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeSection(BNSection* section) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeSection" + )] + internal static extern void BNFreeSection( + + // BNSection* section + IntPtr section + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeSectionList.cs b/Function/BNFreeSectionList.cs new file mode 100644 index 0000000..9db5a9d --- /dev/null +++ b/Function/BNFreeSectionList.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeSectionList(BNSection** sections, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeSectionList" + )] + internal static extern void BNFreeSectionList( + + // BNSection** sections + IntPtr sections , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeSegment.cs b/Function/BNFreeSegment.cs new file mode 100644 index 0000000..b98fb15 --- /dev/null +++ b/Function/BNFreeSegment.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeSegment(BNSegment* seg) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeSegment" + )] + internal static extern void BNFreeSegment( + + // BNSegment* seg + IntPtr seg + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeSegmentList.cs b/Function/BNFreeSegmentList.cs new file mode 100644 index 0000000..b3d0191 --- /dev/null +++ b/Function/BNFreeSegmentList.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeSegmentList(BNSegment** segments, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeSegmentList" + )] + internal static extern void BNFreeSegmentList( + + // BNSegment** segments + IntPtr segments , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeSettings.cs b/Function/BNFreeSettings.cs new file mode 100644 index 0000000..2f2f809 --- /dev/null +++ b/Function/BNFreeSettings.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeSettings(BNSettings* settings) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeSettings" + )] + internal static extern void BNFreeSettings( + + // BNSettings* settings + IntPtr settings + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeSnapshot.cs b/Function/BNFreeSnapshot.cs new file mode 100644 index 0000000..a31ca69 --- /dev/null +++ b/Function/BNFreeSnapshot.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeSnapshot(BNSnapshot* snapshot) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeSnapshot" + )] + internal static extern void BNFreeSnapshot( + + // BNSnapshot* snapshot + IntPtr snapshot + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeSnapshotList.cs b/Function/BNFreeSnapshotList.cs new file mode 100644 index 0000000..c7f2f8a --- /dev/null +++ b/Function/BNFreeSnapshotList.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeSnapshotList(BNSnapshot** snapshots, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeSnapshotList" + )] + internal static extern void BNFreeSnapshotList( + + // BNSnapshot** snapshots + IntPtr snapshots , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeStackVariableReferenceList.cs b/Function/BNFreeStackVariableReferenceList.cs new file mode 100644 index 0000000..b201f6b --- /dev/null +++ b/Function/BNFreeStackVariableReferenceList.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeStackVariableReferenceList(BNStackVariableReference* refs, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeStackVariableReferenceList" + )] + internal static extern void BNFreeStackVariableReferenceList( + + // BNStackVariableReference* refs + IntPtr refs , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeString.cs b/Function/BNFreeString.cs new file mode 100644 index 0000000..0e43dde --- /dev/null +++ b/Function/BNFreeString.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeString(char* str) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreeString" + )] + internal static extern void BNFreeString( + + // const char* str + IntPtr str + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeStringList.cs b/Function/BNFreeStringList.cs new file mode 100644 index 0000000..2bffd7a --- /dev/null +++ b/Function/BNFreeStringList.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeStringList(const char** strs, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreeStringList" + )] + internal static extern void BNFreeStringList( + + // const char** strs + IntPtr strs , + + // uint64_t count + ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeStringRef.cs b/Function/BNFreeStringRef.cs new file mode 100644 index 0000000..fca6c12 --- /dev/null +++ b/Function/BNFreeStringRef.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeStringRef(BNStringRef* @ref) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeStringRef" + )] + internal static extern void BNFreeStringRef( + + // BNStringRef* _ref + IntPtr _ref + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeStringReferenceList.cs b/Function/BNFreeStringReferenceList.cs new file mode 100644 index 0000000..f5baaa5 --- /dev/null +++ b/Function/BNFreeStringReferenceList.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeStringReferenceList(BNStringReference* strings) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreeStringReferenceList" + )] + internal static extern void BNFreeStringReferenceList( + + // BNStringReference* strings + IntPtr strings + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeStructure.cs b/Function/BNFreeStructure.cs new file mode 100644 index 0000000..d1ef4f4 --- /dev/null +++ b/Function/BNFreeStructure.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeStructure(BNStructure* s) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeStructure" + )] + internal static extern void BNFreeStructure( + + // BNStructure* s + IntPtr s + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeStructureBuilder.cs b/Function/BNFreeStructureBuilder.cs new file mode 100644 index 0000000..2709c74 --- /dev/null +++ b/Function/BNFreeStructureBuilder.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeStructureBuilder(BNStructureBuilder* s) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeStructureBuilder" + )] + internal static extern void BNFreeStructureBuilder( + + // BNStructureBuilder* s + IntPtr s + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeStructureMember.cs b/Function/BNFreeStructureMember.cs new file mode 100644 index 0000000..74c3e87 --- /dev/null +++ b/Function/BNFreeStructureMember.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeStructureMember(BNStructureMember* s) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreeStructureMember" + )] + internal static extern void BNFreeStructureMember( + + // BNStructureMember* s + IntPtr s + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeStructureMemberList.cs b/Function/BNFreeStructureMemberList.cs new file mode 100644 index 0000000..faa31a0 --- /dev/null +++ b/Function/BNFreeStructureMemberList.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeStructureMemberList(BNStructureMember* members, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreeStructureMemberList" + )] + internal static extern void BNFreeStructureMemberList( + + // BNStructureMember* members + IntPtr members , + + // uint64_t count + ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeSymbol.cs b/Function/BNFreeSymbol.cs new file mode 100644 index 0000000..d431caa --- /dev/null +++ b/Function/BNFreeSymbol.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeSymbol(BNSymbol* sym) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeSymbol" + )] + internal static extern void BNFreeSymbol( + + // BNSymbol* sym + IntPtr sym + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeSymbolList.cs b/Function/BNFreeSymbolList.cs new file mode 100644 index 0000000..ef26417 --- /dev/null +++ b/Function/BNFreeSymbolList.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeSymbolList(BNSymbol** syms, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreeSymbolList" + )] + internal static extern void BNFreeSymbolList( + + // BNSymbol** syms + IntPtr syms , + + // uint64_t count + ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeSymbolRawBytes.cs b/Function/BNFreeSymbolRawBytes.cs new file mode 100644 index 0000000..d834251 --- /dev/null +++ b/Function/BNFreeSymbolRawBytes.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeSymbolRawBytes(void* bytes) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreeSymbolRawBytes" + )] + internal static extern void BNFreeSymbolRawBytes( + + // void* bytes + IntPtr bytes + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeSystemCallList.cs b/Function/BNFreeSystemCallList.cs new file mode 100644 index 0000000..c528cf8 --- /dev/null +++ b/Function/BNFreeSystemCallList.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeSystemCallList(BNSystemCallInfo* syscalls, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeSystemCallList" + )] + internal static extern void BNFreeSystemCallList( + + // BNSystemCallInfo* syscalls + IntPtr syscalls , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeTag.cs b/Function/BNFreeTag.cs new file mode 100644 index 0000000..9342a79 --- /dev/null +++ b/Function/BNFreeTag.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeTag(BNTag* tag) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeTag" + )] + internal static extern void BNFreeTag( + + // BNTag* tag + IntPtr tag + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeTagList.cs b/Function/BNFreeTagList.cs new file mode 100644 index 0000000..30a3401 --- /dev/null +++ b/Function/BNFreeTagList.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeTagList(BNTag** tags, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeTagList" + )] + internal static extern void BNFreeTagList( + + // BNTag** tags + IntPtr tags , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeTagReferenceTypeCounts.cs b/Function/BNFreeTagReferenceTypeCounts.cs new file mode 100644 index 0000000..0b168ab --- /dev/null +++ b/Function/BNFreeTagReferenceTypeCounts.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeTagReferenceTypeCounts(BNTagType** tagTypes, uint64_t* counts, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeTagReferenceTypeCounts" + )] + internal static extern void BNFreeTagReferenceTypeCounts( + + // BNTagType** tagTypes + IntPtr tagTypes , + + // uint64_t* counts + IntPtr counts , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeTagReferences.cs b/Function/BNFreeTagReferences.cs new file mode 100644 index 0000000..d0e6f34 --- /dev/null +++ b/Function/BNFreeTagReferences.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeTagReferences(BNTagReference* refs, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeTagReferences" + )] + internal static extern void BNFreeTagReferences( + + // BNTagReference* refs + IntPtr refs , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeTagType.cs b/Function/BNFreeTagType.cs new file mode 100644 index 0000000..e8801f4 --- /dev/null +++ b/Function/BNFreeTagType.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeTagType(BNTagType* tagType) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeTagType" + )] + internal static extern void BNFreeTagType( + + // BNTagType* tagType + IntPtr tagType + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeTagTypeList.cs b/Function/BNFreeTagTypeList.cs new file mode 100644 index 0000000..5ccac71 --- /dev/null +++ b/Function/BNFreeTagTypeList.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeTagTypeList(BNTagType** tagTypes, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreeTagTypeList" + )] + internal static extern void BNFreeTagTypeList( + + // BNTagType** tagTypes + IntPtr tagTypes , + + // uint64_t count + ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeTemporaryFile.cs b/Function/BNFreeTemporaryFile.cs new file mode 100644 index 0000000..984b5da --- /dev/null +++ b/Function/BNFreeTemporaryFile.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeTemporaryFile(BNTemporaryFile* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeTemporaryFile" + )] + internal static extern void BNFreeTemporaryFile( + + // BNTemporaryFile* file + IntPtr file + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeTransformContext.cs b/Function/BNFreeTransformContext.cs new file mode 100644 index 0000000..4d815d5 --- /dev/null +++ b/Function/BNFreeTransformContext.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeTransformContext(BNTransformContext* context) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeTransformContext" + )] + internal static extern void BNFreeTransformContext( + + // BNTransformContext* context + IntPtr context + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeTransformContextList.cs b/Function/BNFreeTransformContextList.cs new file mode 100644 index 0000000..8c5667b --- /dev/null +++ b/Function/BNFreeTransformContextList.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeTransformContextList(BNTransformContext** contexts, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreeTransformContextList" + )] + internal static extern void BNFreeTransformContextList( + + // BNTransformContext** contexts + IntPtr contexts , + + // uint64_t count + ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeTransformParameterList.cs b/Function/BNFreeTransformParameterList.cs new file mode 100644 index 0000000..deea7cc --- /dev/null +++ b/Function/BNFreeTransformParameterList.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeTransformParameterList(BNTransformParameterInfo* @params, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreeTransformParameterList" + )] + internal static extern void BNFreeTransformParameterList( + + // BNTransformParameterInfo* _params + IntPtr _params , + + // uint64_t count + ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeTransformSession.cs b/Function/BNFreeTransformSession.cs new file mode 100644 index 0000000..b68db78 --- /dev/null +++ b/Function/BNFreeTransformSession.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeTransformSession(BNTransformSession* session) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeTransformSession" + )] + internal static extern void BNFreeTransformSession( + + // BNTransformSession* session + IntPtr session + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeTransformTypeList.cs b/Function/BNFreeTransformTypeList.cs new file mode 100644 index 0000000..02b463d --- /dev/null +++ b/Function/BNFreeTransformTypeList.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeTransformTypeList(BNTransform** xforms) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreeTransformTypeList" + )] + internal static extern void BNFreeTransformTypeList( + + // BNTransform** xforms + IntPtr xforms + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeType.cs b/Function/BNFreeType.cs new file mode 100644 index 0000000..fd1d5e1 --- /dev/null +++ b/Function/BNFreeType.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeType(BNType* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeType" + )] + internal static extern void BNFreeType( + + // BNType* type + IntPtr type + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeTypeAndNameList.cs b/Function/BNFreeTypeAndNameList.cs new file mode 100644 index 0000000..f6161b0 --- /dev/null +++ b/Function/BNFreeTypeAndNameList.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeTypeAndNameList(BNQualifiedNameAndType* types, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreeTypeAndNameList" + )] + internal static extern void BNFreeTypeAndNameList( + + // BNQualifiedNameAndType* types + IntPtr types , + + // uint64_t count + ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeTypeArchiveList.cs b/Function/BNFreeTypeArchiveList.cs new file mode 100644 index 0000000..b9aab4a --- /dev/null +++ b/Function/BNFreeTypeArchiveList.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeTypeArchiveList(BNTypeArchive** archives, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeTypeArchiveList" + )] + internal static extern void BNFreeTypeArchiveList( + + // BNTypeArchive** archives + IntPtr archives , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeTypeArchiveMergeConflict.cs b/Function/BNFreeTypeArchiveMergeConflict.cs new file mode 100644 index 0000000..bfa7362 --- /dev/null +++ b/Function/BNFreeTypeArchiveMergeConflict.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeTypeArchiveMergeConflict(BNTypeArchiveMergeConflict* conflict) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeTypeArchiveMergeConflict" + )] + internal static extern void BNFreeTypeArchiveMergeConflict( + + // BNTypeArchiveMergeConflict* conflict + IntPtr conflict + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeTypeArchiveMergeConflictList.cs b/Function/BNFreeTypeArchiveMergeConflictList.cs new file mode 100644 index 0000000..0078469 --- /dev/null +++ b/Function/BNFreeTypeArchiveMergeConflictList.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeTypeArchiveMergeConflictList(BNTypeArchiveMergeConflict** conflicts, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeTypeArchiveMergeConflictList" + )] + internal static extern void BNFreeTypeArchiveMergeConflictList( + + // BNTypeArchiveMergeConflict** conflicts + IntPtr conflicts , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeTypeArchiveReference.cs b/Function/BNFreeTypeArchiveReference.cs new file mode 100644 index 0000000..17d36d2 --- /dev/null +++ b/Function/BNFreeTypeArchiveReference.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeTypeArchiveReference(BNTypeArchive* archive) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreeTypeArchiveReference" + )] + internal static extern void BNFreeTypeArchiveReference( + + // BNTypeArchive* archive + IntPtr archive + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeTypeAttributeList.cs b/Function/BNFreeTypeAttributeList.cs new file mode 100644 index 0000000..e5a6fac --- /dev/null +++ b/Function/BNFreeTypeAttributeList.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeTypeAttributeList(BNTypeAttribute* attr, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeTypeAttributeList" + )] + internal static extern void BNFreeTypeAttributeList( + + // BNTypeAttribute* attr + IntPtr attr , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeTypeBuilder.cs b/Function/BNFreeTypeBuilder.cs new file mode 100644 index 0000000..ed68075 --- /dev/null +++ b/Function/BNFreeTypeBuilder.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeTypeBuilder(BNTypeBuilder* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeTypeBuilder" + )] + internal static extern void BNFreeTypeBuilder( + + // BNTypeBuilder* type + IntPtr type + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeTypeContainer.cs b/Function/BNFreeTypeContainer.cs new file mode 100644 index 0000000..e982dd0 --- /dev/null +++ b/Function/BNFreeTypeContainer.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeTypeContainer(BNTypeContainer* container) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeTypeContainer" + )] + internal static extern void BNFreeTypeContainer( + + // BNTypeContainer* container + IntPtr container + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeTypeDefinitionLineList.cs b/Function/BNFreeTypeDefinitionLineList.cs new file mode 100644 index 0000000..a72167d --- /dev/null +++ b/Function/BNFreeTypeDefinitionLineList.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeTypeDefinitionLineList(BNTypeDefinitionLine* list, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeTypeDefinitionLineList" + )] + internal static extern void BNFreeTypeDefinitionLineList( + + // BNTypeDefinitionLine* list + IntPtr list , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeTypeFieldReferenceSizeInfo.cs b/Function/BNFreeTypeFieldReferenceSizeInfo.cs new file mode 100644 index 0000000..f4ef4e9 --- /dev/null +++ b/Function/BNFreeTypeFieldReferenceSizeInfo.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeTypeFieldReferenceSizeInfo(BNTypeFieldReferenceSizeInfo* refs, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeTypeFieldReferenceSizeInfo" + )] + internal static extern void BNFreeTypeFieldReferenceSizeInfo( + + // BNTypeFieldReferenceSizeInfo* refs + IntPtr refs , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeTypeFieldReferenceSizes.cs b/Function/BNFreeTypeFieldReferenceSizes.cs new file mode 100644 index 0000000..fa41b99 --- /dev/null +++ b/Function/BNFreeTypeFieldReferenceSizes.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeTypeFieldReferenceSizes(uint64_t* refs, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreeTypeFieldReferenceSizes" + )] + internal static extern void BNFreeTypeFieldReferenceSizes( + + // uint64_t* refs + IntPtr refs , + + // uint64_t count + ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeTypeFieldReferenceTypeInfo.cs b/Function/BNFreeTypeFieldReferenceTypeInfo.cs new file mode 100644 index 0000000..6b888c6 --- /dev/null +++ b/Function/BNFreeTypeFieldReferenceTypeInfo.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeTypeFieldReferenceTypeInfo(BNTypeFieldReferenceTypeInfo* refs, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeTypeFieldReferenceTypeInfo" + )] + internal static extern void BNFreeTypeFieldReferenceTypeInfo( + + // BNTypeFieldReferenceTypeInfo* refs + IntPtr refs , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeTypeFieldReferenceTypes.cs b/Function/BNFreeTypeFieldReferenceTypes.cs new file mode 100644 index 0000000..f163ded --- /dev/null +++ b/Function/BNFreeTypeFieldReferenceTypes.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeTypeFieldReferenceTypes(BNTypeWithConfidence* refs, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreeTypeFieldReferenceTypes" + )] + internal static extern void BNFreeTypeFieldReferenceTypes( + + // BNTypeWithConfidence* refs + IntPtr refs , + + // uint64_t count + ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeTypeFieldReferences.cs b/Function/BNFreeTypeFieldReferences.cs new file mode 100644 index 0000000..6a7e401 --- /dev/null +++ b/Function/BNFreeTypeFieldReferences.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeTypeFieldReferences(BNTypeFieldReference* refs, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeTypeFieldReferences" + )] + internal static extern void BNFreeTypeFieldReferences( + + // BNTypeFieldReference* refs + IntPtr refs , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeTypeIdList.cs b/Function/BNFreeTypeIdList.cs new file mode 100644 index 0000000..e62c2e7 --- /dev/null +++ b/Function/BNFreeTypeIdList.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeTypeIdList(BNQualifiedNameTypeAndId* types, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeTypeIdList" + )] + internal static extern void BNFreeTypeIdList( + + // BNQualifiedNameTypeAndId* types + IntPtr types , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeTypeLibrary.cs b/Function/BNFreeTypeLibrary.cs new file mode 100644 index 0000000..7d1c7b3 --- /dev/null +++ b/Function/BNFreeTypeLibrary.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeTypeLibrary(BNTypeLibrary* lib) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeTypeLibrary" + )] + internal static extern void BNFreeTypeLibrary( + + // BNTypeLibrary* lib + IntPtr lib + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeTypeLibraryList.cs b/Function/BNFreeTypeLibraryList.cs new file mode 100644 index 0000000..48ba5fe --- /dev/null +++ b/Function/BNFreeTypeLibraryList.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeTypeLibraryList(BNTypeLibrary** lib, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreeTypeLibraryList" + )] + internal static extern void BNFreeTypeLibraryList( + + // BNTypeLibrary** lib + IntPtr lib , + + // uint64_t count + ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeTypeList.cs b/Function/BNFreeTypeList.cs new file mode 100644 index 0000000..3ea1498 --- /dev/null +++ b/Function/BNFreeTypeList.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeTypeList(BNType** types, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreeTypeList" + )] + internal static extern void BNFreeTypeList( + + // BNType** types + IntPtr types , + + // uint64_t count + ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeTypeNameList.cs b/Function/BNFreeTypeNameList.cs new file mode 100644 index 0000000..9f9b0b2 --- /dev/null +++ b/Function/BNFreeTypeNameList.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeTypeNameList(BNQualifiedName* names, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreeTypeNameList" + )] + internal static extern void BNFreeTypeNameList( + + // BNQualifiedName* names + IntPtr names , + + // uint64_t count + ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeTypeParameterList.cs b/Function/BNFreeTypeParameterList.cs new file mode 100644 index 0000000..8174439 --- /dev/null +++ b/Function/BNFreeTypeParameterList.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeTypeParameterList(BNFunctionParameter* types, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeTypeParameterList" + )] + internal static extern void BNFreeTypeParameterList( + + // BNFunctionParameter* types + IntPtr types , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeTypeParserErrors.cs b/Function/BNFreeTypeParserErrors.cs new file mode 100644 index 0000000..a93ece1 --- /dev/null +++ b/Function/BNFreeTypeParserErrors.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeTypeParserErrors(BNTypeParserError* errors, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeTypeParserErrors" + )] + internal static extern void BNFreeTypeParserErrors( + + // BNTypeParserError* errors + IntPtr errors , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeTypeParserList.cs b/Function/BNFreeTypeParserList.cs new file mode 100644 index 0000000..febca89 --- /dev/null +++ b/Function/BNFreeTypeParserList.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeTypeParserList(BNTypeParser** parsers) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeTypeParserList" + )] + internal static extern void BNFreeTypeParserList( + + // BNTypeParser** parsers + IntPtr parsers + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeTypeParserResult.cs b/Function/BNFreeTypeParserResult.cs new file mode 100644 index 0000000..6434277 --- /dev/null +++ b/Function/BNFreeTypeParserResult.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeTypeParserResult(BNTypeParserResult* result) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreeTypeParserResult" + )] + internal static extern void BNFreeTypeParserResult( + + // BNTypeParserResult* result + in BNTypeParserResult result + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeTypePrinterList.cs b/Function/BNFreeTypePrinterList.cs new file mode 100644 index 0000000..0d58beb --- /dev/null +++ b/Function/BNFreeTypePrinterList.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeTypePrinterList(BNTypePrinter** printers) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeTypePrinterList" + )] + internal static extern void BNFreeTypePrinterList( + + // BNTypePrinter** printers + IntPtr printers + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeTypeReferences.cs b/Function/BNFreeTypeReferences.cs new file mode 100644 index 0000000..fdce651 --- /dev/null +++ b/Function/BNFreeTypeReferences.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeTypeReferences(BNTypeReferenceSource* refs, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeTypeReferences" + )] + internal static extern void BNFreeTypeReferences( + + // BNTypeReferenceSource* refs + IntPtr refs , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeUndoAction.cs b/Function/BNFreeUndoAction.cs new file mode 100644 index 0000000..a6768b9 --- /dev/null +++ b/Function/BNFreeUndoAction.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeUndoAction(BNUndoAction* action) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeUndoAction" + )] + internal static extern void BNFreeUndoAction( + + // BNUndoAction* action + IntPtr action + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeUndoActionList.cs b/Function/BNFreeUndoActionList.cs new file mode 100644 index 0000000..a32b2a8 --- /dev/null +++ b/Function/BNFreeUndoActionList.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeUndoActionList(BNUndoAction** actions, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeUndoActionList" + )] + internal static extern void BNFreeUndoActionList( + + // BNUndoAction** actions + IntPtr actions , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeUndoEntries.cs b/Function/BNFreeUndoEntries.cs new file mode 100644 index 0000000..a0354f2 --- /dev/null +++ b/Function/BNFreeUndoEntries.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeUndoEntries(BNUndoEntry** entries, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeUndoEntries" + )] + internal static extern void BNFreeUndoEntries( + + // BNUndoEntry** entries + IntPtr entries , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeUndoEntry.cs b/Function/BNFreeUndoEntry.cs new file mode 100644 index 0000000..31212bb --- /dev/null +++ b/Function/BNFreeUndoEntry.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeUndoEntry(BNUndoEntry* entry) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeUndoEntry" + )] + internal static extern void BNFreeUndoEntry( + + // BNUndoEntry* entry + IntPtr entry + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeUndoEntryList.cs b/Function/BNFreeUndoEntryList.cs new file mode 100644 index 0000000..baf9e2a --- /dev/null +++ b/Function/BNFreeUndoEntryList.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeUndoEntryList(BNUndoEntry** entrys, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreeUndoEntryList" + )] + internal static extern void BNFreeUndoEntryList( + + // BNUndoEntry** entrys + IntPtr entrys , + + // uint64_t count + ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeUnicodeBlockList.cs b/Function/BNFreeUnicodeBlockList.cs new file mode 100644 index 0000000..5d4859c --- /dev/null +++ b/Function/BNFreeUnicodeBlockList.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeUnicodeBlockList(uint32_t** starts, uint32_t** ends, uint64_t* blockCounts, uint64_t blockListCounts) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeUnicodeBlockList" + )] + internal static extern void BNFreeUnicodeBlockList( + + // uint32_t** starts + IntPtr starts , + + // uint32_t** ends + IntPtr ends , + + // uint64_t* blockCounts + IntPtr blockCounts , + + // uint64_t blockListCounts + ulong blockListCounts + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeUnicodeRangeList.cs b/Function/BNFreeUnicodeRangeList.cs new file mode 100644 index 0000000..54a4102 --- /dev/null +++ b/Function/BNFreeUnicodeRangeList.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeUnicodeRangeList(uint32_t* starts, uint32_t* ends) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeUnicodeRangeList" + )] + internal static extern void BNFreeUnicodeRangeList( + + // uint32_t* starts + IntPtr starts , + + // uint32_t* ends + IntPtr ends + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeUpdateChannelList.cs b/Function/BNFreeUpdateChannelList.cs new file mode 100644 index 0000000..01dcdf6 --- /dev/null +++ b/Function/BNFreeUpdateChannelList.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeUpdateChannelList(BNUpdateChannel* list, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeUpdateChannelList" + )] + internal static extern void BNFreeUpdateChannelList( + + // BNUpdateChannel* list + IntPtr list , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeUpdateChannelVersionList.cs b/Function/BNFreeUpdateChannelVersionList.cs new file mode 100644 index 0000000..e230274 --- /dev/null +++ b/Function/BNFreeUpdateChannelVersionList.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeUpdateChannelVersionList(BNUpdateVersion* list, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeUpdateChannelVersionList" + )] + internal static extern void BNFreeUpdateChannelVersionList( + + // BNUpdateVersion* list + IntPtr list , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeUser.cs b/Function/BNFreeUser.cs new file mode 100644 index 0000000..1c43938 --- /dev/null +++ b/Function/BNFreeUser.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeUser(BNUser* user) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeUser" + )] + internal static extern void BNFreeUser( + + // BNUser* user + IntPtr user + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeUserList.cs b/Function/BNFreeUserList.cs new file mode 100644 index 0000000..1ecf059 --- /dev/null +++ b/Function/BNFreeUserList.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeUserList(BNUser** users, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeUserList" + )] + internal static extern void BNFreeUserList( + + // BNUser** users + IntPtr users , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeUserVariableValues.cs b/Function/BNFreeUserVariableValues.cs new file mode 100644 index 0000000..6fd158b --- /dev/null +++ b/Function/BNFreeUserVariableValues.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeUserVariableValues(BNUserVariableValue* result) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeUserVariableValues" + )] + internal static extern void BNFreeUserVariableValues( + + // BNUserVariableValue* result + IntPtr result + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeVariableFieldResolutions.cs b/Function/BNFreeVariableFieldResolutions.cs new file mode 100644 index 0000000..874e49b --- /dev/null +++ b/Function/BNFreeVariableFieldResolutions.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeVariableFieldResolutions(BNVariableFieldResolutionInfo* result, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeVariableFieldResolutions" + )] + internal static extern void BNFreeVariableFieldResolutions( + + // BNVariableFieldResolutionInfo* result + IntPtr result , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeVariableList.cs b/Function/BNFreeVariableList.cs new file mode 100644 index 0000000..a33d960 --- /dev/null +++ b/Function/BNFreeVariableList.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeVariableList(BNVariable* vars) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreeVariableList" + )] + internal static extern void BNFreeVariableList( + + // BNVariable* vars + IntPtr vars + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeVariableNameAndType.cs b/Function/BNFreeVariableNameAndType.cs new file mode 100644 index 0000000..da2fbcc --- /dev/null +++ b/Function/BNFreeVariableNameAndType.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeVariableNameAndType(BNVariableNameAndType* var) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeVariableNameAndType" + )] + internal static extern void BNFreeVariableNameAndType( + + // BNVariableNameAndType* _var + IntPtr _var + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeVariableNameAndTypeList.cs b/Function/BNFreeVariableNameAndTypeList.cs new file mode 100644 index 0000000..3c4e740 --- /dev/null +++ b/Function/BNFreeVariableNameAndTypeList.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeVariableNameAndTypeList(BNVariableNameAndType* vars, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreeVariableNameAndTypeList" + )] + internal static extern void BNFreeVariableNameAndTypeList( + + // BNVariableNameAndType* vars + IntPtr vars , + + // uint64_t count + ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeVariableReferenceSourceList.cs b/Function/BNFreeVariableReferenceSourceList.cs new file mode 100644 index 0000000..322498d --- /dev/null +++ b/Function/BNFreeVariableReferenceSourceList.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeVariableReferenceSourceList(BNVariableReferenceSource* vars, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreeVariableReferenceSourceList" + )] + internal static extern void BNFreeVariableReferenceSourceList( + + // BNVariableReferenceSource* vars + IntPtr vars , + + // uint64_t count + ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeWebsocketClient.cs b/Function/BNFreeWebsocketClient.cs new file mode 100644 index 0000000..1889ef8 --- /dev/null +++ b/Function/BNFreeWebsocketClient.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeWebsocketClient(BNWebsocketClient* client) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeWebsocketClient" + )] + internal static extern void BNFreeWebsocketClient( + + // BNWebsocketClient* client + IntPtr client + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeWebsocketProviderList.cs b/Function/BNFreeWebsocketProviderList.cs new file mode 100644 index 0000000..73d6230 --- /dev/null +++ b/Function/BNFreeWebsocketProviderList.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeWebsocketProviderList(BNWebsocketProvider** providers) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeWebsocketProviderList" + )] + internal static extern void BNFreeWebsocketProviderList( + + // BNWebsocketProvider** providers + IntPtr providers + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeWorkflow.cs b/Function/BNFreeWorkflow.cs new file mode 100644 index 0000000..8229d90 --- /dev/null +++ b/Function/BNFreeWorkflow.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeWorkflow(BNWorkflow* workflow) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFreeWorkflow" + )] + internal static extern void BNFreeWorkflow( + + // BNWorkflow* workflow + IntPtr workflow + + ); + } +} \ No newline at end of file diff --git a/Function/BNFreeWorkflowList.cs b/Function/BNFreeWorkflowList.cs new file mode 100644 index 0000000..89a6490 --- /dev/null +++ b/Function/BNFreeWorkflowList.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFreeWorkflowList(BNWorkflow** workflows, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFreeWorkflowList" + )] + internal static extern void BNFreeWorkflowList( + + // BNWorkflow** workflows + IntPtr workflows , + + // uint64_t count + ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNFromVariableIdentifier.cs b/Function/BNFromVariableIdentifier.cs new file mode 100644 index 0000000..8ef3dd6 --- /dev/null +++ b/Function/BNFromVariableIdentifier.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNVariable BNFromVariableIdentifier(uint64_t id) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFromVariableIdentifier" + )] + internal static extern BNVariable BNFromVariableIdentifier( + + // uint64_t id + ulong id + ); + } +} \ No newline at end of file diff --git a/Function/BNFunctionCheckForDebugReport.cs b/Function/BNFunctionCheckForDebugReport.cs new file mode 100644 index 0000000..de82668 --- /dev/null +++ b/Function/BNFunctionCheckForDebugReport.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNFunctionCheckForDebugReport(BNFunction* func, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFunctionCheckForDebugReport" + )] + internal static extern bool BNFunctionCheckForDebugReport( + + // BNFunction* func + IntPtr func , + + // const char* name + string name + + ); + } +} \ No newline at end of file diff --git a/Function/BNFunctionCollapseRegion.cs b/Function/BNFunctionCollapseRegion.cs new file mode 100644 index 0000000..1229bd1 --- /dev/null +++ b/Function/BNFunctionCollapseRegion.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFunctionCollapseRegion(BNFunction* func, uint64_t hash) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFunctionCollapseRegion" + )] + internal static extern void BNFunctionCollapseRegion( + + // BNFunction* func + IntPtr func , + + // uint64_t hash + ulong hash + + ); + } +} \ No newline at end of file diff --git a/Function/BNFunctionExpandAll.cs b/Function/BNFunctionExpandAll.cs new file mode 100644 index 0000000..b48e86c --- /dev/null +++ b/Function/BNFunctionExpandAll.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFunctionExpandAll(BNFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFunctionExpandAll" + )] + internal static extern void BNFunctionExpandAll( + + // BNFunction* func + IntPtr func + + ); + } +} \ No newline at end of file diff --git a/Function/BNFunctionExpandRegion.cs b/Function/BNFunctionExpandRegion.cs new file mode 100644 index 0000000..ccb35d7 --- /dev/null +++ b/Function/BNFunctionExpandRegion.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFunctionExpandRegion(BNFunction* func, uint64_t hash) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFunctionExpandRegion" + )] + internal static extern void BNFunctionExpandRegion( + + // BNFunction* func + IntPtr func , + + // uint64_t hash + ulong hash + + ); + } +} \ No newline at end of file diff --git a/Function/BNFunctionGetAutoMetadata.cs b/Function/BNFunctionGetAutoMetadata.cs new file mode 100644 index 0000000..d8201d4 --- /dev/null +++ b/Function/BNFunctionGetAutoMetadata.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNMetadata* BNFunctionGetAutoMetadata(BNFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFunctionGetAutoMetadata" + )] + internal static extern IntPtr BNFunctionGetAutoMetadata( + + // BNFunction* func + IntPtr func + + ); + } +} \ No newline at end of file diff --git a/Function/BNFunctionGetMetadata.cs b/Function/BNFunctionGetMetadata.cs new file mode 100644 index 0000000..9239ed5 --- /dev/null +++ b/Function/BNFunctionGetMetadata.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNMetadata* BNFunctionGetMetadata(BNFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFunctionGetMetadata" + )] + internal static extern IntPtr BNFunctionGetMetadata( + + // BNFunction* func + IntPtr func + + ); + } +} \ No newline at end of file diff --git a/Function/BNFunctionHasExplicitlyDefinedType.cs b/Function/BNFunctionHasExplicitlyDefinedType.cs new file mode 100644 index 0000000..e127aed --- /dev/null +++ b/Function/BNFunctionHasExplicitlyDefinedType.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNFunctionHasExplicitlyDefinedType(BNFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFunctionHasExplicitlyDefinedType" + )] + internal static extern bool BNFunctionHasExplicitlyDefinedType( + + // BNFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNFunctionHasUserAnnotations.cs b/Function/BNFunctionHasUserAnnotations.cs new file mode 100644 index 0000000..7281253 --- /dev/null +++ b/Function/BNFunctionHasUserAnnotations.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNFunctionHasUserAnnotations(BNFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFunctionHasUserAnnotations" + )] + internal static extern bool BNFunctionHasUserAnnotations( + + // BNFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNFunctionHasUserType.cs b/Function/BNFunctionHasUserType.cs new file mode 100644 index 0000000..8d696e2 --- /dev/null +++ b/Function/BNFunctionHasUserType.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNFunctionHasUserType(BNFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFunctionHasUserType" + )] + internal static extern bool BNFunctionHasUserType( + + // BNFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNFunctionHasVariableArguments.cs b/Function/BNFunctionHasVariableArguments.cs new file mode 100644 index 0000000..1919336 --- /dev/null +++ b/Function/BNFunctionHasVariableArguments.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBoolWithConfidence BNFunctionHasVariableArguments(BNFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFunctionHasVariableArguments" + )] + internal static extern BNBoolWithConfidence BNFunctionHasVariableArguments( + + // BNFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNFunctionIsRegionCollapsed.cs b/Function/BNFunctionIsRegionCollapsed.cs new file mode 100644 index 0000000..cb5f5be --- /dev/null +++ b/Function/BNFunctionIsRegionCollapsed.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNFunctionIsRegionCollapsed(BNFunction* func, uint64_t hash) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFunctionIsRegionCollapsed" + )] + internal static extern bool BNFunctionIsRegionCollapsed( + + // BNFunction* func + IntPtr func , + + // uint64_t hash + ulong hash + + ); + } +} \ No newline at end of file diff --git a/Function/BNFunctionQueryMetadata.cs b/Function/BNFunctionQueryMetadata.cs new file mode 100644 index 0000000..e006c8c --- /dev/null +++ b/Function/BNFunctionQueryMetadata.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNMetadata* BNFunctionQueryMetadata(BNFunction* func, const char* key) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFunctionQueryMetadata" + )] + internal static extern IntPtr BNFunctionQueryMetadata( + + // BNFunction* func + IntPtr func , + + // const char* key + string key + + ); + } +} \ No newline at end of file diff --git a/Function/BNFunctionRemoveMetadata.cs b/Function/BNFunctionRemoveMetadata.cs new file mode 100644 index 0000000..d676471 --- /dev/null +++ b/Function/BNFunctionRemoveMetadata.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFunctionRemoveMetadata(BNFunction* func, const char* key) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFunctionRemoveMetadata" + )] + internal static extern void BNFunctionRemoveMetadata( + + // BNFunction* func + IntPtr func , + + // const char* key + string key + + ); + } +} \ No newline at end of file diff --git a/Function/BNFunctionStoreMetadata.cs b/Function/BNFunctionStoreMetadata.cs new file mode 100644 index 0000000..6a01edd --- /dev/null +++ b/Function/BNFunctionStoreMetadata.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFunctionStoreMetadata(BNFunction* func, const char* key, BNMetadata* value, bool isAuto) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFunctionStoreMetadata" + )] + internal static extern void BNFunctionStoreMetadata( + + // BNFunction* func + IntPtr func , + + // const char* key + string key , + + // BNMetadata* _value + IntPtr _value , + + // bool isAuto + bool isAuto + + ); + } +} \ No newline at end of file diff --git a/Function/BNFunctionToggleRegion.cs b/Function/BNFunctionToggleRegion.cs new file mode 100644 index 0000000..263761c --- /dev/null +++ b/Function/BNFunctionToggleRegion.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNFunctionToggleRegion(BNFunction* func, uint64_t hash) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFunctionToggleRegion" + )] + internal static extern void BNFunctionToggleRegion( + + // BNFunction* func + IntPtr func , + + // uint64_t hash + ulong hash + + ); + } +} \ No newline at end of file diff --git a/Function/BNFunctionTypeBuilderCanReturn.cs b/Function/BNFunctionTypeBuilderCanReturn.cs new file mode 100644 index 0000000..7ed21b4 --- /dev/null +++ b/Function/BNFunctionTypeBuilderCanReturn.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBoolWithConfidence BNFunctionTypeBuilderCanReturn(BNTypeBuilder* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNFunctionTypeBuilderCanReturn" + )] + internal static extern BNBoolWithConfidence BNFunctionTypeBuilderCanReturn( + + // BNTypeBuilder* type + IntPtr type + ); + } +} \ No newline at end of file diff --git a/Function/BNFunctionTypeCanReturn.cs b/Function/BNFunctionTypeCanReturn.cs new file mode 100644 index 0000000..31ad6a7 --- /dev/null +++ b/Function/BNFunctionTypeCanReturn.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBoolWithConfidence BNFunctionTypeCanReturn(BNType* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFunctionTypeCanReturn" + )] + internal static extern BNBoolWithConfidence BNFunctionTypeCanReturn( + + // BNType* type + IntPtr type + + ); + } +} \ No newline at end of file diff --git a/Function/BNFunctionUsesIncomingGlobalPointer.cs b/Function/BNFunctionUsesIncomingGlobalPointer.cs new file mode 100644 index 0000000..def6338 --- /dev/null +++ b/Function/BNFunctionUsesIncomingGlobalPointer.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNFunctionUsesIncomingGlobalPointer(BNFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFunctionUsesIncomingGlobalPointer" + )] + internal static extern bool BNFunctionUsesIncomingGlobalPointer( + + // BNFunction* func + IntPtr func + + ); + } +} \ No newline at end of file diff --git a/Function/BNFuzzyMatchSingle.cs b/Function/BNFuzzyMatchSingle.cs new file mode 100644 index 0000000..9752d7a --- /dev/null +++ b/Function/BNFuzzyMatchSingle.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNFuzzyMatchSingle(const char* target, const char* query) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNFuzzyMatchSingle" + )] + internal static extern ulong BNFuzzyMatchSingle( + + // const char* target + string target , + + // const char* query + string query + + ); + } +} \ No newline at end of file diff --git a/Function/BNGenerateAutoDebugTypeId.cs b/Function/BNGenerateAutoDebugTypeId.cs new file mode 100644 index 0000000..01cc433 --- /dev/null +++ b/Function/BNGenerateAutoDebugTypeId.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + public static string GenerateAutoDebugTypeId(QualifiedName name) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + return UnsafeUtils.TakeAnsiString( + + BinaryNinja.NativeMethods.BNGenerateAutoDebugTypeId( + name.ToNativeEx(allocator) + ) + ); + } + } + } + + internal static partial class NativeMethods + { + /// + /// char* BNGenerateAutoDebugTypeId(BNQualifiedName* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGenerateAutoDebugTypeId" + )] + internal static extern IntPtr BNGenerateAutoDebugTypeId( + + // BNQualifiedName* name + in BNQualifiedName name + ); + } +} \ No newline at end of file diff --git a/Function/BNGenerateAutoDemangledTypeId.cs b/Function/BNGenerateAutoDemangledTypeId.cs new file mode 100644 index 0000000..fa08173 --- /dev/null +++ b/Function/BNGenerateAutoDemangledTypeId.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public static partial class Core + { + public static string GenerateAutoDemangledTypeId(QualifiedName name) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + return UnsafeUtils.TakeAnsiString( + + NativeMethods.BNGenerateAutoDemangledTypeId( + name.ToNativeEx(allocator) + ) + ); + } + } + } + + internal static partial class NativeMethods + { + /// + /// char* BNGenerateAutoDemangledTypeId(BNQualifiedName* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGenerateAutoDemangledTypeId" + )] + internal static extern IntPtr BNGenerateAutoDemangledTypeId( + + // BNQualifiedName* name + in BNQualifiedName name + ); + } + +} \ No newline at end of file diff --git a/Function/BNGenerateAutoPlatformTypeId.cs b/Function/BNGenerateAutoPlatformTypeId.cs new file mode 100644 index 0000000..f809dc4 --- /dev/null +++ b/Function/BNGenerateAutoPlatformTypeId.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGenerateAutoPlatformTypeId(BNPlatform* platform, BNQualifiedName* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGenerateAutoPlatformTypeId" + )] + internal static extern IntPtr BNGenerateAutoPlatformTypeId( + + // BNPlatform* platform + IntPtr platform , + + // BNQualifiedName* name + IntPtr name + + ); + } +} \ No newline at end of file diff --git a/Function/BNGenerateAutoTypeId.cs b/Function/BNGenerateAutoTypeId.cs new file mode 100644 index 0000000..fdf819e --- /dev/null +++ b/Function/BNGenerateAutoTypeId.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public static partial class Core + { + public static string GenerateAutoTypeId(string source , QualifiedName name) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + return UnsafeUtils.TakeAnsiString( + + NativeMethods.BNGenerateAutoTypeId( + source , + name.ToNativeEx(allocator) + ) + ); + } + } + } + + internal static partial class NativeMethods + { + /// + /// char* BNGenerateAutoTypeId(const char* source, BNQualifiedName* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGenerateAutoTypeId" + )] + internal static extern IntPtr BNGenerateAutoTypeId( + + // const char* source + string source , + + // BNQualifiedName* name + in BNQualifiedName name + ); + } +} \ No newline at end of file diff --git a/Function/BNGenerateHighLevelILSSAForm.cs b/Function/BNGenerateHighLevelILSSAForm.cs new file mode 100644 index 0000000..16df369 --- /dev/null +++ b/Function/BNGenerateHighLevelILSSAForm.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNGenerateHighLevelILSSAForm(BNHighLevelILFunction* func, BNVariable* aliases, uint64_t aliasCount) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGenerateHighLevelILSSAForm" + )] + internal static extern void BNGenerateHighLevelILSSAForm( + + // BNHighLevelILFunction* func + IntPtr func , + + // BNVariable* aliases + BNVariable[] aliases , + + // uint64_t aliasCount + ulong aliasCount + ); + } +} \ No newline at end of file diff --git a/Function/BNGenerateLowLevelILSSAForm.cs b/Function/BNGenerateLowLevelILSSAForm.cs new file mode 100644 index 0000000..42dcc61 --- /dev/null +++ b/Function/BNGenerateLowLevelILSSAForm.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNGenerateLowLevelILSSAForm(BNLowLevelILFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGenerateLowLevelILSSAForm" + )] + internal static extern void BNGenerateLowLevelILSSAForm( + + // BNLowLevelILFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNGenerateMediumLevelILSSAForm.cs b/Function/BNGenerateMediumLevelILSSAForm.cs new file mode 100644 index 0000000..53b934e --- /dev/null +++ b/Function/BNGenerateMediumLevelILSSAForm.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNGenerateMediumLevelILSSAForm(BNMediumLevelILFunction* func, bool analyzeConditionals, bool handleAliases, BNVariable* knownNotAliases, uint64_t knownNotAliasCount, BNVariable* knownAliases, uint64_t knownAliasCount) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGenerateMediumLevelILSSAForm" + )] + internal static extern void BNGenerateMediumLevelILSSAForm( + + // BNMediumLevelILFunction* func + IntPtr func , + + // bool analyzeConditionals + bool analyzeConditionals , + + // bool handleAliases + bool handleAliases , + + // BNVariable* knownNotAliases + BNVariable[] knownNotAliases , + + // uint64_t knownNotAliasCount + ulong knownNotAliasCount , + + // BNVariable* knownAliases + BNVariable[] knownAliases , + + // uint64_t knownAliasCount + ulong knownAliasCount + ); + } +} \ No newline at end of file diff --git a/Function/BNGetActiveMemoryRegionAt.cs b/Function/BNGetActiveMemoryRegionAt.cs new file mode 100644 index 0000000..29571ba --- /dev/null +++ b/Function/BNGetActiveMemoryRegionAt.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetActiveMemoryRegionAt(BNBinaryView* view, uint64_t addr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetActiveMemoryRegionAt" + )] + internal static extern IntPtr BNGetActiveMemoryRegionAt( + + // BNBinaryView* view + IntPtr view , + + // uint64_t addr + ulong addr + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetActiveUpdateChannel.cs b/Function/BNGetActiveUpdateChannel.cs new file mode 100644 index 0000000..e2c05ab --- /dev/null +++ b/Function/BNGetActiveUpdateChannel.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetActiveUpdateChannel() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetActiveUpdateChannel" + )] + internal static extern IntPtr BNGetActiveUpdateChannel( + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetAddressForDataOffset.cs b/Function/BNGetAddressForDataOffset.cs new file mode 100644 index 0000000..335c71b --- /dev/null +++ b/Function/BNGetAddressForDataOffset.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNGetAddressForDataOffset(BNBinaryView* view, uint64_t offset, uint64_t* addr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetAddressForDataOffset" + )] + internal static extern bool BNGetAddressForDataOffset( + + // BNBinaryView* view + IntPtr view , + + // uint64_t offset + ulong offset , + + // uint64_t* addr + out ulong address + ); + } +} \ No newline at end of file diff --git a/Function/BNGetAddressInput.cs b/Function/BNGetAddressInput.cs new file mode 100644 index 0000000..c9e2662 --- /dev/null +++ b/Function/BNGetAddressInput.cs @@ -0,0 +1,58 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public static partial class Core + { + public static ulong? GetAddressInput(string prompt = "PROMPT>" , string title = "get_address" ) + { + bool ok = NativeMethods.BNGetAddressInput( + out ulong result , + prompt , + title, + IntPtr.Zero , + 0 + ); + + if (!ok) + { + return null; + } + + return result; + } + } + + internal static partial class NativeMethods + { + /// + /// bool BNGetAddressInput(uint64_t* result, const char* prompt, const char* title, BNBinaryView* view, uint64_t currentAddr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetAddressInput" + )] + internal static extern bool BNGetAddressInput( + + // uint64_t* result + out ulong result , + + // const char* prompt + string prompt , + + // const char* title + string title , + + // BNBinaryView* view + IntPtr view , + + // uint64_t currentAddr + ulong currentAddr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetAddressRenderedWidth.cs b/Function/BNGetAddressRenderedWidth.cs new file mode 100644 index 0000000..10e7550 --- /dev/null +++ b/Function/BNGetAddressRenderedWidth.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint32_t BNGetAddressRenderedWidth(uint64_t addr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetAddressRenderedWidth" + )] + internal static extern uint BNGetAddressRenderedWidth( + + // uint64_t addr + ulong addr + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetAddressTagReferences.cs b/Function/BNGetAddressTagReferences.cs new file mode 100644 index 0000000..1bf7e50 --- /dev/null +++ b/Function/BNGetAddressTagReferences.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTagReference* BNGetAddressTagReferences(BNFunction* func, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetAddressTagReferences" + )] + internal static extern IntPtr BNGetAddressTagReferences( + + // BNFunction* func + IntPtr func , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetAddressTags.cs b/Function/BNGetAddressTags.cs new file mode 100644 index 0000000..e76ed0e --- /dev/null +++ b/Function/BNGetAddressTags.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTag** BNGetAddressTags(BNFunction* func, BNArchitecture* arch, uint64_t addr, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetAddressTags" + )] + internal static extern IntPtr BNGetAddressTags( + + // BNFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t addr + ulong addr , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetAddressTagsInRange.cs b/Function/BNGetAddressTagsInRange.cs new file mode 100644 index 0000000..3282375 --- /dev/null +++ b/Function/BNGetAddressTagsInRange.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTagReference* BNGetAddressTagsInRange(BNFunction* func, BNArchitecture* arch, uint64_t start, uint64_t end, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetAddressTagsInRange" + )] + internal static extern IntPtr BNGetAddressTagsInRange( + + // BNFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t start + ulong start , + + // uint64_t end + ulong end , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetAddressTagsOfType.cs b/Function/BNGetAddressTagsOfType.cs new file mode 100644 index 0000000..b392d93 --- /dev/null +++ b/Function/BNGetAddressTagsOfType.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTag** BNGetAddressTagsOfType(BNFunction* func, BNArchitecture* arch, uint64_t addr, BNTagType* tagType, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetAddressTagsOfType" + )] + internal static extern IntPtr BNGetAddressTagsOfType( + + // BNFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t addr + ulong addr , + + // BNTagType* tagType + IntPtr tagType , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetAllAddressTagReferences.cs b/Function/BNGetAllAddressTagReferences.cs new file mode 100644 index 0000000..3bfe9ef --- /dev/null +++ b/Function/BNGetAllAddressTagReferences.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTagReference* BNGetAllAddressTagReferences(BNBinaryView* view, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetAllAddressTagReferences" + )] + internal static extern IntPtr BNGetAllAddressTagReferences( + + // BNBinaryView* view + IntPtr view , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetAllArchitectureFlagWriteTypes.cs b/Function/BNGetAllArchitectureFlagWriteTypes.cs new file mode 100644 index 0000000..69b01ab --- /dev/null +++ b/Function/BNGetAllArchitectureFlagWriteTypes.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint32_t* BNGetAllArchitectureFlagWriteTypes(BNArchitecture* arch, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetAllArchitectureFlagWriteTypes" + )] + internal static extern IntPtr BNGetAllArchitectureFlagWriteTypes( + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetAllArchitectureFlags.cs b/Function/BNGetAllArchitectureFlags.cs new file mode 100644 index 0000000..16bd557 --- /dev/null +++ b/Function/BNGetAllArchitectureFlags.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint32_t* BNGetAllArchitectureFlags(BNArchitecture* arch, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetAllArchitectureFlags" + )] + internal static extern IntPtr BNGetAllArchitectureFlags( + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetAllArchitectureIntrinsics.cs b/Function/BNGetAllArchitectureIntrinsics.cs new file mode 100644 index 0000000..bfbb9d3 --- /dev/null +++ b/Function/BNGetAllArchitectureIntrinsics.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint32_t* BNGetAllArchitectureIntrinsics(BNArchitecture* arch, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetAllArchitectureIntrinsics" + )] + internal static extern IntPtr BNGetAllArchitectureIntrinsics( + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetAllArchitectureRegisterStacks.cs b/Function/BNGetAllArchitectureRegisterStacks.cs new file mode 100644 index 0000000..947b553 --- /dev/null +++ b/Function/BNGetAllArchitectureRegisterStacks.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint32_t* BNGetAllArchitectureRegisterStacks(BNArchitecture* arch, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetAllArchitectureRegisterStacks" + )] + internal static extern IntPtr BNGetAllArchitectureRegisterStacks( + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetAllArchitectureRegisters.cs b/Function/BNGetAllArchitectureRegisters.cs new file mode 100644 index 0000000..0e9a3ee --- /dev/null +++ b/Function/BNGetAllArchitectureRegisters.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint32_t* BNGetAllArchitectureRegisters(BNArchitecture* arch, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetAllArchitectureRegisters" + )] + internal static extern IntPtr BNGetAllArchitectureRegisters( + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetAllArchitectureSemanticFlagClasses.cs b/Function/BNGetAllArchitectureSemanticFlagClasses.cs new file mode 100644 index 0000000..ac91ecf --- /dev/null +++ b/Function/BNGetAllArchitectureSemanticFlagClasses.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint32_t* BNGetAllArchitectureSemanticFlagClasses(BNArchitecture* arch, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetAllArchitectureSemanticFlagClasses" + )] + internal static extern IntPtr BNGetAllArchitectureSemanticFlagClasses( + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetAllArchitectureSemanticFlagGroups.cs b/Function/BNGetAllArchitectureSemanticFlagGroups.cs new file mode 100644 index 0000000..bc17127 --- /dev/null +++ b/Function/BNGetAllArchitectureSemanticFlagGroups.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint32_t* BNGetAllArchitectureSemanticFlagGroups(BNArchitecture* arch, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetAllArchitectureSemanticFlagGroups" + )] + internal static extern IntPtr BNGetAllArchitectureSemanticFlagGroups( + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetAllEntryFunctions.cs b/Function/BNGetAllEntryFunctions.cs new file mode 100644 index 0000000..388148d --- /dev/null +++ b/Function/BNGetAllEntryFunctions.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFunction** BNGetAllEntryFunctions(BNBinaryView* view, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetAllEntryFunctions" + )] + internal static extern IntPtr BNGetAllEntryFunctions( + + // BNBinaryView* view + IntPtr view , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetAllFieldsReferenced.cs b/Function/BNGetAllFieldsReferenced.cs new file mode 100644 index 0000000..8d56560 --- /dev/null +++ b/Function/BNGetAllFieldsReferenced.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t* BNGetAllFieldsReferenced(BNBinaryView* view, BNQualifiedName* type, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetAllFieldsReferenced" + )] + internal static extern IntPtr BNGetAllFieldsReferenced( + + // BNBinaryView* view + IntPtr view , + + // BNQualifiedName* type + in BNQualifiedName type , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetAllFunctionTagReferences.cs b/Function/BNGetAllFunctionTagReferences.cs new file mode 100644 index 0000000..7bb8374 --- /dev/null +++ b/Function/BNGetAllFunctionTagReferences.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTagReference* BNGetAllFunctionTagReferences(BNBinaryView* view, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetAllFunctionTagReferences" + )] + internal static extern IntPtr BNGetAllFunctionTagReferences( + + // BNBinaryView* view + IntPtr view , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetAllMediumLevelILBranchDependence.cs b/Function/BNGetAllMediumLevelILBranchDependence.cs new file mode 100644 index 0000000..e44518a --- /dev/null +++ b/Function/BNGetAllMediumLevelILBranchDependence.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNILBranchInstructionAndDependence* BNGetAllMediumLevelILBranchDependence(BNMediumLevelILFunction* func, uint64_t instr, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetAllMediumLevelILBranchDependence" + )] + internal static extern IntPtr BNGetAllMediumLevelILBranchDependence( + + // BNMediumLevelILFunction* func + IntPtr func , + + // uint64_t instr + MediumLevelILInstructionIndex instr , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetAllPluginCommands.cs b/Function/BNGetAllPluginCommands.cs new file mode 100644 index 0000000..b3a72bc --- /dev/null +++ b/Function/BNGetAllPluginCommands.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNPluginCommand* BNGetAllPluginCommands(uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetAllPluginCommands" + )] + internal static extern IntPtr BNGetAllPluginCommands( + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetAllReferencesForType.cs b/Function/BNGetAllReferencesForType.cs new file mode 100644 index 0000000..1f76b45 --- /dev/null +++ b/Function/BNGetAllReferencesForType.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNAllTypeReferences BNGetAllReferencesForType(BNBinaryView* view, BNQualifiedName* type, bool limit, uint64_t maxItems) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetAllReferencesForType" + )] + internal static extern BNAllTypeReferences BNGetAllReferencesForType( + + // BNBinaryView* view + IntPtr view , + + // BNQualifiedName* type + IntPtr type , + + // bool limit + bool limit , + + // uint64_t maxItems + ulong maxItems + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetAllReferencesForTypeField.cs b/Function/BNGetAllReferencesForTypeField.cs new file mode 100644 index 0000000..8ade0a7 --- /dev/null +++ b/Function/BNGetAllReferencesForTypeField.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNAllTypeFieldReferences BNGetAllReferencesForTypeField(BNBinaryView* view, BNQualifiedName* type, uint64_t offset, bool limit, uint64_t maxItems) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetAllReferencesForTypeField" + )] + internal static extern BNAllTypeFieldReferences BNGetAllReferencesForTypeField( + + // BNBinaryView* view + IntPtr view , + + // BNQualifiedName* type + IntPtr type , + + // uint64_t offset + ulong offset , + + // bool limit + bool limit , + + // uint64_t maxItems + ulong maxItems + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetAllSizesReferenced.cs b/Function/BNGetAllSizesReferenced.cs new file mode 100644 index 0000000..3571e9d --- /dev/null +++ b/Function/BNGetAllSizesReferenced.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeFieldReferenceSizeInfo* BNGetAllSizesReferenced(BNBinaryView* view, BNQualifiedName* type, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetAllSizesReferenced" + )] + internal static extern IntPtr BNGetAllSizesReferenced( + + // BNBinaryView* view + IntPtr view , + + // BNQualifiedName* type + in BNQualifiedName type , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetAllTagReferenceTypeCounts.cs b/Function/BNGetAllTagReferenceTypeCounts.cs new file mode 100644 index 0000000..a8ab8ee --- /dev/null +++ b/Function/BNGetAllTagReferenceTypeCounts.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNGetAllTagReferenceTypeCounts(BNBinaryView* view, BNTagType*** tagTypes, uint64_t** counts, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetAllTagReferenceTypeCounts" + )] + internal static extern void BNGetAllTagReferenceTypeCounts( + + // BNBinaryView* view + IntPtr view , + + // BNTagType*** tagTypes + IntPtr tagTypes , + + // uint64_t** counts + IntPtr counts , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetAllTagReferences.cs b/Function/BNGetAllTagReferences.cs new file mode 100644 index 0000000..fefee83 --- /dev/null +++ b/Function/BNGetAllTagReferences.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTagReference* BNGetAllTagReferences(BNBinaryView* view, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetAllTagReferences" + )] + internal static extern IntPtr BNGetAllTagReferences( + + // BNBinaryView* view + IntPtr view , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetAllTagReferencesOfType.cs b/Function/BNGetAllTagReferencesOfType.cs new file mode 100644 index 0000000..e1023a2 --- /dev/null +++ b/Function/BNGetAllTagReferencesOfType.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTagReference* BNGetAllTagReferencesOfType(BNBinaryView* view, BNTagType* tagType, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetAllTagReferencesOfType" + )] + internal static extern IntPtr BNGetAllTagReferencesOfType( + + // BNBinaryView* view + IntPtr view , + + // BNTagType* tagType + IntPtr tagType , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetAllTagReferencesOfTypeCount.cs b/Function/BNGetAllTagReferencesOfTypeCount.cs new file mode 100644 index 0000000..e734d4b --- /dev/null +++ b/Function/BNGetAllTagReferencesOfTypeCount.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetAllTagReferencesOfTypeCount(BNBinaryView* view, BNTagType* tagType) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetAllTagReferencesOfTypeCount" + )] + internal static extern ulong BNGetAllTagReferencesOfTypeCount( + + // BNBinaryView* view + IntPtr view , + + // BNTagType* tagType + IntPtr tagType + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetAllTypesReferenced.cs b/Function/BNGetAllTypesReferenced.cs new file mode 100644 index 0000000..6d3745b --- /dev/null +++ b/Function/BNGetAllTypesReferenced.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeFieldReferenceTypeInfo* BNGetAllTypesReferenced(BNBinaryView* view, BNQualifiedName* type, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetAllTypesReferenced" + )] + internal static extern IntPtr BNGetAllTypesReferenced( + + // BNBinaryView* view + IntPtr view , + + // BNQualifiedName* type + in BNQualifiedName type , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetAllUserVariableValues.cs b/Function/BNGetAllUserVariableValues.cs new file mode 100644 index 0000000..e6eb1da --- /dev/null +++ b/Function/BNGetAllUserVariableValues.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNUserVariableValue* BNGetAllUserVariableValues(BNFunction* func, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetAllUserVariableValues" + )] + internal static extern IntPtr BNGetAllUserVariableValues( + + // BNFunction* func + IntPtr func , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetAllVariableFieldResolutions.cs b/Function/BNGetAllVariableFieldResolutions.cs new file mode 100644 index 0000000..0face4a --- /dev/null +++ b/Function/BNGetAllVariableFieldResolutions.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNVariableFieldResolutionInfo* BNGetAllVariableFieldResolutions(BNFunction* func, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetAllVariableFieldResolutions" + )] + internal static extern IntPtr BNGetAllVariableFieldResolutions( + + // BNFunction* func + IntPtr func , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetAllocatedRanges.cs b/Function/BNGetAllocatedRanges.cs new file mode 100644 index 0000000..c596306 --- /dev/null +++ b/Function/BNGetAllocatedRanges.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNAddressRange* BNGetAllocatedRanges(BNBinaryView* view, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetAllocatedRanges" + )] + internal static extern IntPtr BNGetAllocatedRanges( + + // BNBinaryView* view + IntPtr view , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetAnalysisAutoTypeContainer.cs b/Function/BNGetAnalysisAutoTypeContainer.cs new file mode 100644 index 0000000..d64c649 --- /dev/null +++ b/Function/BNGetAnalysisAutoTypeContainer.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeContainer* BNGetAnalysisAutoTypeContainer(BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetAnalysisAutoTypeContainer" + )] + internal static extern IntPtr BNGetAnalysisAutoTypeContainer( + + // BNBinaryView* view + IntPtr view + ); + } +} \ No newline at end of file diff --git a/Function/BNGetAnalysisDependencySortedTypeList.cs b/Function/BNGetAnalysisDependencySortedTypeList.cs new file mode 100644 index 0000000..59a47e9 --- /dev/null +++ b/Function/BNGetAnalysisDependencySortedTypeList.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNQualifiedNameAndType* BNGetAnalysisDependencySortedTypeList(BNBinaryView* view, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetAnalysisDependencySortedTypeList" + )] + internal static extern IntPtr BNGetAnalysisDependencySortedTypeList( + + // BNBinaryView* view + IntPtr view , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetAnalysisEntryPoint.cs b/Function/BNGetAnalysisEntryPoint.cs new file mode 100644 index 0000000..435ae97 --- /dev/null +++ b/Function/BNGetAnalysisEntryPoint.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFunction* BNGetAnalysisEntryPoint(BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetAnalysisEntryPoint" + )] + internal static extern IntPtr BNGetAnalysisEntryPoint( + + // BNBinaryView* view + IntPtr view + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetAnalysisFunction.cs b/Function/BNGetAnalysisFunction.cs new file mode 100644 index 0000000..61957c0 --- /dev/null +++ b/Function/BNGetAnalysisFunction.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFunction* BNGetAnalysisFunction(BNBinaryView* view, BNPlatform* platform, uint64_t addr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetAnalysisFunction" + )] + internal static extern IntPtr BNGetAnalysisFunction( + + // BNBinaryView* view + IntPtr view , + + // BNPlatform* platform + IntPtr platform , + + // uint64_t addr + ulong addr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetAnalysisFunctionList.cs b/Function/BNGetAnalysisFunctionList.cs new file mode 100644 index 0000000..9f84b43 --- /dev/null +++ b/Function/BNGetAnalysisFunctionList.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFunction** BNGetAnalysisFunctionList(BNBinaryView* view, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetAnalysisFunctionList" + )] + internal static extern IntPtr BNGetAnalysisFunctionList( + + // BNBinaryView* view + IntPtr view , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetAnalysisFunctionsContainingAddress.cs b/Function/BNGetAnalysisFunctionsContainingAddress.cs new file mode 100644 index 0000000..f5e4d96 --- /dev/null +++ b/Function/BNGetAnalysisFunctionsContainingAddress.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFunction** BNGetAnalysisFunctionsContainingAddress(BNBinaryView* view, uint64_t addr, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetAnalysisFunctionsContainingAddress" + )] + internal static extern IntPtr BNGetAnalysisFunctionsContainingAddress( + + // BNBinaryView* view + IntPtr view , + + // uint64_t addr + ulong addr , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetAnalysisFunctionsForAddress.cs b/Function/BNGetAnalysisFunctionsForAddress.cs new file mode 100644 index 0000000..4f9131c --- /dev/null +++ b/Function/BNGetAnalysisFunctionsForAddress.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFunction** BNGetAnalysisFunctionsForAddress(BNBinaryView* view, uint64_t addr, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetAnalysisFunctionsForAddress" + )] + internal static extern IntPtr BNGetAnalysisFunctionsForAddress( + + // BNBinaryView* view + IntPtr view , + + // uint64_t addr + ulong addr , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetAnalysisInfo.cs b/Function/BNGetAnalysisInfo.cs new file mode 100644 index 0000000..6fd9ea2 --- /dev/null +++ b/Function/BNGetAnalysisInfo.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNAnalysisInfo* BNGetAnalysisInfo(BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetAnalysisInfo" + )] + internal static extern IntPtr BNGetAnalysisInfo( + + // BNBinaryView* view + IntPtr view + ); + } +} \ No newline at end of file diff --git a/Function/BNGetAnalysisMergeConflictSplitterList.cs b/Function/BNGetAnalysisMergeConflictSplitterList.cs new file mode 100644 index 0000000..b97e810 --- /dev/null +++ b/Function/BNGetAnalysisMergeConflictSplitterList.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNAnalysisMergeConflictSplitter** BNGetAnalysisMergeConflictSplitterList(uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetAnalysisMergeConflictSplitterList" + )] + internal static extern IntPtr BNGetAnalysisMergeConflictSplitterList( + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetAnalysisProgress.cs b/Function/BNGetAnalysisProgress.cs new file mode 100644 index 0000000..0a753e8 --- /dev/null +++ b/Function/BNGetAnalysisProgress.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNAnalysisProgress BNGetAnalysisProgress(BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetAnalysisProgress" + )] + internal static extern BNAnalysisProgress BNGetAnalysisProgress( + + // BNBinaryView* view + IntPtr view + ); + } +} \ No newline at end of file diff --git a/Function/BNGetAnalysisSkipReason.cs b/Function/BNGetAnalysisSkipReason.cs new file mode 100644 index 0000000..8bc7faf --- /dev/null +++ b/Function/BNGetAnalysisSkipReason.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNAnalysisSkipReason BNGetAnalysisSkipReason(BNFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetAnalysisSkipReason" + )] + internal static extern AnalysisSkipReason BNGetAnalysisSkipReason( + + // BNFunction* func + IntPtr func + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetAnalysisState.cs b/Function/BNGetAnalysisState.cs new file mode 100644 index 0000000..a5ff337 --- /dev/null +++ b/Function/BNGetAnalysisState.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNAnalysisState BNGetAnalysisState(BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetAnalysisState" + )] + internal static extern AnalysisState BNGetAnalysisState( + + // BNBinaryView* view + IntPtr view + ); + } +} \ No newline at end of file diff --git a/Function/BNGetAnalysisSystemCallName.cs b/Function/BNGetAnalysisSystemCallName.cs new file mode 100644 index 0000000..d469cde --- /dev/null +++ b/Function/BNGetAnalysisSystemCallName.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// char* BNGetAnalysisSystemCallName(BNBinaryView* view, BNPlatform* platform, uint32_t id) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetAnalysisSystemCallName" + )] + internal static extern IntPtr BNGetAnalysisSystemCallName( + + // BNBinaryView* view + IntPtr view , + + // BNPlatform* platform + IntPtr platform , + + // uint32_t id + uint id + ); + } +} \ No newline at end of file diff --git a/Function/BNGetAnalysisSystemCallType.cs b/Function/BNGetAnalysisSystemCallType.cs new file mode 100644 index 0000000..1cf6b42 --- /dev/null +++ b/Function/BNGetAnalysisSystemCallType.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNType* BNGetAnalysisSystemCallType(BNBinaryView* view, BNPlatform* platform, uint32_t id) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetAnalysisSystemCallType" + )] + internal static extern IntPtr BNGetAnalysisSystemCallType( + + // BNBinaryView* view + IntPtr view , + + // BNPlatform* platform + IntPtr platform , + + // uint32_t id + uint id + ); + } +} \ No newline at end of file diff --git a/Function/BNGetAnalysisTypeById.cs b/Function/BNGetAnalysisTypeById.cs new file mode 100644 index 0000000..113210e --- /dev/null +++ b/Function/BNGetAnalysisTypeById.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNType* BNGetAnalysisTypeById(BNBinaryView* view, const char* id) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetAnalysisTypeById" + )] + internal static extern IntPtr BNGetAnalysisTypeById( + + // BNBinaryView* view + IntPtr view , + + // const char* id + string id + ); + } +} \ No newline at end of file diff --git a/Function/BNGetAnalysisTypeByName.cs b/Function/BNGetAnalysisTypeByName.cs new file mode 100644 index 0000000..95cbc98 --- /dev/null +++ b/Function/BNGetAnalysisTypeByName.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNType* BNGetAnalysisTypeByName(BNBinaryView* view, BNQualifiedName* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetAnalysisTypeByName" + )] + internal static extern IntPtr BNGetAnalysisTypeByName( + + // BNBinaryView* view + IntPtr view , + + // BNQualifiedName* name + in BNQualifiedName name + ); + } +} \ No newline at end of file diff --git a/Function/BNGetAnalysisTypeByRef.cs b/Function/BNGetAnalysisTypeByRef.cs new file mode 100644 index 0000000..9d17b09 --- /dev/null +++ b/Function/BNGetAnalysisTypeByRef.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNType* BNGetAnalysisTypeByRef(BNBinaryView* view, BNNamedTypeReference* @ref) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetAnalysisTypeByRef" + )] + internal static extern IntPtr BNGetAnalysisTypeByRef( + + // BNBinaryView* view + IntPtr view , + + // BNNamedTypeReference* _ref + IntPtr _ref + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetAnalysisTypeContainer.cs b/Function/BNGetAnalysisTypeContainer.cs new file mode 100644 index 0000000..31befd1 --- /dev/null +++ b/Function/BNGetAnalysisTypeContainer.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeContainer* BNGetAnalysisTypeContainer(BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetAnalysisTypeContainer" + )] + internal static extern IntPtr BNGetAnalysisTypeContainer( + + // BNBinaryView* view + IntPtr view + ); + } +} \ No newline at end of file diff --git a/Function/BNGetAnalysisTypeId.cs b/Function/BNGetAnalysisTypeId.cs new file mode 100644 index 0000000..10d928f --- /dev/null +++ b/Function/BNGetAnalysisTypeId.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// char* BNGetAnalysisTypeId(BNBinaryView* view, BNQualifiedName* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetAnalysisTypeId" + )] + internal static extern IntPtr BNGetAnalysisTypeId( + + // BNBinaryView* view + IntPtr view , + + // BNQualifiedName* name + in BNQualifiedName name + ); + } +} \ No newline at end of file diff --git a/Function/BNGetAnalysisTypeList.cs b/Function/BNGetAnalysisTypeList.cs new file mode 100644 index 0000000..06a6e58 --- /dev/null +++ b/Function/BNGetAnalysisTypeList.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNQualifiedNameAndType* BNGetAnalysisTypeList(BNBinaryView* view, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetAnalysisTypeList" + )] + internal static extern IntPtr BNGetAnalysisTypeList( + + // BNBinaryView* view + IntPtr view , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetAnalysisTypeNameById.cs b/Function/BNGetAnalysisTypeNameById.cs new file mode 100644 index 0000000..fcf8505 --- /dev/null +++ b/Function/BNGetAnalysisTypeNameById.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNQualifiedName BNGetAnalysisTypeNameById(BNBinaryView* view, const char* id) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetAnalysisTypeNameById" + )] + internal static extern BNQualifiedName BNGetAnalysisTypeNameById( + + // BNBinaryView* view + IntPtr view , + + // const char* id + string id + ); + } +} \ No newline at end of file diff --git a/Function/BNGetAnalysisTypeNames.cs b/Function/BNGetAnalysisTypeNames.cs new file mode 100644 index 0000000..4b9cf49 --- /dev/null +++ b/Function/BNGetAnalysisTypeNames.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNQualifiedName* BNGetAnalysisTypeNames(BNBinaryView* view, uint64_t* count, const char* matching) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetAnalysisTypeNames" + )] + internal static extern IntPtr BNGetAnalysisTypeNames( + + // BNBinaryView* view + IntPtr view , + + // uint64_t* count + out ulong count , + + // const char* matching + string matching + ); + } +} \ No newline at end of file diff --git a/Function/BNGetAnalysisUserTypeContainer.cs b/Function/BNGetAnalysisUserTypeContainer.cs new file mode 100644 index 0000000..8626b70 --- /dev/null +++ b/Function/BNGetAnalysisUserTypeContainer.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeContainer* BNGetAnalysisUserTypeContainer(BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetAnalysisUserTypeContainer" + )] + internal static extern IntPtr BNGetAnalysisUserTypeContainer( + + // BNBinaryView* view + IntPtr view + ); + } +} \ No newline at end of file diff --git a/Function/BNGetArchitectureAddressSize.cs b/Function/BNGetArchitectureAddressSize.cs new file mode 100644 index 0000000..0a2e737 --- /dev/null +++ b/Function/BNGetArchitectureAddressSize.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetArchitectureAddressSize(BNArchitecture* arch) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetArchitectureAddressSize" + )] + internal static extern ulong BNGetArchitectureAddressSize( + + // BNArchitecture* arch + IntPtr arch + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetArchitectureByName.cs b/Function/BNGetArchitectureByName.cs new file mode 100644 index 0000000..741a198 --- /dev/null +++ b/Function/BNGetArchitectureByName.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNArchitecture* BNGetArchitectureByName(const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetArchitectureByName" + )] + internal static extern IntPtr BNGetArchitectureByName( + + // const char* name + string name + ); + } +} \ No newline at end of file diff --git a/Function/BNGetArchitectureCallingConventionByName.cs b/Function/BNGetArchitectureCallingConventionByName.cs new file mode 100644 index 0000000..a1b94e5 --- /dev/null +++ b/Function/BNGetArchitectureCallingConventionByName.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNCallingConvention* BNGetArchitectureCallingConventionByName(BNArchitecture* arch, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetArchitectureCallingConventionByName" + )] + internal static extern IntPtr BNGetArchitectureCallingConventionByName( + + // BNArchitecture* arch + IntPtr arch , + + // const char* name + string name + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetArchitectureCallingConventions.cs b/Function/BNGetArchitectureCallingConventions.cs new file mode 100644 index 0000000..f4cd409 --- /dev/null +++ b/Function/BNGetArchitectureCallingConventions.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNCallingConvention** BNGetArchitectureCallingConventions(BNArchitecture* arch, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetArchitectureCallingConventions" + )] + internal static extern IntPtr BNGetArchitectureCallingConventions( + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetArchitectureCdeclCallingConvention.cs b/Function/BNGetArchitectureCdeclCallingConvention.cs new file mode 100644 index 0000000..79e8d43 --- /dev/null +++ b/Function/BNGetArchitectureCdeclCallingConvention.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNCallingConvention* BNGetArchitectureCdeclCallingConvention(BNArchitecture* arch) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetArchitectureCdeclCallingConvention" + )] + internal static extern IntPtr BNGetArchitectureCdeclCallingConvention( + + // BNArchitecture* arch + IntPtr arch + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetArchitectureDefaultCallingConvention.cs b/Function/BNGetArchitectureDefaultCallingConvention.cs new file mode 100644 index 0000000..26b4ab1 --- /dev/null +++ b/Function/BNGetArchitectureDefaultCallingConvention.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNCallingConvention* BNGetArchitectureDefaultCallingConvention(BNArchitecture* arch) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetArchitectureDefaultCallingConvention" + )] + internal static extern IntPtr BNGetArchitectureDefaultCallingConvention( + + // BNArchitecture* arch + IntPtr arch + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetArchitectureDefaultIntegerSize.cs b/Function/BNGetArchitectureDefaultIntegerSize.cs new file mode 100644 index 0000000..e3cac8d --- /dev/null +++ b/Function/BNGetArchitectureDefaultIntegerSize.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetArchitectureDefaultIntegerSize(BNArchitecture* arch) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetArchitectureDefaultIntegerSize" + )] + internal static extern ulong BNGetArchitectureDefaultIntegerSize( + + // BNArchitecture* arch + IntPtr arch + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetArchitectureEndianness.cs b/Function/BNGetArchitectureEndianness.cs new file mode 100644 index 0000000..0f8b7f8 --- /dev/null +++ b/Function/BNGetArchitectureEndianness.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNEndianness BNGetArchitectureEndianness(BNArchitecture* arch) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetArchitectureEndianness" + )] + internal static extern Endianness BNGetArchitectureEndianness( + + // BNArchitecture* arch + IntPtr arch + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetArchitectureFastcallCallingConvention.cs b/Function/BNGetArchitectureFastcallCallingConvention.cs new file mode 100644 index 0000000..849ee01 --- /dev/null +++ b/Function/BNGetArchitectureFastcallCallingConvention.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNCallingConvention* BNGetArchitectureFastcallCallingConvention(BNArchitecture* arch) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetArchitectureFastcallCallingConvention" + )] + internal static extern IntPtr BNGetArchitectureFastcallCallingConvention( + + // BNArchitecture* arch + IntPtr arch + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetArchitectureFlagConditionLowLevelIL.cs b/Function/BNGetArchitectureFlagConditionLowLevelIL.cs new file mode 100644 index 0000000..690b311 --- /dev/null +++ b/Function/BNGetArchitectureFlagConditionLowLevelIL.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetArchitectureFlagConditionLowLevelIL(BNArchitecture* arch, BNLowLevelILFlagCondition cond, uint32_t semClass, BNLowLevelILFunction* il) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetArchitectureFlagConditionLowLevelIL" + )] + internal static extern ulong BNGetArchitectureFlagConditionLowLevelIL( + + // BNArchitecture* arch + IntPtr arch , + + // BNLowLevelILFlagCondition cond + LowLevelILFlagCondition cond , + + // uint32_t semClass + uint semClass , + + // BNLowLevelILFunction* il + IntPtr il + ); + } +} \ No newline at end of file diff --git a/Function/BNGetArchitectureFlagConditionsForSemanticFlagGroup.cs b/Function/BNGetArchitectureFlagConditionsForSemanticFlagGroup.cs new file mode 100644 index 0000000..27f0778 --- /dev/null +++ b/Function/BNGetArchitectureFlagConditionsForSemanticFlagGroup.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFlagConditionForSemanticClass* BNGetArchitectureFlagConditionsForSemanticFlagGroup(BNArchitecture* arch, uint32_t semGroup, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetArchitectureFlagConditionsForSemanticFlagGroup" + )] + internal static extern IntPtr BNGetArchitectureFlagConditionsForSemanticFlagGroup( + + // BNArchitecture* arch + IntPtr arch , + + // uint32_t semGroup + uint semGroup , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetArchitectureFlagName.cs b/Function/BNGetArchitectureFlagName.cs new file mode 100644 index 0000000..a931a58 --- /dev/null +++ b/Function/BNGetArchitectureFlagName.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetArchitectureFlagName(BNArchitecture* arch, uint32_t flag) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetArchitectureFlagName" + )] + internal static extern IntPtr BNGetArchitectureFlagName( + + // BNArchitecture* arch + IntPtr arch , + + // uint32_t flag + FlagIndex flag + ); + } +} \ No newline at end of file diff --git a/Function/BNGetArchitectureFlagRole.cs b/Function/BNGetArchitectureFlagRole.cs new file mode 100644 index 0000000..48878ea --- /dev/null +++ b/Function/BNGetArchitectureFlagRole.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFlagRole BNGetArchitectureFlagRole(BNArchitecture* arch, uint32_t flag, uint32_t semClass) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetArchitectureFlagRole" + )] + internal static extern FlagRole BNGetArchitectureFlagRole( + + // BNArchitecture* arch + IntPtr arch , + + // uint32_t flag + uint flag , + + // uint32_t semClass + uint semClass + ); + } +} \ No newline at end of file diff --git a/Function/BNGetArchitectureFlagWriteLowLevelIL.cs b/Function/BNGetArchitectureFlagWriteLowLevelIL.cs new file mode 100644 index 0000000..8951cb7 --- /dev/null +++ b/Function/BNGetArchitectureFlagWriteLowLevelIL.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetArchitectureFlagWriteLowLevelIL(BNArchitecture* arch, BNLowLevelILOperation op, uint64_t size, uint32_t flagWriteType, uint32_t flag, BNRegisterOrConstant* operands, uint64_t operandCount, BNLowLevelILFunction* il) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetArchitectureFlagWriteLowLevelIL" + )] + internal static extern ulong BNGetArchitectureFlagWriteLowLevelIL( + + // BNArchitecture* arch + IntPtr arch , + + // BNLowLevelILOperation op + LowLevelILOperation op , + + // uint64_t size + ulong size , + + // uint32_t flagWriteType + uint flagWriteType , + + // uint32_t flag + uint flag , + + // BNRegisterOrConstant* operands + BNRegisterOrConstant[] operands , + + // uint64_t operandCount + ulong operandCount , + + // BNLowLevelILFunction* il + IntPtr il + ); + } +} \ No newline at end of file diff --git a/Function/BNGetArchitectureFlagWriteTypeName.cs b/Function/BNGetArchitectureFlagWriteTypeName.cs new file mode 100644 index 0000000..b0b6d43 --- /dev/null +++ b/Function/BNGetArchitectureFlagWriteTypeName.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetArchitectureFlagWriteTypeName(BNArchitecture* arch, uint32_t flags) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetArchitectureFlagWriteTypeName" + )] + internal static extern IntPtr BNGetArchitectureFlagWriteTypeName( + + // BNArchitecture* arch + IntPtr arch , + + // uint32_t flags + uint flags + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetArchitectureFlagsRequiredForFlagCondition.cs b/Function/BNGetArchitectureFlagsRequiredForFlagCondition.cs new file mode 100644 index 0000000..e271b90 --- /dev/null +++ b/Function/BNGetArchitectureFlagsRequiredForFlagCondition.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint32_t* BNGetArchitectureFlagsRequiredForFlagCondition(BNArchitecture* arch, BNLowLevelILFlagCondition cond, uint32_t semClass, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetArchitectureFlagsRequiredForFlagCondition" + )] + internal static extern IntPtr BNGetArchitectureFlagsRequiredForFlagCondition( + + // BNArchitecture* arch + IntPtr arch , + + // BNLowLevelILFlagCondition cond + LowLevelILFlagCondition cond , + + // uint32_t semClass + uint semClass , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetArchitectureFlagsRequiredForSemanticFlagGroup.cs b/Function/BNGetArchitectureFlagsRequiredForSemanticFlagGroup.cs new file mode 100644 index 0000000..d49c5ea --- /dev/null +++ b/Function/BNGetArchitectureFlagsRequiredForSemanticFlagGroup.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint32_t* BNGetArchitectureFlagsRequiredForSemanticFlagGroup(BNArchitecture* arch, uint32_t semGroup, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetArchitectureFlagsRequiredForSemanticFlagGroup" + )] + internal static extern IntPtr BNGetArchitectureFlagsRequiredForSemanticFlagGroup( + + // BNArchitecture* arch + IntPtr arch , + + // uint32_t semGroup + uint semGroup , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetArchitectureFlagsWrittenByFlagWriteType.cs b/Function/BNGetArchitectureFlagsWrittenByFlagWriteType.cs new file mode 100644 index 0000000..d6b15c2 --- /dev/null +++ b/Function/BNGetArchitectureFlagsWrittenByFlagWriteType.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint32_t* BNGetArchitectureFlagsWrittenByFlagWriteType(BNArchitecture* arch, uint32_t writeType, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetArchitectureFlagsWrittenByFlagWriteType" + )] + internal static extern IntPtr BNGetArchitectureFlagsWrittenByFlagWriteType( + + // BNArchitecture* arch + IntPtr arch , + + // uint32_t writeType + uint writeType , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetArchitectureForViewType.cs b/Function/BNGetArchitectureForViewType.cs new file mode 100644 index 0000000..39ab589 --- /dev/null +++ b/Function/BNGetArchitectureForViewType.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNArchitecture* BNGetArchitectureForViewType(BNBinaryViewType* type, uint32_t id, BNEndianness endian) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetArchitectureForViewType" + )] + internal static extern IntPtr BNGetArchitectureForViewType( + + // BNBinaryViewType* type + IntPtr type , + + // uint32_t id + uint id , + + // BNEndianness endian + Endianness endian + ); + } +} \ No newline at end of file diff --git a/Function/BNGetArchitectureGlobalRegisters.cs b/Function/BNGetArchitectureGlobalRegisters.cs new file mode 100644 index 0000000..6c9be7f --- /dev/null +++ b/Function/BNGetArchitectureGlobalRegisters.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint32_t* BNGetArchitectureGlobalRegisters(BNArchitecture* arch, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetArchitectureGlobalRegisters" + )] + internal static extern IntPtr BNGetArchitectureGlobalRegisters( + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetArchitectureInstructionAlignment.cs b/Function/BNGetArchitectureInstructionAlignment.cs new file mode 100644 index 0000000..595d1d9 --- /dev/null +++ b/Function/BNGetArchitectureInstructionAlignment.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetArchitectureInstructionAlignment(BNArchitecture* arch) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetArchitectureInstructionAlignment" + )] + internal static extern ulong BNGetArchitectureInstructionAlignment( + + // BNArchitecture* arch + IntPtr arch + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetArchitectureIntrinsicClass.cs b/Function/BNGetArchitectureIntrinsicClass.cs new file mode 100644 index 0000000..326fec2 --- /dev/null +++ b/Function/BNGetArchitectureIntrinsicClass.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNIntrinsicClass BNGetArchitectureIntrinsicClass(BNArchitecture* arch, uint32_t intrinsic) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetArchitectureIntrinsicClass" + )] + internal static extern IntrinsicClass BNGetArchitectureIntrinsicClass( + + // BNArchitecture* arch + IntPtr arch , + + // uint32_t intrinsic + IntrinsicIndex intrinsic + ); + } +} \ No newline at end of file diff --git a/Function/BNGetArchitectureIntrinsicInputs.cs b/Function/BNGetArchitectureIntrinsicInputs.cs new file mode 100644 index 0000000..291c998 --- /dev/null +++ b/Function/BNGetArchitectureIntrinsicInputs.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNNameAndType* BNGetArchitectureIntrinsicInputs(BNArchitecture* arch, uint32_t intrinsic, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetArchitectureIntrinsicInputs" + )] + internal static extern IntPtr BNGetArchitectureIntrinsicInputs( + + // BNArchitecture* arch + IntPtr arch , + + // uint32_t intrinsic + IntrinsicIndex intrinsic , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetArchitectureIntrinsicName.cs b/Function/BNGetArchitectureIntrinsicName.cs new file mode 100644 index 0000000..3730100 --- /dev/null +++ b/Function/BNGetArchitectureIntrinsicName.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// char* BNGetArchitectureIntrinsicName(BNArchitecture* arch, uint32_t intrinsic) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetArchitectureIntrinsicName" + )] + internal static extern IntPtr BNGetArchitectureIntrinsicName( + + // BNArchitecture* arch + IntPtr arch , + + // uint32_t intrinsic + IntrinsicIndex intrinsic + ); + } +} \ No newline at end of file diff --git a/Function/BNGetArchitectureIntrinsicOutputs.cs b/Function/BNGetArchitectureIntrinsicOutputs.cs new file mode 100644 index 0000000..3d9a906 --- /dev/null +++ b/Function/BNGetArchitectureIntrinsicOutputs.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeWithConfidence* BNGetArchitectureIntrinsicOutputs(BNArchitecture* arch, uint32_t intrinsic, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetArchitectureIntrinsicOutputs" + )] + internal static extern IntPtr BNGetArchitectureIntrinsicOutputs( + + // BNArchitecture* arch + IntPtr arch , + + // uint32_t intrinsic + IntrinsicIndex intrinsic , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetArchitectureLinkRegister.cs b/Function/BNGetArchitectureLinkRegister.cs new file mode 100644 index 0000000..5bcfeae --- /dev/null +++ b/Function/BNGetArchitectureLinkRegister.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint32_t BNGetArchitectureLinkRegister(BNArchitecture* arch) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetArchitectureLinkRegister" + )] + internal static extern uint BNGetArchitectureLinkRegister( + + // BNArchitecture* arch + IntPtr arch + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetArchitectureList.cs b/Function/BNGetArchitectureList.cs new file mode 100644 index 0000000..ceed88f --- /dev/null +++ b/Function/BNGetArchitectureList.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNArchitecture** BNGetArchitectureList(uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetArchitectureList" + )] + internal static extern IntPtr BNGetArchitectureList( + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetArchitectureMaxInstructionLength.cs b/Function/BNGetArchitectureMaxInstructionLength.cs new file mode 100644 index 0000000..e2be7a5 --- /dev/null +++ b/Function/BNGetArchitectureMaxInstructionLength.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetArchitectureMaxInstructionLength(BNArchitecture* arch) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetArchitectureMaxInstructionLength" + )] + internal static extern ulong BNGetArchitectureMaxInstructionLength( + + // BNArchitecture* arch + IntPtr arch + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetArchitectureName.cs b/Function/BNGetArchitectureName.cs new file mode 100644 index 0000000..49e275a --- /dev/null +++ b/Function/BNGetArchitectureName.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// char* BNGetArchitectureName(BNArchitecture* arch) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetArchitectureName" + )] + internal static extern IntPtr BNGetArchitectureName( + + // BNArchitecture* arch + IntPtr arch + ); + } +} \ No newline at end of file diff --git a/Function/BNGetArchitectureOpcodeDisplayLength.cs b/Function/BNGetArchitectureOpcodeDisplayLength.cs new file mode 100644 index 0000000..3a0a51c --- /dev/null +++ b/Function/BNGetArchitectureOpcodeDisplayLength.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetArchitectureOpcodeDisplayLength(BNArchitecture* arch) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetArchitectureOpcodeDisplayLength" + )] + internal static extern ulong BNGetArchitectureOpcodeDisplayLength( + + // BNArchitecture* arch + IntPtr arch + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetArchitectureRegisterByName.cs b/Function/BNGetArchitectureRegisterByName.cs new file mode 100644 index 0000000..4202e9c --- /dev/null +++ b/Function/BNGetArchitectureRegisterByName.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint32_t BNGetArchitectureRegisterByName(BNArchitecture* arch, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetArchitectureRegisterByName" + )] + internal static extern RegisterIndex BNGetArchitectureRegisterByName( + + // BNArchitecture* arch + IntPtr arch , + + // const char* name + string name + ); + } +} \ No newline at end of file diff --git a/Function/BNGetArchitectureRegisterInfo.cs b/Function/BNGetArchitectureRegisterInfo.cs new file mode 100644 index 0000000..aa23c86 --- /dev/null +++ b/Function/BNGetArchitectureRegisterInfo.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRegisterInfo BNGetArchitectureRegisterInfo(BNArchitecture* arch, uint32_t reg) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetArchitectureRegisterInfo" + )] + internal static extern BNRegisterInfo BNGetArchitectureRegisterInfo( + + // BNArchitecture* arch + IntPtr arch , + + // uint32_t reg + RegisterIndex reg + ); + } +} \ No newline at end of file diff --git a/Function/BNGetArchitectureRegisterName.cs b/Function/BNGetArchitectureRegisterName.cs new file mode 100644 index 0000000..a5b5c05 --- /dev/null +++ b/Function/BNGetArchitectureRegisterName.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// char* BNGetArchitectureRegisterName(BNArchitecture* arch, uint32_t reg) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetArchitectureRegisterName" + )] + internal static extern IntPtr BNGetArchitectureRegisterName( + + // BNArchitecture* arch + IntPtr arch , + + // uint32_t reg + RegisterIndex reg + ); + } +} \ No newline at end of file diff --git a/Function/BNGetArchitectureRegisterStackForRegister.cs b/Function/BNGetArchitectureRegisterStackForRegister.cs new file mode 100644 index 0000000..9129310 --- /dev/null +++ b/Function/BNGetArchitectureRegisterStackForRegister.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint32_t BNGetArchitectureRegisterStackForRegister(BNArchitecture* arch, uint32_t reg) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetArchitectureRegisterStackForRegister" + )] + internal static extern uint BNGetArchitectureRegisterStackForRegister( + + // BNArchitecture* arch + IntPtr arch , + + // uint32_t reg + uint reg + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetArchitectureRegisterStackInfo.cs b/Function/BNGetArchitectureRegisterStackInfo.cs new file mode 100644 index 0000000..14a99f4 --- /dev/null +++ b/Function/BNGetArchitectureRegisterStackInfo.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRegisterStackInfo BNGetArchitectureRegisterStackInfo(BNArchitecture* arch, uint32_t regStack) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetArchitectureRegisterStackInfo" + )] + internal static extern BNRegisterStackInfo BNGetArchitectureRegisterStackInfo( + + // BNArchitecture* arch + IntPtr arch , + + // uint32_t regStack + uint regStack + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetArchitectureRegisterStackName.cs b/Function/BNGetArchitectureRegisterStackName.cs new file mode 100644 index 0000000..c82203f --- /dev/null +++ b/Function/BNGetArchitectureRegisterStackName.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// char* BNGetArchitectureRegisterStackName(BNArchitecture* arch, uint32_t regStack) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetArchitectureRegisterStackName" + )] + internal static extern IntPtr BNGetArchitectureRegisterStackName( + + // BNArchitecture* arch + IntPtr arch , + + // uint32_t regStack + RegisterStackIndex regStack + ); + } +} \ No newline at end of file diff --git a/Function/BNGetArchitectureSemanticClassForFlagWriteType.cs b/Function/BNGetArchitectureSemanticClassForFlagWriteType.cs new file mode 100644 index 0000000..646d7ec --- /dev/null +++ b/Function/BNGetArchitectureSemanticClassForFlagWriteType.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint32_t BNGetArchitectureSemanticClassForFlagWriteType(BNArchitecture* arch, uint32_t writeType) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetArchitectureSemanticClassForFlagWriteType" + )] + internal static extern uint BNGetArchitectureSemanticClassForFlagWriteType( + + // BNArchitecture* arch + IntPtr arch , + + // uint32_t writeType + uint writeType + ); + } +} \ No newline at end of file diff --git a/Function/BNGetArchitectureSemanticFlagClassName.cs b/Function/BNGetArchitectureSemanticFlagClassName.cs new file mode 100644 index 0000000..192bc99 --- /dev/null +++ b/Function/BNGetArchitectureSemanticFlagClassName.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// char* BNGetArchitectureSemanticFlagClassName(BNArchitecture* arch, uint32_t semClass) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetArchitectureSemanticFlagClassName" + )] + internal static extern IntPtr BNGetArchitectureSemanticFlagClassName( + + // BNArchitecture* arch + IntPtr arch , + + // uint32_t semClass + SemanticFlagClassIndex semClass + ); + } +} \ No newline at end of file diff --git a/Function/BNGetArchitectureSemanticFlagGroupLowLevelIL.cs b/Function/BNGetArchitectureSemanticFlagGroupLowLevelIL.cs new file mode 100644 index 0000000..b9ad3e4 --- /dev/null +++ b/Function/BNGetArchitectureSemanticFlagGroupLowLevelIL.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetArchitectureSemanticFlagGroupLowLevelIL(BNArchitecture* arch, uint32_t semGroup, BNLowLevelILFunction* il) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetArchitectureSemanticFlagGroupLowLevelIL" + )] + internal static extern ulong BNGetArchitectureSemanticFlagGroupLowLevelIL( + + // BNArchitecture* arch + IntPtr arch , + + // uint32_t semGroup + uint semGroup , + + // BNLowLevelILFunction* il + IntPtr il + ); + } +} \ No newline at end of file diff --git a/Function/BNGetArchitectureSemanticFlagGroupName.cs b/Function/BNGetArchitectureSemanticFlagGroupName.cs new file mode 100644 index 0000000..51bd1e7 --- /dev/null +++ b/Function/BNGetArchitectureSemanticFlagGroupName.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// char* BNGetArchitectureSemanticFlagGroupName(BNArchitecture* arch, uint32_t semGroup) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetArchitectureSemanticFlagGroupName" + )] + internal static extern IntPtr BNGetArchitectureSemanticFlagGroupName( + + // BNArchitecture* arch + IntPtr arch , + + // uint32_t semGroup + SemanticFlagGroupIndex semGroup + ); + } +} \ No newline at end of file diff --git a/Function/BNGetArchitectureStackPointerRegister.cs b/Function/BNGetArchitectureStackPointerRegister.cs new file mode 100644 index 0000000..63caa2d --- /dev/null +++ b/Function/BNGetArchitectureStackPointerRegister.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint32_t BNGetArchitectureStackPointerRegister(BNArchitecture* arch) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetArchitectureStackPointerRegister" + )] + internal static extern uint BNGetArchitectureStackPointerRegister( + + // BNArchitecture* arch + IntPtr arch + ); + } +} \ No newline at end of file diff --git a/Function/BNGetArchitectureStandalonePlatform.cs b/Function/BNGetArchitectureStandalonePlatform.cs new file mode 100644 index 0000000..2b8b7e7 --- /dev/null +++ b/Function/BNGetArchitectureStandalonePlatform.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNPlatform* BNGetArchitectureStandalonePlatform(BNArchitecture* arch) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetArchitectureStandalonePlatform" + )] + internal static extern IntPtr BNGetArchitectureStandalonePlatform( + + // BNArchitecture* arch + IntPtr arch + ); + } +} \ No newline at end of file diff --git a/Function/BNGetArchitectureStdcallCallingConvention.cs b/Function/BNGetArchitectureStdcallCallingConvention.cs new file mode 100644 index 0000000..3c131c9 --- /dev/null +++ b/Function/BNGetArchitectureStdcallCallingConvention.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNCallingConvention* BNGetArchitectureStdcallCallingConvention(BNArchitecture* arch) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetArchitectureStdcallCallingConvention" + )] + internal static extern IntPtr BNGetArchitectureStdcallCallingConvention( + + // BNArchitecture* arch + IntPtr arch + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetArchitectureSystemRegisters.cs b/Function/BNGetArchitectureSystemRegisters.cs new file mode 100644 index 0000000..d830e39 --- /dev/null +++ b/Function/BNGetArchitectureSystemRegisters.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint32_t* BNGetArchitectureSystemRegisters(BNArchitecture* arch, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetArchitectureSystemRegisters" + )] + internal static extern IntPtr BNGetArchitectureSystemRegisters( + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetArchitectureTypeLibraries.cs b/Function/BNGetArchitectureTypeLibraries.cs new file mode 100644 index 0000000..89f833b --- /dev/null +++ b/Function/BNGetArchitectureTypeLibraries.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeLibrary** BNGetArchitectureTypeLibraries(BNArchitecture* arch, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetArchitectureTypeLibraries" + )] + internal static extern IntPtr BNGetArchitectureTypeLibraries( + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetAssociatedArchitectureByAddress.cs b/Function/BNGetAssociatedArchitectureByAddress.cs new file mode 100644 index 0000000..6acdc30 --- /dev/null +++ b/Function/BNGetAssociatedArchitectureByAddress.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNArchitecture* BNGetAssociatedArchitectureByAddress(BNArchitecture* arch, uint64_t* addr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetAssociatedArchitectureByAddress" + )] + internal static extern IntPtr BNGetAssociatedArchitectureByAddress( + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t* addr + ref ulong addr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetAssociatedPlatformByAddress.cs b/Function/BNGetAssociatedPlatformByAddress.cs new file mode 100644 index 0000000..1bd2c1f --- /dev/null +++ b/Function/BNGetAssociatedPlatformByAddress.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNPlatform* BNGetAssociatedPlatformByAddress(BNPlatform* platform, uint64_t* addr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetAssociatedPlatformByAddress" + )] + internal static extern IntPtr BNGetAssociatedPlatformByAddress( + + // BNPlatform* platform + IntPtr platform , + + // uint64_t* addr + ref ulong addr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetAutoAddressTagReferences.cs b/Function/BNGetAutoAddressTagReferences.cs new file mode 100644 index 0000000..8d5c991 --- /dev/null +++ b/Function/BNGetAutoAddressTagReferences.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTagReference* BNGetAutoAddressTagReferences(BNFunction* func, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetAutoAddressTagReferences" + )] + internal static extern IntPtr BNGetAutoAddressTagReferences( + + // BNFunction* func + IntPtr func , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetAutoAddressTags.cs b/Function/BNGetAutoAddressTags.cs new file mode 100644 index 0000000..96f661f --- /dev/null +++ b/Function/BNGetAutoAddressTags.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTag** BNGetAutoAddressTags(BNFunction* func, BNArchitecture* arch, uint64_t addr, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetAutoAddressTags" + )] + internal static extern IntPtr BNGetAutoAddressTags( + + // BNFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t addr + ulong addr , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetAutoAddressTagsInRange.cs b/Function/BNGetAutoAddressTagsInRange.cs new file mode 100644 index 0000000..c94b70d --- /dev/null +++ b/Function/BNGetAutoAddressTagsInRange.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTagReference* BNGetAutoAddressTagsInRange(BNFunction* func, BNArchitecture* arch, uint64_t start, uint64_t end, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetAutoAddressTagsInRange" + )] + internal static extern IntPtr BNGetAutoAddressTagsInRange( + + // BNFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t start + ulong start , + + // uint64_t end + ulong end , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetAutoAddressTagsOfType.cs b/Function/BNGetAutoAddressTagsOfType.cs new file mode 100644 index 0000000..30aa33b --- /dev/null +++ b/Function/BNGetAutoAddressTagsOfType.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTag** BNGetAutoAddressTagsOfType(BNFunction* func, BNArchitecture* arch, uint64_t addr, BNTagType* tagType, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetAutoAddressTagsOfType" + )] + internal static extern IntPtr BNGetAutoAddressTagsOfType( + + // BNFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t addr + ulong addr , + + // BNTagType* tagType + IntPtr tagType , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetAutoDataTagReferences.cs b/Function/BNGetAutoDataTagReferences.cs new file mode 100644 index 0000000..5831076 --- /dev/null +++ b/Function/BNGetAutoDataTagReferences.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTagReference* BNGetAutoDataTagReferences(BNBinaryView* view, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetAutoDataTagReferences" + )] + internal static extern IntPtr BNGetAutoDataTagReferences( + + // BNBinaryView* view + IntPtr view , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetAutoDataTags.cs b/Function/BNGetAutoDataTags.cs new file mode 100644 index 0000000..7b3796d --- /dev/null +++ b/Function/BNGetAutoDataTags.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTag** BNGetAutoDataTags(BNBinaryView* view, uint64_t addr, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetAutoDataTags" + )] + internal static extern IntPtr BNGetAutoDataTags( + + // BNBinaryView* view + IntPtr view , + + // uint64_t addr + ulong addr , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetAutoDataTagsInRange.cs b/Function/BNGetAutoDataTagsInRange.cs new file mode 100644 index 0000000..c3d56c8 --- /dev/null +++ b/Function/BNGetAutoDataTagsInRange.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTagReference* BNGetAutoDataTagsInRange(BNBinaryView* view, uint64_t start, uint64_t end, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetAutoDataTagsInRange" + )] + internal static extern IntPtr BNGetAutoDataTagsInRange( + + // BNBinaryView* view + IntPtr view , + + // uint64_t start + ulong start , + + // uint64_t end + ulong end , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetAutoDataTagsOfType.cs b/Function/BNGetAutoDataTagsOfType.cs new file mode 100644 index 0000000..c9382c6 --- /dev/null +++ b/Function/BNGetAutoDataTagsOfType.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTag** BNGetAutoDataTagsOfType(BNBinaryView* view, uint64_t addr, BNTagType* tagType, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetAutoDataTagsOfType" + )] + internal static extern IntPtr BNGetAutoDataTagsOfType( + + // BNBinaryView* view + IntPtr view , + + // uint64_t addr + ulong addr , + + // BNTagType* tagType + IntPtr tagType , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetAutoDebugTypeIdSource.cs b/Function/BNGetAutoDebugTypeIdSource.cs new file mode 100644 index 0000000..7ca5bb9 --- /dev/null +++ b/Function/BNGetAutoDebugTypeIdSource.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public static partial class Core + { + public static string GetAutoDebugTypeIdSource() + { + return UnsafeUtils.TakeAnsiString( + BinaryNinja.NativeMethods.BNGetAutoDebugTypeIdSource() + ); + } + } + + internal static partial class NativeMethods + { + /// + /// char* BNGetAutoDebugTypeIdSource() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetAutoDebugTypeIdSource" + )] + internal static extern IntPtr BNGetAutoDebugTypeIdSource(); + } +} \ No newline at end of file diff --git a/Function/BNGetAutoDemangledTypeIdSource.cs b/Function/BNGetAutoDemangledTypeIdSource.cs new file mode 100644 index 0000000..f0180e0 --- /dev/null +++ b/Function/BNGetAutoDemangledTypeIdSource.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public static partial class Core + { + public static string GetAutoDemangledTypeIdSource() + { + return UnsafeUtils.TakeAnsiString( + NativeMethods.BNGetAutoDemangledTypeIdSource() + ); + } + } + + internal static partial class NativeMethods + { + /// + /// char* BNGetAutoDemangledTypeIdSource() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetAutoDemangledTypeIdSource" + )] + internal static extern IntPtr BNGetAutoDemangledTypeIdSource(); + } +} \ No newline at end of file diff --git a/Function/BNGetAutoFunctionTagReferences.cs b/Function/BNGetAutoFunctionTagReferences.cs new file mode 100644 index 0000000..0f36307 --- /dev/null +++ b/Function/BNGetAutoFunctionTagReferences.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTagReference* BNGetAutoFunctionTagReferences(BNFunction* func, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetAutoFunctionTagReferences" + )] + internal static extern IntPtr BNGetAutoFunctionTagReferences( + + // BNFunction* func + IntPtr func , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetAutoFunctionTags.cs b/Function/BNGetAutoFunctionTags.cs new file mode 100644 index 0000000..82492bb --- /dev/null +++ b/Function/BNGetAutoFunctionTags.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTag** BNGetAutoFunctionTags(BNFunction* func, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetAutoFunctionTags" + )] + internal static extern IntPtr BNGetAutoFunctionTags( + + // BNFunction* func + IntPtr func , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetAutoFunctionTagsOfType.cs b/Function/BNGetAutoFunctionTagsOfType.cs new file mode 100644 index 0000000..d282983 --- /dev/null +++ b/Function/BNGetAutoFunctionTagsOfType.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTag** BNGetAutoFunctionTagsOfType(BNFunction* func, BNTagType* tagType, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetAutoFunctionTagsOfType" + )] + internal static extern IntPtr BNGetAutoFunctionTagsOfType( + + // BNFunction* func + IntPtr func , + + // BNTagType* tagType + IntPtr tagType , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetAutoPlatformTypeIdSource.cs b/Function/BNGetAutoPlatformTypeIdSource.cs new file mode 100644 index 0000000..a9fc28a --- /dev/null +++ b/Function/BNGetAutoPlatformTypeIdSource.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetAutoPlatformTypeIdSource(BNPlatform* platform) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetAutoPlatformTypeIdSource" + )] + internal static extern IntPtr BNGetAutoPlatformTypeIdSource( + + // BNPlatform* platform + IntPtr platform + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetBackedAddressRanges.cs b/Function/BNGetBackedAddressRanges.cs new file mode 100644 index 0000000..1b84ffe --- /dev/null +++ b/Function/BNGetBackedAddressRanges.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNAddressRange* BNGetBackedAddressRanges(BNBinaryView* view, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetBackedAddressRanges" + )] + internal static extern IntPtr BNGetBackedAddressRanges( + + // BNBinaryView* view + IntPtr view , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetBackgroundAnalysisTask.cs b/Function/BNGetBackgroundAnalysisTask.cs new file mode 100644 index 0000000..b4fbd8d --- /dev/null +++ b/Function/BNGetBackgroundAnalysisTask.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBackgroundTask* BNGetBackgroundAnalysisTask(BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetBackgroundAnalysisTask" + )] + internal static extern IntPtr BNGetBackgroundAnalysisTask( + + // BNBinaryView* view + IntPtr view + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetBackgroundTaskProgressText.cs b/Function/BNGetBackgroundTaskProgressText.cs new file mode 100644 index 0000000..1ff3ae4 --- /dev/null +++ b/Function/BNGetBackgroundTaskProgressText.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// char* BNGetBackgroundTaskProgressText(BNBackgroundTask* task) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetBackgroundTaskProgressText" + )] + internal static extern IntPtr BNGetBackgroundTaskProgressText( + + // BNBackgroundTask* task + IntPtr task + ); + } +} \ No newline at end of file diff --git a/Function/BNGetBackgroundTaskRuntimeSeconds.cs b/Function/BNGetBackgroundTaskRuntimeSeconds.cs new file mode 100644 index 0000000..1c1301d --- /dev/null +++ b/Function/BNGetBackgroundTaskRuntimeSeconds.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetBackgroundTaskRuntimeSeconds(BNBackgroundTask* task) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetBackgroundTaskRuntimeSeconds" + )] + internal static extern ulong BNGetBackgroundTaskRuntimeSeconds( + + // BNBackgroundTask* task + IntPtr task + ); + } +} \ No newline at end of file diff --git a/Function/BNGetBaseAddressDetectionReasons.cs b/Function/BNGetBaseAddressDetectionReasons.cs new file mode 100644 index 0000000..8e56d4b --- /dev/null +++ b/Function/BNGetBaseAddressDetectionReasons.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBaseAddressDetectionReason* BNGetBaseAddressDetectionReasons(BNBaseAddressDetection* bad, uint64_t baseAddress, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetBaseAddressDetectionReasons" + )] + internal static extern IntPtr BNGetBaseAddressDetectionReasons( + + // BNBaseAddressDetection* bad + IntPtr bad , + + // uint64_t baseAddress + ulong baseAddress , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetBaseAddressDetectionScores.cs b/Function/BNGetBaseAddressDetectionScores.cs new file mode 100644 index 0000000..afbd16d --- /dev/null +++ b/Function/BNGetBaseAddressDetectionScores.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetBaseAddressDetectionScores(BNBaseAddressDetection* bad, BNBaseAddressDetectionScore* scores, uint64_t count, BNBaseAddressDetectionConfidence* confidence, uint64_t* lastTestedBaseAddress) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetBaseAddressDetectionScores" + )] + internal static extern ulong BNGetBaseAddressDetectionScores( + + // BNBaseAddressDetection* bad + IntPtr bad , + + // BNBaseAddressDetectionScore* scores + IntPtr scores , + + // uint64_t count + ulong count , + + // BNBaseAddressDetectionConfidence* confidence + IntPtr confidence , + + // uint64_t* lastTestedBaseAddress + IntPtr lastTestedBaseAddress + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetBaseMemoryMapDescription.cs b/Function/BNGetBaseMemoryMapDescription.cs new file mode 100644 index 0000000..1b91283 --- /dev/null +++ b/Function/BNGetBaseMemoryMapDescription.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// char* BNGetBaseMemoryMapDescription(BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetBaseMemoryMapDescription" + )] + internal static extern IntPtr BNGetBaseMemoryMapDescription( + + // BNBinaryView* view + IntPtr view + ); + } +} \ No newline at end of file diff --git a/Function/BNGetBaseStructuresForStructure.cs b/Function/BNGetBaseStructuresForStructure.cs new file mode 100644 index 0000000..6e1c798 --- /dev/null +++ b/Function/BNGetBaseStructuresForStructure.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBaseStructure* BNGetBaseStructuresForStructure(BNStructure* s, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetBaseStructuresForStructure" + )] + internal static extern IntPtr BNGetBaseStructuresForStructure( + + // BNStructure* s + IntPtr s , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetBaseStructuresForStructureBuilder.cs b/Function/BNGetBaseStructuresForStructureBuilder.cs new file mode 100644 index 0000000..ec51813 --- /dev/null +++ b/Function/BNGetBaseStructuresForStructureBuilder.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBaseStructure* BNGetBaseStructuresForStructureBuilder(BNStructureBuilder* s, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetBaseStructuresForStructureBuilder" + )] + internal static extern IntPtr BNGetBaseStructuresForStructureBuilder( + + // BNStructureBuilder* s + IntPtr s , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetBasicBlockArchitecture.cs b/Function/BNGetBasicBlockArchitecture.cs new file mode 100644 index 0000000..0816678 --- /dev/null +++ b/Function/BNGetBasicBlockArchitecture.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNArchitecture* BNGetBasicBlockArchitecture(BNBasicBlock* block) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetBasicBlockArchitecture" + )] + internal static extern IntPtr BNGetBasicBlockArchitecture( + + // BNBasicBlock* block + IntPtr block + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetBasicBlockDisassemblyText.cs b/Function/BNGetBasicBlockDisassemblyText.cs new file mode 100644 index 0000000..577b921 --- /dev/null +++ b/Function/BNGetBasicBlockDisassemblyText.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDisassemblyTextLine* BNGetBasicBlockDisassemblyText(BNBasicBlock* block, BNDisassemblySettings* settings, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetBasicBlockDisassemblyText" + )] + internal static extern IntPtr BNGetBasicBlockDisassemblyText( + + // BNBasicBlock* block + IntPtr block , + + // BNDisassemblySettings* settings + IntPtr settings , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetBasicBlockDominanceFrontier.cs b/Function/BNGetBasicBlockDominanceFrontier.cs new file mode 100644 index 0000000..8415984 --- /dev/null +++ b/Function/BNGetBasicBlockDominanceFrontier.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBasicBlock** BNGetBasicBlockDominanceFrontier(BNBasicBlock* block, uint64_t* count, bool post) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetBasicBlockDominanceFrontier" + )] + internal static extern IntPtr BNGetBasicBlockDominanceFrontier( + + // BNBasicBlock* block + IntPtr block , + + // uint64_t* count + out ulong count , + + // bool post + bool post + ); + } +} \ No newline at end of file diff --git a/Function/BNGetBasicBlockDominatorTreeChildren.cs b/Function/BNGetBasicBlockDominatorTreeChildren.cs new file mode 100644 index 0000000..f079b93 --- /dev/null +++ b/Function/BNGetBasicBlockDominatorTreeChildren.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBasicBlock** BNGetBasicBlockDominatorTreeChildren(BNBasicBlock* block, uint64_t* count, bool post) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetBasicBlockDominatorTreeChildren" + )] + internal static extern IntPtr BNGetBasicBlockDominatorTreeChildren( + + // BNBasicBlock* block + IntPtr block , + + // uint64_t* count + out ulong count , + + // bool post + bool post + ); + } +} \ No newline at end of file diff --git a/Function/BNGetBasicBlockDominators.cs b/Function/BNGetBasicBlockDominators.cs new file mode 100644 index 0000000..219e171 --- /dev/null +++ b/Function/BNGetBasicBlockDominators.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBasicBlock** BNGetBasicBlockDominators(BNBasicBlock* block, uint64_t* count, bool post) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetBasicBlockDominators" + )] + internal static extern IntPtr BNGetBasicBlockDominators( + + // BNBasicBlock* block + IntPtr block , + + // uint64_t* count + out ulong count , + + // bool post + bool post + ); + } +} \ No newline at end of file diff --git a/Function/BNGetBasicBlockEnd.cs b/Function/BNGetBasicBlockEnd.cs new file mode 100644 index 0000000..263bfe3 --- /dev/null +++ b/Function/BNGetBasicBlockEnd.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetBasicBlockEnd(BNBasicBlock* block) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetBasicBlockEnd" + )] + internal static extern ulong BNGetBasicBlockEnd( + + // BNBasicBlock* block + IntPtr block + ); + } +} \ No newline at end of file diff --git a/Function/BNGetBasicBlockFunction.cs b/Function/BNGetBasicBlockFunction.cs new file mode 100644 index 0000000..aed44dd --- /dev/null +++ b/Function/BNGetBasicBlockFunction.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFunction* BNGetBasicBlockFunction(BNBasicBlock* block) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetBasicBlockFunction" + )] + internal static extern IntPtr BNGetBasicBlockFunction( + + // BNBasicBlock* block + IntPtr block + ); + } +} \ No newline at end of file diff --git a/Function/BNGetBasicBlockFunctionGraphType.cs b/Function/BNGetBasicBlockFunctionGraphType.cs new file mode 100644 index 0000000..219863f --- /dev/null +++ b/Function/BNGetBasicBlockFunctionGraphType.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFunctionGraphType BNGetBasicBlockFunctionGraphType(BNBasicBlock* block) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetBasicBlockFunctionGraphType" + )] + internal static extern FunctionGraphType BNGetBasicBlockFunctionGraphType( + + // BNBasicBlock* block + IntPtr block + ); + } +} \ No newline at end of file diff --git a/Function/BNGetBasicBlockHighLevelILFunction.cs b/Function/BNGetBasicBlockHighLevelILFunction.cs new file mode 100644 index 0000000..7f442d6 --- /dev/null +++ b/Function/BNGetBasicBlockHighLevelILFunction.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNHighLevelILFunction* BNGetBasicBlockHighLevelILFunction(BNBasicBlock* block) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetBasicBlockHighLevelILFunction" + )] + internal static extern IntPtr BNGetBasicBlockHighLevelILFunction( + + // BNBasicBlock* block + IntPtr block + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetBasicBlockHighlight.cs b/Function/BNGetBasicBlockHighlight.cs new file mode 100644 index 0000000..3550f18 --- /dev/null +++ b/Function/BNGetBasicBlockHighlight.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNHighlightColor BNGetBasicBlockHighlight(BNBasicBlock* block) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetBasicBlockHighlight" + )] + internal static extern BNHighlightColor BNGetBasicBlockHighlight( + + // BNBasicBlock* block + IntPtr block + ); + } +} \ No newline at end of file diff --git a/Function/BNGetBasicBlockImmediateDominator.cs b/Function/BNGetBasicBlockImmediateDominator.cs new file mode 100644 index 0000000..c1ec622 --- /dev/null +++ b/Function/BNGetBasicBlockImmediateDominator.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBasicBlock* BNGetBasicBlockImmediateDominator(BNBasicBlock* block, bool post) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetBasicBlockImmediateDominator" + )] + internal static extern IntPtr BNGetBasicBlockImmediateDominator( + + // BNBasicBlock* block + IntPtr block , + + // bool post + bool post + ); + } +} \ No newline at end of file diff --git a/Function/BNGetBasicBlockIncomingEdges.cs b/Function/BNGetBasicBlockIncomingEdges.cs new file mode 100644 index 0000000..036d093 --- /dev/null +++ b/Function/BNGetBasicBlockIncomingEdges.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBasicBlockEdge* BNGetBasicBlockIncomingEdges(BNBasicBlock* block, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetBasicBlockIncomingEdges" + )] + internal static extern IntPtr BNGetBasicBlockIncomingEdges( + + // BNBasicBlock* block + IntPtr block , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetBasicBlockIndex.cs b/Function/BNGetBasicBlockIndex.cs new file mode 100644 index 0000000..bd81aeb --- /dev/null +++ b/Function/BNGetBasicBlockIndex.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetBasicBlockIndex(BNBasicBlock* block) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetBasicBlockIndex" + )] + internal static extern ulong BNGetBasicBlockIndex( + + // BNBasicBlock* block + IntPtr block + ); + } +} \ No newline at end of file diff --git a/Function/BNGetBasicBlockInstructionContainingAddress.cs b/Function/BNGetBasicBlockInstructionContainingAddress.cs new file mode 100644 index 0000000..357965f --- /dev/null +++ b/Function/BNGetBasicBlockInstructionContainingAddress.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNGetBasicBlockInstructionContainingAddress(BNBasicBlock* block, uint64_t addr, uint64_t* start) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetBasicBlockInstructionContainingAddress" + )] + internal static extern bool BNGetBasicBlockInstructionContainingAddress( + + // BNBasicBlock* block + IntPtr block , + + // uint64_t addr + ulong addr , + + // uint64_t* start + out ulong start + ); + } +} \ No newline at end of file diff --git a/Function/BNGetBasicBlockIteratedDominanceFrontier.cs b/Function/BNGetBasicBlockIteratedDominanceFrontier.cs new file mode 100644 index 0000000..0703bee --- /dev/null +++ b/Function/BNGetBasicBlockIteratedDominanceFrontier.cs @@ -0,0 +1,59 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public static partial class Core + { + public static BasicBlock[] GetIteratedDominanceFrontier(BasicBlock[] blocks) + { + if (0 == blocks.Length) + { + return Array.Empty(); + } + + using (ScopedAllocator allocator = new ScopedAllocator()) + { + ulong outputCount = 0; + + IntPtr arrayPointer = NativeMethods.BNGetBasicBlockIteratedDominanceFrontier( + allocator.AllocHandleArray(blocks), + (ulong)blocks.Length , + out outputCount + ); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer , + outputCount , + BasicBlock.MustNewFromHandle , + BinaryNinja.NativeMethods.BNFreeBasicBlockList + ); + } + } + } + + internal static partial class NativeMethods + { + /// + /// BNBasicBlock** BNGetBasicBlockIteratedDominanceFrontier(BNBasicBlock** blocks, uint64_t incomingCount, uint64_t* outputCount) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetBasicBlockIteratedDominanceFrontier" + )] + internal static extern IntPtr BNGetBasicBlockIteratedDominanceFrontier( + + // BNBasicBlock** blocks + IntPtr blocks , + + // uint64_t incomingCount + ulong incomingCount , + + // uint64_t* outputCount + out ulong outputCount + ); + } +} \ No newline at end of file diff --git a/Function/BNGetBasicBlockLength.cs b/Function/BNGetBasicBlockLength.cs new file mode 100644 index 0000000..ebe59ba --- /dev/null +++ b/Function/BNGetBasicBlockLength.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetBasicBlockLength(BNBasicBlock* block) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetBasicBlockLength" + )] + internal static extern ulong BNGetBasicBlockLength( + + // BNBasicBlock* block + IntPtr block + ); + } +} \ No newline at end of file diff --git a/Function/BNGetBasicBlockLowLevelILFunction.cs b/Function/BNGetBasicBlockLowLevelILFunction.cs new file mode 100644 index 0000000..b77bd00 --- /dev/null +++ b/Function/BNGetBasicBlockLowLevelILFunction.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLowLevelILFunction* BNGetBasicBlockLowLevelILFunction(BNBasicBlock* block) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetBasicBlockLowLevelILFunction" + )] + internal static extern IntPtr BNGetBasicBlockLowLevelILFunction( + + // BNBasicBlock* block + IntPtr block + ); + } +} \ No newline at end of file diff --git a/Function/BNGetBasicBlockMediumLevelILFunction.cs b/Function/BNGetBasicBlockMediumLevelILFunction.cs new file mode 100644 index 0000000..d2ab338 --- /dev/null +++ b/Function/BNGetBasicBlockMediumLevelILFunction.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNMediumLevelILFunction* BNGetBasicBlockMediumLevelILFunction(BNBasicBlock* block) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetBasicBlockMediumLevelILFunction" + )] + internal static extern IntPtr BNGetBasicBlockMediumLevelILFunction( + + // BNBasicBlock* block + IntPtr block + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetBasicBlockOutgoingEdges.cs b/Function/BNGetBasicBlockOutgoingEdges.cs new file mode 100644 index 0000000..26fc3d3 --- /dev/null +++ b/Function/BNGetBasicBlockOutgoingEdges.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBasicBlockEdge* BNGetBasicBlockOutgoingEdges(BNBasicBlock* block, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetBasicBlockOutgoingEdges" + )] + internal static extern IntPtr BNGetBasicBlockOutgoingEdges( + + // BNBasicBlock* block + IntPtr block , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetBasicBlockPendingOutgoingEdges.cs b/Function/BNGetBasicBlockPendingOutgoingEdges.cs new file mode 100644 index 0000000..de1648a --- /dev/null +++ b/Function/BNGetBasicBlockPendingOutgoingEdges.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNPendingBasicBlockEdge* BNGetBasicBlockPendingOutgoingEdges(BNBasicBlock* block, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetBasicBlockPendingOutgoingEdges" + )] + internal static extern IntPtr BNGetBasicBlockPendingOutgoingEdges( + + // BNBasicBlock* block + IntPtr block , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetBasicBlockSource.cs b/Function/BNGetBasicBlockSource.cs new file mode 100644 index 0000000..cf34676 --- /dev/null +++ b/Function/BNGetBasicBlockSource.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBasicBlock* BNGetBasicBlockSource(BNBasicBlock* block) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetBasicBlockSource" + )] + internal static extern IntPtr BNGetBasicBlockSource( + + // BNBasicBlock* block + IntPtr block + ); + } +} \ No newline at end of file diff --git a/Function/BNGetBasicBlockSourceBlock.cs b/Function/BNGetBasicBlockSourceBlock.cs new file mode 100644 index 0000000..5820e12 --- /dev/null +++ b/Function/BNGetBasicBlockSourceBlock.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBasicBlock* BNGetBasicBlockSourceBlock(BNBasicBlock* block) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetBasicBlockSourceBlock" + )] + internal static extern IntPtr BNGetBasicBlockSourceBlock( + + // BNBasicBlock* block + IntPtr block + ); + } +} \ No newline at end of file diff --git a/Function/BNGetBasicBlockStart.cs b/Function/BNGetBasicBlockStart.cs new file mode 100644 index 0000000..fff4760 --- /dev/null +++ b/Function/BNGetBasicBlockStart.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetBasicBlockStart(BNBasicBlock* block) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetBasicBlockStart" + )] + internal static extern ulong BNGetBasicBlockStart( + + // BNBasicBlock* block + IntPtr block + ); + } +} \ No newline at end of file diff --git a/Function/BNGetBasicBlockStrictDominators.cs b/Function/BNGetBasicBlockStrictDominators.cs new file mode 100644 index 0000000..4a00f42 --- /dev/null +++ b/Function/BNGetBasicBlockStrictDominators.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBasicBlock** BNGetBasicBlockStrictDominators(BNBasicBlock* block, uint64_t* count, bool post) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetBasicBlockStrictDominators" + )] + internal static extern IntPtr BNGetBasicBlockStrictDominators( + + // BNBasicBlock* block + IntPtr block , + + // uint64_t* count + out ulong count , + + // bool post + bool post + ); + } +} \ No newline at end of file diff --git a/Function/BNGetBasicBlocksForAddress.cs b/Function/BNGetBasicBlocksForAddress.cs new file mode 100644 index 0000000..1e66068 --- /dev/null +++ b/Function/BNGetBasicBlocksForAddress.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBasicBlock** BNGetBasicBlocksForAddress(BNBinaryView* view, uint64_t addr, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetBasicBlocksForAddress" + )] + internal static extern IntPtr BNGetBasicBlocksForAddress( + + // BNBinaryView* view + IntPtr view , + + // uint64_t addr + ulong addr , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetBasicBlocksStartingAtAddress.cs b/Function/BNGetBasicBlocksStartingAtAddress.cs new file mode 100644 index 0000000..b8eadd5 --- /dev/null +++ b/Function/BNGetBasicBlocksStartingAtAddress.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBasicBlock** BNGetBasicBlocksStartingAtAddress(BNBinaryView* view, uint64_t addr, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetBasicBlocksStartingAtAddress" + )] + internal static extern IntPtr BNGetBasicBlocksStartingAtAddress( + + // BNBinaryView* view + IntPtr view , + + // uint64_t addr + ulong addr , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetBinaryReaderEndianness.cs b/Function/BNGetBinaryReaderEndianness.cs new file mode 100644 index 0000000..25826d8 --- /dev/null +++ b/Function/BNGetBinaryReaderEndianness.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNEndianness BNGetBinaryReaderEndianness(BNBinaryReader* stream) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetBinaryReaderEndianness" + )] + internal static extern Endianness BNGetBinaryReaderEndianness( + + // BNBinaryReader* stream + IntPtr stream + ); + } +} \ No newline at end of file diff --git a/Function/BNGetBinaryReaderVirtualBase.cs b/Function/BNGetBinaryReaderVirtualBase.cs new file mode 100644 index 0000000..0dfe06c --- /dev/null +++ b/Function/BNGetBinaryReaderVirtualBase.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetBinaryReaderVirtualBase(BNBinaryReader* stream) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetBinaryReaderVirtualBase" + )] + internal static extern ulong BNGetBinaryReaderVirtualBase( + + // BNBinaryReader* stream + IntPtr stream + ); + } +} \ No newline at end of file diff --git a/Function/BNGetBinaryViewDefaultLoadSettingsForData.cs b/Function/BNGetBinaryViewDefaultLoadSettingsForData.cs new file mode 100644 index 0000000..b239a96 --- /dev/null +++ b/Function/BNGetBinaryViewDefaultLoadSettingsForData.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNSettings* BNGetBinaryViewDefaultLoadSettingsForData(BNBinaryViewType* type, BNBinaryView* data) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetBinaryViewDefaultLoadSettingsForData" + )] + internal static extern IntPtr BNGetBinaryViewDefaultLoadSettingsForData( + + // BNBinaryViewType* type + IntPtr type , + + // BNBinaryView* data + IntPtr data + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetBinaryViewLoadSettingsForData.cs b/Function/BNGetBinaryViewLoadSettingsForData.cs new file mode 100644 index 0000000..2efb170 --- /dev/null +++ b/Function/BNGetBinaryViewLoadSettingsForData.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNSettings* BNGetBinaryViewLoadSettingsForData(BNBinaryViewType* type, BNBinaryView* data) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetBinaryViewLoadSettingsForData" + )] + internal static extern IntPtr BNGetBinaryViewLoadSettingsForData( + + // BNBinaryViewType* type + IntPtr type , + + // BNBinaryView* data + IntPtr data + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetBinaryViewTypeByName.cs b/Function/BNGetBinaryViewTypeByName.cs new file mode 100644 index 0000000..fd5959f --- /dev/null +++ b/Function/BNGetBinaryViewTypeByName.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBinaryViewType* BNGetBinaryViewTypeByName(const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetBinaryViewTypeByName" + )] + internal static extern IntPtr BNGetBinaryViewTypeByName( + + // const char* name + string name + ); + } +} \ No newline at end of file diff --git a/Function/BNGetBinaryViewTypeLibraries.cs b/Function/BNGetBinaryViewTypeLibraries.cs new file mode 100644 index 0000000..db29eaa --- /dev/null +++ b/Function/BNGetBinaryViewTypeLibraries.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeLibrary** BNGetBinaryViewTypeLibraries(BNBinaryView* view, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetBinaryViewTypeLibraries" + )] + internal static extern IntPtr BNGetBinaryViewTypeLibraries( + + // BNBinaryView* view + IntPtr view , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetBinaryViewTypeLibrary.cs b/Function/BNGetBinaryViewTypeLibrary.cs new file mode 100644 index 0000000..563c15c --- /dev/null +++ b/Function/BNGetBinaryViewTypeLibrary.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeLibrary* BNGetBinaryViewTypeLibrary(BNBinaryView* view, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetBinaryViewTypeLibrary" + )] + internal static extern IntPtr BNGetBinaryViewTypeLibrary( + + // BNBinaryView* view + IntPtr view , + + // const char* name + string name + ); + } +} \ No newline at end of file diff --git a/Function/BNGetBinaryViewTypeLongName.cs b/Function/BNGetBinaryViewTypeLongName.cs new file mode 100644 index 0000000..eea9fd7 --- /dev/null +++ b/Function/BNGetBinaryViewTypeLongName.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetBinaryViewTypeLongName(BNBinaryViewType* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetBinaryViewTypeLongName" + )] + internal static extern IntPtr BNGetBinaryViewTypeLongName( + + // BNBinaryViewType* type + IntPtr type + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetBinaryViewTypeName.cs b/Function/BNGetBinaryViewTypeName.cs new file mode 100644 index 0000000..23ab14c --- /dev/null +++ b/Function/BNGetBinaryViewTypeName.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetBinaryViewTypeName(BNBinaryViewType* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetBinaryViewTypeName" + )] + internal static extern IntPtr BNGetBinaryViewTypeName( + + // BNBinaryViewType* type + IntPtr type + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetBinaryViewTypes.cs b/Function/BNGetBinaryViewTypes.cs new file mode 100644 index 0000000..7410c7a --- /dev/null +++ b/Function/BNGetBinaryViewTypes.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// + /// BNBinaryViewType** BNGetBinaryViewTypes(uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetBinaryViewTypes" + )] + public static extern IntPtr BNGetBinaryViewTypes( + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetBinaryViewTypesForData.cs b/Function/BNGetBinaryViewTypesForData.cs new file mode 100644 index 0000000..84b99c3 --- /dev/null +++ b/Function/BNGetBinaryViewTypesForData.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBinaryViewType** BNGetBinaryViewTypesForData(BNBinaryView* data, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetBinaryViewTypesForData" + )] + internal static extern IntPtr BNGetBinaryViewTypesForData( + + // BNBinaryView* data + IntPtr data , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetBinaryWriterEndianness.cs b/Function/BNGetBinaryWriterEndianness.cs new file mode 100644 index 0000000..0267536 --- /dev/null +++ b/Function/BNGetBinaryWriterEndianness.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNEndianness BNGetBinaryWriterEndianness(BNBinaryWriter* stream) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetBinaryWriterEndianness" + )] + internal static extern Endianness BNGetBinaryWriterEndianness( + + // BNBinaryWriter* stream + IntPtr stream + ); + } +} \ No newline at end of file diff --git a/Function/BNGetBuildId.cs b/Function/BNGetBuildId.cs new file mode 100644 index 0000000..c3da3c5 --- /dev/null +++ b/Function/BNGetBuildId.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public static partial class Core + { + public static uint GetBuildId() + { + return NativeMethods.BNGetBuildId(); + } + } + + internal static partial class NativeMethods + { + /// + /// uint32_t BNGetBuildId() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetBuildId" + )] + internal static extern uint BNGetBuildId(); + } +} \ No newline at end of file diff --git a/Function/BNGetBundledPluginDirectory.cs b/Function/BNGetBundledPluginDirectory.cs new file mode 100644 index 0000000..b94e87b --- /dev/null +++ b/Function/BNGetBundledPluginDirectory.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public static partial class Core + { + public static string GetBundledPluginDirectory() + { + return UnsafeUtils.TakeUtf8String( + NativeMethods.BNGetBundledPluginDirectory() + ); + } + } + + internal static partial class NativeMethods + { + /// + /// const char* BNGetBundledPluginDirectory() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetBundledPluginDirectory" + )] + internal static extern IntPtr BNGetBundledPluginDirectory(); + } +} \ No newline at end of file diff --git a/Function/BNGetCachedHighLevelILPossibleValueSet.cs b/Function/BNGetCachedHighLevelILPossibleValueSet.cs new file mode 100644 index 0000000..0a8a99a --- /dev/null +++ b/Function/BNGetCachedHighLevelILPossibleValueSet.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNPossibleValueSet BNGetCachedHighLevelILPossibleValueSet(BNHighLevelILFunction* func, uint64_t idx) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetCachedHighLevelILPossibleValueSet" + )] + internal static extern BNPossibleValueSet BNGetCachedHighLevelILPossibleValueSet( + + // BNHighLevelILFunction* func + IntPtr func , + + // uint64_t idx + ulong idx + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetCachedLowLevelILPossibleValueSet.cs b/Function/BNGetCachedLowLevelILPossibleValueSet.cs new file mode 100644 index 0000000..74492a7 --- /dev/null +++ b/Function/BNGetCachedLowLevelILPossibleValueSet.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNPossibleValueSet BNGetCachedLowLevelILPossibleValueSet(BNLowLevelILFunction* func, uint64_t idx) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetCachedLowLevelILPossibleValueSet" + )] + internal static extern BNPossibleValueSet BNGetCachedLowLevelILPossibleValueSet( + + // BNLowLevelILFunction* func + IntPtr func , + + // uint64_t idx + LowLevelILPossibleValueSetCacheIndex idx + ); + } +} \ No newline at end of file diff --git a/Function/BNGetCachedMediumLevelILPossibleValueSet.cs b/Function/BNGetCachedMediumLevelILPossibleValueSet.cs new file mode 100644 index 0000000..6e0746b --- /dev/null +++ b/Function/BNGetCachedMediumLevelILPossibleValueSet.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNPossibleValueSet BNGetCachedMediumLevelILPossibleValueSet(BNMediumLevelILFunction* func, uint64_t idx) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetCachedMediumLevelILPossibleValueSet" + )] + internal static extern BNPossibleValueSet BNGetCachedMediumLevelILPossibleValueSet( + + // BNMediumLevelILFunction* func + IntPtr func , + + // uint64_t idx + ulong idx + ); + } +} \ No newline at end of file diff --git a/Function/BNGetCallRegisterStackAdjustment.cs b/Function/BNGetCallRegisterStackAdjustment.cs new file mode 100644 index 0000000..affcab8 --- /dev/null +++ b/Function/BNGetCallRegisterStackAdjustment.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRegisterStackAdjustment* BNGetCallRegisterStackAdjustment(BNFunction* func, BNArchitecture* arch, uint64_t addr, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetCallRegisterStackAdjustment" + )] + internal static extern IntPtr BNGetCallRegisterStackAdjustment( + + // BNFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t addr + ulong addr , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetCallRegisterStackAdjustmentForRegisterStack.cs b/Function/BNGetCallRegisterStackAdjustmentForRegisterStack.cs new file mode 100644 index 0000000..afd7183 --- /dev/null +++ b/Function/BNGetCallRegisterStackAdjustmentForRegisterStack.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRegisterStackAdjustment BNGetCallRegisterStackAdjustmentForRegisterStack(BNFunction* func, BNArchitecture* arch, uint64_t addr, uint32_t regStack) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetCallRegisterStackAdjustmentForRegisterStack" + )] + internal static extern BNRegisterStackAdjustment BNGetCallRegisterStackAdjustmentForRegisterStack( + + // BNFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t addr + ulong addr , + + // uint32_t regStack + uint regStack + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetCallStackAdjustment.cs b/Function/BNGetCallStackAdjustment.cs new file mode 100644 index 0000000..98d224b --- /dev/null +++ b/Function/BNGetCallStackAdjustment.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNOffsetWithConfidence BNGetCallStackAdjustment(BNFunction* func, BNArchitecture* arch, uint64_t addr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetCallStackAdjustment" + )] + internal static extern BNOffsetWithConfidence BNGetCallStackAdjustment( + + // BNFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t addr + ulong addr + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetCallTypeAdjustment.cs b/Function/BNGetCallTypeAdjustment.cs new file mode 100644 index 0000000..09106d8 --- /dev/null +++ b/Function/BNGetCallTypeAdjustment.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeWithConfidence BNGetCallTypeAdjustment(BNFunction* func, BNArchitecture* arch, uint64_t addr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetCallTypeAdjustment" + )] + internal static extern BNTypeWithConfidence BNGetCallTypeAdjustment( + + // BNFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t addr + ulong addr + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetCalleeForAnalysis.cs b/Function/BNGetCalleeForAnalysis.cs new file mode 100644 index 0000000..62697e2 --- /dev/null +++ b/Function/BNGetCalleeForAnalysis.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFunction* BNGetCalleeForAnalysis(BNFunction* func, BNPlatform* platform, uint64_t addr, bool exact) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetCalleeForAnalysis" + )] + internal static extern IntPtr BNGetCalleeForAnalysis( + + // BNFunction* func + IntPtr func , + + // BNPlatform* platform + IntPtr platform , + + // uint64_t addr + ulong addr , + + // bool exact + bool exact + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetCalleeSavedRegisters.cs b/Function/BNGetCalleeSavedRegisters.cs new file mode 100644 index 0000000..79ecb22 --- /dev/null +++ b/Function/BNGetCalleeSavedRegisters.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint32_t* BNGetCalleeSavedRegisters(BNCallingConvention* cc, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetCalleeSavedRegisters" + )] + internal static extern IntPtr BNGetCalleeSavedRegisters( + + // BNCallingConvention* cc + IntPtr cc , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetCallees.cs b/Function/BNGetCallees.cs new file mode 100644 index 0000000..4057a2b --- /dev/null +++ b/Function/BNGetCallees.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t* BNGetCallees(BNBinaryView* view, BNReferenceSource* callSite, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetCallees" + )] + internal static extern IntPtr BNGetCallees( + + // BNBinaryView* view + IntPtr view , + + // BNReferenceSource* callSite + in BNReferenceSource callSite , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetCallerSavedRegisters.cs b/Function/BNGetCallerSavedRegisters.cs new file mode 100644 index 0000000..b3323c4 --- /dev/null +++ b/Function/BNGetCallerSavedRegisters.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint32_t* BNGetCallerSavedRegisters(BNCallingConvention* cc, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetCallerSavedRegisters" + )] + internal static extern IntPtr BNGetCallerSavedRegisters( + + // BNCallingConvention* cc + IntPtr cc , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetCallers.cs b/Function/BNGetCallers.cs new file mode 100644 index 0000000..b22f440 --- /dev/null +++ b/Function/BNGetCallers.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNReferenceSource* BNGetCallers(BNBinaryView* view, uint64_t callee, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetCallers" + )] + internal static extern IntPtr BNGetCallers( + + // BNBinaryView* view + IntPtr view , + + // uint64_t callee + ulong callee , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetCallingConventionArchitecture.cs b/Function/BNGetCallingConventionArchitecture.cs new file mode 100644 index 0000000..959f173 --- /dev/null +++ b/Function/BNGetCallingConventionArchitecture.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNArchitecture* BNGetCallingConventionArchitecture(BNCallingConvention* cc) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetCallingConventionArchitecture" + )] + internal static extern IntPtr BNGetCallingConventionArchitecture( + + // BNCallingConvention* cc + IntPtr cc + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetCallingConventionName.cs b/Function/BNGetCallingConventionName.cs new file mode 100644 index 0000000..06d4d01 --- /dev/null +++ b/Function/BNGetCallingConventionName.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetCallingConventionName(BNCallingConvention* cc) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetCallingConventionName" + )] + internal static extern IntPtr BNGetCallingConventionName( + + // BNCallingConvention* cc + IntPtr cc + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetCheckboxInput.cs b/Function/BNGetCheckboxInput.cs new file mode 100644 index 0000000..82173a9 --- /dev/null +++ b/Function/BNGetCheckboxInput.cs @@ -0,0 +1,60 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public static partial class Core + { + public static bool? GetCheckboxInput( + string prompt , + string title , + bool defaultChoice = false + ) + { + long defaltChoiceValue = ( defaultChoice ? 1 : 0 ); + + bool ok = NativeMethods.BNGetCheckboxInput( + out long result , + prompt , + title, + ref defaltChoiceValue + ); + + if (!ok) + { + return null; + } + + return result != 0; + } + } + + internal static partial class NativeMethods + { + /// + /// bool BNGetCheckboxInput(int64_t* result, const char* prompt, const char* title, int64_t* defaultChoice) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetCheckboxInput" + )] + internal static extern bool BNGetCheckboxInput( + + // int64_t* result + out long result , + + // const char* prompt + string prompt , + + // const char* title + string title , + + // int64_t* defaultChoice + ref long defaultChoice + ); + } +} \ No newline at end of file diff --git a/Function/BNGetChildType.cs b/Function/BNGetChildType.cs new file mode 100644 index 0000000..d8551d8 --- /dev/null +++ b/Function/BNGetChildType.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeWithConfidence BNGetChildType(BNType* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetChildType" + )] + internal static extern BNTypeWithConfidence BNGetChildType( + + // BNType* type + IntPtr type + ); + } +} \ No newline at end of file diff --git a/Function/BNGetChoiceInput.cs b/Function/BNGetChoiceInput.cs new file mode 100644 index 0000000..97b7739 --- /dev/null +++ b/Function/BNGetChoiceInput.cs @@ -0,0 +1,62 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public static partial class Core + { + public static ulong? GetChoiceInput( + string prompt , + string title , + string[] choices + ) + { + bool ok = NativeMethods.BNGetChoiceInput( + out ulong result , + prompt , + title, + choices , + (ulong)choices.Length + ); + + if (!ok) + { + return null; + } + + return result; + } + } + + internal static partial class NativeMethods + { + /// + /// bool BNGetChoiceInput(uint64_t* result, const char* prompt, const char* title, const char** choices, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetChoiceInput" + )] + internal static extern bool BNGetChoiceInput( + + // uint64_t* result + out ulong result , + + // const char* prompt + string prompt , + + // const char* title + string title , + + // const char** choices + string[] choices , + + // uint64_t count + ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetCodeReferences.cs b/Function/BNGetCodeReferences.cs new file mode 100644 index 0000000..0fc5320 --- /dev/null +++ b/Function/BNGetCodeReferences.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNReferenceSource* BNGetCodeReferences(BNBinaryView* view, uint64_t addr, uint64_t* count, bool limit, uint64_t maxItems) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetCodeReferences" + )] + internal static extern IntPtr BNGetCodeReferences( + + // BNBinaryView* view + IntPtr view , + + // uint64_t addr + ulong addr , + + // uint64_t* count + out ulong count , + + // bool limit + bool limit , + + // uint64_t maxItems + ulong maxItems + ); + } +} \ No newline at end of file diff --git a/Function/BNGetCodeReferencesForType.cs b/Function/BNGetCodeReferencesForType.cs new file mode 100644 index 0000000..ce4eb31 --- /dev/null +++ b/Function/BNGetCodeReferencesForType.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNReferenceSource* BNGetCodeReferencesForType(BNBinaryView* view, BNQualifiedName* type, uint64_t* count, bool limit, uint64_t maxItems) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetCodeReferencesForType" + )] + internal static extern IntPtr BNGetCodeReferencesForType( + + // BNBinaryView* view + IntPtr view , + + // BNQualifiedName* type + in BNQualifiedName type , + + // uint64_t* count + out ulong count , + + // bool limit + bool limit , + + // uint64_t maxItems + ulong maxItems + ); + } +} \ No newline at end of file diff --git a/Function/BNGetCodeReferencesForTypeField.cs b/Function/BNGetCodeReferencesForTypeField.cs new file mode 100644 index 0000000..d6d9d30 --- /dev/null +++ b/Function/BNGetCodeReferencesForTypeField.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeFieldReference* BNGetCodeReferencesForTypeField(BNBinaryView* view, BNQualifiedName* type, uint64_t offset, uint64_t* count, bool limit, uint64_t maxItems) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetCodeReferencesForTypeField" + )] + internal static extern IntPtr BNGetCodeReferencesForTypeField( + + // BNBinaryView* view + IntPtr view , + + // BNQualifiedName* type + in BNQualifiedName type , + + // uint64_t offset + ulong offset , + + // uint64_t* count + out ulong count , + + // bool limit + bool limit , + + // uint64_t maxItems + ulong maxItems + ); + } +} \ No newline at end of file diff --git a/Function/BNGetCodeReferencesForTypeFieldsFrom.cs b/Function/BNGetCodeReferencesForTypeFieldsFrom.cs new file mode 100644 index 0000000..609e7d2 --- /dev/null +++ b/Function/BNGetCodeReferencesForTypeFieldsFrom.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeReferenceSource* BNGetCodeReferencesForTypeFieldsFrom(BNBinaryView* view, BNReferenceSource* addr, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetCodeReferencesForTypeFieldsFrom" + )] + internal static extern IntPtr BNGetCodeReferencesForTypeFieldsFrom( + + // BNBinaryView* view + IntPtr view , + + // BNReferenceSource* addr + in BNReferenceSource addr , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetCodeReferencesForTypeFieldsFromInRange.cs b/Function/BNGetCodeReferencesForTypeFieldsFromInRange.cs new file mode 100644 index 0000000..1908d13 --- /dev/null +++ b/Function/BNGetCodeReferencesForTypeFieldsFromInRange.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeReferenceSource* BNGetCodeReferencesForTypeFieldsFromInRange(BNBinaryView* view, BNReferenceSource* addr, uint64_t len, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetCodeReferencesForTypeFieldsFromInRange" + )] + internal static extern IntPtr BNGetCodeReferencesForTypeFieldsFromInRange( + + // BNBinaryView* view + IntPtr view , + + // BNReferenceSource* addr + in BNReferenceSource addr , + + // uint64_t len + ulong len , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetCodeReferencesForTypeFrom.cs b/Function/BNGetCodeReferencesForTypeFrom.cs new file mode 100644 index 0000000..da15cbc --- /dev/null +++ b/Function/BNGetCodeReferencesForTypeFrom.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeReferenceSource* BNGetCodeReferencesForTypeFrom(BNBinaryView* view, BNReferenceSource* addr, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetCodeReferencesForTypeFrom" + )] + internal static extern IntPtr BNGetCodeReferencesForTypeFrom( + + // BNBinaryView* view + IntPtr view , + + // BNReferenceSource* addr + in BNReferenceSource addr , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetCodeReferencesForTypeFromInRange.cs b/Function/BNGetCodeReferencesForTypeFromInRange.cs new file mode 100644 index 0000000..0a06af3 --- /dev/null +++ b/Function/BNGetCodeReferencesForTypeFromInRange.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeReferenceSource* BNGetCodeReferencesForTypeFromInRange(BNBinaryView* view, BNReferenceSource* addr, uint64_t len, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetCodeReferencesForTypeFromInRange" + )] + internal static extern IntPtr BNGetCodeReferencesForTypeFromInRange( + + // BNBinaryView* view + IntPtr view , + + // BNReferenceSource* addr + in BNReferenceSource addr , + + // uint64_t len + ulong len , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetCodeReferencesFrom.cs b/Function/BNGetCodeReferencesFrom.cs new file mode 100644 index 0000000..3600d32 --- /dev/null +++ b/Function/BNGetCodeReferencesFrom.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t* BNGetCodeReferencesFrom(BNBinaryView* view, BNReferenceSource* src, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetCodeReferencesFrom" + )] + internal static extern IntPtr BNGetCodeReferencesFrom( + + // BNBinaryView* view + IntPtr view , + + // BNReferenceSource* src + in BNReferenceSource src , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetCodeReferencesFromInRange.cs b/Function/BNGetCodeReferencesFromInRange.cs new file mode 100644 index 0000000..2facbc2 --- /dev/null +++ b/Function/BNGetCodeReferencesFromInRange.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t* BNGetCodeReferencesFromInRange(BNBinaryView* view, BNReferenceSource* src, uint64_t len, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetCodeReferencesFromInRange" + )] + internal static extern IntPtr BNGetCodeReferencesFromInRange( + + // BNBinaryView* view + IntPtr view , + + // BNReferenceSource* src + in BNReferenceSource src , + + // uint64_t len + ulong len , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetCodeReferencesInRange.cs b/Function/BNGetCodeReferencesInRange.cs new file mode 100644 index 0000000..ddfc2ba --- /dev/null +++ b/Function/BNGetCodeReferencesInRange.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNReferenceSource* BNGetCodeReferencesInRange(BNBinaryView* view, uint64_t addr, uint64_t len, uint64_t* count, bool limit, uint64_t maxItems) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetCodeReferencesInRange" + )] + internal static extern IntPtr BNGetCodeReferencesInRange( + + // BNBinaryView* view + IntPtr view , + + // uint64_t addr + ulong addr , + + // uint64_t len + ulong len , + + // uint64_t* count + out ulong count , + + // bool limit + bool limit , + + // uint64_t maxItems + ulong maxItems + ); + } +} \ No newline at end of file diff --git a/Function/BNGetCommentForAddress.cs b/Function/BNGetCommentForAddress.cs new file mode 100644 index 0000000..6494d7f --- /dev/null +++ b/Function/BNGetCommentForAddress.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + + /// + /// char* BNGetCommentForAddress(BNFunction* func, uint64_t addr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetCommentForAddress" + )] + internal static extern IntPtr BNGetCommentForAddress( + + // BNFunction* func + IntPtr func , + + // uint64_t addr + ulong addr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetCommentedAddresses.cs b/Function/BNGetCommentedAddresses.cs new file mode 100644 index 0000000..85928ec --- /dev/null +++ b/Function/BNGetCommentedAddresses.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t* BNGetCommentedAddresses(BNFunction* func, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetCommentedAddresses" + )] + internal static extern IntPtr BNGetCommentedAddresses( + + // BNFunction* func + IntPtr func , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetComponentByGuid.cs b/Function/BNGetComponentByGuid.cs new file mode 100644 index 0000000..cf88d08 --- /dev/null +++ b/Function/BNGetComponentByGuid.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNComponent* BNGetComponentByGuid(BNBinaryView* view, const char* guid) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetComponentByGuid" + )] + internal static extern IntPtr BNGetComponentByGuid( + + // BNBinaryView* view + IntPtr view , + + // const char* guid + string guid + ); + } +} \ No newline at end of file diff --git a/Function/BNGetComponentByPath.cs b/Function/BNGetComponentByPath.cs new file mode 100644 index 0000000..f61ed7b --- /dev/null +++ b/Function/BNGetComponentByPath.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNComponent* BNGetComponentByPath(BNBinaryView* view, const char* path) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetComponentByPath" + )] + internal static extern IntPtr BNGetComponentByPath( + + // BNBinaryView* view + IntPtr view , + + // const char* path + string path + ); + } +} \ No newline at end of file diff --git a/Function/BNGetConstantData.cs b/Function/BNGetConstantData.cs new file mode 100644 index 0000000..fb97393 --- /dev/null +++ b/Function/BNGetConstantData.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDataBuffer* BNGetConstantData(BNFunction* func, BNRegisterValueType state, uint64_t value, uint64_t size, BNBuiltinType* builtin) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetConstantData" + )] + internal static extern IntPtr BNGetConstantData( + + // BNFunction* func + IntPtr func , + + // BNRegisterValueType state + RegisterValueType state , + + // uint64_t value + ulong value , + + // uint64_t size + ulong size , + + // BNBuiltinType* builtin + out BuiltinType builtin + ); + } +} \ No newline at end of file diff --git a/Function/BNGetConstantsReferencedByInstruction.cs b/Function/BNGetConstantsReferencedByInstruction.cs new file mode 100644 index 0000000..edeb595 --- /dev/null +++ b/Function/BNGetConstantsReferencedByInstruction.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNConstantReference* BNGetConstantsReferencedByInstruction(BNFunction* func, BNArchitecture* arch, uint64_t addr, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetConstantsReferencedByInstruction" + )] + internal static extern IntPtr BNGetConstantsReferencedByInstruction( + + // BNFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t addr + ulong addr , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetConstantsReferencedByInstructionIfAvailable.cs b/Function/BNGetConstantsReferencedByInstructionIfAvailable.cs new file mode 100644 index 0000000..3e43ef6 --- /dev/null +++ b/Function/BNGetConstantsReferencedByInstructionIfAvailable.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNConstantReference* BNGetConstantsReferencedByInstructionIfAvailable(BNFunction* func, BNArchitecture* arch, uint64_t addr, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetConstantsReferencedByInstructionIfAvailable" + )] + internal static extern IntPtr BNGetConstantsReferencedByInstructionIfAvailable( + + // BNFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t addr + ulong addr , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetCurrentCoreABIVersion.cs b/Function/BNGetCurrentCoreABIVersion.cs new file mode 100644 index 0000000..bc8da86 --- /dev/null +++ b/Function/BNGetCurrentCoreABIVersion.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public static partial class Core + { + public static uint GetCurrentCoreABIVersion() + { + return NativeMethods.BNGetCurrentCoreABIVersion(); + } + } + + internal static partial class NativeMethods + { + /// + /// uint32_t BNGetCurrentCoreABIVersion() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetCurrentCoreABIVersion" + )] + public static extern uint BNGetCurrentCoreABIVersion(); + } +} \ No newline at end of file diff --git a/Function/BNGetCurrentOffset.cs b/Function/BNGetCurrentOffset.cs new file mode 100644 index 0000000..ce5b273 --- /dev/null +++ b/Function/BNGetCurrentOffset.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetCurrentOffset(BNFileMetadata* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetCurrentOffset" + )] + internal static extern ulong BNGetCurrentOffset( + + // BNFileMetadata* file + IntPtr file + ); + } +} \ No newline at end of file diff --git a/Function/BNGetCurrentStackTraceString.cs b/Function/BNGetCurrentStackTraceString.cs new file mode 100644 index 0000000..aea739c --- /dev/null +++ b/Function/BNGetCurrentStackTraceString.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetCurrentStackTraceString() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetCurrentStackTraceString" + )] + internal static extern IntPtr BNGetCurrentStackTraceString( + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetCurrentView.cs b/Function/BNGetCurrentView.cs new file mode 100644 index 0000000..6e71ddd --- /dev/null +++ b/Function/BNGetCurrentView.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// char* BNGetCurrentView(BNFileMetadata* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetCurrentView" + )] + internal static extern IntPtr BNGetCurrentView( + + // BNFileMetadata* file + IntPtr file + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDataBufferByte.cs b/Function/BNGetDataBufferByte.cs new file mode 100644 index 0000000..e20136c --- /dev/null +++ b/Function/BNGetDataBufferByte.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint8_t BNGetDataBufferByte(BNDataBuffer* buf, uint64_t offset) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetDataBufferByte" + )] + internal static extern byte BNGetDataBufferByte( + + // BNDataBuffer* buf + IntPtr buf , + + // uint64_t offset + ulong offset + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDataBufferContents.cs b/Function/BNGetDataBufferContents.cs new file mode 100644 index 0000000..4918d26 --- /dev/null +++ b/Function/BNGetDataBufferContents.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void* BNGetDataBufferContents(BNDataBuffer* buf) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetDataBufferContents" + )] + internal static extern IntPtr BNGetDataBufferContents( + + // BNDataBuffer* buf + IntPtr buf + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDataBufferContentsAt.cs b/Function/BNGetDataBufferContentsAt.cs new file mode 100644 index 0000000..279cb0b --- /dev/null +++ b/Function/BNGetDataBufferContentsAt.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void* BNGetDataBufferContentsAt(BNDataBuffer* buf, uint64_t offset) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetDataBufferContentsAt" + )] + internal static extern IntPtr BNGetDataBufferContentsAt( + + // BNDataBuffer* buf + IntPtr buf , + + // uint64_t offset + ulong offset + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDataBufferLength.cs b/Function/BNGetDataBufferLength.cs new file mode 100644 index 0000000..af7f32e --- /dev/null +++ b/Function/BNGetDataBufferLength.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetDataBufferLength(BNDataBuffer* buf) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetDataBufferLength" + )] + internal static extern ulong BNGetDataBufferLength( + + // BNDataBuffer* buf + IntPtr buf + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDataBufferSlice.cs b/Function/BNGetDataBufferSlice.cs new file mode 100644 index 0000000..b195355 --- /dev/null +++ b/Function/BNGetDataBufferSlice.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDataBuffer* BNGetDataBufferSlice(BNDataBuffer* buf, uint64_t start, uint64_t len) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetDataBufferSlice" + )] + internal static extern IntPtr BNGetDataBufferSlice( + + // BNDataBuffer* buf + IntPtr buf , + + // uint64_t start + ulong start , + + // uint64_t len + ulong len + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDataReferences.cs b/Function/BNGetDataReferences.cs new file mode 100644 index 0000000..3a3406b --- /dev/null +++ b/Function/BNGetDataReferences.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t* BNGetDataReferences(BNBinaryView* view, uint64_t addr, uint64_t* count, bool limit, uint64_t maxItems) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetDataReferences" + )] + internal static extern IntPtr BNGetDataReferences( + + // BNBinaryView* view + IntPtr view , + + // uint64_t addr + ulong addr , + + // uint64_t* count + out ulong count , + + // bool limit + bool limit , + + // uint64_t maxItems + ulong maxItems + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDataReferencesForType.cs b/Function/BNGetDataReferencesForType.cs new file mode 100644 index 0000000..0e19679 --- /dev/null +++ b/Function/BNGetDataReferencesForType.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t* BNGetDataReferencesForType(BNBinaryView* view, BNQualifiedName* type, uint64_t* count, bool limit, uint64_t maxItems) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetDataReferencesForType" + )] + internal static extern IntPtr BNGetDataReferencesForType( + + // BNBinaryView* view + IntPtr view , + + // BNQualifiedName* type + in BNQualifiedName type , + + // uint64_t* count + out ulong count , + + // bool limit + bool limit , + + // uint64_t maxItems + ulong maxItems + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDataReferencesForTypeField.cs b/Function/BNGetDataReferencesForTypeField.cs new file mode 100644 index 0000000..9363d15 --- /dev/null +++ b/Function/BNGetDataReferencesForTypeField.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t* BNGetDataReferencesForTypeField(BNBinaryView* view, BNQualifiedName* type, uint64_t offset, uint64_t* count, bool limit, uint64_t maxItems) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetDataReferencesForTypeField" + )] + internal static extern IntPtr BNGetDataReferencesForTypeField( + + // BNBinaryView* view + IntPtr view , + + // BNQualifiedName* type + in BNQualifiedName type , + + // uint64_t offset + ulong offset , + + // uint64_t* count + out ulong count , + + // bool limit + bool limit , + + // uint64_t maxItems + ulong maxItems + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDataReferencesFrom.cs b/Function/BNGetDataReferencesFrom.cs new file mode 100644 index 0000000..e83b08c --- /dev/null +++ b/Function/BNGetDataReferencesFrom.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t* BNGetDataReferencesFrom(BNBinaryView* view, uint64_t addr, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetDataReferencesFrom" + )] + internal static extern IntPtr BNGetDataReferencesFrom( + + // BNBinaryView* view + IntPtr view , + + // uint64_t addr + ulong addr , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDataReferencesFromForTypeField.cs b/Function/BNGetDataReferencesFromForTypeField.cs new file mode 100644 index 0000000..afd75af --- /dev/null +++ b/Function/BNGetDataReferencesFromForTypeField.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t* BNGetDataReferencesFromForTypeField(BNBinaryView* view, BNQualifiedName* type, uint64_t offset, uint64_t* count, bool limit, uint64_t maxItems) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetDataReferencesFromForTypeField" + )] + internal static extern IntPtr BNGetDataReferencesFromForTypeField( + + // BNBinaryView* view + IntPtr view , + + // BNQualifiedName* type + in BNQualifiedName type , + + // uint64_t offset + ulong offset , + + // uint64_t* count + out ulong count , + + // bool limit + bool limit , + + // uint64_t maxItems + ulong maxItems + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDataReferencesFromInRange.cs b/Function/BNGetDataReferencesFromInRange.cs new file mode 100644 index 0000000..3fc68c6 --- /dev/null +++ b/Function/BNGetDataReferencesFromInRange.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t* BNGetDataReferencesFromInRange(BNBinaryView* view, uint64_t addr, uint64_t len, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetDataReferencesFromInRange" + )] + internal static extern IntPtr BNGetDataReferencesFromInRange( + + // BNBinaryView* view + IntPtr view , + + // uint64_t addr + ulong addr , + + // uint64_t len + ulong len , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDataReferencesInRange.cs b/Function/BNGetDataReferencesInRange.cs new file mode 100644 index 0000000..34d1e57 --- /dev/null +++ b/Function/BNGetDataReferencesInRange.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t* BNGetDataReferencesInRange(BNBinaryView* view, uint64_t addr, uint64_t len, uint64_t* count, bool limit, uint64_t maxItems) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetDataReferencesInRange" + )] + internal static extern IntPtr BNGetDataReferencesInRange( + + // BNBinaryView* view + IntPtr view , + + // uint64_t addr + ulong addr , + + // uint64_t len + ulong len , + + // uint64_t* count + out ulong count , + + // bool limit + bool limit , + + // uint64_t maxItems + ulong maxItems + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDataRendererContainer.cs b/Function/BNGetDataRendererContainer.cs new file mode 100644 index 0000000..eadb228 --- /dev/null +++ b/Function/BNGetDataRendererContainer.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDataRendererContainer* BNGetDataRendererContainer() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetDataRendererContainer" + )] + internal static extern IntPtr BNGetDataRendererContainer( + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDataTagReferences.cs b/Function/BNGetDataTagReferences.cs new file mode 100644 index 0000000..fb7f76d --- /dev/null +++ b/Function/BNGetDataTagReferences.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTagReference* BNGetDataTagReferences(BNBinaryView* view, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetDataTagReferences" + )] + internal static extern IntPtr BNGetDataTagReferences( + + // BNBinaryView* view + IntPtr view , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDataTags.cs b/Function/BNGetDataTags.cs new file mode 100644 index 0000000..47f39f9 --- /dev/null +++ b/Function/BNGetDataTags.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTag** BNGetDataTags(BNBinaryView* view, uint64_t addr, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetDataTags" + )] + internal static extern IntPtr BNGetDataTags( + + // BNBinaryView* view + IntPtr view , + + // uint64_t addr + ulong addr , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDataTagsInRange.cs b/Function/BNGetDataTagsInRange.cs new file mode 100644 index 0000000..77bcc4a --- /dev/null +++ b/Function/BNGetDataTagsInRange.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTagReference* BNGetDataTagsInRange(BNBinaryView* view, uint64_t start, uint64_t end, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetDataTagsInRange" + )] + internal static extern IntPtr BNGetDataTagsInRange( + + // BNBinaryView* view + IntPtr view , + + // uint64_t start + ulong start , + + // uint64_t end + ulong end , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDataTagsOfType.cs b/Function/BNGetDataTagsOfType.cs new file mode 100644 index 0000000..315e05b --- /dev/null +++ b/Function/BNGetDataTagsOfType.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTag** BNGetDataTagsOfType(BNBinaryView* view, uint64_t addr, BNTagType* tagType, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetDataTagsOfType" + )] + internal static extern IntPtr BNGetDataTagsOfType( + + // BNBinaryView* view + IntPtr view , + + // uint64_t addr + ulong addr , + + // BNTagType* tagType + IntPtr tagType , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDataVariableAtAddress.cs b/Function/BNGetDataVariableAtAddress.cs new file mode 100644 index 0000000..bc39145 --- /dev/null +++ b/Function/BNGetDataVariableAtAddress.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNGetDataVariableAtAddress(BNBinaryView* view, uint64_t addr, BNDataVariable* var) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetDataVariableAtAddress" + )] + internal static extern bool BNGetDataVariableAtAddress( + + // BNBinaryView* view + IntPtr view , + + // uint64_t addr + ulong addr , + + // BNDataVariable* _var + out BNDataVariable var + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDataVariableParentComponents.cs b/Function/BNGetDataVariableParentComponents.cs new file mode 100644 index 0000000..df61618 --- /dev/null +++ b/Function/BNGetDataVariableParentComponents.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNComponent** BNGetDataVariableParentComponents(BNBinaryView* view, uint64_t dataVariable, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetDataVariableParentComponents" + )] + internal static extern IntPtr BNGetDataVariableParentComponents( + + // BNBinaryView* view + IntPtr view , + + // uint64_t dataVariable + ulong dataVariable , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDataVariables.cs b/Function/BNGetDataVariables.cs new file mode 100644 index 0000000..479d305 --- /dev/null +++ b/Function/BNGetDataVariables.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDataVariable* BNGetDataVariables(BNBinaryView* view, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetDataVariables" + )] + internal static extern IntPtr BNGetDataVariables( + + // BNBinaryView* view + IntPtr view , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDatabaseCurrentSnapshot.cs b/Function/BNGetDatabaseCurrentSnapshot.cs new file mode 100644 index 0000000..337e767 --- /dev/null +++ b/Function/BNGetDatabaseCurrentSnapshot.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNSnapshot* BNGetDatabaseCurrentSnapshot(BNDatabase* database) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetDatabaseCurrentSnapshot" + )] + internal static extern IntPtr BNGetDatabaseCurrentSnapshot( + + // BNDatabase* database + IntPtr database + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDatabaseFile.cs b/Function/BNGetDatabaseFile.cs new file mode 100644 index 0000000..eb368e7 --- /dev/null +++ b/Function/BNGetDatabaseFile.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFileMetadata* BNGetDatabaseFile(BNDatabase* database) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetDatabaseFile" + )] + internal static extern IntPtr BNGetDatabaseFile( + + // BNDatabase* database + IntPtr database + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDatabaseGlobalKeys.cs b/Function/BNGetDatabaseGlobalKeys.cs new file mode 100644 index 0000000..1ede9d1 --- /dev/null +++ b/Function/BNGetDatabaseGlobalKeys.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char** BNGetDatabaseGlobalKeys(BNDatabase* database, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetDatabaseGlobalKeys" + )] + internal static extern IntPtr BNGetDatabaseGlobalKeys( + + // BNDatabase* database + IntPtr database , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDatabaseSnapshot.cs b/Function/BNGetDatabaseSnapshot.cs new file mode 100644 index 0000000..886215a --- /dev/null +++ b/Function/BNGetDatabaseSnapshot.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNSnapshot* BNGetDatabaseSnapshot(BNDatabase* database, int64_t id) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetDatabaseSnapshot" + )] + internal static extern IntPtr BNGetDatabaseSnapshot( + + // BNDatabase* database + IntPtr database , + + // int64_t id + long id + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDatabaseSnapshots.cs b/Function/BNGetDatabaseSnapshots.cs new file mode 100644 index 0000000..55275a2 --- /dev/null +++ b/Function/BNGetDatabaseSnapshots.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNSnapshot** BNGetDatabaseSnapshots(BNDatabase* database, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetDatabaseSnapshots" + )] + internal static extern IntPtr BNGetDatabaseSnapshots( + + // BNDatabase* database + IntPtr database , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDebugDataVariableByAddress.cs b/Function/BNGetDebugDataVariableByAddress.cs new file mode 100644 index 0000000..6553e39 --- /dev/null +++ b/Function/BNGetDebugDataVariableByAddress.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNGetDebugDataVariableByAddress(BNDebugInfo* debugInfo, const char* parserName, uint64_t address, BNDataVariableAndName* var) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetDebugDataVariableByAddress" + )] + internal static extern bool BNGetDebugDataVariableByAddress( + + // BNDebugInfo* debugInfo + IntPtr debugInfo , + + // const char* parserName + string parserName , + + // uint64_t address + ulong address , + + // BNDataVariableAndName* _var + IntPtr _var + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDebugDataVariableByName.cs b/Function/BNGetDebugDataVariableByName.cs new file mode 100644 index 0000000..47605d8 --- /dev/null +++ b/Function/BNGetDebugDataVariableByName.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNGetDebugDataVariableByName(BNDebugInfo* debugInfo, const char* parserName, const char* variableName, BNDataVariableAndName* var) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetDebugDataVariableByName" + )] + internal static extern bool BNGetDebugDataVariableByName( + + // BNDebugInfo* debugInfo + IntPtr debugInfo , + + // const char* parserName + string parserName , + + // const char* variableName + string variableName , + + // BNDataVariableAndName* _var + IntPtr _var + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDebugDataVariables.cs b/Function/BNGetDebugDataVariables.cs new file mode 100644 index 0000000..eb77e92 --- /dev/null +++ b/Function/BNGetDebugDataVariables.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDataVariableAndName* BNGetDebugDataVariables(BNDebugInfo* debugInfo, const char* name, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetDebugDataVariables" + )] + internal static extern IntPtr BNGetDebugDataVariables( + + // BNDebugInfo* debugInfo + IntPtr debugInfo , + + // const char* name + string name , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDebugDataVariablesByAddress.cs b/Function/BNGetDebugDataVariablesByAddress.cs new file mode 100644 index 0000000..cbccb26 --- /dev/null +++ b/Function/BNGetDebugDataVariablesByAddress.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDataVariableAndNameAndDebugParser* BNGetDebugDataVariablesByAddress(BNDebugInfo* debugInfo, uint64_t address, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetDebugDataVariablesByAddress" + )] + internal static extern IntPtr BNGetDebugDataVariablesByAddress( + + // BNDebugInfo* debugInfo + IntPtr debugInfo , + + // uint64_t address + ulong address , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDebugDataVariablesByName.cs b/Function/BNGetDebugDataVariablesByName.cs new file mode 100644 index 0000000..34078a7 --- /dev/null +++ b/Function/BNGetDebugDataVariablesByName.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDataVariableAndName* BNGetDebugDataVariablesByName(BNDebugInfo* debugInfo, const char* variableName, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetDebugDataVariablesByName" + )] + internal static extern IntPtr BNGetDebugDataVariablesByName( + + // BNDebugInfo* debugInfo + IntPtr debugInfo , + + // const char* variableName + string variableName , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDebugFunctions.cs b/Function/BNGetDebugFunctions.cs new file mode 100644 index 0000000..8f6a4dd --- /dev/null +++ b/Function/BNGetDebugFunctions.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDebugFunctionInfo* BNGetDebugFunctions(BNDebugInfo* debugInfo, const char* name, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetDebugFunctions" + )] + internal static extern IntPtr BNGetDebugFunctions( + + // BNDebugInfo* debugInfo + IntPtr debugInfo , + + // const char* name + string name , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDebugInfo.cs b/Function/BNGetDebugInfo.cs new file mode 100644 index 0000000..3419e95 --- /dev/null +++ b/Function/BNGetDebugInfo.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDebugInfo* BNGetDebugInfo(BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetDebugInfo" + )] + internal static extern IntPtr BNGetDebugInfo( + + // BNBinaryView* view + IntPtr view + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDebugInfoParserByName.cs b/Function/BNGetDebugInfoParserByName.cs new file mode 100644 index 0000000..cb47905 --- /dev/null +++ b/Function/BNGetDebugInfoParserByName.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDebugInfoParser* BNGetDebugInfoParserByName(const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetDebugInfoParserByName" + )] + internal static extern IntPtr BNGetDebugInfoParserByName( + + // const char* name + string name + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDebugInfoParserName.cs b/Function/BNGetDebugInfoParserName.cs new file mode 100644 index 0000000..80e32c3 --- /dev/null +++ b/Function/BNGetDebugInfoParserName.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetDebugInfoParserName(BNDebugInfoParser* parser) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetDebugInfoParserName" + )] + internal static extern IntPtr BNGetDebugInfoParserName( + + // BNDebugInfoParser* parser + IntPtr parser + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDebugInfoParsers.cs b/Function/BNGetDebugInfoParsers.cs new file mode 100644 index 0000000..647d00c --- /dev/null +++ b/Function/BNGetDebugInfoParsers.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDebugInfoParser** BNGetDebugInfoParsers(uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetDebugInfoParsers" + )] + internal static extern IntPtr BNGetDebugInfoParsers( + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDebugInfoParsersForView.cs b/Function/BNGetDebugInfoParsersForView.cs new file mode 100644 index 0000000..eec96b9 --- /dev/null +++ b/Function/BNGetDebugInfoParsersForView.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDebugInfoParser** BNGetDebugInfoParsersForView(BNBinaryView* view, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetDebugInfoParsersForView" + )] + internal static extern IntPtr BNGetDebugInfoParsersForView( + + // BNBinaryView* view + IntPtr view , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDebugInfoTypeContainer.cs b/Function/BNGetDebugInfoTypeContainer.cs new file mode 100644 index 0000000..f7485ff --- /dev/null +++ b/Function/BNGetDebugInfoTypeContainer.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeContainer* BNGetDebugInfoTypeContainer(BNDebugInfo* debugInfo, const char* parserName) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetDebugInfoTypeContainer" + )] + internal static extern IntPtr BNGetDebugInfoTypeContainer( + + // BNDebugInfo* debugInfo + IntPtr debugInfo , + + // const char* parserName + string parserName + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDebugParserNames.cs b/Function/BNGetDebugParserNames.cs new file mode 100644 index 0000000..91ed0e5 --- /dev/null +++ b/Function/BNGetDebugParserNames.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char** BNGetDebugParserNames(BNDebugInfo* debugInfo, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetDebugParserNames" + )] + internal static extern IntPtr BNGetDebugParserNames( + + // BNDebugInfo* debugInfo + IntPtr debugInfo , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDebugTypeByName.cs b/Function/BNGetDebugTypeByName.cs new file mode 100644 index 0000000..6844062 --- /dev/null +++ b/Function/BNGetDebugTypeByName.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNType* BNGetDebugTypeByName(BNDebugInfo* debugInfo, const char* parserName, const char* typeName) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetDebugTypeByName" + )] + internal static extern IntPtr BNGetDebugTypeByName( + + // BNDebugInfo* debugInfo + IntPtr debugInfo , + + // const char* parserName + string parserName , + + // const char* typeName + string typeName + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDebugTypes.cs b/Function/BNGetDebugTypes.cs new file mode 100644 index 0000000..ecf713e --- /dev/null +++ b/Function/BNGetDebugTypes.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNNameAndType* BNGetDebugTypes(BNDebugInfo* debugInfo, const char* name, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetDebugTypes" + )] + internal static extern IntPtr BNGetDebugTypes( + + // BNDebugInfo* debugInfo + IntPtr debugInfo , + + // const char* name + string name , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDebugTypesByName.cs b/Function/BNGetDebugTypesByName.cs new file mode 100644 index 0000000..d47e27b --- /dev/null +++ b/Function/BNGetDebugTypesByName.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNNameAndType* BNGetDebugTypesByName(BNDebugInfo* debugInfo, const char* typeName, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetDebugTypesByName" + )] + internal static extern IntPtr BNGetDebugTypesByName( + + // BNDebugInfo* debugInfo + IntPtr debugInfo , + + // const char* typeName + string typeName , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDefaultArchitecture.cs b/Function/BNGetDefaultArchitecture.cs new file mode 100644 index 0000000..26445f9 --- /dev/null +++ b/Function/BNGetDefaultArchitecture.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNArchitecture* BNGetDefaultArchitecture(BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetDefaultArchitecture" + )] + internal static extern IntPtr BNGetDefaultArchitecture( + + // BNBinaryView* view + IntPtr view + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDefaultArchitectureFlagConditionLowLevelIL.cs b/Function/BNGetDefaultArchitectureFlagConditionLowLevelIL.cs new file mode 100644 index 0000000..c37fd11 --- /dev/null +++ b/Function/BNGetDefaultArchitectureFlagConditionLowLevelIL.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetDefaultArchitectureFlagConditionLowLevelIL(BNArchitecture* arch, BNLowLevelILFlagCondition cond, uint32_t semClass, BNLowLevelILFunction* il) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetDefaultArchitectureFlagConditionLowLevelIL" + )] + internal static extern ulong BNGetDefaultArchitectureFlagConditionLowLevelIL( + + // BNArchitecture* arch + IntPtr arch , + + // BNLowLevelILFlagCondition cond + LowLevelILFlagCondition cond , + + // uint32_t semClass + uint semClass , + + // BNLowLevelILFunction* il + IntPtr il + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDefaultArchitectureFlagWriteLowLevelIL.cs b/Function/BNGetDefaultArchitectureFlagWriteLowLevelIL.cs new file mode 100644 index 0000000..b22bb43 --- /dev/null +++ b/Function/BNGetDefaultArchitectureFlagWriteLowLevelIL.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetDefaultArchitectureFlagWriteLowLevelIL(BNArchitecture* arch, BNLowLevelILOperation op, uint64_t size, BNFlagRole role, BNRegisterOrConstant* operands, uint64_t operandCount, BNLowLevelILFunction* il) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetDefaultArchitectureFlagWriteLowLevelIL" + )] + internal static extern ulong BNGetDefaultArchitectureFlagWriteLowLevelIL( + + // BNArchitecture* arch + IntPtr arch , + + // BNLowLevelILOperation op + LowLevelILOperation op , + + // uint64_t size + ulong size , + + // BNFlagRole role + FlagRole role , + + // BNRegisterOrConstant* operands + BNRegisterOrConstant[] operands , + + // uint64_t operandCount + ulong operandCount , + + // BNLowLevelILFunction* il + IntPtr il + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDefaultEndianness.cs b/Function/BNGetDefaultEndianness.cs new file mode 100644 index 0000000..b9fc3a4 --- /dev/null +++ b/Function/BNGetDefaultEndianness.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNEndianness BNGetDefaultEndianness(BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetDefaultEndianness" + )] + internal static extern Endianness BNGetDefaultEndianness( + + // BNBinaryView* view + IntPtr view + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDefaultIncomingVariableForParameterVariable.cs b/Function/BNGetDefaultIncomingVariableForParameterVariable.cs new file mode 100644 index 0000000..d61878c --- /dev/null +++ b/Function/BNGetDefaultIncomingVariableForParameterVariable.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNVariable BNGetDefaultIncomingVariableForParameterVariable(BNCallingConvention* cc, BNVariable* var) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetDefaultIncomingVariableForParameterVariable" + )] + internal static extern BNVariable BNGetDefaultIncomingVariableForParameterVariable( + + // BNCallingConvention* cc + IntPtr cc , + + // BNVariable* _var + IntPtr _var + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDefaultIndexForMediumLevelILVariableDefinition.cs b/Function/BNGetDefaultIndexForMediumLevelILVariableDefinition.cs new file mode 100644 index 0000000..ed3b61b --- /dev/null +++ b/Function/BNGetDefaultIndexForMediumLevelILVariableDefinition.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint32_t BNGetDefaultIndexForMediumLevelILVariableDefinition(BNMediumLevelILFunction* func, BNVariable* var, uint64_t instrIndex) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetDefaultIndexForMediumLevelILVariableDefinition" + )] + internal static extern uint BNGetDefaultIndexForMediumLevelILVariableDefinition( + + // BNMediumLevelILFunction* func + IntPtr func , + + // BNVariable* _var + in BNVariable variable , + + // uint64_t instrIndex + MediumLevelILInstructionIndex instrIndex + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDefaultLineFormatter.cs b/Function/BNGetDefaultLineFormatter.cs new file mode 100644 index 0000000..46d94fb --- /dev/null +++ b/Function/BNGetDefaultLineFormatter.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLineFormatter* BNGetDefaultLineFormatter() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetDefaultLineFormatter" + )] + internal static extern IntPtr BNGetDefaultLineFormatter( + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDefaultLineFormatterSettings.cs b/Function/BNGetDefaultLineFormatterSettings.cs new file mode 100644 index 0000000..72ca404 --- /dev/null +++ b/Function/BNGetDefaultLineFormatterSettings.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLineFormatterSettings* BNGetDefaultLineFormatterSettings(BNDisassemblySettings* settings, BNHighLevelILFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetDefaultLineFormatterSettings" + )] + internal static extern IntPtr BNGetDefaultLineFormatterSettings( + + // BNDisassemblySettings* settings + IntPtr settings , + + // BNHighLevelILFunction* func + IntPtr func + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDefaultParameterVariableForIncomingVariable.cs b/Function/BNGetDefaultParameterVariableForIncomingVariable.cs new file mode 100644 index 0000000..faed875 --- /dev/null +++ b/Function/BNGetDefaultParameterVariableForIncomingVariable.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNVariable BNGetDefaultParameterVariableForIncomingVariable(BNCallingConvention* cc, BNVariable* var) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetDefaultParameterVariableForIncomingVariable" + )] + internal static extern BNVariable BNGetDefaultParameterVariableForIncomingVariable( + + // BNCallingConvention* cc + IntPtr cc , + + // BNVariable* _var + IntPtr _var + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDefaultPlatform.cs b/Function/BNGetDefaultPlatform.cs new file mode 100644 index 0000000..a1f1ef4 --- /dev/null +++ b/Function/BNGetDefaultPlatform.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNPlatform* BNGetDefaultPlatform(BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetDefaultPlatform" + )] + internal static extern IntPtr BNGetDefaultPlatform( + + // BNBinaryView* view + IntPtr view + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDefaultTypeParser.cs b/Function/BNGetDefaultTypeParser.cs new file mode 100644 index 0000000..8d5198c --- /dev/null +++ b/Function/BNGetDefaultTypeParser.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeParser* BNGetDefaultTypeParser() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetDefaultTypeParser" + )] + internal static extern IntPtr BNGetDefaultTypeParser( + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDemanglerByName.cs b/Function/BNGetDemanglerByName.cs new file mode 100644 index 0000000..26a82a4 --- /dev/null +++ b/Function/BNGetDemanglerByName.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDemangler* BNGetDemanglerByName(const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetDemanglerByName" + )] + internal static extern IntPtr BNGetDemanglerByName( + + // const char* name + string name + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDemanglerList.cs b/Function/BNGetDemanglerList.cs new file mode 100644 index 0000000..78337de --- /dev/null +++ b/Function/BNGetDemanglerList.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDemangler** BNGetDemanglerList(uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetDemanglerList" + )] + internal static extern IntPtr BNGetDemanglerList( + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDemanglerName.cs b/Function/BNGetDemanglerName.cs new file mode 100644 index 0000000..b807150 --- /dev/null +++ b/Function/BNGetDemanglerName.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetDemanglerName(BNDemangler* demangler) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetDemanglerName" + )] + internal static extern IntPtr BNGetDemanglerName( + + // BNDemangler* demangler + IntPtr demangler + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDirectoryNameInput.cs b/Function/BNGetDirectoryNameInput.cs new file mode 100644 index 0000000..caa9225 --- /dev/null +++ b/Function/BNGetDirectoryNameInput.cs @@ -0,0 +1,53 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public static partial class Core + { + public static string? GetDirectoryNameInput( + string prompt = "Choose a directory:" , + string defaultName = "." + ) + { + bool ok = NativeMethods.BNGetDirectoryNameInput( + out IntPtr result , + prompt , + defaultName + ); + + if (!ok) + { + return null; + } + + return UnsafeUtils.TakeUtf8String(result); + } + } + + internal static partial class NativeMethods + { + /// + /// bool BNGetDirectoryNameInput(const char** result, const char* prompt, const char* defaultName) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetDirectoryNameInput" + )] + internal static extern bool BNGetDirectoryNameInput( + + // char** result + out IntPtr result , + + // const char* prompt + string prompt , + + // const char* defaultName + string defaultName + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDisassemblyAddressBaseOffset.cs b/Function/BNGetDisassemblyAddressBaseOffset.cs new file mode 100644 index 0000000..be9659d --- /dev/null +++ b/Function/BNGetDisassemblyAddressBaseOffset.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetDisassemblyAddressBaseOffset(BNDisassemblySettings* settings) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetDisassemblyAddressBaseOffset" + )] + internal static extern ulong BNGetDisassemblyAddressBaseOffset( + + // BNDisassemblySettings* settings + IntPtr settings + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDisassemblyAddressMode.cs b/Function/BNGetDisassemblyAddressMode.cs new file mode 100644 index 0000000..47b94ed --- /dev/null +++ b/Function/BNGetDisassemblyAddressMode.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDisassemblyAddressMode BNGetDisassemblyAddressMode(BNDisassemblySettings* settings) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetDisassemblyAddressMode" + )] + internal static extern DisassemblyAddressMode BNGetDisassemblyAddressMode( + + // BNDisassemblySettings* settings + IntPtr settings + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDisassemblyBlockLabels.cs b/Function/BNGetDisassemblyBlockLabels.cs new file mode 100644 index 0000000..a1bdd3f --- /dev/null +++ b/Function/BNGetDisassemblyBlockLabels.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDisassemblyBlockLabels BNGetDisassemblyBlockLabels(BNDisassemblySettings* settings) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetDisassemblyBlockLabels" + )] + internal static extern DisassemblyBlockLabels BNGetDisassemblyBlockLabels( + + // BNDisassemblySettings* settings + IntPtr settings + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDisassemblyCallParameterHints.cs b/Function/BNGetDisassemblyCallParameterHints.cs new file mode 100644 index 0000000..dbc2c31 --- /dev/null +++ b/Function/BNGetDisassemblyCallParameterHints.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDisassemblyCallParameterHints BNGetDisassemblyCallParameterHints(BNDisassemblySettings* settings) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetDisassemblyCallParameterHints" + )] + internal static extern DisassemblyCallParameterHints BNGetDisassemblyCallParameterHints( + + // BNDisassemblySettings* settings + IntPtr settings + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDisassemblyGutterWidth.cs b/Function/BNGetDisassemblyGutterWidth.cs new file mode 100644 index 0000000..2004c05 --- /dev/null +++ b/Function/BNGetDisassemblyGutterWidth.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetDisassemblyGutterWidth(BNDisassemblySettings* settings) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetDisassemblyGutterWidth" + )] + internal static extern ulong BNGetDisassemblyGutterWidth( + + // BNDisassemblySettings* settings + IntPtr settings + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDisassemblyMaximumSymbolWidth.cs b/Function/BNGetDisassemblyMaximumSymbolWidth.cs new file mode 100644 index 0000000..fcb937c --- /dev/null +++ b/Function/BNGetDisassemblyMaximumSymbolWidth.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetDisassemblyMaximumSymbolWidth(BNDisassemblySettings* settings) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetDisassemblyMaximumSymbolWidth" + )] + internal static extern ulong BNGetDisassemblyMaximumSymbolWidth( + + // BNDisassemblySettings* settings + IntPtr settings + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDisassemblyTextRendererArchitecture.cs b/Function/BNGetDisassemblyTextRendererArchitecture.cs new file mode 100644 index 0000000..62eebd3 --- /dev/null +++ b/Function/BNGetDisassemblyTextRendererArchitecture.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNArchitecture* BNGetDisassemblyTextRendererArchitecture(BNDisassemblyTextRenderer* renderer) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetDisassemblyTextRendererArchitecture" + )] + internal static extern IntPtr BNGetDisassemblyTextRendererArchitecture( + + // BNDisassemblyTextRenderer* renderer + IntPtr renderer + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDisassemblyTextRendererBasicBlock.cs b/Function/BNGetDisassemblyTextRendererBasicBlock.cs new file mode 100644 index 0000000..e43d81e --- /dev/null +++ b/Function/BNGetDisassemblyTextRendererBasicBlock.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBasicBlock* BNGetDisassemblyTextRendererBasicBlock(BNDisassemblyTextRenderer* renderer) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetDisassemblyTextRendererBasicBlock" + )] + internal static extern IntPtr BNGetDisassemblyTextRendererBasicBlock( + + // BNDisassemblyTextRenderer* renderer + IntPtr renderer + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDisassemblyTextRendererFunction.cs b/Function/BNGetDisassemblyTextRendererFunction.cs new file mode 100644 index 0000000..7b5de55 --- /dev/null +++ b/Function/BNGetDisassemblyTextRendererFunction.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFunction* BNGetDisassemblyTextRendererFunction(BNDisassemblyTextRenderer* renderer) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetDisassemblyTextRendererFunction" + )] + internal static extern IntPtr BNGetDisassemblyTextRendererFunction( + + // BNDisassemblyTextRenderer* renderer + IntPtr renderer + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDisassemblyTextRendererHighLevelILFunction.cs b/Function/BNGetDisassemblyTextRendererHighLevelILFunction.cs new file mode 100644 index 0000000..73c9459 --- /dev/null +++ b/Function/BNGetDisassemblyTextRendererHighLevelILFunction.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNHighLevelILFunction* BNGetDisassemblyTextRendererHighLevelILFunction(BNDisassemblyTextRenderer* renderer) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetDisassemblyTextRendererHighLevelILFunction" + )] + internal static extern IntPtr BNGetDisassemblyTextRendererHighLevelILFunction( + + // BNDisassemblyTextRenderer* renderer + IntPtr renderer + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDisassemblyTextRendererInstructionAnnotations.cs b/Function/BNGetDisassemblyTextRendererInstructionAnnotations.cs new file mode 100644 index 0000000..7b40b0e --- /dev/null +++ b/Function/BNGetDisassemblyTextRendererInstructionAnnotations.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNInstructionTextToken* BNGetDisassemblyTextRendererInstructionAnnotations(BNDisassemblyTextRenderer* renderer, uint64_t addr, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetDisassemblyTextRendererInstructionAnnotations" + )] + internal static extern IntPtr BNGetDisassemblyTextRendererInstructionAnnotations( + + // BNDisassemblyTextRenderer* renderer + IntPtr renderer , + + // uint64_t addr + ulong addr , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDisassemblyTextRendererInstructionText.cs b/Function/BNGetDisassemblyTextRendererInstructionText.cs new file mode 100644 index 0000000..ba5c8cb --- /dev/null +++ b/Function/BNGetDisassemblyTextRendererInstructionText.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNGetDisassemblyTextRendererInstructionText(BNDisassemblyTextRenderer* renderer, uint64_t addr, uint64_t* len, BNDisassemblyTextLine** result, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetDisassemblyTextRendererInstructionText" + )] + internal static extern bool BNGetDisassemblyTextRendererInstructionText( + + // BNDisassemblyTextRenderer* renderer + IntPtr renderer , + + // uint64_t addr + ulong addr , + + // uint64_t* len + IntPtr len , + + // BNDisassemblyTextLine** result + IntPtr result , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDisassemblyTextRendererIntegerTokens.cs b/Function/BNGetDisassemblyTextRendererIntegerTokens.cs new file mode 100644 index 0000000..fb106ed --- /dev/null +++ b/Function/BNGetDisassemblyTextRendererIntegerTokens.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNInstructionTextToken* BNGetDisassemblyTextRendererIntegerTokens(BNDisassemblyTextRenderer* renderer, BNInstructionTextToken* token, BNArchitecture* arch, uint64_t addr, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetDisassemblyTextRendererIntegerTokens" + )] + internal static extern IntPtr BNGetDisassemblyTextRendererIntegerTokens( + + // BNDisassemblyTextRenderer* renderer + IntPtr renderer , + + // BNInstructionTextToken* token + IntPtr token , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t addr + ulong addr , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDisassemblyTextRendererLines.cs b/Function/BNGetDisassemblyTextRendererLines.cs new file mode 100644 index 0000000..5630783 --- /dev/null +++ b/Function/BNGetDisassemblyTextRendererLines.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNGetDisassemblyTextRendererLines(BNDisassemblyTextRenderer* renderer, uint64_t addr, uint64_t* len, BNDisassemblyTextLine** result, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetDisassemblyTextRendererLines" + )] + internal static extern bool BNGetDisassemblyTextRendererLines( + + // BNDisassemblyTextRenderer* renderer + IntPtr renderer , + + // uint64_t addr + ulong addr , + + // uint64_t* len + IntPtr len , + + // BNDisassemblyTextLine** result + IntPtr result , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDisassemblyTextRendererLowLevelILFunction.cs b/Function/BNGetDisassemblyTextRendererLowLevelILFunction.cs new file mode 100644 index 0000000..a3383c4 --- /dev/null +++ b/Function/BNGetDisassemblyTextRendererLowLevelILFunction.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLowLevelILFunction* BNGetDisassemblyTextRendererLowLevelILFunction(BNDisassemblyTextRenderer* renderer) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetDisassemblyTextRendererLowLevelILFunction" + )] + internal static extern IntPtr BNGetDisassemblyTextRendererLowLevelILFunction( + + // BNDisassemblyTextRenderer* renderer + IntPtr renderer + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDisassemblyTextRendererMediumLevelILFunction.cs b/Function/BNGetDisassemblyTextRendererMediumLevelILFunction.cs new file mode 100644 index 0000000..88c64f7 --- /dev/null +++ b/Function/BNGetDisassemblyTextRendererMediumLevelILFunction.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNMediumLevelILFunction* BNGetDisassemblyTextRendererMediumLevelILFunction(BNDisassemblyTextRenderer* renderer) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetDisassemblyTextRendererMediumLevelILFunction" + )] + internal static extern IntPtr BNGetDisassemblyTextRendererMediumLevelILFunction( + + // BNDisassemblyTextRenderer* renderer + IntPtr renderer + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDisassemblyTextRendererSettings.cs b/Function/BNGetDisassemblyTextRendererSettings.cs new file mode 100644 index 0000000..7237282 --- /dev/null +++ b/Function/BNGetDisassemblyTextRendererSettings.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDisassemblySettings* BNGetDisassemblyTextRendererSettings(BNDisassemblyTextRenderer* renderer) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetDisassemblyTextRendererSettings" + )] + internal static extern IntPtr BNGetDisassemblyTextRendererSettings( + + // BNDisassemblyTextRenderer* renderer + IntPtr renderer + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDisassemblyTextRendererStackVariableReferenceTokens.cs b/Function/BNGetDisassemblyTextRendererStackVariableReferenceTokens.cs new file mode 100644 index 0000000..202b8af --- /dev/null +++ b/Function/BNGetDisassemblyTextRendererStackVariableReferenceTokens.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNInstructionTextToken* BNGetDisassemblyTextRendererStackVariableReferenceTokens(BNDisassemblyTextRenderer* renderer, BNStackVariableReference* @ref, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetDisassemblyTextRendererStackVariableReferenceTokens" + )] + internal static extern IntPtr BNGetDisassemblyTextRendererStackVariableReferenceTokens( + + // BNDisassemblyTextRenderer* renderer + IntPtr renderer , + + // BNStackVariableReference* _ref + IntPtr _ref , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDisassemblyTextRendererSymbolTokens.cs b/Function/BNGetDisassemblyTextRendererSymbolTokens.cs new file mode 100644 index 0000000..c6a49c9 --- /dev/null +++ b/Function/BNGetDisassemblyTextRendererSymbolTokens.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNGetDisassemblyTextRendererSymbolTokens(BNDisassemblyTextRenderer* renderer, uint64_t addr, uint64_t size, uint64_t operand, BNInstructionTextToken** result, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetDisassemblyTextRendererSymbolTokens" + )] + internal static extern bool BNGetDisassemblyTextRendererSymbolTokens( + + // BNDisassemblyTextRenderer* renderer + IntPtr renderer , + + // uint64_t addr + ulong addr , + + // uint64_t size + ulong size , + + // uint64_t operand + ulong operand , + + // BNInstructionTextToken** result + IntPtr result , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDisassemblyTextRendererSymbolTokensStatic.cs b/Function/BNGetDisassemblyTextRendererSymbolTokensStatic.cs new file mode 100644 index 0000000..7c2df32 --- /dev/null +++ b/Function/BNGetDisassemblyTextRendererSymbolTokensStatic.cs @@ -0,0 +1,62 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNSymbolDisplayResult BNGetDisassemblyTextRendererSymbolTokensStatic(uint64_t addr, uint64_t size, uint64_t operand, BNBinaryView* data, uint64_t maxSymbolWidth, BNFunction* func, uint8_t confidence, BNSymbolDisplayType symbolDisplay, BNOperatorPrecedence precedence, uint64_t instrAddr, uint64_t exprIndex, BNInstructionTextToken** result, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetDisassemblyTextRendererSymbolTokensStatic" + )] + internal static extern SymbolDisplayResult BNGetDisassemblyTextRendererSymbolTokensStatic( + + // uint64_t addr + ulong addr , + + // uint64_t size + ulong size , + + // uint64_t operand + ulong operand , + + // BNBinaryView* data + IntPtr data , + + // uint64_t maxSymbolWidth + ulong maxSymbolWidth , + + // BNFunction* func + IntPtr func , + + // uint8_t confidence + byte confidence , + + // BNSymbolDisplayType symbolDisplay + SymbolDisplayType symbolDisplay , + + // BNOperatorPrecedence precedence + OperatorPrecedence precedence , + + // uint64_t instrAddr + ulong instrAddr , + + // uint64_t exprIndex + ulong exprIndex , + + // BNInstructionTextToken** result + IntPtr result , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDisassemblyWidth.cs b/Function/BNGetDisassemblyWidth.cs new file mode 100644 index 0000000..54d5d5a --- /dev/null +++ b/Function/BNGetDisassemblyWidth.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetDisassemblyWidth(BNDisassemblySettings* settings) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetDisassemblyWidth" + )] + internal static extern ulong BNGetDisassemblyWidth( + + // BNDisassemblySettings* settings + IntPtr settings + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDisplayStringForInteger.cs b/Function/BNGetDisplayStringForInteger.cs new file mode 100644 index 0000000..91088fa --- /dev/null +++ b/Function/BNGetDisplayStringForInteger.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetDisplayStringForInteger(BNBinaryView* binaryView, BNIntegerDisplayType type, uint64_t value, uint64_t inputWidth, bool isSigned) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetDisplayStringForInteger" + )] + internal static extern IntPtr BNGetDisplayStringForInteger( + + // BNBinaryView* binaryView + IntPtr binaryView , + + // BNIntegerDisplayType type + IntegerDisplayType type , + + // uint64_t _value + ulong _value , + + // uint64_t inputWidth + ulong inputWidth , + + // bool isSigned + bool isSigned + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDownloadProviderByName.cs b/Function/BNGetDownloadProviderByName.cs new file mode 100644 index 0000000..b2c8110 --- /dev/null +++ b/Function/BNGetDownloadProviderByName.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDownloadProvider* BNGetDownloadProviderByName(const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetDownloadProviderByName" + )] + internal static extern IntPtr BNGetDownloadProviderByName( + + // const char* name + string name + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDownloadProviderList.cs b/Function/BNGetDownloadProviderList.cs new file mode 100644 index 0000000..7086b82 --- /dev/null +++ b/Function/BNGetDownloadProviderList.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDownloadProvider** BNGetDownloadProviderList(uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetDownloadProviderList" + )] + internal static extern IntPtr BNGetDownloadProviderList( + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetDownloadProviderName.cs b/Function/BNGetDownloadProviderName.cs new file mode 100644 index 0000000..c54768e --- /dev/null +++ b/Function/BNGetDownloadProviderName.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetDownloadProviderName(BNDownloadProvider* provider) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetDownloadProviderName" + )] + internal static extern IntPtr BNGetDownloadProviderName( + + // BNDownloadProvider* provider + IntPtr provider + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetEarlyReturn.cs b/Function/BNGetEarlyReturn.cs new file mode 100644 index 0000000..888a2dd --- /dev/null +++ b/Function/BNGetEarlyReturn.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNEarlyReturn BNGetEarlyReturn(BNFunction* func, uint64_t addr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetEarlyReturn" + )] + internal static extern EarlyReturn BNGetEarlyReturn( + + // BNFunction* func + IntPtr func , + + // uint64_t addr + ulong addr + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetEmptyTypeContainer.cs b/Function/BNGetEmptyTypeContainer.cs new file mode 100644 index 0000000..ec9ac65 --- /dev/null +++ b/Function/BNGetEmptyTypeContainer.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeContainer* BNGetEmptyTypeContainer() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetEmptyTypeContainer" + )] + internal static extern IntPtr BNGetEmptyTypeContainer(); + } +} \ No newline at end of file diff --git a/Function/BNGetEndOffset.cs b/Function/BNGetEndOffset.cs new file mode 100644 index 0000000..ac60889 --- /dev/null +++ b/Function/BNGetEndOffset.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetEndOffset(BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetEndOffset" + )] + internal static extern ulong BNGetEndOffset( + + // BNBinaryView* view + IntPtr view + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetEnterpriseServerAuthenticationMethods.cs b/Function/BNGetEnterpriseServerAuthenticationMethods.cs new file mode 100644 index 0000000..6866a59 --- /dev/null +++ b/Function/BNGetEnterpriseServerAuthenticationMethods.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetEnterpriseServerAuthenticationMethods(const char*** methods, const char*** names) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetEnterpriseServerAuthenticationMethods" + )] + internal static extern ulong BNGetEnterpriseServerAuthenticationMethods( + + // const char*** methods + IntPtr methods , + + // const char*** names + IntPtr names + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetEnterpriseServerBuildId.cs b/Function/BNGetEnterpriseServerBuildId.cs new file mode 100644 index 0000000..0558526 --- /dev/null +++ b/Function/BNGetEnterpriseServerBuildId.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetEnterpriseServerBuildId() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetEnterpriseServerBuildId" + )] + internal static extern IntPtr BNGetEnterpriseServerBuildId( + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetEnterpriseServerId.cs b/Function/BNGetEnterpriseServerId.cs new file mode 100644 index 0000000..0a92feb --- /dev/null +++ b/Function/BNGetEnterpriseServerId.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetEnterpriseServerId() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetEnterpriseServerId" + )] + internal static extern IntPtr BNGetEnterpriseServerId( + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetEnterpriseServerLastError.cs b/Function/BNGetEnterpriseServerLastError.cs new file mode 100644 index 0000000..b7a2023 --- /dev/null +++ b/Function/BNGetEnterpriseServerLastError.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetEnterpriseServerLastError() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetEnterpriseServerLastError" + )] + internal static extern IntPtr BNGetEnterpriseServerLastError( + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetEnterpriseServerLicenseDuration.cs b/Function/BNGetEnterpriseServerLicenseDuration.cs new file mode 100644 index 0000000..891bfd1 --- /dev/null +++ b/Function/BNGetEnterpriseServerLicenseDuration.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetEnterpriseServerLicenseDuration() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetEnterpriseServerLicenseDuration" + )] + internal static extern ulong BNGetEnterpriseServerLicenseDuration( + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetEnterpriseServerLicenseExpirationTime.cs b/Function/BNGetEnterpriseServerLicenseExpirationTime.cs new file mode 100644 index 0000000..58df1ad --- /dev/null +++ b/Function/BNGetEnterpriseServerLicenseExpirationTime.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetEnterpriseServerLicenseExpirationTime() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetEnterpriseServerLicenseExpirationTime" + )] + internal static extern ulong BNGetEnterpriseServerLicenseExpirationTime( + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetEnterpriseServerName.cs b/Function/BNGetEnterpriseServerName.cs new file mode 100644 index 0000000..8efa981 --- /dev/null +++ b/Function/BNGetEnterpriseServerName.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetEnterpriseServerName() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetEnterpriseServerName" + )] + internal static extern IntPtr BNGetEnterpriseServerName( + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetEnterpriseServerReservationTimeLimit.cs b/Function/BNGetEnterpriseServerReservationTimeLimit.cs new file mode 100644 index 0000000..203eda9 --- /dev/null +++ b/Function/BNGetEnterpriseServerReservationTimeLimit.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetEnterpriseServerReservationTimeLimit() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetEnterpriseServerReservationTimeLimit" + )] + internal static extern ulong BNGetEnterpriseServerReservationTimeLimit( + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetEnterpriseServerToken.cs b/Function/BNGetEnterpriseServerToken.cs new file mode 100644 index 0000000..304cfd1 --- /dev/null +++ b/Function/BNGetEnterpriseServerToken.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetEnterpriseServerToken() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetEnterpriseServerToken" + )] + internal static extern IntPtr BNGetEnterpriseServerToken( + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetEnterpriseServerUrl.cs b/Function/BNGetEnterpriseServerUrl.cs new file mode 100644 index 0000000..b75ff01 --- /dev/null +++ b/Function/BNGetEnterpriseServerUrl.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetEnterpriseServerUrl() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetEnterpriseServerUrl" + )] + internal static extern IntPtr BNGetEnterpriseServerUrl( + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetEnterpriseServerUsername.cs b/Function/BNGetEnterpriseServerUsername.cs new file mode 100644 index 0000000..42bd72a --- /dev/null +++ b/Function/BNGetEnterpriseServerUsername.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetEnterpriseServerUsername() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetEnterpriseServerUsername" + )] + internal static extern IntPtr BNGetEnterpriseServerUsername( + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetEnterpriseServerVersion.cs b/Function/BNGetEnterpriseServerVersion.cs new file mode 100644 index 0000000..314c4de --- /dev/null +++ b/Function/BNGetEnterpriseServerVersion.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetEnterpriseServerVersion() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetEnterpriseServerVersion" + )] + internal static extern ulong BNGetEnterpriseServerVersion( + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetEntropy.cs b/Function/BNGetEntropy.cs new file mode 100644 index 0000000..e380a22 --- /dev/null +++ b/Function/BNGetEntropy.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetEntropy(BNBinaryView* view, uint64_t offset, uint64_t len, uint64_t blockSize, float* result) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetEntropy" + )] + internal static extern ulong BNGetEntropy( + + // BNBinaryView* view + IntPtr view , + + // uint64_t offset + ulong offset , + + // uint64_t len + ulong len , + + // uint64_t blockSize + ulong blockSize , + + // float* result + ref float[] result + ); + } +} \ No newline at end of file diff --git a/Function/BNGetEntryPoint.cs b/Function/BNGetEntryPoint.cs new file mode 100644 index 0000000..970f89a --- /dev/null +++ b/Function/BNGetEntryPoint.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetEntryPoint(BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetEntryPoint" + )] + internal static extern ulong BNGetEntryPoint( + + // BNBinaryView* view + IntPtr view + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetEnumerationBuilderMembers.cs b/Function/BNGetEnumerationBuilderMembers.cs new file mode 100644 index 0000000..85ddef9 --- /dev/null +++ b/Function/BNGetEnumerationBuilderMembers.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNEnumerationMember* BNGetEnumerationBuilderMembers(BNEnumerationBuilder* e, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetEnumerationBuilderMembers" + )] + internal static extern IntPtr BNGetEnumerationBuilderMembers( + + // BNEnumerationBuilder* e + IntPtr e , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetEnumerationMembers.cs b/Function/BNGetEnumerationMembers.cs new file mode 100644 index 0000000..19fa364 --- /dev/null +++ b/Function/BNGetEnumerationMembers.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNEnumerationMember* BNGetEnumerationMembers(BNEnumeration* e, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetEnumerationMembers" + )] + internal static extern IntPtr BNGetEnumerationMembers( + + // BNEnumeration* e + IntPtr e , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetEnumerationTokensForValue.cs b/Function/BNGetEnumerationTokensForValue.cs new file mode 100644 index 0000000..63b459a --- /dev/null +++ b/Function/BNGetEnumerationTokensForValue.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNInstructionTextToken* BNGetEnumerationTokensForValue(BNEnumeration* e, uint64_t value, uint64_t width, uint64_t* count, BNType* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetEnumerationTokensForValue" + )] + internal static extern IntPtr BNGetEnumerationTokensForValue( + + // BNEnumeration* e + IntPtr e , + + // uint64_t value + ulong value , + + // uint64_t width + ulong width , + + // uint64_t* count + out ulong count , + + // BNType* type + IntPtr type + ); + } +} \ No newline at end of file diff --git a/Function/BNGetErrorForDownloadInstance.cs b/Function/BNGetErrorForDownloadInstance.cs new file mode 100644 index 0000000..bb9907b --- /dev/null +++ b/Function/BNGetErrorForDownloadInstance.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetErrorForDownloadInstance(BNDownloadInstance* instance) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetErrorForDownloadInstance" + )] + internal static extern IntPtr BNGetErrorForDownloadInstance( + + // BNDownloadInstance* instance + IntPtr instance + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetExistingViews.cs b/Function/BNGetExistingViews.cs new file mode 100644 index 0000000..018305a --- /dev/null +++ b/Function/BNGetExistingViews.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// char** BNGetExistingViews(BNFileMetadata* file, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetExistingViews" + )] + internal static extern IntPtr BNGetExistingViews( + + // BNFileMetadata* file + IntPtr file , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetExprFolding.cs b/Function/BNGetExprFolding.cs new file mode 100644 index 0000000..e682187 --- /dev/null +++ b/Function/BNGetExprFolding.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNExprFolding BNGetExprFolding(BNFunction* func, uint64_t addr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetExprFolding" + )] + internal static extern ExprFolding BNGetExprFolding( + + // BNFunction* func + IntPtr func , + + // uint64_t addr + ulong addr + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetExpressionParserMagicValue.cs b/Function/BNGetExpressionParserMagicValue.cs new file mode 100644 index 0000000..aed842e --- /dev/null +++ b/Function/BNGetExpressionParserMagicValue.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNGetExpressionParserMagicValue(BNBinaryView* view, const char* name, uint64_t* value) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetExpressionParserMagicValue" + )] + internal static extern bool BNGetExpressionParserMagicValue( + + // BNBinaryView* view + IntPtr view , + + // const char* name + string name , + + // uint64_t* value + out ulong value + ); + } +} \ No newline at end of file diff --git a/Function/BNGetExternalNameSpace.cs b/Function/BNGetExternalNameSpace.cs new file mode 100644 index 0000000..30b085f --- /dev/null +++ b/Function/BNGetExternalNameSpace.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNNameSpace BNGetExternalNameSpace() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetExternalNameSpace" + )] + internal static extern BNNameSpace BNGetExternalNameSpace(); + } +} \ No newline at end of file diff --git a/Function/BNGetFieldResolutionForVariableAt.cs b/Function/BNGetFieldResolutionForVariableAt.cs new file mode 100644 index 0000000..6c353b7 --- /dev/null +++ b/Function/BNGetFieldResolutionForVariableAt.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFieldResolutionInfo* BNGetFieldResolutionForVariableAt(BNFunction* func, BNVariable* var, BNArchitectureAndAddress* defSite) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetFieldResolutionForVariableAt" + )] + internal static extern IntPtr BNGetFieldResolutionForVariableAt( + + // BNFunction* func + IntPtr func , + + // BNVariable* _var + IntPtr _var , + + // BNArchitectureAndAddress* defSite + IntPtr defSite + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFileExtension.cs b/Function/BNGetFileExtension.cs new file mode 100644 index 0000000..c93d856 --- /dev/null +++ b/Function/BNGetFileExtension.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetFileExtension(const char* path) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetFileExtension" + )] + internal static extern IntPtr BNGetFileExtension( + + // const char* path + string path + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFileForView.cs b/Function/BNGetFileForView.cs new file mode 100644 index 0000000..a5aa52c --- /dev/null +++ b/Function/BNGetFileForView.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFileMetadata* BNGetFileForView(BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetFileForView" + )] + internal static extern IntPtr BNGetFileForView( + + // BNBinaryView* view + IntPtr view + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFileMetadataDatabase.cs b/Function/BNGetFileMetadataDatabase.cs new file mode 100644 index 0000000..7731bce --- /dev/null +++ b/Function/BNGetFileMetadataDatabase.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDatabase* BNGetFileMetadataDatabase(BNFileMetadata* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetFileMetadataDatabase" + )] + internal static extern IntPtr BNGetFileMetadataDatabase( + + // BNFileMetadata* file + IntPtr file + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFilePathsInDirectory.cs b/Function/BNGetFilePathsInDirectory.cs new file mode 100644 index 0000000..a99b433 --- /dev/null +++ b/Function/BNGetFilePathsInDirectory.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char** BNGetFilePathsInDirectory(const char* path, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetFilePathsInDirectory" + )] + internal static extern IntPtr BNGetFilePathsInDirectory( + + // const char* path + string path , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFileViewOfType.cs b/Function/BNGetFileViewOfType.cs new file mode 100644 index 0000000..6e0dd91 --- /dev/null +++ b/Function/BNGetFileViewOfType.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBinaryView* BNGetFileViewOfType(BNFileMetadata* file, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetFileViewOfType" + )] + internal static extern IntPtr BNGetFileViewOfType( + + // BNFileMetadata* file + IntPtr file , + + // const char* name + string name + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFilename.cs b/Function/BNGetFilename.cs new file mode 100644 index 0000000..4bc48ab --- /dev/null +++ b/Function/BNGetFilename.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// char* BNGetFileName(BNFileMetadata* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetFilename" + )] + internal static extern IntPtr BNGetFilename( + + // BNFileMetadata* file + IntPtr file + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFirstLinearViewObjectChild.cs b/Function/BNGetFirstLinearViewObjectChild.cs new file mode 100644 index 0000000..b516980 --- /dev/null +++ b/Function/BNGetFirstLinearViewObjectChild.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLinearViewObject* BNGetFirstLinearViewObjectChild(BNLinearViewObject* obj) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetFirstLinearViewObjectChild" + )] + internal static extern IntPtr BNGetFirstLinearViewObjectChild( + + // BNLinearViewObject* obj + IntPtr obj + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFlagsReadByLiftedILInstruction.cs b/Function/BNGetFlagsReadByLiftedILInstruction.cs new file mode 100644 index 0000000..492ecb8 --- /dev/null +++ b/Function/BNGetFlagsReadByLiftedILInstruction.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint32_t* BNGetFlagsReadByLiftedILInstruction(BNFunction* func, uint64_t i, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetFlagsReadByLiftedILInstruction" + )] + internal static extern IntPtr BNGetFlagsReadByLiftedILInstruction( + + // BNFunction* func + IntPtr func , + + // uint64_t i + ulong i , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFlagsWrittenByLiftedILInstruction.cs b/Function/BNGetFlagsWrittenByLiftedILInstruction.cs new file mode 100644 index 0000000..88c899f --- /dev/null +++ b/Function/BNGetFlagsWrittenByLiftedILInstruction.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint32_t* BNGetFlagsWrittenByLiftedILInstruction(BNFunction* func, uint64_t i, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetFlagsWrittenByLiftedILInstruction" + )] + internal static extern IntPtr BNGetFlagsWrittenByLiftedILInstruction( + + // BNFunction* func + IntPtr func , + + // uint64_t i + ulong i , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFloatArgumentRegisters.cs b/Function/BNGetFloatArgumentRegisters.cs new file mode 100644 index 0000000..ef4623a --- /dev/null +++ b/Function/BNGetFloatArgumentRegisters.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint32_t* BNGetFloatArgumentRegisters(BNCallingConvention* cc, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetFloatArgumentRegisters" + )] + internal static extern IntPtr BNGetFloatArgumentRegisters( + + // BNCallingConvention* cc + IntPtr cc , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFloatReturnValueRegister.cs b/Function/BNGetFloatReturnValueRegister.cs new file mode 100644 index 0000000..4beb34e --- /dev/null +++ b/Function/BNGetFloatReturnValueRegister.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint32_t BNGetFloatReturnValueRegister(BNCallingConvention* cc) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetFloatReturnValueRegister" + )] + internal static extern uint BNGetFloatReturnValueRegister( + + // BNCallingConvention* cc + IntPtr cc + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFlowGraphBasicBlock.cs b/Function/BNGetFlowGraphBasicBlock.cs new file mode 100644 index 0000000..16d847f --- /dev/null +++ b/Function/BNGetFlowGraphBasicBlock.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBasicBlock* BNGetFlowGraphBasicBlock(BNFlowGraphNode* node) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetFlowGraphBasicBlock" + )] + internal static extern IntPtr BNGetFlowGraphBasicBlock( + + // BNFlowGraphNode* node + IntPtr node + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFlowGraphHeight.cs b/Function/BNGetFlowGraphHeight.cs new file mode 100644 index 0000000..7acbc3e --- /dev/null +++ b/Function/BNGetFlowGraphHeight.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// int32_t BNGetFlowGraphHeight(BNFlowGraph* graph) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetFlowGraphHeight" + )] + internal static extern int BNGetFlowGraphHeight( + + // BNFlowGraph* graph + IntPtr graph + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFlowGraphHighLevelILFunction.cs b/Function/BNGetFlowGraphHighLevelILFunction.cs new file mode 100644 index 0000000..94635d8 --- /dev/null +++ b/Function/BNGetFlowGraphHighLevelILFunction.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNHighLevelILFunction* BNGetFlowGraphHighLevelILFunction(BNFlowGraph* graph) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetFlowGraphHighLevelILFunction" + )] + internal static extern IntPtr BNGetFlowGraphHighLevelILFunction( + + // BNFlowGraph* graph + IntPtr graph + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFlowGraphLayoutByName.cs b/Function/BNGetFlowGraphLayoutByName.cs new file mode 100644 index 0000000..490c8d8 --- /dev/null +++ b/Function/BNGetFlowGraphLayoutByName.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFlowGraphLayout* BNGetFlowGraphLayoutByName(const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetFlowGraphLayoutByName" + )] + internal static extern IntPtr BNGetFlowGraphLayoutByName( + + // const char* name + string name + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFlowGraphLayoutName.cs b/Function/BNGetFlowGraphLayoutName.cs new file mode 100644 index 0000000..ed39a95 --- /dev/null +++ b/Function/BNGetFlowGraphLayoutName.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetFlowGraphLayoutName(BNFlowGraphLayout* layout) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetFlowGraphLayoutName" + )] + internal static extern IntPtr BNGetFlowGraphLayoutName( + + // BNFlowGraphLayout* layout + IntPtr layout + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFlowGraphLayouts.cs b/Function/BNGetFlowGraphLayouts.cs new file mode 100644 index 0000000..8447dee --- /dev/null +++ b/Function/BNGetFlowGraphLayouts.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFlowGraphLayout** BNGetFlowGraphLayouts(uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetFlowGraphLayouts" + )] + internal static extern IntPtr BNGetFlowGraphLayouts( + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFlowGraphLowLevelILFunction.cs b/Function/BNGetFlowGraphLowLevelILFunction.cs new file mode 100644 index 0000000..854a444 --- /dev/null +++ b/Function/BNGetFlowGraphLowLevelILFunction.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLowLevelILFunction* BNGetFlowGraphLowLevelILFunction(BNFlowGraph* graph) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetFlowGraphLowLevelILFunction" + )] + internal static extern IntPtr BNGetFlowGraphLowLevelILFunction( + + // BNFlowGraph* graph + IntPtr graph + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFlowGraphMediumLevelILFunction.cs b/Function/BNGetFlowGraphMediumLevelILFunction.cs new file mode 100644 index 0000000..5c51f6f --- /dev/null +++ b/Function/BNGetFlowGraphMediumLevelILFunction.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNMediumLevelILFunction* BNGetFlowGraphMediumLevelILFunction(BNFlowGraph* graph) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetFlowGraphMediumLevelILFunction" + )] + internal static extern IntPtr BNGetFlowGraphMediumLevelILFunction( + + // BNFlowGraph* graph + IntPtr graph + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFlowGraphNode.cs b/Function/BNGetFlowGraphNode.cs new file mode 100644 index 0000000..b06e3e9 --- /dev/null +++ b/Function/BNGetFlowGraphNode.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFlowGraphNode* BNGetFlowGraphNode(BNFlowGraph* graph, uint64_t i) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetFlowGraphNode" + )] + internal static extern IntPtr BNGetFlowGraphNode( + + // BNFlowGraph* graph + IntPtr graph , + + // uint64_t i + ulong i + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFlowGraphNodeCount.cs b/Function/BNGetFlowGraphNodeCount.cs new file mode 100644 index 0000000..a72ffb0 --- /dev/null +++ b/Function/BNGetFlowGraphNodeCount.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetFlowGraphNodeCount(BNFlowGraph* graph) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetFlowGraphNodeCount" + )] + internal static extern ulong BNGetFlowGraphNodeCount( + + // BNFlowGraph* graph + IntPtr graph + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFlowGraphNodeHeight.cs b/Function/BNGetFlowGraphNodeHeight.cs new file mode 100644 index 0000000..4a06264 --- /dev/null +++ b/Function/BNGetFlowGraphNodeHeight.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// int32_t BNGetFlowGraphNodeHeight(BNFlowGraphNode* node) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetFlowGraphNodeHeight" + )] + internal static extern int BNGetFlowGraphNodeHeight( + + // BNFlowGraphNode* node + IntPtr node + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFlowGraphNodeHighlight.cs b/Function/BNGetFlowGraphNodeHighlight.cs new file mode 100644 index 0000000..48f9992 --- /dev/null +++ b/Function/BNGetFlowGraphNodeHighlight.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNHighlightColor BNGetFlowGraphNodeHighlight(BNFlowGraphNode* node) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetFlowGraphNodeHighlight" + )] + internal static extern BNHighlightColor BNGetFlowGraphNodeHighlight( + + // BNFlowGraphNode* node + IntPtr node + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFlowGraphNodeIncomingEdges.cs b/Function/BNGetFlowGraphNodeIncomingEdges.cs new file mode 100644 index 0000000..1ab4d63 --- /dev/null +++ b/Function/BNGetFlowGraphNodeIncomingEdges.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFlowGraphEdge* BNGetFlowGraphNodeIncomingEdges(BNFlowGraphNode* node, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetFlowGraphNodeIncomingEdges" + )] + internal static extern IntPtr BNGetFlowGraphNodeIncomingEdges( + + // BNFlowGraphNode* node + IntPtr node , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFlowGraphNodeLines.cs b/Function/BNGetFlowGraphNodeLines.cs new file mode 100644 index 0000000..c3ed236 --- /dev/null +++ b/Function/BNGetFlowGraphNodeLines.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDisassemblyTextLine* BNGetFlowGraphNodeLines(BNFlowGraphNode* node, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetFlowGraphNodeLines" + )] + internal static extern IntPtr BNGetFlowGraphNodeLines( + + // BNFlowGraphNode* node + IntPtr node , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFlowGraphNodeOutgoingEdges.cs b/Function/BNGetFlowGraphNodeOutgoingEdges.cs new file mode 100644 index 0000000..f4a03f3 --- /dev/null +++ b/Function/BNGetFlowGraphNodeOutgoingEdges.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFlowGraphEdge* BNGetFlowGraphNodeOutgoingEdges(BNFlowGraphNode* node, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetFlowGraphNodeOutgoingEdges" + )] + internal static extern IntPtr BNGetFlowGraphNodeOutgoingEdges( + + // BNFlowGraphNode* node + IntPtr node , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFlowGraphNodeOwner.cs b/Function/BNGetFlowGraphNodeOwner.cs new file mode 100644 index 0000000..b4ac261 --- /dev/null +++ b/Function/BNGetFlowGraphNodeOwner.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFlowGraph* BNGetFlowGraphNodeOwner(BNFlowGraphNode* node) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetFlowGraphNodeOwner" + )] + internal static extern IntPtr BNGetFlowGraphNodeOwner( + + // BNFlowGraphNode* node + IntPtr node + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFlowGraphNodeWidth.cs b/Function/BNGetFlowGraphNodeWidth.cs new file mode 100644 index 0000000..e00b682 --- /dev/null +++ b/Function/BNGetFlowGraphNodeWidth.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// int32_t BNGetFlowGraphNodeWidth(BNFlowGraphNode* node) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetFlowGraphNodeWidth" + )] + internal static extern int BNGetFlowGraphNodeWidth( + + // BNFlowGraphNode* node + IntPtr node + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFlowGraphNodeX.cs b/Function/BNGetFlowGraphNodeX.cs new file mode 100644 index 0000000..5327745 --- /dev/null +++ b/Function/BNGetFlowGraphNodeX.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// int32_t BNGetFlowGraphNodeX(BNFlowGraphNode* node) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetFlowGraphNodeX" + )] + internal static extern int BNGetFlowGraphNodeX( + + // BNFlowGraphNode* node + IntPtr node + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFlowGraphNodeY.cs b/Function/BNGetFlowGraphNodeY.cs new file mode 100644 index 0000000..f436558 --- /dev/null +++ b/Function/BNGetFlowGraphNodeY.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// int32_t BNGetFlowGraphNodeY(BNFlowGraphNode* node) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetFlowGraphNodeY" + )] + internal static extern int BNGetFlowGraphNodeY( + + // BNFlowGraphNode* node + IntPtr node + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFlowGraphNodes.cs b/Function/BNGetFlowGraphNodes.cs new file mode 100644 index 0000000..9a9bc30 --- /dev/null +++ b/Function/BNGetFlowGraphNodes.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFlowGraphNode** BNGetFlowGraphNodes(BNFlowGraph* graph, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetFlowGraphNodes" + )] + internal static extern IntPtr BNGetFlowGraphNodes( + + // BNFlowGraph* graph + IntPtr graph , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFlowGraphNodesInRegion.cs b/Function/BNGetFlowGraphNodesInRegion.cs new file mode 100644 index 0000000..d1ec359 --- /dev/null +++ b/Function/BNGetFlowGraphNodesInRegion.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFlowGraphNode** BNGetFlowGraphNodesInRegion(BNFlowGraph* graph, int32_t left, int32_t top, int32_t right, int32_t bottom, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetFlowGraphNodesInRegion" + )] + internal static extern IntPtr BNGetFlowGraphNodesInRegion( + + // BNFlowGraph* graph + IntPtr graph , + + // int32_t left + int left , + + // int32_t top + int top , + + // int32_t right + int right , + + // int32_t bottom + int bottom , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFlowGraphRenderLayers.cs b/Function/BNGetFlowGraphRenderLayers.cs new file mode 100644 index 0000000..11dbd6c --- /dev/null +++ b/Function/BNGetFlowGraphRenderLayers.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRenderLayer** BNGetFlowGraphRenderLayers(BNFlowGraph* graph, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetFlowGraphRenderLayers" + )] + internal static extern IntPtr BNGetFlowGraphRenderLayers( + + // BNFlowGraph* graph + IntPtr graph , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFlowGraphWidth.cs b/Function/BNGetFlowGraphWidth.cs new file mode 100644 index 0000000..3ced560 --- /dev/null +++ b/Function/BNGetFlowGraphWidth.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// int32_t BNGetFlowGraphWidth(BNFlowGraph* graph) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetFlowGraphWidth" + )] + internal static extern int BNGetFlowGraphWidth( + + // BNFlowGraph* graph + IntPtr graph + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFormInput.cs b/Function/BNGetFormInput.cs new file mode 100644 index 0000000..5f84c3b --- /dev/null +++ b/Function/BNGetFormInput.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNGetFormInput(BNFormInputField* fields, uint64_t count, const char* title) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetFormInput" + )] + internal static extern bool BNGetFormInput( + + // BNFormInputField* fields + BNFormInputField[] fields , + + // uint64_t count + ulong count , + + // const char* title + string title + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFullInfoUpdateChannels.cs b/Function/BNGetFullInfoUpdateChannels.cs new file mode 100644 index 0000000..1b5ac92 --- /dev/null +++ b/Function/BNGetFullInfoUpdateChannels.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNUpdateChannelFullInfo* BNGetFullInfoUpdateChannels(uint64_t* count, const char** errors) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetFullInfoUpdateChannels" + )] + internal static extern IntPtr BNGetFullInfoUpdateChannels( + + // uint64_t* count + IntPtr count , + + // const char** errors + string[] errors + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFullWidthArchitectureRegisters.cs b/Function/BNGetFullWidthArchitectureRegisters.cs new file mode 100644 index 0000000..3aa99f2 --- /dev/null +++ b/Function/BNGetFullWidthArchitectureRegisters.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint32_t* BNGetFullWidthArchitectureRegisters(BNArchitecture* arch, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetFullWidthArchitectureRegisters" + )] + internal static extern IntPtr BNGetFullWidthArchitectureRegisters( + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFunctionAddressRanges.cs b/Function/BNGetFunctionAddressRanges.cs new file mode 100644 index 0000000..96e40ea --- /dev/null +++ b/Function/BNGetFunctionAddressRanges.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNAddressRange* BNGetFunctionAddressRanges(BNFunction* func, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetFunctionAddressRanges" + )] + internal static extern IntPtr BNGetFunctionAddressRanges( + + // BNFunction* func + IntPtr func , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFunctionAllTagReferences.cs b/Function/BNGetFunctionAllTagReferences.cs new file mode 100644 index 0000000..6c020d3 --- /dev/null +++ b/Function/BNGetFunctionAllTagReferences.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTagReference* BNGetFunctionAllTagReferences(BNFunction* func, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetFunctionAllTagReferences" + )] + internal static extern IntPtr BNGetFunctionAllTagReferences( + + // BNFunction* func + IntPtr func , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFunctionAnalysisPerformanceInfo.cs b/Function/BNGetFunctionAnalysisPerformanceInfo.cs new file mode 100644 index 0000000..560b738 --- /dev/null +++ b/Function/BNGetFunctionAnalysisPerformanceInfo.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNPerformanceInfo* BNGetFunctionAnalysisPerformanceInfo(BNFunction* func, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetFunctionAnalysisPerformanceInfo" + )] + internal static extern IntPtr BNGetFunctionAnalysisPerformanceInfo( + + // BNFunction* func + IntPtr func , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFunctionAnalysisSkipOverride.cs b/Function/BNGetFunctionAnalysisSkipOverride.cs new file mode 100644 index 0000000..a9e2c7c --- /dev/null +++ b/Function/BNGetFunctionAnalysisSkipOverride.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFunctionAnalysisSkipOverride BNGetFunctionAnalysisSkipOverride(BNFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetFunctionAnalysisSkipOverride" + )] + internal static extern FunctionAnalysisSkipOverride BNGetFunctionAnalysisSkipOverride( + + // BNFunction* func + IntPtr func + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFunctionAnalysisUpdateDisabled.cs b/Function/BNGetFunctionAnalysisUpdateDisabled.cs new file mode 100644 index 0000000..de39ed4 --- /dev/null +++ b/Function/BNGetFunctionAnalysisUpdateDisabled.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNGetFunctionAnalysisUpdateDisabled(BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetFunctionAnalysisUpdateDisabled" + )] + internal static extern bool BNGetFunctionAnalysisUpdateDisabled( + + // BNBinaryView* view + IntPtr view + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFunctionArchitecture.cs b/Function/BNGetFunctionArchitecture.cs new file mode 100644 index 0000000..81ca910 --- /dev/null +++ b/Function/BNGetFunctionArchitecture.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNArchitecture* BNGetFunctionArchitecture(BNFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetFunctionArchitecture" + )] + internal static extern IntPtr BNGetFunctionArchitecture( + + // BNFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFunctionBasicBlockAtAddress.cs b/Function/BNGetFunctionBasicBlockAtAddress.cs new file mode 100644 index 0000000..7964b13 --- /dev/null +++ b/Function/BNGetFunctionBasicBlockAtAddress.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBasicBlock* BNGetFunctionBasicBlockAtAddress(BNFunction* func, BNArchitecture* arch, uint64_t addr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetFunctionBasicBlockAtAddress" + )] + internal static extern IntPtr BNGetFunctionBasicBlockAtAddress( + + // BNFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t addr + ulong addr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFunctionBasicBlockList.cs b/Function/BNGetFunctionBasicBlockList.cs new file mode 100644 index 0000000..05f2ee3 --- /dev/null +++ b/Function/BNGetFunctionBasicBlockList.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBasicBlock** BNGetFunctionBasicBlockList(BNFunction* func, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetFunctionBasicBlockList" + )] + internal static extern IntPtr BNGetFunctionBasicBlockList( + + // BNFunction* func + IntPtr func , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFunctionBlockAnnotations.cs b/Function/BNGetFunctionBlockAnnotations.cs new file mode 100644 index 0000000..ea4d2da --- /dev/null +++ b/Function/BNGetFunctionBlockAnnotations.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNInstructionTextLine* BNGetFunctionBlockAnnotations(BNFunction* func, BNArchitecture* arch, uint64_t addr, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetFunctionBlockAnnotations" + )] + internal static extern IntPtr BNGetFunctionBlockAnnotations( + + // BNFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t addr + ulong addr , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFunctionCallSites.cs b/Function/BNGetFunctionCallSites.cs new file mode 100644 index 0000000..3073397 --- /dev/null +++ b/Function/BNGetFunctionCallSites.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNReferenceSource* BNGetFunctionCallSites(BNFunction* func, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetFunctionCallSites" + )] + internal static extern IntPtr BNGetFunctionCallSites( + + // BNFunction* func + IntPtr func , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFunctionCallingConvention.cs b/Function/BNGetFunctionCallingConvention.cs new file mode 100644 index 0000000..af975d4 --- /dev/null +++ b/Function/BNGetFunctionCallingConvention.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNCallingConventionWithConfidence BNGetFunctionCallingConvention(BNFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetFunctionCallingConvention" + )] + internal static extern BNCallingConventionWithConfidence BNGetFunctionCallingConvention( + + // BNFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFunctionClobberedRegisters.cs b/Function/BNGetFunctionClobberedRegisters.cs new file mode 100644 index 0000000..b8011e2 --- /dev/null +++ b/Function/BNGetFunctionClobberedRegisters.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRegisterSetWithConfidence BNGetFunctionClobberedRegisters(BNFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetFunctionClobberedRegisters" + )] + internal static extern BNRegisterSetWithConfidence BNGetFunctionClobberedRegisters( + + // BNFunction* func + IntPtr func + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFunctionComment.cs b/Function/BNGetFunctionComment.cs new file mode 100644 index 0000000..e60480e --- /dev/null +++ b/Function/BNGetFunctionComment.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// char* BNGetFunctionComment(BNFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetFunctionComment" + )] + internal static extern IntPtr BNGetFunctionComment( + + // BNFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFunctionData.cs b/Function/BNGetFunctionData.cs new file mode 100644 index 0000000..693600d --- /dev/null +++ b/Function/BNGetFunctionData.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBinaryView* BNGetFunctionData(BNFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetFunctionData" + )] + internal static extern IntPtr BNGetFunctionData( + + // BNFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFunctionForFlowGraph.cs b/Function/BNGetFunctionForFlowGraph.cs new file mode 100644 index 0000000..744ab69 --- /dev/null +++ b/Function/BNGetFunctionForFlowGraph.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFunction* BNGetFunctionForFlowGraph(BNFlowGraph* graph) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetFunctionForFlowGraph" + )] + internal static extern IntPtr BNGetFunctionForFlowGraph( + + // BNFlowGraph* graph + IntPtr graph + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFunctionGlobalPointerValue.cs b/Function/BNGetFunctionGlobalPointerValue.cs new file mode 100644 index 0000000..66c0b0c --- /dev/null +++ b/Function/BNGetFunctionGlobalPointerValue.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRegisterValueWithConfidence BNGetFunctionGlobalPointerValue(BNFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetFunctionGlobalPointerValue" + )] + internal static extern BNRegisterValueWithConfidence BNGetFunctionGlobalPointerValue( + + // BNFunction* func + IntPtr func + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFunctionHighLevelIL.cs b/Function/BNGetFunctionHighLevelIL.cs new file mode 100644 index 0000000..1ff874b --- /dev/null +++ b/Function/BNGetFunctionHighLevelIL.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNHighLevelILFunction* BNGetFunctionHighLevelIL(BNFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetFunctionHighLevelIL" + )] + internal static extern IntPtr BNGetFunctionHighLevelIL( + + // BNFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFunctionHighLevelILIfAvailable.cs b/Function/BNGetFunctionHighLevelILIfAvailable.cs new file mode 100644 index 0000000..5dc377a --- /dev/null +++ b/Function/BNGetFunctionHighLevelILIfAvailable.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNHighLevelILFunction* BNGetFunctionHighLevelILIfAvailable(BNFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetFunctionHighLevelILIfAvailable" + )] + internal static extern IntPtr BNGetFunctionHighLevelILIfAvailable( + + // BNFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFunctionHighestAddress.cs b/Function/BNGetFunctionHighestAddress.cs new file mode 100644 index 0000000..0ce5275 --- /dev/null +++ b/Function/BNGetFunctionHighestAddress.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetFunctionHighestAddress(BNFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetFunctionHighestAddress" + )] + internal static extern ulong BNGetFunctionHighestAddress( + + // BNFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFunctionLanguageRepresentation.cs b/Function/BNGetFunctionLanguageRepresentation.cs new file mode 100644 index 0000000..57d351e --- /dev/null +++ b/Function/BNGetFunctionLanguageRepresentation.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLanguageRepresentationFunction* BNGetFunctionLanguageRepresentation(BNFunction* func, const char* language) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetFunctionLanguageRepresentation" + )] + internal static extern IntPtr BNGetFunctionLanguageRepresentation( + + // BNFunction* func + IntPtr func , + + // const char* language + string language + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFunctionLanguageRepresentationIfAvailable.cs b/Function/BNGetFunctionLanguageRepresentationIfAvailable.cs new file mode 100644 index 0000000..cbc6934 --- /dev/null +++ b/Function/BNGetFunctionLanguageRepresentationIfAvailable.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLanguageRepresentationFunction* BNGetFunctionLanguageRepresentationIfAvailable(BNFunction* func, const char* language) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetFunctionLanguageRepresentationIfAvailable" + )] + internal static extern IntPtr BNGetFunctionLanguageRepresentationIfAvailable( + + // BNFunction* func + IntPtr func , + + // const char* language + string language + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFunctionLiftedIL.cs b/Function/BNGetFunctionLiftedIL.cs new file mode 100644 index 0000000..ee19c6c --- /dev/null +++ b/Function/BNGetFunctionLiftedIL.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLowLevelILFunction* BNGetFunctionLiftedIL(BNFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetFunctionLiftedIL" + )] + internal static extern IntPtr BNGetFunctionLiftedIL( + + // BNFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFunctionLiftedILIfAvailable.cs b/Function/BNGetFunctionLiftedILIfAvailable.cs new file mode 100644 index 0000000..ca16896 --- /dev/null +++ b/Function/BNGetFunctionLiftedILIfAvailable.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLowLevelILFunction* BNGetFunctionLiftedILIfAvailable(BNFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetFunctionLiftedILIfAvailable" + )] + internal static extern IntPtr BNGetFunctionLiftedILIfAvailable( + + // BNFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFunctionLowLevelIL.cs b/Function/BNGetFunctionLowLevelIL.cs new file mode 100644 index 0000000..a779eff --- /dev/null +++ b/Function/BNGetFunctionLowLevelIL.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLowLevelILFunction* BNGetFunctionLowLevelIL(BNFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetFunctionLowLevelIL" + )] + internal static extern IntPtr BNGetFunctionLowLevelIL( + + // BNFunction* func + IntPtr func + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFunctionLowLevelILIfAvailable.cs b/Function/BNGetFunctionLowLevelILIfAvailable.cs new file mode 100644 index 0000000..a7ef1bc --- /dev/null +++ b/Function/BNGetFunctionLowLevelILIfAvailable.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLowLevelILFunction* BNGetFunctionLowLevelILIfAvailable(BNFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetFunctionLowLevelILIfAvailable" + )] + internal static extern IntPtr BNGetFunctionLowLevelILIfAvailable( + + // BNFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFunctionLowestAddress.cs b/Function/BNGetFunctionLowestAddress.cs new file mode 100644 index 0000000..663c952 --- /dev/null +++ b/Function/BNGetFunctionLowestAddress.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetFunctionLowestAddress(BNFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetFunctionLowestAddress" + )] + internal static extern ulong BNGetFunctionLowestAddress( + + // BNFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFunctionMappedMediumLevelIL.cs b/Function/BNGetFunctionMappedMediumLevelIL.cs new file mode 100644 index 0000000..77889de --- /dev/null +++ b/Function/BNGetFunctionMappedMediumLevelIL.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNMediumLevelILFunction* BNGetFunctionMappedMediumLevelIL(BNFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetFunctionMappedMediumLevelIL" + )] + internal static extern IntPtr BNGetFunctionMappedMediumLevelIL( + + // BNFunction* func + IntPtr func + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFunctionMappedMediumLevelILIfAvailable.cs b/Function/BNGetFunctionMappedMediumLevelILIfAvailable.cs new file mode 100644 index 0000000..8abcac2 --- /dev/null +++ b/Function/BNGetFunctionMappedMediumLevelILIfAvailable.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNMediumLevelILFunction* BNGetFunctionMappedMediumLevelILIfAvailable(BNFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetFunctionMappedMediumLevelILIfAvailable" + )] + internal static extern IntPtr BNGetFunctionMappedMediumLevelILIfAvailable( + + // BNFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFunctionMediumLevelIL.cs b/Function/BNGetFunctionMediumLevelIL.cs new file mode 100644 index 0000000..ebc9633 --- /dev/null +++ b/Function/BNGetFunctionMediumLevelIL.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNMediumLevelILFunction* BNGetFunctionMediumLevelIL(BNFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetFunctionMediumLevelIL" + )] + internal static extern IntPtr BNGetFunctionMediumLevelIL( + + // BNFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFunctionMediumLevelILIfAvailable.cs b/Function/BNGetFunctionMediumLevelILIfAvailable.cs new file mode 100644 index 0000000..52b433c --- /dev/null +++ b/Function/BNGetFunctionMediumLevelILIfAvailable.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNMediumLevelILFunction* BNGetFunctionMediumLevelILIfAvailable(BNFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetFunctionMediumLevelILIfAvailable" + )] + internal static extern IntPtr BNGetFunctionMediumLevelILIfAvailable( + + // BNFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFunctionParameterVariables.cs b/Function/BNGetFunctionParameterVariables.cs new file mode 100644 index 0000000..6ece157 --- /dev/null +++ b/Function/BNGetFunctionParameterVariables.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNParameterVariablesWithConfidence BNGetFunctionParameterVariables(BNFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetFunctionParameterVariables" + )] + internal static extern BNParameterVariablesWithConfidence BNGetFunctionParameterVariables( + + // BNFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFunctionParentComponents.cs b/Function/BNGetFunctionParentComponents.cs new file mode 100644 index 0000000..3c777a2 --- /dev/null +++ b/Function/BNGetFunctionParentComponents.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNComponent** BNGetFunctionParentComponents(BNBinaryView* view, BNFunction* func, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetFunctionParentComponents" + )] + internal static extern IntPtr BNGetFunctionParentComponents( + + // BNBinaryView* view + IntPtr view , + + // BNFunction* func + IntPtr func , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFunctionPlatform.cs b/Function/BNGetFunctionPlatform.cs new file mode 100644 index 0000000..f9ce316 --- /dev/null +++ b/Function/BNGetFunctionPlatform.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNPlatform* BNGetFunctionPlatform(BNFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetFunctionPlatform" + )] + internal static extern IntPtr BNGetFunctionPlatform( + + // BNFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFunctionRegisterStackAdjustments.cs b/Function/BNGetFunctionRegisterStackAdjustments.cs new file mode 100644 index 0000000..b977a31 --- /dev/null +++ b/Function/BNGetFunctionRegisterStackAdjustments.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRegisterStackAdjustment* BNGetFunctionRegisterStackAdjustments(BNFunction* func, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetFunctionRegisterStackAdjustments" + )] + internal static extern IntPtr BNGetFunctionRegisterStackAdjustments( + + // BNFunction* func + IntPtr func , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFunctionRegisterValueAtExit.cs b/Function/BNGetFunctionRegisterValueAtExit.cs new file mode 100644 index 0000000..deef8c2 --- /dev/null +++ b/Function/BNGetFunctionRegisterValueAtExit.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRegisterValueWithConfidence BNGetFunctionRegisterValueAtExit(BNFunction* func, uint32_t reg) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetFunctionRegisterValueAtExit" + )] + internal static extern BNRegisterValueWithConfidence BNGetFunctionRegisterValueAtExit( + + // BNFunction* func + IntPtr func , + + // uint32_t reg + uint reg + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFunctionReturnRegisters.cs b/Function/BNGetFunctionReturnRegisters.cs new file mode 100644 index 0000000..f781e2e --- /dev/null +++ b/Function/BNGetFunctionReturnRegisters.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRegisterSetWithConfidence BNGetFunctionReturnRegisters(BNFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetFunctionReturnRegisters" + )] + internal static extern BNRegisterSetWithConfidence BNGetFunctionReturnRegisters( + + // BNFunction* func + IntPtr func + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFunctionReturnType.cs b/Function/BNGetFunctionReturnType.cs new file mode 100644 index 0000000..7887975 --- /dev/null +++ b/Function/BNGetFunctionReturnType.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeWithConfidence BNGetFunctionReturnType(BNFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetFunctionReturnType" + )] + internal static extern BNTypeWithConfidence BNGetFunctionReturnType( + + // BNFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFunctionStackAdjustment.cs b/Function/BNGetFunctionStackAdjustment.cs new file mode 100644 index 0000000..eba7973 --- /dev/null +++ b/Function/BNGetFunctionStackAdjustment.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNOffsetWithConfidence BNGetFunctionStackAdjustment(BNFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetFunctionStackAdjustment" + )] + internal static extern BNOffsetWithConfidence BNGetFunctionStackAdjustment( + + // BNFunction* func + IntPtr func + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFunctionStart.cs b/Function/BNGetFunctionStart.cs new file mode 100644 index 0000000..2dc9f5c --- /dev/null +++ b/Function/BNGetFunctionStart.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetFunctionStart(BNFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetFunctionStart" + )] + internal static extern ulong BNGetFunctionStart( + + // BNFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFunctionSymbol.cs b/Function/BNGetFunctionSymbol.cs new file mode 100644 index 0000000..6d4259a --- /dev/null +++ b/Function/BNGetFunctionSymbol.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNSymbol* BNGetFunctionSymbol(BNFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetFunctionSymbol" + )] + internal static extern IntPtr BNGetFunctionSymbol( + + // BNFunction* func + IntPtr func + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFunctionTagReferences.cs b/Function/BNGetFunctionTagReferences.cs new file mode 100644 index 0000000..5133fed --- /dev/null +++ b/Function/BNGetFunctionTagReferences.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTagReference* BNGetFunctionTagReferences(BNFunction* func, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetFunctionTagReferences" + )] + internal static extern IntPtr BNGetFunctionTagReferences( + + // BNFunction* func + IntPtr func , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFunctionTagReferencesOfType.cs b/Function/BNGetFunctionTagReferencesOfType.cs new file mode 100644 index 0000000..dfeee99 --- /dev/null +++ b/Function/BNGetFunctionTagReferencesOfType.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTagReference* BNGetFunctionTagReferencesOfType(BNFunction* func, BNTagType* tagType, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetFunctionTagReferencesOfType" + )] + internal static extern IntPtr BNGetFunctionTagReferencesOfType( + + // BNFunction* func + IntPtr func , + + // BNTagType* tagType + IntPtr tagType , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFunctionTags.cs b/Function/BNGetFunctionTags.cs new file mode 100644 index 0000000..a1f35f4 --- /dev/null +++ b/Function/BNGetFunctionTags.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTag** BNGetFunctionTags(BNFunction* func, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetFunctionTags" + )] + internal static extern IntPtr BNGetFunctionTags( + + // BNFunction* func + IntPtr func , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFunctionTagsOfType.cs b/Function/BNGetFunctionTagsOfType.cs new file mode 100644 index 0000000..9a9926c --- /dev/null +++ b/Function/BNGetFunctionTagsOfType.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTag** BNGetFunctionTagsOfType(BNFunction* func, BNTagType* tagType, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetFunctionTagsOfType" + )] + internal static extern IntPtr BNGetFunctionTagsOfType( + + // BNFunction* func + IntPtr func , + + // BNTagType* tagType + IntPtr tagType , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFunctionType.cs b/Function/BNGetFunctionType.cs new file mode 100644 index 0000000..7647976 --- /dev/null +++ b/Function/BNGetFunctionType.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNType* BNGetFunctionType(BNFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetFunctionType" + )] + internal static extern IntPtr BNGetFunctionType( + + // BNFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFunctionTypeTokens.cs b/Function/BNGetFunctionTypeTokens.cs new file mode 100644 index 0000000..6538567 --- /dev/null +++ b/Function/BNGetFunctionTypeTokens.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDisassemblyTextLine* BNGetFunctionTypeTokens(BNFunction* func, BNDisassemblySettings* settings, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetFunctionTypeTokens" + )] + internal static extern IntPtr BNGetFunctionTypeTokens( + + // BNFunction* func + IntPtr func , + + // BNDisassemblySettings* settings + IntPtr settings , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFunctionVariableDeadStoreElimination.cs b/Function/BNGetFunctionVariableDeadStoreElimination.cs new file mode 100644 index 0000000..b6d81ae --- /dev/null +++ b/Function/BNGetFunctionVariableDeadStoreElimination.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDeadStoreElimination BNGetFunctionVariableDeadStoreElimination(BNFunction* func, BNVariable* var) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetFunctionVariableDeadStoreElimination" + )] + internal static extern DeadStoreElimination BNGetFunctionVariableDeadStoreElimination( + + // BNFunction* func + IntPtr func , + + // BNVariable* _var + IntPtr _var + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetFunctionVariables.cs b/Function/BNGetFunctionVariables.cs new file mode 100644 index 0000000..e443830 --- /dev/null +++ b/Function/BNGetFunctionVariables.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNVariableNameAndType* BNGetFunctionVariables(BNFunction* func, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetFunctionVariables" + )] + internal static extern IntPtr BNGetFunctionVariables( + + // BNFunction* func + IntPtr func , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetGlobalCommentForAddress.cs b/Function/BNGetGlobalCommentForAddress.cs new file mode 100644 index 0000000..cdfc1d5 --- /dev/null +++ b/Function/BNGetGlobalCommentForAddress.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetGlobalCommentForAddress(BNBinaryView* view, uint64_t addr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetGlobalCommentForAddress" + )] + internal static extern IntPtr BNGetGlobalCommentForAddress( + + // BNBinaryView* view + IntPtr view , + + // uint64_t addr + ulong addr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetGlobalCommentedAddresses.cs b/Function/BNGetGlobalCommentedAddresses.cs new file mode 100644 index 0000000..52e6f4e --- /dev/null +++ b/Function/BNGetGlobalCommentedAddresses.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t* BNGetGlobalCommentedAddresses(BNBinaryView* view, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetGlobalCommentedAddresses" + )] + internal static extern IntPtr BNGetGlobalCommentedAddresses( + + // BNBinaryView* view + IntPtr view , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetGlobalPointerRegister.cs b/Function/BNGetGlobalPointerRegister.cs new file mode 100644 index 0000000..f88a310 --- /dev/null +++ b/Function/BNGetGlobalPointerRegister.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint32_t BNGetGlobalPointerRegister(BNCallingConvention* cc) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetGlobalPointerRegister" + )] + internal static extern uint BNGetGlobalPointerRegister( + + // BNCallingConvention* cc + IntPtr cc + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetGlobalPointerValue.cs b/Function/BNGetGlobalPointerValue.cs new file mode 100644 index 0000000..dbf618a --- /dev/null +++ b/Function/BNGetGlobalPointerValue.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRegisterValueWithConfidence BNGetGlobalPointerValue(BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetGlobalPointerValue" + )] + internal static extern BNRegisterValueWithConfidence BNGetGlobalPointerValue( + + // BNBinaryView* view + IntPtr view + ); + } +} \ No newline at end of file diff --git a/Function/BNGetGotoLabelName.cs b/Function/BNGetGotoLabelName.cs new file mode 100644 index 0000000..6a8738f --- /dev/null +++ b/Function/BNGetGotoLabelName.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// char* BNGetGotoLabelName(BNFunction* func, uint64_t labelId) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetGotoLabelName" + )] + internal static extern IntPtr BNGetGotoLabelName( + + // BNFunction* func + IntPtr func , + + // uint64_t labelId + ulong labelId + ); + } +} \ No newline at end of file diff --git a/Function/BNGetGraphForFlowGraphLayoutRequest.cs b/Function/BNGetGraphForFlowGraphLayoutRequest.cs new file mode 100644 index 0000000..bffee81 --- /dev/null +++ b/Function/BNGetGraphForFlowGraphLayoutRequest.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFlowGraph* BNGetGraphForFlowGraphLayoutRequest(BNFlowGraphLayoutRequest* layout) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetGraphForFlowGraphLayoutRequest" + )] + internal static extern IntPtr BNGetGraphForFlowGraphLayoutRequest( + + // BNFlowGraphLayoutRequest* layout + IntPtr layout + ); + } +} \ No newline at end of file diff --git a/Function/BNGetGuidedSourceBlocks.cs b/Function/BNGetGuidedSourceBlocks.cs new file mode 100644 index 0000000..d69fa6a --- /dev/null +++ b/Function/BNGetGuidedSourceBlocks.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNArchitectureAndAddress* BNGetGuidedSourceBlocks(BNFunction* func, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetGuidedSourceBlocks" + )] + internal static extern IntPtr BNGetGuidedSourceBlocks( + + // BNFunction* func + IntPtr func , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetHighIntegerReturnValueRegister.cs b/Function/BNGetHighIntegerReturnValueRegister.cs new file mode 100644 index 0000000..63b1645 --- /dev/null +++ b/Function/BNGetHighIntegerReturnValueRegister.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint32_t BNGetHighIntegerReturnValueRegister(BNCallingConvention* cc) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetHighIntegerReturnValueRegister" + )] + internal static extern uint BNGetHighIntegerReturnValueRegister( + + // BNCallingConvention* cc + IntPtr cc + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetHighLevelILAliasedVariables.cs b/Function/BNGetHighLevelILAliasedVariables.cs new file mode 100644 index 0000000..bce0391 --- /dev/null +++ b/Function/BNGetHighLevelILAliasedVariables.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNVariable* BNGetHighLevelILAliasedVariables(BNHighLevelILFunction* func, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetHighLevelILAliasedVariables" + )] + internal static extern IntPtr BNGetHighLevelILAliasedVariables( + + // BNHighLevelILFunction* func + IntPtr func , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetHighLevelILBasicBlockForInstruction.cs b/Function/BNGetHighLevelILBasicBlockForInstruction.cs new file mode 100644 index 0000000..f748171 --- /dev/null +++ b/Function/BNGetHighLevelILBasicBlockForInstruction.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBasicBlock* BNGetHighLevelILBasicBlockForInstruction(BNHighLevelILFunction* func, uint64_t i) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetHighLevelILBasicBlockForInstruction" + )] + internal static extern IntPtr BNGetHighLevelILBasicBlockForInstruction( + + // BNHighLevelILFunction* func + IntPtr func , + + // uint64_t i + HighLevelILInstructionIndex i + ); + } +} \ No newline at end of file diff --git a/Function/BNGetHighLevelILBasicBlockList.cs b/Function/BNGetHighLevelILBasicBlockList.cs new file mode 100644 index 0000000..18cbd40 --- /dev/null +++ b/Function/BNGetHighLevelILBasicBlockList.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBasicBlock** BNGetHighLevelILBasicBlockList(BNHighLevelILFunction* func, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetHighLevelILBasicBlockList" + )] + internal static extern IntPtr BNGetHighLevelILBasicBlockList( + + // BNHighLevelILFunction* func + IntPtr func , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetHighLevelILByIndex.cs b/Function/BNGetHighLevelILByIndex.cs new file mode 100644 index 0000000..4d1c954 --- /dev/null +++ b/Function/BNGetHighLevelILByIndex.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNHighLevelILInstruction BNGetHighLevelILByIndex(BNHighLevelILFunction* func, uint64_t i, bool asFullAst) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetHighLevelILByIndex" + )] + internal static extern BNHighLevelILInstruction BNGetHighLevelILByIndex( + + // BNHighLevelILFunction* func + IntPtr func , + + // uint64_t i + HighLevelILExpressionIndex i , + + // bool asFullAst + bool asFullAst + ); + } +} \ No newline at end of file diff --git a/Function/BNGetHighLevelILExprCount.cs b/Function/BNGetHighLevelILExprCount.cs new file mode 100644 index 0000000..17ec4f0 --- /dev/null +++ b/Function/BNGetHighLevelILExprCount.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetHighLevelILExprCount(BNHighLevelILFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetHighLevelILExprCount" + )] + internal static extern ulong BNGetHighLevelILExprCount( + + // BNHighLevelILFunction* func + IntPtr func + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetHighLevelILExprIndex.cs b/Function/BNGetHighLevelILExprIndex.cs new file mode 100644 index 0000000..c9dceca --- /dev/null +++ b/Function/BNGetHighLevelILExprIndex.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetHighLevelILExprIndex(BNMediumLevelILFunction* func, uint64_t expr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetHighLevelILExprIndex" + )] + internal static extern HighLevelILExpressionIndex BNGetHighLevelILExprIndex( + + // BNMediumLevelILFunction* func + IntPtr func , + + // uint64_t expr + MediumLevelILExpressionIndex expr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetHighLevelILExprIndexForLabel.cs b/Function/BNGetHighLevelILExprIndexForLabel.cs new file mode 100644 index 0000000..1e6e5c7 --- /dev/null +++ b/Function/BNGetHighLevelILExprIndexForLabel.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetHighLevelILExprIndexForLabel(BNHighLevelILFunction* func, uint64_t label) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetHighLevelILExprIndexForLabel" + )] + internal static extern HighLevelILExpressionIndex BNGetHighLevelILExprIndexForLabel( + + // BNHighLevelILFunction* func + IntPtr func , + + // uint64_t label + ulong label + ); + } +} \ No newline at end of file diff --git a/Function/BNGetHighLevelILExprIndexes.cs b/Function/BNGetHighLevelILExprIndexes.cs new file mode 100644 index 0000000..38e5721 --- /dev/null +++ b/Function/BNGetHighLevelILExprIndexes.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t* BNGetHighLevelILExprIndexes(BNMediumLevelILFunction* func, uint64_t expr, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetHighLevelILExprIndexes" + )] + internal static extern IntPtr BNGetHighLevelILExprIndexes( + + // BNMediumLevelILFunction* func + IntPtr func , + + // uint64_t expr + MediumLevelILExpressionIndex expr , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetHighLevelILExprScopeType.cs b/Function/BNGetHighLevelILExprScopeType.cs new file mode 100644 index 0000000..ff6d23a --- /dev/null +++ b/Function/BNGetHighLevelILExprScopeType.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNScopeType BNGetHighLevelILExprScopeType(BNHighLevelILFunction* func, uint64_t exprIndex) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetHighLevelILExprScopeType" + )] + internal static extern ScopeType BNGetHighLevelILExprScopeType( + + // BNHighLevelILFunction* func + IntPtr func , + + // uint64_t exprIndex + ulong exprIndex + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetHighLevelILExprText.cs b/Function/BNGetHighLevelILExprText.cs new file mode 100644 index 0000000..3eda687 --- /dev/null +++ b/Function/BNGetHighLevelILExprText.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDisassemblyTextLine* BNGetHighLevelILExprText(BNHighLevelILFunction* func, uint64_t expr, bool asFullAst, uint64_t* count, BNDisassemblySettings* settings) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetHighLevelILExprText" + )] + internal static extern IntPtr BNGetHighLevelILExprText( + + // BNHighLevelILFunction* func + IntPtr func , + + // uint64_t expr + HighLevelILExpressionIndex expr , + + // bool asFullAst + bool asFullAst , + + // uint64_t* count + out ulong count , + + // BNDisassemblySettings* settings + IntPtr settings + ); + } +} \ No newline at end of file diff --git a/Function/BNGetHighLevelILExprType.cs b/Function/BNGetHighLevelILExprType.cs new file mode 100644 index 0000000..ff0b696 --- /dev/null +++ b/Function/BNGetHighLevelILExprType.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeWithConfidence BNGetHighLevelILExprType(BNHighLevelILFunction* func, uint64_t expr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetHighLevelILExprType" + )] + internal static extern BNTypeWithConfidence BNGetHighLevelILExprType( + + // BNHighLevelILFunction* func + IntPtr func , + + // uint64_t expr + HighLevelILExpressionIndex expr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetHighLevelILForMediumLevelIL.cs b/Function/BNGetHighLevelILForMediumLevelIL.cs new file mode 100644 index 0000000..ecad4a2 --- /dev/null +++ b/Function/BNGetHighLevelILForMediumLevelIL.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNHighLevelILFunction* BNGetHighLevelILForMediumLevelIL(BNMediumLevelILFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetHighLevelILForMediumLevelIL" + )] + internal static extern IntPtr BNGetHighLevelILForMediumLevelIL( + + // BNMediumLevelILFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNGetHighLevelILIndexForInstruction.cs b/Function/BNGetHighLevelILIndexForInstruction.cs new file mode 100644 index 0000000..2399bbe --- /dev/null +++ b/Function/BNGetHighLevelILIndexForInstruction.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetHighLevelILIndexForInstruction(BNHighLevelILFunction* func, uint64_t i) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetHighLevelILIndexForInstruction" + )] + internal static extern HighLevelILExpressionIndex BNGetHighLevelILIndexForInstruction( + + // BNHighLevelILFunction* func + IntPtr func , + + // uint64_t i + HighLevelILInstructionIndex i + ); + } +} \ No newline at end of file diff --git a/Function/BNGetHighLevelILInstructionCount.cs b/Function/BNGetHighLevelILInstructionCount.cs new file mode 100644 index 0000000..2e2003e --- /dev/null +++ b/Function/BNGetHighLevelILInstructionCount.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetHighLevelILInstructionCount(BNHighLevelILFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetHighLevelILInstructionCount" + )] + internal static extern ulong BNGetHighLevelILInstructionCount( + + // BNHighLevelILFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNGetHighLevelILInstructionForExpr.cs b/Function/BNGetHighLevelILInstructionForExpr.cs new file mode 100644 index 0000000..16841dd --- /dev/null +++ b/Function/BNGetHighLevelILInstructionForExpr.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetHighLevelILInstructionForExpr(BNHighLevelILFunction* func, uint64_t expr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetHighLevelILInstructionForExpr" + )] + internal static extern HighLevelILInstructionIndex BNGetHighLevelILInstructionForExpr( + + // BNHighLevelILFunction* func + IntPtr func , + + // uint64_t expr + HighLevelILExpressionIndex expr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetHighLevelILInstructionIndex.cs b/Function/BNGetHighLevelILInstructionIndex.cs new file mode 100644 index 0000000..50ed385 --- /dev/null +++ b/Function/BNGetHighLevelILInstructionIndex.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + + + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetHighLevelILInstructionIndex(BNMediumLevelILFunction* func, uint64_t instr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetHighLevelILInstructionIndex" + )] + internal static extern HighLevelILInstructionIndex BNGetHighLevelILInstructionIndex( + + // BNMediumLevelILFunction* func + IntPtr func , + + // uint64_t instr + MediumLevelILInstructionIndex instr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetHighLevelILNonSSAExprIndex.cs b/Function/BNGetHighLevelILNonSSAExprIndex.cs new file mode 100644 index 0000000..0cd48e1 --- /dev/null +++ b/Function/BNGetHighLevelILNonSSAExprIndex.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetHighLevelILNonSSAExprIndex(BNHighLevelILFunction* func, uint64_t expr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetHighLevelILNonSSAExprIndex" + )] + internal static extern HighLevelILExpressionIndex BNGetHighLevelILNonSSAExprIndex( + + // BNHighLevelILFunction* func + IntPtr func , + + // uint64_t expr + HighLevelILExpressionIndex expr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetHighLevelILNonSSAForm.cs b/Function/BNGetHighLevelILNonSSAForm.cs new file mode 100644 index 0000000..40de388 --- /dev/null +++ b/Function/BNGetHighLevelILNonSSAForm.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNHighLevelILFunction* BNGetHighLevelILNonSSAForm(BNHighLevelILFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetHighLevelILNonSSAForm" + )] + internal static extern IntPtr BNGetHighLevelILNonSSAForm( + + // BNHighLevelILFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNGetHighLevelILNonSSAInstructionIndex.cs b/Function/BNGetHighLevelILNonSSAInstructionIndex.cs new file mode 100644 index 0000000..7c071ce --- /dev/null +++ b/Function/BNGetHighLevelILNonSSAInstructionIndex.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetHighLevelILNonSSAInstructionIndex(BNHighLevelILFunction* func, uint64_t instr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetHighLevelILNonSSAInstructionIndex" + )] + internal static extern HighLevelILInstructionIndex BNGetHighLevelILNonSSAInstructionIndex( + + // BNHighLevelILFunction* func + IntPtr func , + + // uint64_t instr + HighLevelILInstructionIndex instr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetHighLevelILOwnerFunction.cs b/Function/BNGetHighLevelILOwnerFunction.cs new file mode 100644 index 0000000..dffe142 --- /dev/null +++ b/Function/BNGetHighLevelILOwnerFunction.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFunction* BNGetHighLevelILOwnerFunction(BNHighLevelILFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetHighLevelILOwnerFunction" + )] + internal static extern IntPtr BNGetHighLevelILOwnerFunction( + + // BNHighLevelILFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNGetHighLevelILRootExpr.cs b/Function/BNGetHighLevelILRootExpr.cs new file mode 100644 index 0000000..e3c17c5 --- /dev/null +++ b/Function/BNGetHighLevelILRootExpr.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetHighLevelILRootExpr(BNHighLevelILFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetHighLevelILRootExpr" + )] + internal static extern HighLevelILExpressionIndex BNGetHighLevelILRootExpr( + + // BNHighLevelILFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNGetHighLevelILSSAExprIndex.cs b/Function/BNGetHighLevelILSSAExprIndex.cs new file mode 100644 index 0000000..60c2afa --- /dev/null +++ b/Function/BNGetHighLevelILSSAExprIndex.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetHighLevelILSSAExprIndex(BNHighLevelILFunction* func, uint64_t expr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetHighLevelILSSAExprIndex" + )] + internal static extern HighLevelILExpressionIndex BNGetHighLevelILSSAExprIndex( + + // BNHighLevelILFunction* func + IntPtr func , + + // uint64_t expr + HighLevelILExpressionIndex expr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetHighLevelILSSAForm.cs b/Function/BNGetHighLevelILSSAForm.cs new file mode 100644 index 0000000..9590a35 --- /dev/null +++ b/Function/BNGetHighLevelILSSAForm.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNHighLevelILFunction* BNGetHighLevelILSSAForm(BNHighLevelILFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetHighLevelILSSAForm" + )] + internal static extern IntPtr BNGetHighLevelILSSAForm( + + // BNHighLevelILFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNGetHighLevelILSSAInstructionIndex.cs b/Function/BNGetHighLevelILSSAInstructionIndex.cs new file mode 100644 index 0000000..2de3980 --- /dev/null +++ b/Function/BNGetHighLevelILSSAInstructionIndex.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetHighLevelILSSAInstructionIndex(BNHighLevelILFunction* func, uint64_t instr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetHighLevelILSSAInstructionIndex" + )] + internal static extern HighLevelILInstructionIndex BNGetHighLevelILSSAInstructionIndex( + + // BNHighLevelILFunction* func + IntPtr func , + + // uint64_t instr + HighLevelILInstructionIndex instr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetHighLevelILSSAMemoryDefinition.cs b/Function/BNGetHighLevelILSSAMemoryDefinition.cs new file mode 100644 index 0000000..dccaba4 --- /dev/null +++ b/Function/BNGetHighLevelILSSAMemoryDefinition.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetHighLevelILSSAMemoryDefinition(BNHighLevelILFunction* func, uint64_t version) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetHighLevelILSSAMemoryDefinition" + )] + internal static extern HighLevelILExpressionIndex BNGetHighLevelILSSAMemoryDefinition( + + // BNHighLevelILFunction* func + IntPtr func , + + // uint64_t version + ulong version + ); + } +} \ No newline at end of file diff --git a/Function/BNGetHighLevelILSSAMemoryUses.cs b/Function/BNGetHighLevelILSSAMemoryUses.cs new file mode 100644 index 0000000..05ecfa4 --- /dev/null +++ b/Function/BNGetHighLevelILSSAMemoryUses.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t* BNGetHighLevelILSSAMemoryUses(BNHighLevelILFunction* func, uint64_t version, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetHighLevelILSSAMemoryUses" + )] + internal static extern IntPtr BNGetHighLevelILSSAMemoryUses( + + // BNHighLevelILFunction* func + IntPtr func , + + // uint64_t version + ulong version , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetHighLevelILSSAMemoryVersionAtILInstruction.cs b/Function/BNGetHighLevelILSSAMemoryVersionAtILInstruction.cs new file mode 100644 index 0000000..cab85ec --- /dev/null +++ b/Function/BNGetHighLevelILSSAMemoryVersionAtILInstruction.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetHighLevelILSSAMemoryVersionAtILInstruction(BNHighLevelILFunction* func, uint64_t instr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetHighLevelILSSAMemoryVersionAtILInstruction" + )] + internal static extern ulong BNGetHighLevelILSSAMemoryVersionAtILInstruction( + + // BNHighLevelILFunction* func + IntPtr func , + + // uint64_t instr + HighLevelILInstructionIndex instr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetHighLevelILSSAVarDefinition.cs b/Function/BNGetHighLevelILSSAVarDefinition.cs new file mode 100644 index 0000000..038fe8d --- /dev/null +++ b/Function/BNGetHighLevelILSSAVarDefinition.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetHighLevelILSSAVarDefinition(BNHighLevelILFunction* func, BNVariable* var, uint64_t version) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetHighLevelILSSAVarDefinition" + )] + internal static extern HighLevelILExpressionIndex BNGetHighLevelILSSAVarDefinition( + + // BNHighLevelILFunction* func + IntPtr func , + + // BNVariable* _var + in BNVariable _var , + + // uint64_t version + ulong version + ); + } +} \ No newline at end of file diff --git a/Function/BNGetHighLevelILSSAVarUses.cs b/Function/BNGetHighLevelILSSAVarUses.cs new file mode 100644 index 0000000..dc56cf9 --- /dev/null +++ b/Function/BNGetHighLevelILSSAVarUses.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t* BNGetHighLevelILSSAVarUses(BNHighLevelILFunction* func, BNVariable* var, uint64_t version, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetHighLevelILSSAVarUses" + )] + internal static extern IntPtr BNGetHighLevelILSSAVarUses( + + // BNHighLevelILFunction* func + IntPtr func , + + // BNVariable* _var + in BNVariable _var , + + // uint64_t version + ulong version , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetHighLevelILSSAVarVersionAtILInstruction.cs b/Function/BNGetHighLevelILSSAVarVersionAtILInstruction.cs new file mode 100644 index 0000000..dc50d65 --- /dev/null +++ b/Function/BNGetHighLevelILSSAVarVersionAtILInstruction.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetHighLevelILSSAVarVersionAtILInstruction(BNHighLevelILFunction* func, BNVariable* var, uint64_t instr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetHighLevelILSSAVarVersionAtILInstruction" + )] + internal static extern ulong BNGetHighLevelILSSAVarVersionAtILInstruction( + + // BNHighLevelILFunction* func + IntPtr func , + + // BNVariable* _var + in BNVariable _var , + + // uint64_t instr + HighLevelILInstructionIndex instr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetHighLevelILUsesForLabel.cs b/Function/BNGetHighLevelILUsesForLabel.cs new file mode 100644 index 0000000..95746f9 --- /dev/null +++ b/Function/BNGetHighLevelILUsesForLabel.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t* BNGetHighLevelILUsesForLabel(BNHighLevelILFunction* func, uint64_t label, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetHighLevelILUsesForLabel" + )] + internal static extern IntPtr BNGetHighLevelILUsesForLabel( + + // BNHighLevelILFunction* func + IntPtr func , + + // uint64_t label + ulong label , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetHighLevelILVariableDefinitions.cs b/Function/BNGetHighLevelILVariableDefinitions.cs new file mode 100644 index 0000000..947fafa --- /dev/null +++ b/Function/BNGetHighLevelILVariableDefinitions.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t* BNGetHighLevelILVariableDefinitions(BNHighLevelILFunction* func, BNVariable* var, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetHighLevelILVariableDefinitions" + )] + internal static extern IntPtr BNGetHighLevelILVariableDefinitions( + + // BNHighLevelILFunction* func + IntPtr func , + + // BNVariable* _var + in BNVariable _var , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetHighLevelILVariableReferences.cs b/Function/BNGetHighLevelILVariableReferences.cs new file mode 100644 index 0000000..d152d23 --- /dev/null +++ b/Function/BNGetHighLevelILVariableReferences.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNILReferenceSource* BNGetHighLevelILVariableReferences(BNFunction* func, BNVariable* var, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetHighLevelILVariableReferences" + )] + internal static extern IntPtr BNGetHighLevelILVariableReferences( + + // BNFunction* func + IntPtr func , + + // BNVariable* _var + IntPtr _var , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetHighLevelILVariableReferencesFrom.cs b/Function/BNGetHighLevelILVariableReferencesFrom.cs new file mode 100644 index 0000000..912b949 --- /dev/null +++ b/Function/BNGetHighLevelILVariableReferencesFrom.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNVariableReferenceSource* BNGetHighLevelILVariableReferencesFrom(BNFunction* func, BNArchitecture* arch, uint64_t address, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetHighLevelILVariableReferencesFrom" + )] + internal static extern IntPtr BNGetHighLevelILVariableReferencesFrom( + + // BNFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t address + ulong address , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetHighLevelILVariableReferencesFromIfAvailable.cs b/Function/BNGetHighLevelILVariableReferencesFromIfAvailable.cs new file mode 100644 index 0000000..3f74698 --- /dev/null +++ b/Function/BNGetHighLevelILVariableReferencesFromIfAvailable.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNVariableReferenceSource* BNGetHighLevelILVariableReferencesFromIfAvailable(BNFunction* func, BNArchitecture* arch, uint64_t address, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetHighLevelILVariableReferencesFromIfAvailable" + )] + internal static extern IntPtr BNGetHighLevelILVariableReferencesFromIfAvailable( + + // BNFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t address + ulong address , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetHighLevelILVariableReferencesIfAvailable.cs b/Function/BNGetHighLevelILVariableReferencesIfAvailable.cs new file mode 100644 index 0000000..65a4ebd --- /dev/null +++ b/Function/BNGetHighLevelILVariableReferencesIfAvailable.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNILReferenceSource* BNGetHighLevelILVariableReferencesIfAvailable(BNFunction* func, BNVariable* var, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetHighLevelILVariableReferencesIfAvailable" + )] + internal static extern IntPtr BNGetHighLevelILVariableReferencesIfAvailable( + + // BNFunction* func + IntPtr func , + + // BNVariable* _var + IntPtr _var , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetHighLevelILVariableReferencesInRange.cs b/Function/BNGetHighLevelILVariableReferencesInRange.cs new file mode 100644 index 0000000..0c4aad4 --- /dev/null +++ b/Function/BNGetHighLevelILVariableReferencesInRange.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNVariableReferenceSource* BNGetHighLevelILVariableReferencesInRange(BNFunction* func, BNArchitecture* arch, uint64_t address, uint64_t len, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetHighLevelILVariableReferencesInRange" + )] + internal static extern IntPtr BNGetHighLevelILVariableReferencesInRange( + + // BNFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t address + ulong address , + + // uint64_t len + ulong len , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetHighLevelILVariableReferencesInRangeIfAvailable.cs b/Function/BNGetHighLevelILVariableReferencesInRangeIfAvailable.cs new file mode 100644 index 0000000..300f813 --- /dev/null +++ b/Function/BNGetHighLevelILVariableReferencesInRangeIfAvailable.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNVariableReferenceSource* BNGetHighLevelILVariableReferencesInRangeIfAvailable(BNFunction* func, BNArchitecture* arch, uint64_t address, uint64_t len, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetHighLevelILVariableReferencesInRangeIfAvailable" + )] + internal static extern IntPtr BNGetHighLevelILVariableReferencesInRangeIfAvailable( + + // BNFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t address + ulong address , + + // uint64_t len + ulong len , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetHighLevelILVariableSSAVersions.cs b/Function/BNGetHighLevelILVariableSSAVersions.cs new file mode 100644 index 0000000..7f1371e --- /dev/null +++ b/Function/BNGetHighLevelILVariableSSAVersions.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t* BNGetHighLevelILVariableSSAVersions(BNHighLevelILFunction* func, BNVariable* var, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetHighLevelILVariableSSAVersions" + )] + internal static extern IntPtr BNGetHighLevelILVariableSSAVersions( + + // BNHighLevelILFunction* func + IntPtr func , + + // BNVariable* _var + in BNVariable _var , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetHighLevelILVariableUses.cs b/Function/BNGetHighLevelILVariableUses.cs new file mode 100644 index 0000000..50dad5c --- /dev/null +++ b/Function/BNGetHighLevelILVariableUses.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t* BNGetHighLevelILVariableUses(BNHighLevelILFunction* func, BNVariable* var, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetHighLevelILVariableUses" + )] + internal static extern IntPtr BNGetHighLevelILVariableUses( + + // BNHighLevelILFunction* func + IntPtr func , + + // BNVariable* _var + in BNVariable _var , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetHighLevelILVariables.cs b/Function/BNGetHighLevelILVariables.cs new file mode 100644 index 0000000..923a823 --- /dev/null +++ b/Function/BNGetHighLevelILVariables.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNVariable* BNGetHighLevelILVariables(BNHighLevelILFunction* func, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetHighLevelILVariables" + )] + internal static extern IntPtr BNGetHighLevelILVariables( + + // BNHighLevelILFunction* func + IntPtr func , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetHorizontalFlowGraphNodeMargin.cs b/Function/BNGetHorizontalFlowGraphNodeMargin.cs new file mode 100644 index 0000000..edbedb8 --- /dev/null +++ b/Function/BNGetHorizontalFlowGraphNodeMargin.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// int32_t BNGetHorizontalFlowGraphNodeMargin(BNFlowGraph* graph) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetHorizontalFlowGraphNodeMargin" + )] + internal static extern int BNGetHorizontalFlowGraphNodeMargin( + + // BNFlowGraph* graph + IntPtr graph + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetImageBase.cs b/Function/BNGetImageBase.cs new file mode 100644 index 0000000..3c0d388 --- /dev/null +++ b/Function/BNGetImageBase.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetImageBase(BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetImageBase" + )] + internal static extern ulong BNGetImageBase( + + // BNBinaryView* view + IntPtr view + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetImplicitlyDefinedRegisters.cs b/Function/BNGetImplicitlyDefinedRegisters.cs new file mode 100644 index 0000000..4560355 --- /dev/null +++ b/Function/BNGetImplicitlyDefinedRegisters.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint32_t* BNGetImplicitlyDefinedRegisters(BNCallingConvention* cc, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetImplicitlyDefinedRegisters" + )] + internal static extern IntPtr BNGetImplicitlyDefinedRegisters( + + // BNCallingConvention* cc + IntPtr cc , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetIncomingDirectTypeReferences.cs b/Function/BNGetIncomingDirectTypeReferences.cs new file mode 100644 index 0000000..2bc0c0c --- /dev/null +++ b/Function/BNGetIncomingDirectTypeReferences.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNQualifiedName* BNGetIncomingDirectTypeReferences(BNBinaryView* view, BNQualifiedName* type, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetIncomingDirectTypeReferences" + )] + internal static extern IntPtr BNGetIncomingDirectTypeReferences( + + // BNBinaryView* view + IntPtr view , + + // BNQualifiedName* type + in BNQualifiedName type , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetIncomingFlagValue.cs b/Function/BNGetIncomingFlagValue.cs new file mode 100644 index 0000000..c611a47 --- /dev/null +++ b/Function/BNGetIncomingFlagValue.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRegisterValue BNGetIncomingFlagValue(BNCallingConvention* cc, uint32_t reg, BNFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetIncomingFlagValue" + )] + internal static extern BNRegisterValue BNGetIncomingFlagValue( + + // BNCallingConvention* cc + IntPtr cc , + + // uint32_t reg + uint reg , + + // BNFunction* func + IntPtr func + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetIncomingRecursiveTypeReferences.cs b/Function/BNGetIncomingRecursiveTypeReferences.cs new file mode 100644 index 0000000..20567d2 --- /dev/null +++ b/Function/BNGetIncomingRecursiveTypeReferences.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNQualifiedName* BNGetIncomingRecursiveTypeReferences(BNBinaryView* view, BNQualifiedName* types, uint64_t typeCount, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetIncomingRecursiveTypeReferences" + )] + internal static extern IntPtr BNGetIncomingRecursiveTypeReferences( + + // BNBinaryView* view + IntPtr view , + + // BNQualifiedName* types + BNQualifiedName[] types , + + // uint64_t typeCount + ulong typeCount , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetIncomingRegisterValue.cs b/Function/BNGetIncomingRegisterValue.cs new file mode 100644 index 0000000..c22fea1 --- /dev/null +++ b/Function/BNGetIncomingRegisterValue.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRegisterValue BNGetIncomingRegisterValue(BNCallingConvention* cc, uint32_t reg, BNFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetIncomingRegisterValue" + )] + internal static extern BNRegisterValue BNGetIncomingRegisterValue( + + // BNCallingConvention* cc + IntPtr cc , + + // uint32_t reg + uint reg , + + // BNFunction* func + IntPtr func + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetIncomingVariableForParameterVariable.cs b/Function/BNGetIncomingVariableForParameterVariable.cs new file mode 100644 index 0000000..684da94 --- /dev/null +++ b/Function/BNGetIncomingVariableForParameterVariable.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNVariable BNGetIncomingVariableForParameterVariable(BNCallingConvention* cc, BNVariable* var, BNFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetIncomingVariableForParameterVariable" + )] + internal static extern BNVariable BNGetIncomingVariableForParameterVariable( + + // BNCallingConvention* cc + IntPtr cc , + + // BNVariable* _var + IntPtr _var , + + // BNFunction* func + IntPtr func + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetIndirectBranches.cs b/Function/BNGetIndirectBranches.cs new file mode 100644 index 0000000..f69ee1d --- /dev/null +++ b/Function/BNGetIndirectBranches.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNIndirectBranchInfo* BNGetIndirectBranches(BNFunction* func, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetIndirectBranches" + )] + internal static extern IntPtr BNGetIndirectBranches( + + // BNFunction* func + IntPtr func , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetIndirectBranchesAt.cs b/Function/BNGetIndirectBranchesAt.cs new file mode 100644 index 0000000..d3fa2f7 --- /dev/null +++ b/Function/BNGetIndirectBranchesAt.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNIndirectBranchInfo* BNGetIndirectBranchesAt(BNFunction* func, BNArchitecture* arch, uint64_t addr, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetIndirectBranchesAt" + )] + internal static extern IntPtr BNGetIndirectBranchesAt( + + // BNFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t addr + ulong addr , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetInstallDirectory.cs b/Function/BNGetInstallDirectory.cs new file mode 100644 index 0000000..882d880 --- /dev/null +++ b/Function/BNGetInstallDirectory.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public static partial class Core + { + public static string GetInstallDirectory() + { + return UnsafeUtils.TakeUtf8String( + NativeMethods.BNGetInstallDirectory() + ); + } + } + + internal static partial class NativeMethods + { + /// + /// const char* BNGetInstallDirectory() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetInstallDirectory" + )] + internal static extern IntPtr BNGetInstallDirectory(); + } +} \ No newline at end of file diff --git a/Function/BNGetInstructionContainingAddress.cs b/Function/BNGetInstructionContainingAddress.cs new file mode 100644 index 0000000..9e2b64a --- /dev/null +++ b/Function/BNGetInstructionContainingAddress.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNGetInstructionContainingAddress(BNFunction* func, BNArchitecture* arch, uint64_t addr, uint64_t* start) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetInstructionContainingAddress" + )] + internal static extern bool BNGetInstructionContainingAddress( + + // BNFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t addr + ulong addr , + + // uint64_t* start + out ulong start + ); + } +} \ No newline at end of file diff --git a/Function/BNGetInstructionHighlight.cs b/Function/BNGetInstructionHighlight.cs new file mode 100644 index 0000000..8bfc87f --- /dev/null +++ b/Function/BNGetInstructionHighlight.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNHighlightColor BNGetInstructionHighlight(BNFunction* func, BNArchitecture* arch, uint64_t addr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetInstructionHighlight" + )] + internal static extern BNHighlightColor BNGetInstructionHighlight( + + // BNFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t addr + ulong addr + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetInstructionInfo.cs b/Function/BNGetInstructionInfo.cs new file mode 100644 index 0000000..189f9f5 --- /dev/null +++ b/Function/BNGetInstructionInfo.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNGetInstructionInfo(BNArchitecture* arch, uint8_t* data, uint64_t addr, uint64_t maxLen, BNInstructionInfo* result) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetInstructionInfo" + )] + internal static extern bool BNGetInstructionInfo( + + // BNArchitecture* arch + IntPtr arch , + + // uint8_t* data + byte[] data , + + // uint64_t addr + ulong addr , + + // uint64_t maxLen + ulong maxLen , + + // BNInstructionInfo* result + out BNInstructionInfo result + ); + } +} \ No newline at end of file diff --git a/Function/BNGetInstructionLength.cs b/Function/BNGetInstructionLength.cs new file mode 100644 index 0000000..ff713e0 --- /dev/null +++ b/Function/BNGetInstructionLength.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetInstructionLength(BNBinaryView* view, BNArchitecture* arch, uint64_t addr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetInstructionLength" + )] + internal static extern ulong BNGetInstructionLength( + + // BNBinaryView* view + IntPtr view , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t addr + ulong addr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetInstructionLowLevelIL.cs b/Function/BNGetInstructionLowLevelIL.cs new file mode 100644 index 0000000..2d801e0 --- /dev/null +++ b/Function/BNGetInstructionLowLevelIL.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNGetInstructionLowLevelIL(BNArchitecture* arch, uint8_t* data, uint64_t addr, uint64_t* len, BNLowLevelILFunction* il) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetInstructionLowLevelIL" + )] + internal static extern bool BNGetInstructionLowLevelIL( + + // BNArchitecture* arch + IntPtr arch , + + // const uint8_t* data + byte[] data , + + // uint64_t addr + ulong addr , + + // uint64_t* len + ref ulong len , + + // BNLowLevelILFunction* il + IntPtr il + ); + } +} \ No newline at end of file diff --git a/Function/BNGetInstructionText.cs b/Function/BNGetInstructionText.cs new file mode 100644 index 0000000..68bf32c --- /dev/null +++ b/Function/BNGetInstructionText.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNGetInstructionText(BNArchitecture* arch, uint8_t* data, uint64_t addr, uint64_t* len, BNInstructionTextToken** result, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetInstructionText" + )] + internal static extern bool BNGetInstructionText( + + // BNArchitecture* arch + IntPtr arch , + + // uint8_t* data + byte[] data , + + // uint64_t addr + ulong addr , + + // uint64_t* len + ref ulong len , + + // BNInstructionTextToken** result + out IntPtr result , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetIntegerArgumentRegisters.cs b/Function/BNGetIntegerArgumentRegisters.cs new file mode 100644 index 0000000..dfb6819 --- /dev/null +++ b/Function/BNGetIntegerArgumentRegisters.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint32_t* BNGetIntegerArgumentRegisters(BNCallingConvention* cc, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetIntegerArgumentRegisters" + )] + internal static extern IntPtr BNGetIntegerArgumentRegisters( + + // BNCallingConvention* cc + IntPtr cc , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetIntegerConstantDisplayType.cs b/Function/BNGetIntegerConstantDisplayType.cs new file mode 100644 index 0000000..0ad6260 --- /dev/null +++ b/Function/BNGetIntegerConstantDisplayType.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNIntegerDisplayType BNGetIntegerConstantDisplayType(BNFunction* func, BNArchitecture* arch, uint64_t instrAddr, uint64_t value, uint64_t operand) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetIntegerConstantDisplayType" + )] + internal static extern IntegerDisplayType BNGetIntegerConstantDisplayType( + + // BNFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t instrAddr + ulong instrAddr , + + // uint64_t _value + ulong _value , + + // uint64_t operand + ulong operand + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetIntegerConstantDisplayTypeEnumerationType.cs b/Function/BNGetIntegerConstantDisplayTypeEnumerationType.cs new file mode 100644 index 0000000..9c8284d --- /dev/null +++ b/Function/BNGetIntegerConstantDisplayTypeEnumerationType.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetIntegerConstantDisplayTypeEnumerationType(BNFunction* func, BNArchitecture* arch, uint64_t instrAddr, uint64_t value, uint64_t operand) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetIntegerConstantDisplayTypeEnumerationType" + )] + internal static extern IntPtr BNGetIntegerConstantDisplayTypeEnumerationType( + + // BNFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t instrAddr + ulong instrAddr , + + // uint64_t _value + ulong _value , + + // uint64_t operand + ulong operand + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetIntegerInput.cs b/Function/BNGetIntegerInput.cs new file mode 100644 index 0000000..948ef47 --- /dev/null +++ b/Function/BNGetIntegerInput.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public static partial class Core + { + public static ulong? GetIntegerInput(string prompt , string title ) + { + bool ok = NativeMethods.BNGetIntegerInput( + out ulong result , + prompt , + title + ); + + if (!ok) + { + return null; + } + + return result; + } + } + + internal static partial class NativeMethods + { + /// + /// bool BNGetIntegerInput(int64_t* result, const char* prompt, const char* title) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetIntegerInput" + )] + internal static extern bool BNGetIntegerInput( + + // int64_t* result + out ulong result , + + // const char* prompt + string prompt , + + // const char* title + string title + ); + } +} \ No newline at end of file diff --git a/Function/BNGetIntegerReturnValueRegister.cs b/Function/BNGetIntegerReturnValueRegister.cs new file mode 100644 index 0000000..9ea077b --- /dev/null +++ b/Function/BNGetIntegerReturnValueRegister.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint32_t BNGetIntegerReturnValueRegister(BNCallingConvention* cc) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetIntegerReturnValueRegister" + )] + internal static extern uint BNGetIntegerReturnValueRegister( + + // BNCallingConvention* cc + IntPtr cc + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetIntegerTypeDisplayType.cs b/Function/BNGetIntegerTypeDisplayType.cs new file mode 100644 index 0000000..096f0fc --- /dev/null +++ b/Function/BNGetIntegerTypeDisplayType.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNIntegerDisplayType BNGetIntegerTypeDisplayType(BNType* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetIntegerTypeDisplayType" + )] + internal static extern IntegerDisplayType BNGetIntegerTypeDisplayType( + + // BNType* type + IntPtr type + ); + } +} \ No newline at end of file diff --git a/Function/BNGetInternalNameSpace.cs b/Function/BNGetInternalNameSpace.cs new file mode 100644 index 0000000..b08d57b --- /dev/null +++ b/Function/BNGetInternalNameSpace.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNNameSpace BNGetInternalNameSpace() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetInternalNameSpace" + )] + internal static extern BNNameSpace BNGetInternalNameSpace(); + } +} \ No newline at end of file diff --git a/Function/BNGetKeyValueStoreBuffer.cs b/Function/BNGetKeyValueStoreBuffer.cs new file mode 100644 index 0000000..d000949 --- /dev/null +++ b/Function/BNGetKeyValueStoreBuffer.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDataBuffer* BNGetKeyValueStoreBuffer(BNKeyValueStore* store, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetKeyValueStoreBuffer" + )] + internal static extern IntPtr BNGetKeyValueStoreBuffer( + + // BNKeyValueStore* store + IntPtr store , + + // const char* name + string name + ); + } +} \ No newline at end of file diff --git a/Function/BNGetKeyValueStoreDataSize.cs b/Function/BNGetKeyValueStoreDataSize.cs new file mode 100644 index 0000000..83b4af8 --- /dev/null +++ b/Function/BNGetKeyValueStoreDataSize.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetKeyValueStoreDataSize(BNKeyValueStore* store) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetKeyValueStoreDataSize" + )] + internal static extern ulong BNGetKeyValueStoreDataSize( + + // BNKeyValueStore* store + IntPtr store + ); + } +} \ No newline at end of file diff --git a/Function/BNGetKeyValueStoreKeys.cs b/Function/BNGetKeyValueStoreKeys.cs new file mode 100644 index 0000000..983cdf3 --- /dev/null +++ b/Function/BNGetKeyValueStoreKeys.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// char** BNGetKeyValueStoreKeys(BNKeyValueStore* store, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetKeyValueStoreKeys" + )] + internal static extern IntPtr BNGetKeyValueStoreKeys( + + // BNKeyValueStore* store + IntPtr store , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetKeyValueStoreNamespaceSize.cs b/Function/BNGetKeyValueStoreNamespaceSize.cs new file mode 100644 index 0000000..b3527aa --- /dev/null +++ b/Function/BNGetKeyValueStoreNamespaceSize.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetKeyValueStoreNamespaceSize(BNKeyValueStore* store) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetKeyValueStoreNamespaceSize" + )] + internal static extern ulong BNGetKeyValueStoreNamespaceSize( + + // BNKeyValueStore* store + IntPtr store + ); + } +} \ No newline at end of file diff --git a/Function/BNGetKeyValueStoreSerializedData.cs b/Function/BNGetKeyValueStoreSerializedData.cs new file mode 100644 index 0000000..c0f086d --- /dev/null +++ b/Function/BNGetKeyValueStoreSerializedData.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDataBuffer* BNGetKeyValueStoreSerializedData(BNKeyValueStore* store) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetKeyValueStoreSerializedData" + )] + internal static extern IntPtr BNGetKeyValueStoreSerializedData( + + // BNKeyValueStore* store + IntPtr store + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetKeyValueStoreValue.cs b/Function/BNGetKeyValueStoreValue.cs new file mode 100644 index 0000000..856e29c --- /dev/null +++ b/Function/BNGetKeyValueStoreValue.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// char* BNGetKeyValueStoreValue(BNKeyValueStore* store, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetKeyValueStoreValue" + )] + internal static extern IntPtr BNGetKeyValueStoreValue( + + // BNKeyValueStore* store + IntPtr store , + + // const char* name + string name + ); + } +} \ No newline at end of file diff --git a/Function/BNGetKeyValueStoreValueHash.cs b/Function/BNGetKeyValueStoreValueHash.cs new file mode 100644 index 0000000..1706344 --- /dev/null +++ b/Function/BNGetKeyValueStoreValueHash.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDataBuffer* BNGetKeyValueStoreValueHash(BNKeyValueStore* store, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetKeyValueStoreValueHash" + )] + internal static extern IntPtr BNGetKeyValueStoreValueHash( + + // BNKeyValueStore* store + IntPtr store , + + // const char* name + string name + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetKeyValueStoreValueSize.cs b/Function/BNGetKeyValueStoreValueSize.cs new file mode 100644 index 0000000..56c258a --- /dev/null +++ b/Function/BNGetKeyValueStoreValueSize.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetKeyValueStoreValueSize(BNKeyValueStore* store) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetKeyValueStoreValueSize" + )] + internal static extern ulong BNGetKeyValueStoreValueSize( + + // BNKeyValueStore* store + IntPtr store + ); + } +} \ No newline at end of file diff --git a/Function/BNGetKeyValueStoreValueStorageSize.cs b/Function/BNGetKeyValueStoreValueStorageSize.cs new file mode 100644 index 0000000..1317621 --- /dev/null +++ b/Function/BNGetKeyValueStoreValueStorageSize.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetKeyValueStoreValueStorageSize(BNKeyValueStore* store) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetKeyValueStoreValueStorageSize" + )] + internal static extern ulong BNGetKeyValueStoreValueStorageSize( + + // BNKeyValueStore* store + IntPtr store + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLabelForLowLevelILSourceInstruction.cs b/Function/BNGetLabelForLowLevelILSourceInstruction.cs new file mode 100644 index 0000000..9f17575 --- /dev/null +++ b/Function/BNGetLabelForLowLevelILSourceInstruction.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLowLevelILLabel* BNGetLabelForLowLevelILSourceInstruction(BNLowLevelILFunction* func, uint64_t instr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLabelForLowLevelILSourceInstruction" + )] + internal static extern IntPtr BNGetLabelForLowLevelILSourceInstruction( + + // BNLowLevelILFunction* func + IntPtr func , + + // uint64_t instr + LowLevelILInstructionIndex instr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLabelForMediumLevelILSourceInstruction.cs b/Function/BNGetLabelForMediumLevelILSourceInstruction.cs new file mode 100644 index 0000000..c50de37 --- /dev/null +++ b/Function/BNGetLabelForMediumLevelILSourceInstruction.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNMediumLevelILLabel* BNGetLabelForMediumLevelILSourceInstruction(BNMediumLevelILFunction* func, uint64_t instr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLabelForMediumLevelILSourceInstruction" + )] + internal static extern IntPtr BNGetLabelForMediumLevelILSourceInstruction( + + // BNMediumLevelILFunction* func + IntPtr func , + + // uint64_t instr + MediumLevelILInstructionIndex instr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLanguageRepresentationArchitecture.cs b/Function/BNGetLanguageRepresentationArchitecture.cs new file mode 100644 index 0000000..3219eba --- /dev/null +++ b/Function/BNGetLanguageRepresentationArchitecture.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNArchitecture* BNGetLanguageRepresentationArchitecture(BNLanguageRepresentationFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLanguageRepresentationArchitecture" + )] + internal static extern IntPtr BNGetLanguageRepresentationArchitecture( + + // BNLanguageRepresentationFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLanguageRepresentationFunctionAnnotationEndString.cs b/Function/BNGetLanguageRepresentationFunctionAnnotationEndString.cs new file mode 100644 index 0000000..b55b217 --- /dev/null +++ b/Function/BNGetLanguageRepresentationFunctionAnnotationEndString.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetLanguageRepresentationFunctionAnnotationEndString(BNLanguageRepresentationFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetLanguageRepresentationFunctionAnnotationEndString" + )] + internal static extern IntPtr BNGetLanguageRepresentationFunctionAnnotationEndString( + + // BNLanguageRepresentationFunction* func + IntPtr func + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLanguageRepresentationFunctionAnnotationStartString.cs b/Function/BNGetLanguageRepresentationFunctionAnnotationStartString.cs new file mode 100644 index 0000000..e954bfc --- /dev/null +++ b/Function/BNGetLanguageRepresentationFunctionAnnotationStartString.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetLanguageRepresentationFunctionAnnotationStartString(BNLanguageRepresentationFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetLanguageRepresentationFunctionAnnotationStartString" + )] + internal static extern IntPtr BNGetLanguageRepresentationFunctionAnnotationStartString( + + // BNLanguageRepresentationFunction* func + IntPtr func + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLanguageRepresentationFunctionBlockLines.cs b/Function/BNGetLanguageRepresentationFunctionBlockLines.cs new file mode 100644 index 0000000..4be9ac7 --- /dev/null +++ b/Function/BNGetLanguageRepresentationFunctionBlockLines.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDisassemblyTextLine* BNGetLanguageRepresentationFunctionBlockLines(BNLanguageRepresentationFunction* func, BNBasicBlock* block, BNDisassemblySettings* settings, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLanguageRepresentationFunctionBlockLines" + )] + internal static extern IntPtr BNGetLanguageRepresentationFunctionBlockLines( + + // BNLanguageRepresentationFunction* func + IntPtr func , + + // BNBasicBlock* block + IntPtr block , + + // BNDisassemblySettings* settings + IntPtr settings , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLanguageRepresentationFunctionCommentEndString.cs b/Function/BNGetLanguageRepresentationFunctionCommentEndString.cs new file mode 100644 index 0000000..f8ea779 --- /dev/null +++ b/Function/BNGetLanguageRepresentationFunctionCommentEndString.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// char* BNGetLanguageRepresentationFunctionCommentEndString(BNLanguageRepresentationFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLanguageRepresentationFunctionCommentEndString" + )] + internal static extern IntPtr BNGetLanguageRepresentationFunctionCommentEndString( + + // BNLanguageRepresentationFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLanguageRepresentationFunctionCommentStartString.cs b/Function/BNGetLanguageRepresentationFunctionCommentStartString.cs new file mode 100644 index 0000000..82c0131 --- /dev/null +++ b/Function/BNGetLanguageRepresentationFunctionCommentStartString.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// char* BNGetLanguageRepresentationFunctionCommentStartString(BNLanguageRepresentationFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLanguageRepresentationFunctionCommentStartString" + )] + internal static extern IntPtr BNGetLanguageRepresentationFunctionCommentStartString( + + // BNLanguageRepresentationFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLanguageRepresentationFunctionExprText.cs b/Function/BNGetLanguageRepresentationFunctionExprText.cs new file mode 100644 index 0000000..539b0e6 --- /dev/null +++ b/Function/BNGetLanguageRepresentationFunctionExprText.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDisassemblyTextLine* BNGetLanguageRepresentationFunctionExprText(BNLanguageRepresentationFunction* func, BNHighLevelILFunction* il, uint64_t exprIndex, BNDisassemblySettings* settings, bool asFullAst, BNOperatorPrecedence precedence, bool statement, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLanguageRepresentationFunctionExprText" + )] + internal static extern IntPtr BNGetLanguageRepresentationFunctionExprText( + + // BNLanguageRepresentationFunction* func + IntPtr func , + + // BNHighLevelILFunction* il + IntPtr il , + + // uint64_t exprIndex + HighLevelILExpressionIndex exprIndex , + + // BNDisassemblySettings* settings + IntPtr settings , + + // bool asFullAst + bool asFullAst , + + // BNOperatorPrecedence precedence + OperatorPrecedence precedence , + + // bool statement + bool statement , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLanguageRepresentationFunctionHighlight.cs b/Function/BNGetLanguageRepresentationFunctionHighlight.cs new file mode 100644 index 0000000..e0f8703 --- /dev/null +++ b/Function/BNGetLanguageRepresentationFunctionHighlight.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNHighlightColor BNGetLanguageRepresentationFunctionHighlight(BNLanguageRepresentationFunction* func, BNBasicBlock* block) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLanguageRepresentationFunctionHighlight" + )] + internal static extern BNHighlightColor BNGetLanguageRepresentationFunctionHighlight( + + // BNLanguageRepresentationFunction* func + IntPtr func , + + // BNBasicBlock* block + IntPtr block + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLanguageRepresentationFunctionLinearLines.cs b/Function/BNGetLanguageRepresentationFunctionLinearLines.cs new file mode 100644 index 0000000..7f2ca65 --- /dev/null +++ b/Function/BNGetLanguageRepresentationFunctionLinearLines.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDisassemblyTextLine* BNGetLanguageRepresentationFunctionLinearLines(BNLanguageRepresentationFunction* func, BNHighLevelILFunction* il, uint64_t exprIndex, BNDisassemblySettings* settings, bool asFullAst, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLanguageRepresentationFunctionLinearLines" + )] + internal static extern IntPtr BNGetLanguageRepresentationFunctionLinearLines( + + // BNLanguageRepresentationFunction* func + IntPtr func , + + // BNHighLevelILFunction* il + IntPtr il , + + // uint64_t exprIndex + HighLevelILExpressionIndex exprIndex , + + // BNDisassemblySettings* settings + IntPtr settings , + + // bool asFullAst + bool asFullAst , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLanguageRepresentationFunctionTypeByName.cs b/Function/BNGetLanguageRepresentationFunctionTypeByName.cs new file mode 100644 index 0000000..342b790 --- /dev/null +++ b/Function/BNGetLanguageRepresentationFunctionTypeByName.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLanguageRepresentationFunctionType* BNGetLanguageRepresentationFunctionTypeByName(const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetLanguageRepresentationFunctionTypeByName" + )] + internal static extern IntPtr BNGetLanguageRepresentationFunctionTypeByName( + + // const char* name + string name + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLanguageRepresentationFunctionTypeFunctionTypeTokens.cs b/Function/BNGetLanguageRepresentationFunctionTypeFunctionTypeTokens.cs new file mode 100644 index 0000000..3034fad --- /dev/null +++ b/Function/BNGetLanguageRepresentationFunctionTypeFunctionTypeTokens.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDisassemblyTextLine* BNGetLanguageRepresentationFunctionTypeFunctionTypeTokens(BNLanguageRepresentationFunctionType* type, BNFunction* func, BNDisassemblySettings* settings, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetLanguageRepresentationFunctionTypeFunctionTypeTokens" + )] + internal static extern IntPtr BNGetLanguageRepresentationFunctionTypeFunctionTypeTokens( + + // BNLanguageRepresentationFunctionType* type + IntPtr type , + + // BNFunction* func + IntPtr func , + + // BNDisassemblySettings* settings + IntPtr settings , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLanguageRepresentationFunctionTypeLineFormatter.cs b/Function/BNGetLanguageRepresentationFunctionTypeLineFormatter.cs new file mode 100644 index 0000000..2673324 --- /dev/null +++ b/Function/BNGetLanguageRepresentationFunctionTypeLineFormatter.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLineFormatter* BNGetLanguageRepresentationFunctionTypeLineFormatter(BNLanguageRepresentationFunctionType* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetLanguageRepresentationFunctionTypeLineFormatter" + )] + internal static extern IntPtr BNGetLanguageRepresentationFunctionTypeLineFormatter( + + // BNLanguageRepresentationFunctionType* type + IntPtr type + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLanguageRepresentationFunctionTypeList.cs b/Function/BNGetLanguageRepresentationFunctionTypeList.cs new file mode 100644 index 0000000..d69438d --- /dev/null +++ b/Function/BNGetLanguageRepresentationFunctionTypeList.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLanguageRepresentationFunctionType** BNGetLanguageRepresentationFunctionTypeList(uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLanguageRepresentationFunctionTypeList" + )] + internal static extern IntPtr BNGetLanguageRepresentationFunctionTypeList( + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLanguageRepresentationFunctionTypeName.cs b/Function/BNGetLanguageRepresentationFunctionTypeName.cs new file mode 100644 index 0000000..d8e5de8 --- /dev/null +++ b/Function/BNGetLanguageRepresentationFunctionTypeName.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetLanguageRepresentationFunctionTypeName(BNLanguageRepresentationFunctionType* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetLanguageRepresentationFunctionTypeName" + )] + internal static extern IntPtr BNGetLanguageRepresentationFunctionTypeName( + + // BNLanguageRepresentationFunctionType* type + IntPtr type + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLanguageRepresentationFunctionTypeParser.cs b/Function/BNGetLanguageRepresentationFunctionTypeParser.cs new file mode 100644 index 0000000..03b77be --- /dev/null +++ b/Function/BNGetLanguageRepresentationFunctionTypeParser.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeParser* BNGetLanguageRepresentationFunctionTypeParser(BNLanguageRepresentationFunctionType* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetLanguageRepresentationFunctionTypeParser" + )] + internal static extern IntPtr BNGetLanguageRepresentationFunctionTypeParser( + + // BNLanguageRepresentationFunctionType* type + IntPtr type + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLanguageRepresentationFunctionTypePrinter.cs b/Function/BNGetLanguageRepresentationFunctionTypePrinter.cs new file mode 100644 index 0000000..f67b076 --- /dev/null +++ b/Function/BNGetLanguageRepresentationFunctionTypePrinter.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypePrinter* BNGetLanguageRepresentationFunctionTypePrinter(BNLanguageRepresentationFunctionType* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetLanguageRepresentationFunctionTypePrinter" + )] + internal static extern IntPtr BNGetLanguageRepresentationFunctionTypePrinter( + + // BNLanguageRepresentationFunctionType* type + IntPtr type + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLanguageRepresentationILFunction.cs b/Function/BNGetLanguageRepresentationILFunction.cs new file mode 100644 index 0000000..d3c12d8 --- /dev/null +++ b/Function/BNGetLanguageRepresentationILFunction.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNHighLevelILFunction* BNGetLanguageRepresentationILFunction(BNLanguageRepresentationFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLanguageRepresentationILFunction" + )] + internal static extern IntPtr BNGetLanguageRepresentationILFunction( + + // BNLanguageRepresentationFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLanguageRepresentationLineFormatterSettings.cs b/Function/BNGetLanguageRepresentationLineFormatterSettings.cs new file mode 100644 index 0000000..3e2fe12 --- /dev/null +++ b/Function/BNGetLanguageRepresentationLineFormatterSettings.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLineFormatterSettings* BNGetLanguageRepresentationLineFormatterSettings(BNDisassemblySettings* settings, BNLanguageRepresentationFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetLanguageRepresentationLineFormatterSettings" + )] + internal static extern IntPtr BNGetLanguageRepresentationLineFormatterSettings( + + // BNDisassemblySettings* settings + IntPtr settings , + + // BNLanguageRepresentationFunction* func + IntPtr func + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLanguageRepresentationOwnerFunction.cs b/Function/BNGetLanguageRepresentationOwnerFunction.cs new file mode 100644 index 0000000..a43309d --- /dev/null +++ b/Function/BNGetLanguageRepresentationOwnerFunction.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFunction* BNGetLanguageRepresentationOwnerFunction(BNLanguageRepresentationFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetLanguageRepresentationOwnerFunction" + )] + internal static extern IntPtr BNGetLanguageRepresentationOwnerFunction( + + // BNLanguageRepresentationFunction* func + IntPtr func + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLanguageRepresentationType.cs b/Function/BNGetLanguageRepresentationType.cs new file mode 100644 index 0000000..c21c0a1 --- /dev/null +++ b/Function/BNGetLanguageRepresentationType.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLanguageRepresentationFunctionType* BNGetLanguageRepresentationType(BNLanguageRepresentationFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetLanguageRepresentationType" + )] + internal static extern IntPtr BNGetLanguageRepresentationType( + + // BNLanguageRepresentationFunction* func + IntPtr func + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLargeChoiceInput.cs b/Function/BNGetLargeChoiceInput.cs new file mode 100644 index 0000000..06af313 --- /dev/null +++ b/Function/BNGetLargeChoiceInput.cs @@ -0,0 +1,62 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public static partial class Core + { + public static int? GetLargeChoiceInput( + string prompt , + string title , + string[] choices + ) + { + bool ok = NativeMethods.BNGetLargeChoiceInput( + out ulong result , + prompt , + title, + choices , + (ulong)choices.Length + ); + + if (!ok) + { + return null; + } + + return (int)result; + } + } + + internal static partial class NativeMethods + { + /// + /// bool BNGetLargeChoiceInput(uint64_t* result, const char* prompt, const char* title, const char** choices, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetLargeChoiceInput" + )] + internal static extern bool BNGetLargeChoiceInput( + + // uint64_t* result + out ulong result , + + // const char* prompt + string prompt , + + // const char* title + string title , + + // const char** choices + string[] choices , + + // uint64_t count + ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLastLinearViewObjectChild.cs b/Function/BNGetLastLinearViewObjectChild.cs new file mode 100644 index 0000000..4719da3 --- /dev/null +++ b/Function/BNGetLastLinearViewObjectChild.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLinearViewObject* BNGetLastLinearViewObjectChild(BNLinearViewObject* obj) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLastLinearViewObjectChild" + )] + internal static extern IntPtr BNGetLastLinearViewObjectChild( + + // BNLinearViewObject* obj + IntPtr obj + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLastRedoEntry.cs b/Function/BNGetLastRedoEntry.cs new file mode 100644 index 0000000..de63d09 --- /dev/null +++ b/Function/BNGetLastRedoEntry.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNUndoEntry* BNGetLastRedoEntry(BNFileMetadata* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetLastRedoEntry" + )] + internal static extern IntPtr BNGetLastRedoEntry( + + // BNFileMetadata* file + IntPtr file + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLastRedoEntryTitle.cs b/Function/BNGetLastRedoEntryTitle.cs new file mode 100644 index 0000000..dd1ccf7 --- /dev/null +++ b/Function/BNGetLastRedoEntryTitle.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetLastRedoEntryTitle(BNFileMetadata* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetLastRedoEntryTitle" + )] + internal static extern IntPtr BNGetLastRedoEntryTitle( + + // BNFileMetadata* file + IntPtr file + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLastSeenVariableNameOrDefault.cs b/Function/BNGetLastSeenVariableNameOrDefault.cs new file mode 100644 index 0000000..7eac32e --- /dev/null +++ b/Function/BNGetLastSeenVariableNameOrDefault.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// char* BNGetLastSeenVariableNameOrDefault(BNFunction* func, BNVariable* var) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLastSeenVariableNameOrDefault" + )] + internal static extern IntPtr BNGetLastSeenVariableNameOrDefault( + + // BNFunction* func + IntPtr func , + + // BNVariable* _var + in BNVariable _var + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLastUndoEntry.cs b/Function/BNGetLastUndoEntry.cs new file mode 100644 index 0000000..6ec9e1d --- /dev/null +++ b/Function/BNGetLastUndoEntry.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNUndoEntry* BNGetLastUndoEntry(BNFileMetadata* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetLastUndoEntry" + )] + internal static extern IntPtr BNGetLastUndoEntry( + + // BNFileMetadata* file + IntPtr file + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLastUndoEntryTitle.cs b/Function/BNGetLastUndoEntryTitle.cs new file mode 100644 index 0000000..e39684a --- /dev/null +++ b/Function/BNGetLastUndoEntryTitle.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetLastUndoEntryTitle(BNFileMetadata* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetLastUndoEntryTitle" + )] + internal static extern IntPtr BNGetLastUndoEntryTitle( + + // BNFileMetadata* file + IntPtr file + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLicenseCount.cs b/Function/BNGetLicenseCount.cs new file mode 100644 index 0000000..695ef47 --- /dev/null +++ b/Function/BNGetLicenseCount.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// int32_t BNGetLicenseCount() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetLicenseCount" + )] + internal static extern int BNGetLicenseCount( + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLicenseExpirationTime.cs b/Function/BNGetLicenseExpirationTime.cs new file mode 100644 index 0000000..08ebee8 --- /dev/null +++ b/Function/BNGetLicenseExpirationTime.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetLicenseExpirationTime() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetLicenseExpirationTime" + )] + internal static extern ulong BNGetLicenseExpirationTime( + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLicensedUserEmail.cs b/Function/BNGetLicensedUserEmail.cs new file mode 100644 index 0000000..b1be327 --- /dev/null +++ b/Function/BNGetLicensedUserEmail.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetLicensedUserEmail() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetLicensedUserEmail" + )] + internal static extern IntPtr BNGetLicensedUserEmail( + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLiftedILFlagDefinitionsForUse.cs b/Function/BNGetLiftedILFlagDefinitionsForUse.cs new file mode 100644 index 0000000..f86d2eb --- /dev/null +++ b/Function/BNGetLiftedILFlagDefinitionsForUse.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t* BNGetLiftedILFlagDefinitionsForUse(BNFunction* func, uint64_t i, uint32_t flag, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetLiftedILFlagDefinitionsForUse" + )] + internal static extern IntPtr BNGetLiftedILFlagDefinitionsForUse( + + // BNFunction* func + IntPtr func , + + // uint64_t i + ulong i , + + // uint32_t flag + uint flag , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLiftedILFlagUsesForDefinition.cs b/Function/BNGetLiftedILFlagUsesForDefinition.cs new file mode 100644 index 0000000..7d594d0 --- /dev/null +++ b/Function/BNGetLiftedILFlagUsesForDefinition.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t* BNGetLiftedILFlagUsesForDefinition(BNFunction* func, uint64_t i, uint32_t flag, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetLiftedILFlagUsesForDefinition" + )] + internal static extern IntPtr BNGetLiftedILFlagUsesForDefinition( + + // BNFunction* func + IntPtr func , + + // uint64_t i + ulong i , + + // uint32_t flag + uint flag , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLineFormatterByName.cs b/Function/BNGetLineFormatterByName.cs new file mode 100644 index 0000000..7991a85 --- /dev/null +++ b/Function/BNGetLineFormatterByName.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLineFormatter* BNGetLineFormatterByName(const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetLineFormatterByName" + )] + internal static extern IntPtr BNGetLineFormatterByName( + + // const char* name + string name + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLineFormatterList.cs b/Function/BNGetLineFormatterList.cs new file mode 100644 index 0000000..cee7c1d --- /dev/null +++ b/Function/BNGetLineFormatterList.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLineFormatter** BNGetLineFormatterList(uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetLineFormatterList" + )] + internal static extern IntPtr BNGetLineFormatterList( + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLineFormatterName.cs b/Function/BNGetLineFormatterName.cs new file mode 100644 index 0000000..f7e15f2 --- /dev/null +++ b/Function/BNGetLineFormatterName.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetLineFormatterName(BNLineFormatter* formatter) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetLineFormatterName" + )] + internal static extern IntPtr BNGetLineFormatterName( + + // BNLineFormatter* formatter + IntPtr formatter + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLinearViewCursorCurrentObject.cs b/Function/BNGetLinearViewCursorCurrentObject.cs new file mode 100644 index 0000000..7149be9 --- /dev/null +++ b/Function/BNGetLinearViewCursorCurrentObject.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLinearViewObject* BNGetLinearViewCursorCurrentObject(BNLinearViewCursor* cursor) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetLinearViewCursorCurrentObject" + )] + internal static extern IntPtr BNGetLinearViewCursorCurrentObject( + + // BNLinearViewCursor* cursor + IntPtr cursor + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLinearViewCursorLines.cs b/Function/BNGetLinearViewCursorLines.cs new file mode 100644 index 0000000..894a339 --- /dev/null +++ b/Function/BNGetLinearViewCursorLines.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLinearDisassemblyLine* BNGetLinearViewCursorLines(BNLinearViewCursor* cursor, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLinearViewCursorLines" + )] + internal static extern IntPtr BNGetLinearViewCursorLines( + + // BNLinearViewCursor* cursor + IntPtr cursor , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLinearViewCursorOrderingIndex.cs b/Function/BNGetLinearViewCursorOrderingIndex.cs new file mode 100644 index 0000000..8c728c8 --- /dev/null +++ b/Function/BNGetLinearViewCursorOrderingIndex.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNAddressRange BNGetLinearViewCursorOrderingIndex(BNLinearViewCursor* cursor) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLinearViewCursorOrderingIndex" + )] + internal static extern BNAddressRange BNGetLinearViewCursorOrderingIndex( + + // BNLinearViewCursor* cursor + IntPtr cursor + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLinearViewCursorOrderingIndexTotal.cs b/Function/BNGetLinearViewCursorOrderingIndexTotal.cs new file mode 100644 index 0000000..5f928c8 --- /dev/null +++ b/Function/BNGetLinearViewCursorOrderingIndexTotal.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetLinearViewCursorOrderingIndexTotal(BNLinearViewCursor* cursor) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLinearViewCursorOrderingIndexTotal" + )] + internal static extern ulong BNGetLinearViewCursorOrderingIndexTotal( + + // BNLinearViewCursor* cursor + IntPtr cursor + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLinearViewCursorPath.cs b/Function/BNGetLinearViewCursorPath.cs new file mode 100644 index 0000000..2369a2e --- /dev/null +++ b/Function/BNGetLinearViewCursorPath.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLinearViewObjectIdentifier* BNGetLinearViewCursorPath(BNLinearViewCursor* cursor, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLinearViewCursorPath" + )] + internal static extern IntPtr BNGetLinearViewCursorPath( + + // BNLinearViewCursor* cursor + IntPtr cursor , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLinearViewCursorPathObjects.cs b/Function/BNGetLinearViewCursorPathObjects.cs new file mode 100644 index 0000000..4df7816 --- /dev/null +++ b/Function/BNGetLinearViewCursorPathObjects.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLinearViewObject** BNGetLinearViewCursorPathObjects(BNLinearViewCursor* cursor, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLinearViewCursorPathObjects" + )] + internal static extern IntPtr BNGetLinearViewCursorPathObjects( + + // BNLinearViewCursor* cursor + IntPtr cursor , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLinearViewCursorRenderLayers.cs b/Function/BNGetLinearViewCursorRenderLayers.cs new file mode 100644 index 0000000..60afe34 --- /dev/null +++ b/Function/BNGetLinearViewCursorRenderLayers.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRenderLayer** BNGetLinearViewCursorRenderLayers(BNLinearViewCursor* cursor, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLinearViewCursorRenderLayers" + )] + internal static extern IntPtr BNGetLinearViewCursorRenderLayers( + + // BNLinearViewCursor* cursor + IntPtr cursor , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLinearViewObjectChildForAddress.cs b/Function/BNGetLinearViewObjectChildForAddress.cs new file mode 100644 index 0000000..75192ab --- /dev/null +++ b/Function/BNGetLinearViewObjectChildForAddress.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLinearViewObject* BNGetLinearViewObjectChildForAddress(BNLinearViewObject* parent, uint64_t addr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLinearViewObjectChildForAddress" + )] + internal static extern IntPtr BNGetLinearViewObjectChildForAddress( + + // BNLinearViewObject* parent + IntPtr parent , + + // uint64_t addr + ulong addr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLinearViewObjectChildForIdentifier.cs b/Function/BNGetLinearViewObjectChildForIdentifier.cs new file mode 100644 index 0000000..fca9b0f --- /dev/null +++ b/Function/BNGetLinearViewObjectChildForIdentifier.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLinearViewObject* BNGetLinearViewObjectChildForIdentifier(BNLinearViewObject* parent, BNLinearViewObjectIdentifier* id) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLinearViewObjectChildForIdentifier" + )] + internal static extern IntPtr BNGetLinearViewObjectChildForIdentifier( + + // BNLinearViewObject* parent + IntPtr parent , + + // BNLinearViewObjectIdentifier* id + in BNLinearViewObjectIdentifier id + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLinearViewObjectChildForOrderingIndex.cs b/Function/BNGetLinearViewObjectChildForOrderingIndex.cs new file mode 100644 index 0000000..485a27c --- /dev/null +++ b/Function/BNGetLinearViewObjectChildForOrderingIndex.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLinearViewObject* BNGetLinearViewObjectChildForOrderingIndex(BNLinearViewObject* parent, uint64_t idx) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLinearViewObjectChildForOrderingIndex" + )] + internal static extern IntPtr BNGetLinearViewObjectChildForOrderingIndex( + + // BNLinearViewObject* parent + IntPtr parent , + + // uint64_t idx + ulong idx + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLinearViewObjectEnd.cs b/Function/BNGetLinearViewObjectEnd.cs new file mode 100644 index 0000000..c13b8db --- /dev/null +++ b/Function/BNGetLinearViewObjectEnd.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetLinearViewObjectEnd(BNLinearViewObject* obj) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLinearViewObjectEnd" + )] + internal static extern ulong BNGetLinearViewObjectEnd( + + // BNLinearViewObject* obj + IntPtr obj + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLinearViewObjectIdentifier.cs b/Function/BNGetLinearViewObjectIdentifier.cs new file mode 100644 index 0000000..a6a3087 --- /dev/null +++ b/Function/BNGetLinearViewObjectIdentifier.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLinearViewObjectIdentifier BNGetLinearViewObjectIdentifier(BNLinearViewObject* obj) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLinearViewObjectIdentifier" + )] + internal static extern BNLinearViewObjectIdentifier BNGetLinearViewObjectIdentifier( + + // BNLinearViewObject* obj + IntPtr obj + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLinearViewObjectLines.cs b/Function/BNGetLinearViewObjectLines.cs new file mode 100644 index 0000000..5644ff4 --- /dev/null +++ b/Function/BNGetLinearViewObjectLines.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLinearDisassemblyLine* BNGetLinearViewObjectLines(BNLinearViewObject* obj, BNLinearViewObject* prev, BNLinearViewObject* next, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLinearViewObjectLines" + )] + internal static extern IntPtr BNGetLinearViewObjectLines( + + // BNLinearViewObject* obj + IntPtr obj , + + // BNLinearViewObject* prev + IntPtr prev , + + // BNLinearViewObject* next + IntPtr next , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLinearViewObjectOrderingIndexForChild.cs b/Function/BNGetLinearViewObjectOrderingIndexForChild.cs new file mode 100644 index 0000000..ea17a47 --- /dev/null +++ b/Function/BNGetLinearViewObjectOrderingIndexForChild.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetLinearViewObjectOrderingIndexForChild(BNLinearViewObject* parent, BNLinearViewObject* child) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLinearViewObjectOrderingIndexForChild" + )] + internal static extern ulong BNGetLinearViewObjectOrderingIndexForChild( + + // BNLinearViewObject* parent + IntPtr parent , + + // BNLinearViewObject* child + IntPtr child + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLinearViewObjectOrderingIndexTotal.cs b/Function/BNGetLinearViewObjectOrderingIndexTotal.cs new file mode 100644 index 0000000..0429868 --- /dev/null +++ b/Function/BNGetLinearViewObjectOrderingIndexTotal.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetLinearViewObjectOrderingIndexTotal(BNLinearViewObject* obj) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLinearViewObjectOrderingIndexTotal" + )] + internal static extern ulong BNGetLinearViewObjectOrderingIndexTotal( + + // BNLinearViewObject* obj + IntPtr obj + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLinearViewObjectStart.cs b/Function/BNGetLinearViewObjectStart.cs new file mode 100644 index 0000000..d890699 --- /dev/null +++ b/Function/BNGetLinearViewObjectStart.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetLinearViewObjectStart(BNLinearViewObject* obj) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLinearViewObjectStart" + )] + internal static extern ulong BNGetLinearViewObjectStart( + + // BNLinearViewObject* obj + IntPtr obj + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLinesForData.cs b/Function/BNGetLinesForData.cs new file mode 100644 index 0000000..5ad2d8c --- /dev/null +++ b/Function/BNGetLinesForData.cs @@ -0,0 +1,56 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDisassemblyTextLine* BNGetLinesForData(void* ctxt, BNBinaryView* view, uint64_t addr, BNType* type, BNInstructionTextToken* prefix, uint64_t prefixCount, uint64_t width, uint64_t* count, BNTypeContext* typeCtx, uint64_t ctxCount, const char* language) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetLinesForData" + )] + internal static extern IntPtr BNGetLinesForData( + + // void* ctxt + IntPtr ctxt , + + // BNBinaryView* view + IntPtr view , + + // uint64_t addr + ulong addr , + + // BNType* type + IntPtr type , + + // BNInstructionTextToken* prefix + IntPtr prefix , + + // uint64_t prefixCount + ulong prefixCount , + + // uint64_t width + ulong width , + + // uint64_t* count + IntPtr count , + + // BNTypeContext* typeCtx + IntPtr typeCtx , + + // uint64_t ctxCount + ulong ctxCount , + + // const char* language + string language + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLoggerIndent.cs b/Function/BNGetLoggerIndent.cs new file mode 100644 index 0000000..a648e30 --- /dev/null +++ b/Function/BNGetLoggerIndent.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// char* BNGetLoggerIndent(BNLogger* logger) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLoggerIndent" + )] + internal static extern IntPtr BNGetLoggerIndent( + + // BNLogger* logger + IntPtr logger + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLowLevelFlagSSAVersions.cs b/Function/BNGetLowLevelFlagSSAVersions.cs new file mode 100644 index 0000000..c7c2b71 --- /dev/null +++ b/Function/BNGetLowLevelFlagSSAVersions.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t* BNGetLowLevelFlagSSAVersions(BNLowLevelILFunction* func, uint32_t var, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLowLevelFlagSSAVersions" + )] + internal static extern IntPtr BNGetLowLevelFlagSSAVersions( + + // BNLowLevelILFunction* func + IntPtr func , + + // uint32_t _var + FlagIndex _var , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLowLevelFlags.cs b/Function/BNGetLowLevelFlags.cs new file mode 100644 index 0000000..ac9bff8 --- /dev/null +++ b/Function/BNGetLowLevelFlags.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint32_t* BNGetLowLevelFlags(BNLowLevelILFunction* func, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLowLevelFlags" + )] + internal static extern IntPtr BNGetLowLevelFlags( + + // BNLowLevelILFunction* func + IntPtr func , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLowLevelILBasicBlockForInstruction.cs b/Function/BNGetLowLevelILBasicBlockForInstruction.cs new file mode 100644 index 0000000..33c03d9 --- /dev/null +++ b/Function/BNGetLowLevelILBasicBlockForInstruction.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBasicBlock* BNGetLowLevelILBasicBlockForInstruction(BNLowLevelILFunction* func, uint64_t i) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLowLevelILBasicBlockForInstruction" + )] + internal static extern IntPtr BNGetLowLevelILBasicBlockForInstruction( + + // BNLowLevelILFunction* func + IntPtr func , + + // uint64_t i + LowLevelILInstructionIndex i + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLowLevelILBasicBlockList.cs b/Function/BNGetLowLevelILBasicBlockList.cs new file mode 100644 index 0000000..7860430 --- /dev/null +++ b/Function/BNGetLowLevelILBasicBlockList.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBasicBlock** BNGetLowLevelILBasicBlockList(BNLowLevelILFunction* func, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLowLevelILBasicBlockList" + )] + internal static extern IntPtr BNGetLowLevelILBasicBlockList( + + // BNLowLevelILFunction* func + IntPtr func , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLowLevelILByIndex.cs b/Function/BNGetLowLevelILByIndex.cs new file mode 100644 index 0000000..1ccf914 --- /dev/null +++ b/Function/BNGetLowLevelILByIndex.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLowLevelILInstruction BNGetLowLevelILByIndex(BNLowLevelILFunction* func, uint64_t i) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetLowLevelILByIndex" + )] + internal static extern BNLowLevelILInstruction BNGetLowLevelILByIndex( + + // BNLowLevelILFunction* func + IntPtr func , + + // uint64_t i + LowLevelILExpressionIndex i + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLowLevelILExprCount.cs b/Function/BNGetLowLevelILExprCount.cs new file mode 100644 index 0000000..e9e4f88 --- /dev/null +++ b/Function/BNGetLowLevelILExprCount.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetLowLevelILExprCount(BNLowLevelILFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLowLevelILExprCount" + )] + internal static extern ulong BNGetLowLevelILExprCount( + + // BNLowLevelILFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLowLevelILExprIndex.cs b/Function/BNGetLowLevelILExprIndex.cs new file mode 100644 index 0000000..82802f4 --- /dev/null +++ b/Function/BNGetLowLevelILExprIndex.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetLowLevelILExprIndex(BNMediumLevelILFunction* func, uint64_t expr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLowLevelILExprIndex" + )] + internal static extern LowLevelILExpressionIndex BNGetLowLevelILExprIndex( + + // BNMediumLevelILFunction* func + IntPtr func , + + // uint64_t expr + MediumLevelILExpressionIndex expr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLowLevelILExprIndexes.cs b/Function/BNGetLowLevelILExprIndexes.cs new file mode 100644 index 0000000..2b54c98 --- /dev/null +++ b/Function/BNGetLowLevelILExprIndexes.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t* BNGetLowLevelILExprIndexes(BNMediumLevelILFunction* func, uint64_t expr, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLowLevelILExprIndexes" + )] + internal static extern IntPtr BNGetLowLevelILExprIndexes( + + // BNMediumLevelILFunction* func + IntPtr func , + + // uint64_t expr + MediumLevelILExpressionIndex expr , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLowLevelILExprText.cs b/Function/BNGetLowLevelILExprText.cs new file mode 100644 index 0000000..a73729b --- /dev/null +++ b/Function/BNGetLowLevelILExprText.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNGetLowLevelILExprText(BNLowLevelILFunction* func, BNArchitecture* arch, uint64_t i, BNDisassemblySettings* settings, BNInstructionTextToken** tokens, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLowLevelILExprText" + )] + internal static extern bool BNGetLowLevelILExprText( + + // BNLowLevelILFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t i + LowLevelILExpressionIndex i , + + // BNDisassemblySettings* settings + IntPtr settings , + + // BNInstructionTextToken** tokens + out IntPtr tokens , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLowLevelILExprValue.cs b/Function/BNGetLowLevelILExprValue.cs new file mode 100644 index 0000000..1c287a5 --- /dev/null +++ b/Function/BNGetLowLevelILExprValue.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRegisterValue BNGetLowLevelILExprValue(BNLowLevelILFunction* func, uint64_t expr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLowLevelILExprValue" + )] + internal static extern BNRegisterValue BNGetLowLevelILExprValue( + + // BNLowLevelILFunction* func + IntPtr func , + + // uint64_t expr + LowLevelILExpressionIndex expr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLowLevelILFlagValueAfterInstruction.cs b/Function/BNGetLowLevelILFlagValueAfterInstruction.cs new file mode 100644 index 0000000..052fb05 --- /dev/null +++ b/Function/BNGetLowLevelILFlagValueAfterInstruction.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRegisterValue BNGetLowLevelILFlagValueAfterInstruction(BNLowLevelILFunction* func, uint32_t flag, uint64_t instr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLowLevelILFlagValueAfterInstruction" + )] + internal static extern BNRegisterValue BNGetLowLevelILFlagValueAfterInstruction( + + // BNLowLevelILFunction* func + IntPtr func , + + // uint32_t flag + FlagIndex flag , + + // uint64_t instr + LowLevelILInstructionIndex instr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLowLevelILFlagValueAtInstruction.cs b/Function/BNGetLowLevelILFlagValueAtInstruction.cs new file mode 100644 index 0000000..7775c6c --- /dev/null +++ b/Function/BNGetLowLevelILFlagValueAtInstruction.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRegisterValue BNGetLowLevelILFlagValueAtInstruction(BNLowLevelILFunction* func, uint32_t flag, uint64_t instr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLowLevelILFlagValueAtInstruction" + )] + internal static extern BNRegisterValue BNGetLowLevelILFlagValueAtInstruction( + + // BNLowLevelILFunction* func + IntPtr func , + + // uint32_t flag + FlagIndex flag , + + // uint64_t instr + LowLevelILInstructionIndex instr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLowLevelILForMediumLevelIL.cs b/Function/BNGetLowLevelILForMediumLevelIL.cs new file mode 100644 index 0000000..559f513 --- /dev/null +++ b/Function/BNGetLowLevelILForMediumLevelIL.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLowLevelILFunction* BNGetLowLevelILForMediumLevelIL(BNMediumLevelILFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLowLevelILForMediumLevelIL" + )] + internal static extern IntPtr BNGetLowLevelILForMediumLevelIL( + + // BNMediumLevelILFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLowLevelILIndexForInstruction.cs b/Function/BNGetLowLevelILIndexForInstruction.cs new file mode 100644 index 0000000..f392b2f --- /dev/null +++ b/Function/BNGetLowLevelILIndexForInstruction.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetLowLevelILIndexForInstruction(BNLowLevelILFunction* func, uint64_t i) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLowLevelILIndexForInstruction" + )] + internal static extern LowLevelILExpressionIndex BNGetLowLevelILIndexForInstruction( + + // BNLowLevelILFunction* func + IntPtr func , + + // uint64_t i + LowLevelILInstructionIndex i + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLowLevelILInstructionCount.cs b/Function/BNGetLowLevelILInstructionCount.cs new file mode 100644 index 0000000..22c7664 --- /dev/null +++ b/Function/BNGetLowLevelILInstructionCount.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetLowLevelILInstructionCount(BNLowLevelILFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLowLevelILInstructionCount" + )] + internal static extern ulong BNGetLowLevelILInstructionCount( + + // BNLowLevelILFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLowLevelILInstructionForExpr.cs b/Function/BNGetLowLevelILInstructionForExpr.cs new file mode 100644 index 0000000..69df82c --- /dev/null +++ b/Function/BNGetLowLevelILInstructionForExpr.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetLowLevelILInstructionForExpr(BNLowLevelILFunction* func, uint64_t expr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLowLevelILInstructionForExpr" + )] + internal static extern LowLevelILInstructionIndex BNGetLowLevelILInstructionForExpr( + + // BNLowLevelILFunction* func + IntPtr func , + + // uint64_t expr + LowLevelILExpressionIndex expr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLowLevelILInstructionIndex.cs b/Function/BNGetLowLevelILInstructionIndex.cs new file mode 100644 index 0000000..f65453b --- /dev/null +++ b/Function/BNGetLowLevelILInstructionIndex.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetLowLevelILInstructionIndex(BNMediumLevelILFunction* func, uint64_t instr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLowLevelILInstructionIndex" + )] + internal static extern LowLevelILInstructionIndex BNGetLowLevelILInstructionIndex( + + // BNMediumLevelILFunction* func + IntPtr func , + + // uint64_t instr + MediumLevelILInstructionIndex instr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLowLevelILInstructionText.cs b/Function/BNGetLowLevelILInstructionText.cs new file mode 100644 index 0000000..5b31a7b --- /dev/null +++ b/Function/BNGetLowLevelILInstructionText.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNGetLowLevelILInstructionText(BNLowLevelILFunction* il, BNFunction* func, BNArchitecture* arch, uint64_t i, BNDisassemblySettings* settings, BNInstructionTextToken** tokens, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetLowLevelILInstructionText" + )] + internal static extern bool BNGetLowLevelILInstructionText( + + // BNLowLevelILFunction* il + IntPtr il , + + // BNFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t i + LowLevelILInstructionIndex i , + + // BNDisassemblySettings* settings + IntPtr settings , + + // BNInstructionTextToken** tokens + out IntPtr tokens , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLowLevelILLabelForAddress.cs b/Function/BNGetLowLevelILLabelForAddress.cs new file mode 100644 index 0000000..42111d8 --- /dev/null +++ b/Function/BNGetLowLevelILLabelForAddress.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLowLevelILLabel* BNGetLowLevelILLabelForAddress(BNLowLevelILFunction* func, BNArchitecture* arch, uint64_t addr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetLowLevelILLabelForAddress" + )] + internal static extern IntPtr BNGetLowLevelILLabelForAddress( + + // BNLowLevelILFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t addr + ulong addr + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLowLevelILNonSSAExprIndex.cs b/Function/BNGetLowLevelILNonSSAExprIndex.cs new file mode 100644 index 0000000..1558a5c --- /dev/null +++ b/Function/BNGetLowLevelILNonSSAExprIndex.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetLowLevelILNonSSAExprIndex(BNLowLevelILFunction* func, uint64_t expr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLowLevelILNonSSAExprIndex" + )] + internal static extern LowLevelILExpressionIndex BNGetLowLevelILNonSSAExprIndex( + + // BNLowLevelILFunction* func + IntPtr func , + + // uint64_t expr + LowLevelILExpressionIndex expr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLowLevelILNonSSAForm.cs b/Function/BNGetLowLevelILNonSSAForm.cs new file mode 100644 index 0000000..0ed242f --- /dev/null +++ b/Function/BNGetLowLevelILNonSSAForm.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLowLevelILFunction* BNGetLowLevelILNonSSAForm(BNLowLevelILFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetLowLevelILNonSSAForm" + )] + internal static extern IntPtr BNGetLowLevelILNonSSAForm( + + // BNLowLevelILFunction* func + IntPtr func + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLowLevelILNonSSAInstructionIndex.cs b/Function/BNGetLowLevelILNonSSAInstructionIndex.cs new file mode 100644 index 0000000..a81000d --- /dev/null +++ b/Function/BNGetLowLevelILNonSSAInstructionIndex.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetLowLevelILNonSSAInstructionIndex(BNLowLevelILFunction* func, uint64_t instr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLowLevelILNonSSAInstructionIndex" + )] + internal static extern LowLevelILInstructionIndex BNGetLowLevelILNonSSAInstructionIndex( + + // BNLowLevelILFunction* func + IntPtr func , + + // uint64_t instr + LowLevelILInstructionIndex instr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLowLevelILOwnerFunction.cs b/Function/BNGetLowLevelILOwnerFunction.cs new file mode 100644 index 0000000..ec01e1d --- /dev/null +++ b/Function/BNGetLowLevelILOwnerFunction.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFunction* BNGetLowLevelILOwnerFunction(BNLowLevelILFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLowLevelILOwnerFunction" + )] + internal static extern IntPtr BNGetLowLevelILOwnerFunction( + + // BNLowLevelILFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLowLevelILPossibleExprValues.cs b/Function/BNGetLowLevelILPossibleExprValues.cs new file mode 100644 index 0000000..8fe2bdc --- /dev/null +++ b/Function/BNGetLowLevelILPossibleExprValues.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNPossibleValueSet BNGetLowLevelILPossibleExprValues(BNLowLevelILFunction* func, uint64_t expr, BNDataFlowQueryOption* options, uint64_t optionCount) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLowLevelILPossibleExprValues" + )] + internal static extern BNPossibleValueSet BNGetLowLevelILPossibleExprValues( + + // BNLowLevelILFunction* func + IntPtr func , + + // uint64_t expr + LowLevelILExpressionIndex expr , + + // BNDataFlowQueryOption* options + DataFlowQueryOption[] options , + + // uint64_t optionCount + ulong optionCount + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLowLevelILPossibleFlagValuesAfterInstruction.cs b/Function/BNGetLowLevelILPossibleFlagValuesAfterInstruction.cs new file mode 100644 index 0000000..303d5dc --- /dev/null +++ b/Function/BNGetLowLevelILPossibleFlagValuesAfterInstruction.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNPossibleValueSet BNGetLowLevelILPossibleFlagValuesAfterInstruction(BNLowLevelILFunction* func, uint32_t flag, uint64_t instr, BNDataFlowQueryOption* options, uint64_t optionCount) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLowLevelILPossibleFlagValuesAfterInstruction" + )] + internal static extern BNPossibleValueSet BNGetLowLevelILPossibleFlagValuesAfterInstruction( + + // BNLowLevelILFunction* func + IntPtr func , + + // uint32_t flag + FlagIndex flag , + + // uint64_t instr + LowLevelILInstructionIndex instr , + + // BNDataFlowQueryOption* options + DataFlowQueryOption[] options , + + // uint64_t optionCount + ulong optionCount + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLowLevelILPossibleFlagValuesAtInstruction.cs b/Function/BNGetLowLevelILPossibleFlagValuesAtInstruction.cs new file mode 100644 index 0000000..711e7a1 --- /dev/null +++ b/Function/BNGetLowLevelILPossibleFlagValuesAtInstruction.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNPossibleValueSet BNGetLowLevelILPossibleFlagValuesAtInstruction(BNLowLevelILFunction* func, uint32_t flag, uint64_t instr, BNDataFlowQueryOption* options, uint64_t optionCount) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLowLevelILPossibleFlagValuesAtInstruction" + )] + internal static extern BNPossibleValueSet BNGetLowLevelILPossibleFlagValuesAtInstruction( + + // BNLowLevelILFunction* func + IntPtr func , + + // uint32_t flag + FlagIndex flag , + + // uint64_t instr + LowLevelILInstructionIndex instr , + + // BNDataFlowQueryOption* options + DataFlowQueryOption[] options , + + // uint64_t optionCount + ulong optionCount + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLowLevelILPossibleRegisterValuesAfterInstruction.cs b/Function/BNGetLowLevelILPossibleRegisterValuesAfterInstruction.cs new file mode 100644 index 0000000..f7ee363 --- /dev/null +++ b/Function/BNGetLowLevelILPossibleRegisterValuesAfterInstruction.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNPossibleValueSet BNGetLowLevelILPossibleRegisterValuesAfterInstruction(BNLowLevelILFunction* func, uint32_t reg, uint64_t instr, BNDataFlowQueryOption* options, uint64_t optionCount) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLowLevelILPossibleRegisterValuesAfterInstruction" + )] + internal static extern BNPossibleValueSet BNGetLowLevelILPossibleRegisterValuesAfterInstruction( + + // BNLowLevelILFunction* func + IntPtr func , + + // uint32_t reg + RegisterIndex reg , + + // uint64_t instr + LowLevelILInstructionIndex instr , + + // BNDataFlowQueryOption* options + DataFlowQueryOption[] options , + + // uint64_t optionCount + ulong optionCount + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLowLevelILPossibleRegisterValuesAtInstruction.cs b/Function/BNGetLowLevelILPossibleRegisterValuesAtInstruction.cs new file mode 100644 index 0000000..5b3ca2e --- /dev/null +++ b/Function/BNGetLowLevelILPossibleRegisterValuesAtInstruction.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNPossibleValueSet BNGetLowLevelILPossibleRegisterValuesAtInstruction(BNLowLevelILFunction* func, uint32_t reg, uint64_t instr, BNDataFlowQueryOption* options, uint64_t optionCount) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLowLevelILPossibleRegisterValuesAtInstruction" + )] + internal static extern BNPossibleValueSet BNGetLowLevelILPossibleRegisterValuesAtInstruction( + + // BNLowLevelILFunction* func + IntPtr func , + + // uint32_t reg + RegisterIndex reg , + + // uint64_t instr + LowLevelILInstructionIndex instr , + + // BNDataFlowQueryOption* options + DataFlowQueryOption[] options , + + // uint64_t optionCount + ulong optionCount + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLowLevelILPossibleStackContentsAfterInstruction.cs b/Function/BNGetLowLevelILPossibleStackContentsAfterInstruction.cs new file mode 100644 index 0000000..8cfc334 --- /dev/null +++ b/Function/BNGetLowLevelILPossibleStackContentsAfterInstruction.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNPossibleValueSet BNGetLowLevelILPossibleStackContentsAfterInstruction(BNLowLevelILFunction* func, int64_t offset, uint64_t len, uint64_t instr, BNDataFlowQueryOption* options, uint64_t optionCount) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLowLevelILPossibleStackContentsAfterInstruction" + )] + internal static extern BNPossibleValueSet BNGetLowLevelILPossibleStackContentsAfterInstruction( + + // BNLowLevelILFunction* func + IntPtr func , + + // int64_t offset + long offset , + + // uint64_t len + ulong len , + + // uint64_t instr + LowLevelILInstructionIndex instr , + + // BNDataFlowQueryOption* options + DataFlowQueryOption[] options , + + // uint64_t optionCount + ulong optionCount + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLowLevelILPossibleStackContentsAtInstruction.cs b/Function/BNGetLowLevelILPossibleStackContentsAtInstruction.cs new file mode 100644 index 0000000..32d2292 --- /dev/null +++ b/Function/BNGetLowLevelILPossibleStackContentsAtInstruction.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNPossibleValueSet BNGetLowLevelILPossibleStackContentsAtInstruction(BNLowLevelILFunction* func, int64_t offset, uint64_t len, uint64_t instr, BNDataFlowQueryOption* options, uint64_t optionCount) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLowLevelILPossibleStackContentsAtInstruction" + )] + internal static extern BNPossibleValueSet BNGetLowLevelILPossibleStackContentsAtInstruction( + + // BNLowLevelILFunction* func + IntPtr func , + + // int64_t offset + long offset , + + // uint64_t len + ulong len , + + // uint64_t instr + LowLevelILInstructionIndex instr , + + // BNDataFlowQueryOption* options + DataFlowQueryOption[] options , + + // uint64_t optionCount + ulong optionCount + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLowLevelILRegisterValueAfterInstruction.cs b/Function/BNGetLowLevelILRegisterValueAfterInstruction.cs new file mode 100644 index 0000000..f3c6cce --- /dev/null +++ b/Function/BNGetLowLevelILRegisterValueAfterInstruction.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRegisterValue BNGetLowLevelILRegisterValueAfterInstruction(BNLowLevelILFunction* func, uint32_t reg, uint64_t instr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLowLevelILRegisterValueAfterInstruction" + )] + internal static extern BNRegisterValue BNGetLowLevelILRegisterValueAfterInstruction( + + // BNLowLevelILFunction* func + IntPtr func , + + // uint32_t reg + uint reg , + + // uint64_t instr + LowLevelILInstructionIndex instr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLowLevelILRegisterValueAtInstruction.cs b/Function/BNGetLowLevelILRegisterValueAtInstruction.cs new file mode 100644 index 0000000..e0da4fe --- /dev/null +++ b/Function/BNGetLowLevelILRegisterValueAtInstruction.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRegisterValue BNGetLowLevelILRegisterValueAtInstruction(BNLowLevelILFunction* func, uint32_t reg, uint64_t instr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLowLevelILRegisterValueAtInstruction" + )] + internal static extern BNRegisterValue BNGetLowLevelILRegisterValueAtInstruction( + + // BNLowLevelILFunction* func + IntPtr func , + + // uint32_t reg + RegisterIndex reg , + + // uint64_t instr + LowLevelILInstructionIndex instr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLowLevelILSSAExprIndex.cs b/Function/BNGetLowLevelILSSAExprIndex.cs new file mode 100644 index 0000000..a6f08a5 --- /dev/null +++ b/Function/BNGetLowLevelILSSAExprIndex.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetLowLevelILSSAExprIndex(BNLowLevelILFunction* func, uint64_t expr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLowLevelILSSAExprIndex" + )] + internal static extern LowLevelILExpressionIndex BNGetLowLevelILSSAExprIndex( + + // BNLowLevelILFunction* func + IntPtr func , + + // uint64_t expr + LowLevelILExpressionIndex expr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLowLevelILSSAFlagDefinition.cs b/Function/BNGetLowLevelILSSAFlagDefinition.cs new file mode 100644 index 0000000..3ccb635 --- /dev/null +++ b/Function/BNGetLowLevelILSSAFlagDefinition.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetLowLevelILSSAFlagDefinition(BNLowLevelILFunction* func, uint32_t reg, uint64_t version) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLowLevelILSSAFlagDefinition" + )] + internal static extern LowLevelILInstructionIndex BNGetLowLevelILSSAFlagDefinition( + + // BNLowLevelILFunction* func + IntPtr func , + + // uint32_t reg + FlagIndex flag , + + // uint64_t version + ulong version + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLowLevelILSSAFlagUses.cs b/Function/BNGetLowLevelILSSAFlagUses.cs new file mode 100644 index 0000000..9d3e564 --- /dev/null +++ b/Function/BNGetLowLevelILSSAFlagUses.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t* BNGetLowLevelILSSAFlagUses(BNLowLevelILFunction* func, uint32_t reg, uint64_t version, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLowLevelILSSAFlagUses" + )] + internal static extern IntPtr BNGetLowLevelILSSAFlagUses( + + // BNLowLevelILFunction* func + IntPtr func , + + // uint32_t reg + FlagIndex reg , + + // uint64_t version + ulong version , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLowLevelILSSAFlagValue.cs b/Function/BNGetLowLevelILSSAFlagValue.cs new file mode 100644 index 0000000..4ce06f2 --- /dev/null +++ b/Function/BNGetLowLevelILSSAFlagValue.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRegisterValue BNGetLowLevelILSSAFlagValue(BNLowLevelILFunction* func, uint32_t flag, uint64_t version) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLowLevelILSSAFlagValue" + )] + internal static extern BNRegisterValue BNGetLowLevelILSSAFlagValue( + + // BNLowLevelILFunction* func + IntPtr func , + + // uint32_t flag + FlagIndex flag , + + // uint64_t version + ulong version + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLowLevelILSSAForm.cs b/Function/BNGetLowLevelILSSAForm.cs new file mode 100644 index 0000000..be5bf6f --- /dev/null +++ b/Function/BNGetLowLevelILSSAForm.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLowLevelILFunction* BNGetLowLevelILSSAForm(BNLowLevelILFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLowLevelILSSAForm" + )] + internal static extern IntPtr BNGetLowLevelILSSAForm( + + // BNLowLevelILFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLowLevelILSSAInstructionIndex.cs b/Function/BNGetLowLevelILSSAInstructionIndex.cs new file mode 100644 index 0000000..58944ba --- /dev/null +++ b/Function/BNGetLowLevelILSSAInstructionIndex.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetLowLevelILSSAInstructionIndex(BNLowLevelILFunction* func, uint64_t instr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLowLevelILSSAInstructionIndex" + )] + internal static extern LowLevelILInstructionIndex BNGetLowLevelILSSAInstructionIndex( + + // BNLowLevelILFunction* func + IntPtr func , + + // uint64_t instr + LowLevelILInstructionIndex instr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLowLevelILSSAMemoryDefinition.cs b/Function/BNGetLowLevelILSSAMemoryDefinition.cs new file mode 100644 index 0000000..8b7b7b6 --- /dev/null +++ b/Function/BNGetLowLevelILSSAMemoryDefinition.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetLowLevelILSSAMemoryDefinition(BNLowLevelILFunction* func, uint64_t version) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLowLevelILSSAMemoryDefinition" + )] + internal static extern LowLevelILInstructionIndex BNGetLowLevelILSSAMemoryDefinition( + + // BNLowLevelILFunction* func + IntPtr func , + + // uint64_t version + ulong version + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLowLevelILSSAMemoryUses.cs b/Function/BNGetLowLevelILSSAMemoryUses.cs new file mode 100644 index 0000000..e66f270 --- /dev/null +++ b/Function/BNGetLowLevelILSSAMemoryUses.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t* BNGetLowLevelILSSAMemoryUses(BNLowLevelILFunction* func, uint64_t version, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLowLevelILSSAMemoryUses" + )] + internal static extern IntPtr BNGetLowLevelILSSAMemoryUses( + + // BNLowLevelILFunction* func + IntPtr func , + + // uint64_t version + ulong version , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLowLevelILSSARegisterDefinition.cs b/Function/BNGetLowLevelILSSARegisterDefinition.cs new file mode 100644 index 0000000..7e911dd --- /dev/null +++ b/Function/BNGetLowLevelILSSARegisterDefinition.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetLowLevelILSSARegisterDefinition(BNLowLevelILFunction* func, uint32_t reg, uint64_t version) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLowLevelILSSARegisterDefinition" + )] + internal static extern LowLevelILInstructionIndex BNGetLowLevelILSSARegisterDefinition( + + // BNLowLevelILFunction* func + IntPtr func , + + // uint32_t reg + RegisterIndex reg , + + // uint64_t version + ulong version + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLowLevelILSSARegisterUses.cs b/Function/BNGetLowLevelILSSARegisterUses.cs new file mode 100644 index 0000000..a96667e --- /dev/null +++ b/Function/BNGetLowLevelILSSARegisterUses.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t* BNGetLowLevelILSSARegisterUses(BNLowLevelILFunction* func, uint32_t reg, uint64_t version, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLowLevelILSSARegisterUses" + )] + internal static extern IntPtr BNGetLowLevelILSSARegisterUses( + + // BNLowLevelILFunction* func + IntPtr func , + + // uint32_t reg + RegisterIndex reg , + + // uint64_t version + ulong version , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLowLevelILSSARegisterValue.cs b/Function/BNGetLowLevelILSSARegisterValue.cs new file mode 100644 index 0000000..fe8ab9c --- /dev/null +++ b/Function/BNGetLowLevelILSSARegisterValue.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRegisterValue BNGetLowLevelILSSARegisterValue(BNLowLevelILFunction* func, uint32_t reg, uint64_t version) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLowLevelILSSARegisterValue" + )] + internal static extern BNRegisterValue BNGetLowLevelILSSARegisterValue( + + // BNLowLevelILFunction* func + IntPtr func , + + // uint32_t reg + RegisterIndex reg , + + // uint64_t version + ulong version + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLowLevelILStackContentsAfterInstruction.cs b/Function/BNGetLowLevelILStackContentsAfterInstruction.cs new file mode 100644 index 0000000..1cc01e7 --- /dev/null +++ b/Function/BNGetLowLevelILStackContentsAfterInstruction.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRegisterValue BNGetLowLevelILStackContentsAfterInstruction(BNLowLevelILFunction* func, int64_t offset, uint64_t len, uint64_t instr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLowLevelILStackContentsAfterInstruction" + )] + internal static extern BNRegisterValue BNGetLowLevelILStackContentsAfterInstruction( + + // BNLowLevelILFunction* func + IntPtr func , + + // int64_t offset + long offset , + + // uint64_t len + ulong len , + + // uint64_t instr + LowLevelILInstructionIndex instr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLowLevelILStackContentsAtInstruction.cs b/Function/BNGetLowLevelILStackContentsAtInstruction.cs new file mode 100644 index 0000000..1060d76 --- /dev/null +++ b/Function/BNGetLowLevelILStackContentsAtInstruction.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRegisterValue BNGetLowLevelILStackContentsAtInstruction(BNLowLevelILFunction* func, int64_t offset, uint64_t len, uint64_t instr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLowLevelILStackContentsAtInstruction" + )] + internal static extern BNRegisterValue BNGetLowLevelILStackContentsAtInstruction( + + // BNLowLevelILFunction* func + IntPtr func , + + // int64_t offset + long offset , + + // uint64_t len + ulong len , + + // uint64_t instr + LowLevelILInstructionIndex instr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLowLevelILTemporaryFlagCount.cs b/Function/BNGetLowLevelILTemporaryFlagCount.cs new file mode 100644 index 0000000..cdea03f --- /dev/null +++ b/Function/BNGetLowLevelILTemporaryFlagCount.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint32_t BNGetLowLevelILTemporaryFlagCount(BNLowLevelILFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLowLevelILTemporaryFlagCount" + )] + internal static extern uint BNGetLowLevelILTemporaryFlagCount( + + // BNLowLevelILFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLowLevelILTemporaryRegisterCount.cs b/Function/BNGetLowLevelILTemporaryRegisterCount.cs new file mode 100644 index 0000000..296fcff --- /dev/null +++ b/Function/BNGetLowLevelILTemporaryRegisterCount.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint32_t BNGetLowLevelILTemporaryRegisterCount(BNLowLevelILFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLowLevelILTemporaryRegisterCount" + )] + internal static extern uint BNGetLowLevelILTemporaryRegisterCount( + + // BNLowLevelILFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLowLevelMemoryVersions.cs b/Function/BNGetLowLevelMemoryVersions.cs new file mode 100644 index 0000000..951ad2c --- /dev/null +++ b/Function/BNGetLowLevelMemoryVersions.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t* BNGetLowLevelMemoryVersions(BNLowLevelILFunction* func, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLowLevelMemoryVersions" + )] + internal static extern IntPtr BNGetLowLevelMemoryVersions( + + // BNLowLevelILFunction* func + IntPtr func , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLowLevelRegisterSSAVersions.cs b/Function/BNGetLowLevelRegisterSSAVersions.cs new file mode 100644 index 0000000..4a788a6 --- /dev/null +++ b/Function/BNGetLowLevelRegisterSSAVersions.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t* BNGetLowLevelRegisterSSAVersions(BNLowLevelILFunction* func, uint32_t var, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLowLevelRegisterSSAVersions" + )] + internal static extern IntPtr BNGetLowLevelRegisterSSAVersions( + + // BNLowLevelILFunction* func + IntPtr func , + + // uint32_t _var + RegisterIndex _var , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLowLevelRegisterStackSSAVersions.cs b/Function/BNGetLowLevelRegisterStackSSAVersions.cs new file mode 100644 index 0000000..6c53446 --- /dev/null +++ b/Function/BNGetLowLevelRegisterStackSSAVersions.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t* BNGetLowLevelRegisterStackSSAVersions(BNLowLevelILFunction* func, uint32_t var, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLowLevelRegisterStackSSAVersions" + )] + internal static extern IntPtr BNGetLowLevelRegisterStackSSAVersions( + + // BNLowLevelILFunction* func + IntPtr func , + + // uint32_t _var + RegisterStackIndex _var , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLowLevelRegisterStacks.cs b/Function/BNGetLowLevelRegisterStacks.cs new file mode 100644 index 0000000..0107321 --- /dev/null +++ b/Function/BNGetLowLevelRegisterStacks.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint32_t* BNGetLowLevelRegisterStacks(BNLowLevelILFunction* func, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLowLevelRegisterStacks" + )] + internal static extern IntPtr BNGetLowLevelRegisterStacks( + + // BNLowLevelILFunction* func + IntPtr func , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLowLevelRegisters.cs b/Function/BNGetLowLevelRegisters.cs new file mode 100644 index 0000000..12c99ad --- /dev/null +++ b/Function/BNGetLowLevelRegisters.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint32_t* BNGetLowLevelRegisters(BNLowLevelILFunction* func, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLowLevelRegisters" + )] + internal static extern IntPtr BNGetLowLevelRegisters( + + // BNLowLevelILFunction* func + IntPtr func , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLowLevelSSAFlagsWithoutVersions.cs b/Function/BNGetLowLevelSSAFlagsWithoutVersions.cs new file mode 100644 index 0000000..9c008d6 --- /dev/null +++ b/Function/BNGetLowLevelSSAFlagsWithoutVersions.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint32_t* BNGetLowLevelSSAFlagsWithoutVersions(BNLowLevelILFunction* func, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLowLevelSSAFlagsWithoutVersions" + )] + internal static extern IntPtr BNGetLowLevelSSAFlagsWithoutVersions( + + // BNLowLevelILFunction* func + IntPtr func , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLowLevelSSARegisterStacksWithoutVersions.cs b/Function/BNGetLowLevelSSARegisterStacksWithoutVersions.cs new file mode 100644 index 0000000..17a40e6 --- /dev/null +++ b/Function/BNGetLowLevelSSARegisterStacksWithoutVersions.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint32_t* BNGetLowLevelSSARegisterStacksWithoutVersions(BNLowLevelILFunction* func, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLowLevelSSARegisterStacksWithoutVersions" + )] + internal static extern IntPtr BNGetLowLevelSSARegisterStacksWithoutVersions( + + // BNLowLevelILFunction* func + IntPtr func , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetLowLevelSSARegistersWithoutVersions.cs b/Function/BNGetLowLevelSSARegistersWithoutVersions.cs new file mode 100644 index 0000000..1efebbe --- /dev/null +++ b/Function/BNGetLowLevelSSARegistersWithoutVersions.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint32_t* BNGetLowLevelSSARegistersWithoutVersions(BNLowLevelILFunction* func, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetLowLevelSSARegistersWithoutVersions" + )] + internal static extern IntPtr BNGetLowLevelSSARegistersWithoutVersions( + + // BNLowLevelILFunction* func + IntPtr func , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMappedAddressRanges.cs b/Function/BNGetMappedAddressRanges.cs new file mode 100644 index 0000000..62aec98 --- /dev/null +++ b/Function/BNGetMappedAddressRanges.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNAddressRange* BNGetMappedAddressRanges(BNBinaryView* view, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetMappedAddressRanges" + )] + internal static extern IntPtr BNGetMappedAddressRanges( + + // BNBinaryView* view + IntPtr view , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMappedMediumLevelIL.cs b/Function/BNGetMappedMediumLevelIL.cs new file mode 100644 index 0000000..6370ef7 --- /dev/null +++ b/Function/BNGetMappedMediumLevelIL.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNMediumLevelILFunction* BNGetMappedMediumLevelIL(BNLowLevelILFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetMappedMediumLevelIL" + )] + internal static extern IntPtr BNGetMappedMediumLevelIL( + + // BNLowLevelILFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMappedMediumLevelILExprIndex.cs b/Function/BNGetMappedMediumLevelILExprIndex.cs new file mode 100644 index 0000000..afab36e --- /dev/null +++ b/Function/BNGetMappedMediumLevelILExprIndex.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetMappedMediumLevelILExprIndex(BNLowLevelILFunction* func, uint64_t expr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetMappedMediumLevelILExprIndex" + )] + internal static extern MediumLevelILExpressionIndex BNGetMappedMediumLevelILExprIndex( + + // BNLowLevelILFunction* func + IntPtr func , + + // uint64_t expr + LowLevelILExpressionIndex expr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMappedMediumLevelILInstructionIndex.cs b/Function/BNGetMappedMediumLevelILInstructionIndex.cs new file mode 100644 index 0000000..6da1897 --- /dev/null +++ b/Function/BNGetMappedMediumLevelILInstructionIndex.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetMappedMediumLevelILInstructionIndex(BNLowLevelILFunction* func, uint64_t instr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetMappedMediumLevelILInstructionIndex" + )] + internal static extern MediumLevelILInstructionIndex BNGetMappedMediumLevelILInstructionIndex( + + // BNLowLevelILFunction* func + IntPtr func , + + // uint64_t instr + LowLevelILInstructionIndex instr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMaskForSize.cs b/Function/BNGetMaskForSize.cs new file mode 100644 index 0000000..9a8e406 --- /dev/null +++ b/Function/BNGetMaskForSize.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// int64_t BNGetMaskForSize(uint64_t size) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetMaskForSize" + )] + internal static extern long BNGetMaskForSize( + + // uint64_t size + ulong size + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMaxFunctionSizeForAnalysis.cs b/Function/BNGetMaxFunctionSizeForAnalysis.cs new file mode 100644 index 0000000..86693d3 --- /dev/null +++ b/Function/BNGetMaxFunctionSizeForAnalysis.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetMaxFunctionSizeForAnalysis(BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetMaxFunctionSizeForAnalysis" + )] + internal static extern ulong BNGetMaxFunctionSizeForAnalysis( + + // BNBinaryView* view + IntPtr view + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMediumLevelILAliasedVariables.cs b/Function/BNGetMediumLevelILAliasedVariables.cs new file mode 100644 index 0000000..fba6ed9 --- /dev/null +++ b/Function/BNGetMediumLevelILAliasedVariables.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNVariable* BNGetMediumLevelILAliasedVariables(BNMediumLevelILFunction* func, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetMediumLevelILAliasedVariables" + )] + internal static extern IntPtr BNGetMediumLevelILAliasedVariables( + + // BNMediumLevelILFunction* func + IntPtr func , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMediumLevelILBasicBlockForInstruction.cs b/Function/BNGetMediumLevelILBasicBlockForInstruction.cs new file mode 100644 index 0000000..933fbeb --- /dev/null +++ b/Function/BNGetMediumLevelILBasicBlockForInstruction.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBasicBlock* BNGetMediumLevelILBasicBlockForInstruction(BNMediumLevelILFunction* func, uint64_t i) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetMediumLevelILBasicBlockForInstruction" + )] + internal static extern IntPtr BNGetMediumLevelILBasicBlockForInstruction( + + // BNMediumLevelILFunction* func + IntPtr func , + + // uint64_t i + MediumLevelILInstructionIndex i + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMediumLevelILBasicBlockList.cs b/Function/BNGetMediumLevelILBasicBlockList.cs new file mode 100644 index 0000000..7baf03c --- /dev/null +++ b/Function/BNGetMediumLevelILBasicBlockList.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBasicBlock** BNGetMediumLevelILBasicBlockList(BNMediumLevelILFunction* func, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetMediumLevelILBasicBlockList" + )] + internal static extern IntPtr BNGetMediumLevelILBasicBlockList( + + // BNMediumLevelILFunction* func + IntPtr func , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMediumLevelILBranchDependence.cs b/Function/BNGetMediumLevelILBranchDependence.cs new file mode 100644 index 0000000..5edeade --- /dev/null +++ b/Function/BNGetMediumLevelILBranchDependence.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNILBranchDependence BNGetMediumLevelILBranchDependence(BNMediumLevelILFunction* func, uint64_t curInstr, uint64_t branchInstr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetMediumLevelILBranchDependence" + )] + internal static extern ILBranchDependence BNGetMediumLevelILBranchDependence( + + // BNMediumLevelILFunction* func + IntPtr func , + + // uint64_t curInstr + MediumLevelILInstructionIndex curInstr , + + // uint64_t branchInstr + MediumLevelILInstructionIndex branchInstr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMediumLevelILByIndex.cs b/Function/BNGetMediumLevelILByIndex.cs new file mode 100644 index 0000000..a623655 --- /dev/null +++ b/Function/BNGetMediumLevelILByIndex.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNMediumLevelILInstruction BNGetMediumLevelILByIndex(BNMediumLevelILFunction* func, uint64_t i) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetMediumLevelILByIndex" + )] + internal static extern BNMediumLevelILInstruction BNGetMediumLevelILByIndex( + + // BNMediumLevelILFunction* func + IntPtr func , + + // uint64_t i + MediumLevelILExpressionIndex i + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMediumLevelILExprCount.cs b/Function/BNGetMediumLevelILExprCount.cs new file mode 100644 index 0000000..a03c47b --- /dev/null +++ b/Function/BNGetMediumLevelILExprCount.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetMediumLevelILExprCount(BNMediumLevelILFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetMediumLevelILExprCount" + )] + internal static extern ulong BNGetMediumLevelILExprCount( + + // BNMediumLevelILFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMediumLevelILExprIndex.cs b/Function/BNGetMediumLevelILExprIndex.cs new file mode 100644 index 0000000..06beb73 --- /dev/null +++ b/Function/BNGetMediumLevelILExprIndex.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetMediumLevelILExprIndex(BNLowLevelILFunction* func, uint64_t expr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetMediumLevelILExprIndex" + )] + internal static extern MediumLevelILExpressionIndex BNGetMediumLevelILExprIndex( + + // BNLowLevelILFunction* func + IntPtr func , + + // uint64_t expr + LowLevelILExpressionIndex expr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMediumLevelILExprIndexFromHighLevelIL.cs b/Function/BNGetMediumLevelILExprIndexFromHighLevelIL.cs new file mode 100644 index 0000000..0a4ce32 --- /dev/null +++ b/Function/BNGetMediumLevelILExprIndexFromHighLevelIL.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetMediumLevelILExprIndexFromHighLevelIL(BNHighLevelILFunction* func, uint64_t expr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetMediumLevelILExprIndexFromHighLevelIL" + )] + internal static extern MediumLevelILExpressionIndex BNGetMediumLevelILExprIndexFromHighLevelIL( + + // BNHighLevelILFunction* func + IntPtr func , + + // uint64_t expr + HighLevelILExpressionIndex expr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMediumLevelILExprIndexes.cs b/Function/BNGetMediumLevelILExprIndexes.cs new file mode 100644 index 0000000..285138b --- /dev/null +++ b/Function/BNGetMediumLevelILExprIndexes.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t* BNGetMediumLevelILExprIndexes(BNLowLevelILFunction* func, uint64_t expr, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetMediumLevelILExprIndexes" + )] + internal static extern IntPtr BNGetMediumLevelILExprIndexes( + + // BNLowLevelILFunction* func + IntPtr func , + + // uint64_t expr + LowLevelILExpressionIndex expr , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMediumLevelILExprIndexesFromHighLevelIL.cs b/Function/BNGetMediumLevelILExprIndexesFromHighLevelIL.cs new file mode 100644 index 0000000..940ff4a --- /dev/null +++ b/Function/BNGetMediumLevelILExprIndexesFromHighLevelIL.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t* BNGetMediumLevelILExprIndexesFromHighLevelIL(BNHighLevelILFunction* func, uint64_t expr, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetMediumLevelILExprIndexesFromHighLevelIL" + )] + internal static extern IntPtr BNGetMediumLevelILExprIndexesFromHighLevelIL( + + // BNHighLevelILFunction* func + IntPtr func , + + // uint64_t expr + HighLevelILExpressionIndex expr , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMediumLevelILExprText.cs b/Function/BNGetMediumLevelILExprText.cs new file mode 100644 index 0000000..fce8c21 --- /dev/null +++ b/Function/BNGetMediumLevelILExprText.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNGetMediumLevelILExprText(BNMediumLevelILFunction* func, BNArchitecture* arch, uint64_t i, BNInstructionTextToken** tokens, uint64_t* count, BNDisassemblySettings* settings) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetMediumLevelILExprText" + )] + internal static extern bool BNGetMediumLevelILExprText( + + // BNMediumLevelILFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t i + MediumLevelILExpressionIndex i , + + // BNInstructionTextToken** tokens + out IntPtr tokens , + + // uint64_t* count + out ulong count , + + // BNDisassemblySettings* settings + IntPtr settings + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMediumLevelILExprType.cs b/Function/BNGetMediumLevelILExprType.cs new file mode 100644 index 0000000..76c75e2 --- /dev/null +++ b/Function/BNGetMediumLevelILExprType.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeWithConfidence BNGetMediumLevelILExprType(BNMediumLevelILFunction* func, uint64_t expr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetMediumLevelILExprType" + )] + internal static extern BNTypeWithConfidence BNGetMediumLevelILExprType( + + // BNMediumLevelILFunction* func + IntPtr func , + + // uint64_t expr + MediumLevelILExpressionIndex expr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMediumLevelILExprValue.cs b/Function/BNGetMediumLevelILExprValue.cs new file mode 100644 index 0000000..be44f6e --- /dev/null +++ b/Function/BNGetMediumLevelILExprValue.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRegisterValue BNGetMediumLevelILExprValue(BNMediumLevelILFunction* func, uint64_t expr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetMediumLevelILExprValue" + )] + internal static extern BNRegisterValue BNGetMediumLevelILExprValue( + + // BNMediumLevelILFunction* func + IntPtr func , + + // uint64_t expr + MediumLevelILExpressionIndex expr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMediumLevelILFlagValueAfterInstruction.cs b/Function/BNGetMediumLevelILFlagValueAfterInstruction.cs new file mode 100644 index 0000000..7f797f1 --- /dev/null +++ b/Function/BNGetMediumLevelILFlagValueAfterInstruction.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRegisterValue BNGetMediumLevelILFlagValueAfterInstruction(BNMediumLevelILFunction* func, uint32_t flag, uint64_t instr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetMediumLevelILFlagValueAfterInstruction" + )] + internal static extern BNRegisterValue BNGetMediumLevelILFlagValueAfterInstruction( + + // BNMediumLevelILFunction* func + IntPtr func , + + // uint32_t flag + FlagIndex flag , + + // uint64_t instr + MediumLevelILInstructionIndex instr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMediumLevelILFlagValueAtInstruction.cs b/Function/BNGetMediumLevelILFlagValueAtInstruction.cs new file mode 100644 index 0000000..a4eff32 --- /dev/null +++ b/Function/BNGetMediumLevelILFlagValueAtInstruction.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRegisterValue BNGetMediumLevelILFlagValueAtInstruction(BNMediumLevelILFunction* func, uint32_t flag, uint64_t instr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetMediumLevelILFlagValueAtInstruction" + )] + internal static extern BNRegisterValue BNGetMediumLevelILFlagValueAtInstruction( + + // BNMediumLevelILFunction* func + IntPtr func , + + // uint32_t flag + FlagIndex flag , + + // uint64_t instr + MediumLevelILInstructionIndex instr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMediumLevelILForHighLevelILFunction.cs b/Function/BNGetMediumLevelILForHighLevelILFunction.cs new file mode 100644 index 0000000..5096109 --- /dev/null +++ b/Function/BNGetMediumLevelILForHighLevelILFunction.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNMediumLevelILFunction* BNGetMediumLevelILForHighLevelILFunction(BNHighLevelILFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetMediumLevelILForHighLevelILFunction" + )] + internal static extern IntPtr BNGetMediumLevelILForHighLevelILFunction( + + // BNHighLevelILFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMediumLevelILForLowLevelIL.cs b/Function/BNGetMediumLevelILForLowLevelIL.cs new file mode 100644 index 0000000..eba707c --- /dev/null +++ b/Function/BNGetMediumLevelILForLowLevelIL.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNMediumLevelILFunction* BNGetMediumLevelILForLowLevelIL(BNLowLevelILFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetMediumLevelILForLowLevelIL" + )] + internal static extern IntPtr BNGetMediumLevelILForLowLevelIL( + + // BNLowLevelILFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMediumLevelILIndexForInstruction.cs b/Function/BNGetMediumLevelILIndexForInstruction.cs new file mode 100644 index 0000000..7d0a334 --- /dev/null +++ b/Function/BNGetMediumLevelILIndexForInstruction.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetMediumLevelILIndexForInstruction(BNMediumLevelILFunction* func, uint64_t i) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetMediumLevelILIndexForInstruction" + )] + internal static extern MediumLevelILExpressionIndex BNGetMediumLevelILIndexForInstruction( + + // BNMediumLevelILFunction* func + IntPtr func , + + // uint64_t i + MediumLevelILInstructionIndex i + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMediumLevelILInstructionCount.cs b/Function/BNGetMediumLevelILInstructionCount.cs new file mode 100644 index 0000000..6cf4c1f --- /dev/null +++ b/Function/BNGetMediumLevelILInstructionCount.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetMediumLevelILInstructionCount(BNMediumLevelILFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetMediumLevelILInstructionCount" + )] + internal static extern ulong BNGetMediumLevelILInstructionCount( + + // BNMediumLevelILFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMediumLevelILInstructionForExpr.cs b/Function/BNGetMediumLevelILInstructionForExpr.cs new file mode 100644 index 0000000..92df16e --- /dev/null +++ b/Function/BNGetMediumLevelILInstructionForExpr.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetMediumLevelILInstructionForExpr(BNMediumLevelILFunction* func, uint64_t expr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetMediumLevelILInstructionForExpr" + )] + internal static extern MediumLevelILInstructionIndex BNGetMediumLevelILInstructionForExpr( + + // BNMediumLevelILFunction* func + IntPtr func , + + // uint64_t expr + MediumLevelILExpressionIndex expr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMediumLevelILInstructionIndex.cs b/Function/BNGetMediumLevelILInstructionIndex.cs new file mode 100644 index 0000000..f08e405 --- /dev/null +++ b/Function/BNGetMediumLevelILInstructionIndex.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetMediumLevelILInstructionIndex(BNLowLevelILFunction* func, uint64_t instr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetMediumLevelILInstructionIndex" + )] + internal static extern MediumLevelILInstructionIndex BNGetMediumLevelILInstructionIndex( + + // BNLowLevelILFunction* func + IntPtr func , + + // uint64_t instr + LowLevelILInstructionIndex instr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMediumLevelILInstructionText.cs b/Function/BNGetMediumLevelILInstructionText.cs new file mode 100644 index 0000000..6284c36 --- /dev/null +++ b/Function/BNGetMediumLevelILInstructionText.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNGetMediumLevelILInstructionText(BNMediumLevelILFunction* il, BNFunction* func, BNArchitecture* arch, uint64_t i, BNInstructionTextToken** tokens, uint64_t* count, BNDisassemblySettings* settings) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetMediumLevelILInstructionText" + )] + internal static extern bool BNGetMediumLevelILInstructionText( + + // BNMediumLevelILFunction* il + IntPtr il , + + // BNFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t i + ulong i , + + // BNInstructionTextToken** tokens + IntPtr tokens , + + // uint64_t* count + IntPtr count , + + // BNDisassemblySettings* settings + IntPtr settings + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMediumLevelILLiveInstructionsForVariable.cs b/Function/BNGetMediumLevelILLiveInstructionsForVariable.cs new file mode 100644 index 0000000..9eccad6 --- /dev/null +++ b/Function/BNGetMediumLevelILLiveInstructionsForVariable.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t* BNGetMediumLevelILLiveInstructionsForVariable(BNMediumLevelILFunction* func, BNVariable* var, bool includeLastUse, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetMediumLevelILLiveInstructionsForVariable" + )] + internal static extern IntPtr BNGetMediumLevelILLiveInstructionsForVariable( + + // BNMediumLevelILFunction* func + IntPtr func , + + // BNVariable* _var + in BNVariable variable , + + // bool includeLastUse + bool includeLastUse , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMediumLevelILNonSSAExprIndex.cs b/Function/BNGetMediumLevelILNonSSAExprIndex.cs new file mode 100644 index 0000000..8ca3ed4 --- /dev/null +++ b/Function/BNGetMediumLevelILNonSSAExprIndex.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetMediumLevelILNonSSAExprIndex(BNMediumLevelILFunction* func, uint64_t expr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetMediumLevelILNonSSAExprIndex" + )] + internal static extern MediumLevelILExpressionIndex BNGetMediumLevelILNonSSAExprIndex( + + // BNMediumLevelILFunction* func + IntPtr func , + + // uint64_t expr + MediumLevelILExpressionIndex expr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMediumLevelILNonSSAForm.cs b/Function/BNGetMediumLevelILNonSSAForm.cs new file mode 100644 index 0000000..27bf422 --- /dev/null +++ b/Function/BNGetMediumLevelILNonSSAForm.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNMediumLevelILFunction* BNGetMediumLevelILNonSSAForm(BNMediumLevelILFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetMediumLevelILNonSSAForm" + )] + internal static extern IntPtr BNGetMediumLevelILNonSSAForm( + + // BNMediumLevelILFunction* func + IntPtr func + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMediumLevelILNonSSAInstructionIndex.cs b/Function/BNGetMediumLevelILNonSSAInstructionIndex.cs new file mode 100644 index 0000000..6f03d76 --- /dev/null +++ b/Function/BNGetMediumLevelILNonSSAInstructionIndex.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetMediumLevelILNonSSAInstructionIndex(BNMediumLevelILFunction* func, uint64_t instr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetMediumLevelILNonSSAInstructionIndex" + )] + internal static extern MediumLevelILInstructionIndex BNGetMediumLevelILNonSSAInstructionIndex( + + // BNMediumLevelILFunction* func + IntPtr func , + + // uint64_t instr + MediumLevelILInstructionIndex instr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMediumLevelILOwnerFunction.cs b/Function/BNGetMediumLevelILOwnerFunction.cs new file mode 100644 index 0000000..9b779ac --- /dev/null +++ b/Function/BNGetMediumLevelILOwnerFunction.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFunction* BNGetMediumLevelILOwnerFunction(BNMediumLevelILFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetMediumLevelILOwnerFunction" + )] + internal static extern IntPtr BNGetMediumLevelILOwnerFunction( + + // BNMediumLevelILFunction* func + IntPtr function + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMediumLevelILPossibleExprValues.cs b/Function/BNGetMediumLevelILPossibleExprValues.cs new file mode 100644 index 0000000..a10d4aa --- /dev/null +++ b/Function/BNGetMediumLevelILPossibleExprValues.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNPossibleValueSet BNGetMediumLevelILPossibleExprValues(BNMediumLevelILFunction* func, uint64_t expr, BNDataFlowQueryOption* options, uint64_t optionCount) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetMediumLevelILPossibleExprValues" + )] + internal static extern BNPossibleValueSet BNGetMediumLevelILPossibleExprValues( + + // BNMediumLevelILFunction* func + IntPtr func , + + // uint64_t expr + MediumLevelILExpressionIndex expression , + + // BNDataFlowQueryOption* options + DataFlowQueryOption[] options , + + // uint64_t optionCount + ulong optionCount + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMediumLevelILPossibleFlagValuesAfterInstruction.cs b/Function/BNGetMediumLevelILPossibleFlagValuesAfterInstruction.cs new file mode 100644 index 0000000..3726d63 --- /dev/null +++ b/Function/BNGetMediumLevelILPossibleFlagValuesAfterInstruction.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNPossibleValueSet BNGetMediumLevelILPossibleFlagValuesAfterInstruction(BNMediumLevelILFunction* func, uint32_t flag, uint64_t instr, BNDataFlowQueryOption* options, uint64_t optionCount) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetMediumLevelILPossibleFlagValuesAfterInstruction" + )] + internal static extern BNPossibleValueSet BNGetMediumLevelILPossibleFlagValuesAfterInstruction( + + // BNMediumLevelILFunction* func + IntPtr func , + + // uint32_t flag + FlagIndex flag , + + // uint64_t instr + MediumLevelILInstructionIndex instr , + + // BNDataFlowQueryOption* options + DataFlowQueryOption[] options , + + // uint64_t optionCount + ulong optionCount + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMediumLevelILPossibleFlagValuesAtInstruction.cs b/Function/BNGetMediumLevelILPossibleFlagValuesAtInstruction.cs new file mode 100644 index 0000000..f45a66d --- /dev/null +++ b/Function/BNGetMediumLevelILPossibleFlagValuesAtInstruction.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNPossibleValueSet BNGetMediumLevelILPossibleFlagValuesAtInstruction(BNMediumLevelILFunction* func, uint32_t flag, uint64_t instr, BNDataFlowQueryOption* options, uint64_t optionCount) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetMediumLevelILPossibleFlagValuesAtInstruction" + )] + internal static extern BNPossibleValueSet BNGetMediumLevelILPossibleFlagValuesAtInstruction( + + // BNMediumLevelILFunction* func + IntPtr func , + + // uint32_t flag + FlagIndex flag , + + // uint64_t instr + MediumLevelILInstructionIndex instr , + + // BNDataFlowQueryOption* options + DataFlowQueryOption[] options , + + // uint64_t optionCount + ulong optionCount + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMediumLevelILPossibleRegisterValuesAfterInstruction.cs b/Function/BNGetMediumLevelILPossibleRegisterValuesAfterInstruction.cs new file mode 100644 index 0000000..4e3e812 --- /dev/null +++ b/Function/BNGetMediumLevelILPossibleRegisterValuesAfterInstruction.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNPossibleValueSet BNGetMediumLevelILPossibleRegisterValuesAfterInstruction(BNMediumLevelILFunction* func, uint32_t reg, uint64_t instr, BNDataFlowQueryOption* options, uint64_t optionCount) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetMediumLevelILPossibleRegisterValuesAfterInstruction" + )] + internal static extern BNPossibleValueSet BNGetMediumLevelILPossibleRegisterValuesAfterInstruction( + + // BNMediumLevelILFunction* func + IntPtr func , + + // uint32_t reg + RegisterIndex reg , + + // uint64_t instr + MediumLevelILInstructionIndex instr , + + // BNDataFlowQueryOption* options + DataFlowQueryOption[] options , + + // uint64_t optionCount + ulong optionCount + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMediumLevelILPossibleRegisterValuesAtInstruction.cs b/Function/BNGetMediumLevelILPossibleRegisterValuesAtInstruction.cs new file mode 100644 index 0000000..fb7b761 --- /dev/null +++ b/Function/BNGetMediumLevelILPossibleRegisterValuesAtInstruction.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNPossibleValueSet BNGetMediumLevelILPossibleRegisterValuesAtInstruction(BNMediumLevelILFunction* func, uint32_t reg, uint64_t instr, BNDataFlowQueryOption* options, uint64_t optionCount) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetMediumLevelILPossibleRegisterValuesAtInstruction" + )] + internal static extern BNPossibleValueSet BNGetMediumLevelILPossibleRegisterValuesAtInstruction( + + // BNMediumLevelILFunction* func + IntPtr func , + + // uint32_t reg + RegisterIndex reg , + + // uint64_t instr + MediumLevelILInstructionIndex instr , + + // BNDataFlowQueryOption* options + DataFlowQueryOption[] options , + + // uint64_t optionCount + ulong optionCount + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMediumLevelILPossibleSSAVarValues.cs b/Function/BNGetMediumLevelILPossibleSSAVarValues.cs new file mode 100644 index 0000000..3cd17fc --- /dev/null +++ b/Function/BNGetMediumLevelILPossibleSSAVarValues.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNPossibleValueSet BNGetMediumLevelILPossibleSSAVarValues(BNMediumLevelILFunction* func, BNVariable* var, uint64_t version, uint64_t instr, BNDataFlowQueryOption* options, uint64_t optionCount) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetMediumLevelILPossibleSSAVarValues" + )] + internal static extern BNPossibleValueSet BNGetMediumLevelILPossibleSSAVarValues( + + // BNMediumLevelILFunction* func + IntPtr func , + + // BNVariable* _var + in BNVariable variable , + + // uint64_t version + ulong version , + + // uint64_t instr + MediumLevelILInstructionIndex instr , + + // BNDataFlowQueryOption* options + DataFlowQueryOption[] options , + + // uint64_t optionCount + ulong optionCount + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMediumLevelILPossibleStackContentsAfterInstruction.cs b/Function/BNGetMediumLevelILPossibleStackContentsAfterInstruction.cs new file mode 100644 index 0000000..fe6563a --- /dev/null +++ b/Function/BNGetMediumLevelILPossibleStackContentsAfterInstruction.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNPossibleValueSet BNGetMediumLevelILPossibleStackContentsAfterInstruction(BNMediumLevelILFunction* func, int64_t offset, uint64_t len, uint64_t instr, BNDataFlowQueryOption* options, uint64_t optionCount) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetMediumLevelILPossibleStackContentsAfterInstruction" + )] + internal static extern BNPossibleValueSet BNGetMediumLevelILPossibleStackContentsAfterInstruction( + + // BNMediumLevelILFunction* func + IntPtr func , + + // int64_t offset + long offset , + + // uint64_t len + ulong len , + + // uint64_t instr + MediumLevelILInstructionIndex instr , + + // BNDataFlowQueryOption* options + DataFlowQueryOption[] options , + + // uint64_t optionCount + ulong optionCount + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMediumLevelILPossibleStackContentsAtInstruction.cs b/Function/BNGetMediumLevelILPossibleStackContentsAtInstruction.cs new file mode 100644 index 0000000..280db7d --- /dev/null +++ b/Function/BNGetMediumLevelILPossibleStackContentsAtInstruction.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNPossibleValueSet BNGetMediumLevelILPossibleStackContentsAtInstruction(BNMediumLevelILFunction* func, int64_t offset, uint64_t len, uint64_t instr, BNDataFlowQueryOption* options, uint64_t optionCount) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetMediumLevelILPossibleStackContentsAtInstruction" + )] + internal static extern BNPossibleValueSet BNGetMediumLevelILPossibleStackContentsAtInstruction( + + // BNMediumLevelILFunction* func + IntPtr func , + + // int64_t offset + long offset , + + // uint64_t len + ulong len , + + // uint64_t instr + MediumLevelILInstructionIndex instr , + + // BNDataFlowQueryOption* options + DataFlowQueryOption[] options , + + // uint64_t optionCount + ulong optionCount + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMediumLevelILRegisterValueAfterInstruction.cs b/Function/BNGetMediumLevelILRegisterValueAfterInstruction.cs new file mode 100644 index 0000000..3deefe3 --- /dev/null +++ b/Function/BNGetMediumLevelILRegisterValueAfterInstruction.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRegisterValue BNGetMediumLevelILRegisterValueAfterInstruction(BNMediumLevelILFunction* func, uint32_t reg, uint64_t instr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetMediumLevelILRegisterValueAfterInstruction" + )] + internal static extern BNRegisterValue BNGetMediumLevelILRegisterValueAfterInstruction( + + // BNMediumLevelILFunction* func + IntPtr func , + + // uint32_t reg + RegisterIndex reg , + + // uint64_t instr + MediumLevelILInstructionIndex instr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMediumLevelILRegisterValueAtInstruction.cs b/Function/BNGetMediumLevelILRegisterValueAtInstruction.cs new file mode 100644 index 0000000..1f6e930 --- /dev/null +++ b/Function/BNGetMediumLevelILRegisterValueAtInstruction.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRegisterValue BNGetMediumLevelILRegisterValueAtInstruction(BNMediumLevelILFunction* func, uint32_t reg, uint64_t instr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetMediumLevelILRegisterValueAtInstruction" + )] + internal static extern BNRegisterValue BNGetMediumLevelILRegisterValueAtInstruction( + + // BNMediumLevelILFunction* func + IntPtr func , + + // uint32_t reg + uint reg , + + // uint64_t instr + MediumLevelILInstructionIndex instr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMediumLevelILSSAExprIndex.cs b/Function/BNGetMediumLevelILSSAExprIndex.cs new file mode 100644 index 0000000..7c6bc2b --- /dev/null +++ b/Function/BNGetMediumLevelILSSAExprIndex.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetMediumLevelILSSAExprIndex(BNMediumLevelILFunction* func, uint64_t expr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetMediumLevelILSSAExprIndex" + )] + internal static extern MediumLevelILExpressionIndex BNGetMediumLevelILSSAExprIndex( + + // BNMediumLevelILFunction* func + IntPtr func , + + // uint64_t expr + MediumLevelILExpressionIndex expr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMediumLevelILSSAForm.cs b/Function/BNGetMediumLevelILSSAForm.cs new file mode 100644 index 0000000..d1fefb8 --- /dev/null +++ b/Function/BNGetMediumLevelILSSAForm.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNMediumLevelILFunction* BNGetMediumLevelILSSAForm(BNMediumLevelILFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetMediumLevelILSSAForm" + )] + internal static extern IntPtr BNGetMediumLevelILSSAForm( + + // BNMediumLevelILFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMediumLevelILSSAInstructionIndex.cs b/Function/BNGetMediumLevelILSSAInstructionIndex.cs new file mode 100644 index 0000000..5e9365a --- /dev/null +++ b/Function/BNGetMediumLevelILSSAInstructionIndex.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetMediumLevelILSSAInstructionIndex(BNMediumLevelILFunction* func, uint64_t instr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetMediumLevelILSSAInstructionIndex" + )] + internal static extern MediumLevelILInstructionIndex BNGetMediumLevelILSSAInstructionIndex( + + // BNMediumLevelILFunction* func + IntPtr func , + + // uint64_t instr + MediumLevelILInstructionIndex instr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMediumLevelILSSAMemoryDefinition.cs b/Function/BNGetMediumLevelILSSAMemoryDefinition.cs new file mode 100644 index 0000000..f962669 --- /dev/null +++ b/Function/BNGetMediumLevelILSSAMemoryDefinition.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetMediumLevelILSSAMemoryDefinition(BNMediumLevelILFunction* func, uint64_t version) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetMediumLevelILSSAMemoryDefinition" + )] + internal static extern MediumLevelILInstructionIndex BNGetMediumLevelILSSAMemoryDefinition( + + // BNMediumLevelILFunction* func + IntPtr func , + + // uint64_t version + ulong version + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMediumLevelILSSAMemoryUses.cs b/Function/BNGetMediumLevelILSSAMemoryUses.cs new file mode 100644 index 0000000..e58d44b --- /dev/null +++ b/Function/BNGetMediumLevelILSSAMemoryUses.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t* BNGetMediumLevelILSSAMemoryUses(BNMediumLevelILFunction* func, uint64_t version, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetMediumLevelILSSAMemoryUses" + )] + internal static extern IntPtr BNGetMediumLevelILSSAMemoryUses( + + // BNMediumLevelILFunction* func + IntPtr func , + + // uint64_t version + ulong version , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMediumLevelILSSAMemoryVersionAfterILInstruction.cs b/Function/BNGetMediumLevelILSSAMemoryVersionAfterILInstruction.cs new file mode 100644 index 0000000..d289eed --- /dev/null +++ b/Function/BNGetMediumLevelILSSAMemoryVersionAfterILInstruction.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetMediumLevelILSSAMemoryVersionAfterILInstruction(BNMediumLevelILFunction* func, uint64_t instr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetMediumLevelILSSAMemoryVersionAfterILInstruction" + )] + internal static extern ulong BNGetMediumLevelILSSAMemoryVersionAfterILInstruction( + + // BNMediumLevelILFunction* func + IntPtr func , + + // uint64_t instr + MediumLevelILInstructionIndex instr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMediumLevelILSSAMemoryVersionAtILInstruction.cs b/Function/BNGetMediumLevelILSSAMemoryVersionAtILInstruction.cs new file mode 100644 index 0000000..413f88f --- /dev/null +++ b/Function/BNGetMediumLevelILSSAMemoryVersionAtILInstruction.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetMediumLevelILSSAMemoryVersionAtILInstruction(BNMediumLevelILFunction* func, uint64_t instr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetMediumLevelILSSAMemoryVersionAtILInstruction" + )] + internal static extern ulong BNGetMediumLevelILSSAMemoryVersionAtILInstruction( + + // BNMediumLevelILFunction* func + IntPtr func , + + // uint64_t instr + MediumLevelILInstructionIndex instr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMediumLevelILSSAVarDefinition.cs b/Function/BNGetMediumLevelILSSAVarDefinition.cs new file mode 100644 index 0000000..9fa7716 --- /dev/null +++ b/Function/BNGetMediumLevelILSSAVarDefinition.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetMediumLevelILSSAVarDefinition(BNMediumLevelILFunction* func, BNVariable* var, uint64_t version) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetMediumLevelILSSAVarDefinition" + )] + internal static extern MediumLevelILExpressionIndex BNGetMediumLevelILSSAVarDefinition( + + // BNMediumLevelILFunction* func + IntPtr func , + + // BNVariable* _var + in BNVariable variable , + + // uint64_t version + ulong version + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMediumLevelILSSAVarUses.cs b/Function/BNGetMediumLevelILSSAVarUses.cs new file mode 100644 index 0000000..8d79d47 --- /dev/null +++ b/Function/BNGetMediumLevelILSSAVarUses.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t* BNGetMediumLevelILSSAVarUses(BNMediumLevelILFunction* func, BNVariable* var, uint64_t version, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetMediumLevelILSSAVarUses" + )] + internal static extern IntPtr BNGetMediumLevelILSSAVarUses( + + // BNMediumLevelILFunction* func + IntPtr function , + + // BNVariable* variable + in BNVariable variable , + + // uint64_t version + ulong version , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMediumLevelILSSAVarValue.cs b/Function/BNGetMediumLevelILSSAVarValue.cs new file mode 100644 index 0000000..2814115 --- /dev/null +++ b/Function/BNGetMediumLevelILSSAVarValue.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRegisterValue BNGetMediumLevelILSSAVarValue(BNMediumLevelILFunction* func, BNVariable* var, uint64_t version) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetMediumLevelILSSAVarValue" + )] + internal static extern BNRegisterValue BNGetMediumLevelILSSAVarValue( + + // BNMediumLevelILFunction* func + IntPtr func , + + // BNVariable* _var + in BNVariable variable , + + // uint64_t version + ulong version + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMediumLevelILSSAVarVersionAfterILInstruction.cs b/Function/BNGetMediumLevelILSSAVarVersionAfterILInstruction.cs new file mode 100644 index 0000000..e42264c --- /dev/null +++ b/Function/BNGetMediumLevelILSSAVarVersionAfterILInstruction.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetMediumLevelILSSAVarVersionAfterILInstruction(BNMediumLevelILFunction* func, BNVariable* var, uint64_t instr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetMediumLevelILSSAVarVersionAfterILInstruction" + )] + internal static extern ulong BNGetMediumLevelILSSAVarVersionAfterILInstruction( + + // BNMediumLevelILFunction* func + IntPtr func , + + // BNVariable* _var + in BNVariable variable , + + // uint64_t instr + MediumLevelILInstructionIndex instr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMediumLevelILSSAVarVersionAtILInstruction.cs b/Function/BNGetMediumLevelILSSAVarVersionAtILInstruction.cs new file mode 100644 index 0000000..11781ec --- /dev/null +++ b/Function/BNGetMediumLevelILSSAVarVersionAtILInstruction.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetMediumLevelILSSAVarVersionAtILInstruction(BNMediumLevelILFunction* func, BNVariable* var, uint64_t instr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetMediumLevelILSSAVarVersionAtILInstruction" + )] + internal static extern ulong BNGetMediumLevelILSSAVarVersionAtILInstruction( + + // BNMediumLevelILFunction* func + IntPtr func , + + // BNVariable* _var + in BNVariable variable , + + // uint64_t instr + MediumLevelILInstructionIndex instr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMediumLevelILStackContentsAfterInstruction.cs b/Function/BNGetMediumLevelILStackContentsAfterInstruction.cs new file mode 100644 index 0000000..39220fa --- /dev/null +++ b/Function/BNGetMediumLevelILStackContentsAfterInstruction.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRegisterValue BNGetMediumLevelILStackContentsAfterInstruction(BNMediumLevelILFunction* func, int64_t offset, uint64_t len, uint64_t instr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetMediumLevelILStackContentsAfterInstruction" + )] + internal static extern BNRegisterValue BNGetMediumLevelILStackContentsAfterInstruction( + + // BNMediumLevelILFunction* func + IntPtr func , + + // int64_t offset + long offset , + + // uint64_t len + ulong len , + + // uint64_t instr + MediumLevelILInstructionIndex instr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMediumLevelILStackContentsAtInstruction.cs b/Function/BNGetMediumLevelILStackContentsAtInstruction.cs new file mode 100644 index 0000000..538eae8 --- /dev/null +++ b/Function/BNGetMediumLevelILStackContentsAtInstruction.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRegisterValue BNGetMediumLevelILStackContentsAtInstruction(BNMediumLevelILFunction* func, int64_t offset, uint64_t len, uint64_t instr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetMediumLevelILStackContentsAtInstruction" + )] + internal static extern BNRegisterValue BNGetMediumLevelILStackContentsAtInstruction( + + // BNMediumLevelILFunction* func + IntPtr func , + + // int64_t offset + long offset , + + // uint64_t len + ulong len , + + // uint64_t instr + MediumLevelILInstructionIndex instr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMediumLevelILVariableDefinitions.cs b/Function/BNGetMediumLevelILVariableDefinitions.cs new file mode 100644 index 0000000..54c321b --- /dev/null +++ b/Function/BNGetMediumLevelILVariableDefinitions.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t* BNGetMediumLevelILVariableDefinitions(BNMediumLevelILFunction* func, BNVariable* var, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetMediumLevelILVariableDefinitions" + )] + internal static extern IntPtr BNGetMediumLevelILVariableDefinitions( + + // BNMediumLevelILFunction* func + IntPtr func , + + // BNVariable* _var + in BNVariable variable , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMediumLevelILVariableForFlagAfterInstruction.cs b/Function/BNGetMediumLevelILVariableForFlagAfterInstruction.cs new file mode 100644 index 0000000..5924976 --- /dev/null +++ b/Function/BNGetMediumLevelILVariableForFlagAfterInstruction.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNVariable BNGetMediumLevelILVariableForFlagAfterInstruction(BNMediumLevelILFunction* func, uint32_t flag, uint64_t instr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetMediumLevelILVariableForFlagAfterInstruction" + )] + internal static extern BNVariable BNGetMediumLevelILVariableForFlagAfterInstruction( + + // BNMediumLevelILFunction* func + IntPtr func , + + // uint32_t flag + FlagIndex flag , + + // uint64_t instr + MediumLevelILInstructionIndex instr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMediumLevelILVariableForFlagAtInstruction.cs b/Function/BNGetMediumLevelILVariableForFlagAtInstruction.cs new file mode 100644 index 0000000..f00c003 --- /dev/null +++ b/Function/BNGetMediumLevelILVariableForFlagAtInstruction.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNVariable BNGetMediumLevelILVariableForFlagAtInstruction(BNMediumLevelILFunction* func, uint32_t flag, uint64_t instr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetMediumLevelILVariableForFlagAtInstruction" + )] + internal static extern BNVariable BNGetMediumLevelILVariableForFlagAtInstruction( + + // BNMediumLevelILFunction* func + IntPtr func , + + // uint32_t flag + FlagIndex flag , + + // uint64_t instr + MediumLevelILInstructionIndex instr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMediumLevelILVariableForRegisterAfterInstruction.cs b/Function/BNGetMediumLevelILVariableForRegisterAfterInstruction.cs new file mode 100644 index 0000000..3d6c6ef --- /dev/null +++ b/Function/BNGetMediumLevelILVariableForRegisterAfterInstruction.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNVariable BNGetMediumLevelILVariableForRegisterAfterInstruction(BNMediumLevelILFunction* func, uint32_t reg, uint64_t instr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetMediumLevelILVariableForRegisterAfterInstruction" + )] + internal static extern BNVariable BNGetMediumLevelILVariableForRegisterAfterInstruction( + + // BNMediumLevelILFunction* func + IntPtr func , + + // uint32_t reg + RegisterIndex reg , + + // uint64_t instr + MediumLevelILInstructionIndex instr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMediumLevelILVariableForRegisterAtInstruction.cs b/Function/BNGetMediumLevelILVariableForRegisterAtInstruction.cs new file mode 100644 index 0000000..b26c281 --- /dev/null +++ b/Function/BNGetMediumLevelILVariableForRegisterAtInstruction.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNVariable BNGetMediumLevelILVariableForRegisterAtInstruction(BNMediumLevelILFunction* func, uint32_t reg, uint64_t instr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetMediumLevelILVariableForRegisterAtInstruction" + )] + internal static extern BNVariable BNGetMediumLevelILVariableForRegisterAtInstruction( + + // BNMediumLevelILFunction* func + IntPtr func , + + // uint32_t reg + uint reg , + + // uint64_t instr + MediumLevelILInstructionIndex instr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMediumLevelILVariableForStackLocationAfterInstruction.cs b/Function/BNGetMediumLevelILVariableForStackLocationAfterInstruction.cs new file mode 100644 index 0000000..bd75bfd --- /dev/null +++ b/Function/BNGetMediumLevelILVariableForStackLocationAfterInstruction.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNVariable BNGetMediumLevelILVariableForStackLocationAfterInstruction(BNMediumLevelILFunction* func, int64_t offset, uint64_t instr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetMediumLevelILVariableForStackLocationAfterInstruction" + )] + internal static extern BNVariable BNGetMediumLevelILVariableForStackLocationAfterInstruction( + + // BNMediumLevelILFunction* func + IntPtr func , + + // int64_t offset + long offset , + + // uint64_t instr + MediumLevelILInstructionIndex instr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMediumLevelILVariableForStackLocationAtInstruction.cs b/Function/BNGetMediumLevelILVariableForStackLocationAtInstruction.cs new file mode 100644 index 0000000..0a9f483 --- /dev/null +++ b/Function/BNGetMediumLevelILVariableForStackLocationAtInstruction.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNVariable BNGetMediumLevelILVariableForStackLocationAtInstruction(BNMediumLevelILFunction* func, int64_t offset, uint64_t instr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetMediumLevelILVariableForStackLocationAtInstruction" + )] + internal static extern BNVariable BNGetMediumLevelILVariableForStackLocationAtInstruction( + + // BNMediumLevelILFunction* func + IntPtr func , + + // int64_t offset + long offset , + + // uint64_t instr + MediumLevelILInstructionIndex instr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMediumLevelILVariableReferences.cs b/Function/BNGetMediumLevelILVariableReferences.cs new file mode 100644 index 0000000..3313426 --- /dev/null +++ b/Function/BNGetMediumLevelILVariableReferences.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNILReferenceSource* BNGetMediumLevelILVariableReferences(BNFunction* func, BNVariable* var, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetMediumLevelILVariableReferences" + )] + internal static extern IntPtr BNGetMediumLevelILVariableReferences( + + // BNFunction* func + IntPtr func , + + // BNVariable* _var + in BNVariable _var , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMediumLevelILVariableReferencesFrom.cs b/Function/BNGetMediumLevelILVariableReferencesFrom.cs new file mode 100644 index 0000000..dde3e9d --- /dev/null +++ b/Function/BNGetMediumLevelILVariableReferencesFrom.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNVariableReferenceSource* BNGetMediumLevelILVariableReferencesFrom(BNFunction* func, BNArchitecture* arch, uint64_t address, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetMediumLevelILVariableReferencesFrom" + )] + internal static extern IntPtr BNGetMediumLevelILVariableReferencesFrom( + + // BNFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t address + ulong address , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMediumLevelILVariableReferencesFromIfAvailable.cs b/Function/BNGetMediumLevelILVariableReferencesFromIfAvailable.cs new file mode 100644 index 0000000..848cfb3 --- /dev/null +++ b/Function/BNGetMediumLevelILVariableReferencesFromIfAvailable.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNVariableReferenceSource* BNGetMediumLevelILVariableReferencesFromIfAvailable(BNFunction* func, BNArchitecture* arch, uint64_t address, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetMediumLevelILVariableReferencesFromIfAvailable" + )] + internal static extern IntPtr BNGetMediumLevelILVariableReferencesFromIfAvailable( + + // BNFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t address + ulong address , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMediumLevelILVariableReferencesIfAvailable.cs b/Function/BNGetMediumLevelILVariableReferencesIfAvailable.cs new file mode 100644 index 0000000..c07db6a --- /dev/null +++ b/Function/BNGetMediumLevelILVariableReferencesIfAvailable.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNILReferenceSource* BNGetMediumLevelILVariableReferencesIfAvailable(BNFunction* func, BNVariable* var, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetMediumLevelILVariableReferencesIfAvailable" + )] + internal static extern IntPtr BNGetMediumLevelILVariableReferencesIfAvailable( + + // BNFunction* func + IntPtr func , + + // BNVariable* _var + IntPtr _var , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMediumLevelILVariableReferencesInRange.cs b/Function/BNGetMediumLevelILVariableReferencesInRange.cs new file mode 100644 index 0000000..7b2aa6d --- /dev/null +++ b/Function/BNGetMediumLevelILVariableReferencesInRange.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNVariableReferenceSource* BNGetMediumLevelILVariableReferencesInRange(BNFunction* func, BNArchitecture* arch, uint64_t address, uint64_t len, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetMediumLevelILVariableReferencesInRange" + )] + internal static extern IntPtr BNGetMediumLevelILVariableReferencesInRange( + + // BNFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t address + ulong address , + + // uint64_t len + ulong len , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMediumLevelILVariableReferencesInRangeIfAvailable.cs b/Function/BNGetMediumLevelILVariableReferencesInRangeIfAvailable.cs new file mode 100644 index 0000000..3e2ed6c --- /dev/null +++ b/Function/BNGetMediumLevelILVariableReferencesInRangeIfAvailable.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNVariableReferenceSource* BNGetMediumLevelILVariableReferencesInRangeIfAvailable(BNFunction* func, BNArchitecture* arch, uint64_t address, uint64_t len, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetMediumLevelILVariableReferencesInRangeIfAvailable" + )] + internal static extern IntPtr BNGetMediumLevelILVariableReferencesInRangeIfAvailable( + + // BNFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t address + ulong address , + + // uint64_t len + ulong len , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMediumLevelILVariableSSAVersions.cs b/Function/BNGetMediumLevelILVariableSSAVersions.cs new file mode 100644 index 0000000..1c54759 --- /dev/null +++ b/Function/BNGetMediumLevelILVariableSSAVersions.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t* BNGetMediumLevelILVariableSSAVersions(BNMediumLevelILFunction* func, BNVariable* var, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetMediumLevelILVariableSSAVersions" + )] + internal static extern IntPtr BNGetMediumLevelILVariableSSAVersions( + + // BNMediumLevelILFunction* func + IntPtr func , + + // BNVariable* _var + in BNVariable variable , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMediumLevelILVariableUses.cs b/Function/BNGetMediumLevelILVariableUses.cs new file mode 100644 index 0000000..f21d706 --- /dev/null +++ b/Function/BNGetMediumLevelILVariableUses.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t* BNGetMediumLevelILVariableUses(BNMediumLevelILFunction* func, BNVariable* var, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetMediumLevelILVariableUses" + )] + internal static extern IntPtr BNGetMediumLevelILVariableUses( + + // BNMediumLevelILFunction* func + IntPtr func , + + // BNVariable* _var + in BNVariable variable , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMediumLevelILVariables.cs b/Function/BNGetMediumLevelILVariables.cs new file mode 100644 index 0000000..323b9af --- /dev/null +++ b/Function/BNGetMediumLevelILVariables.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNVariable* BNGetMediumLevelILVariables(BNMediumLevelILFunction* func, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetMediumLevelILVariables" + )] + internal static extern IntPtr BNGetMediumLevelILVariables( + + // BNMediumLevelILFunction* func + IntPtr func , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMemberIncludingInheritedAtOffset.cs b/Function/BNGetMemberIncludingInheritedAtOffset.cs new file mode 100644 index 0000000..61a5db6 --- /dev/null +++ b/Function/BNGetMemberIncludingInheritedAtOffset.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNInheritedStructureMember* BNGetMemberIncludingInheritedAtOffset(BNStructure* s, BNBinaryView* view, int64_t offset) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetMemberIncludingInheritedAtOffset" + )] + internal static extern IntPtr BNGetMemberIncludingInheritedAtOffset( + + // BNStructure* s + IntPtr s , + + // BNBinaryView* view + IntPtr view , + + // int64_t offset + long offset + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMemoryMapDescription.cs b/Function/BNGetMemoryMapDescription.cs new file mode 100644 index 0000000..a4d9008 --- /dev/null +++ b/Function/BNGetMemoryMapDescription.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetMemoryMapDescription(BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetMemoryMapDescription" + )] + internal static extern IntPtr BNGetMemoryMapDescription( + + // BNBinaryView* view + IntPtr view + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMemoryRegionFill.cs b/Function/BNGetMemoryRegionFill.cs new file mode 100644 index 0000000..27a71fd --- /dev/null +++ b/Function/BNGetMemoryRegionFill.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint8_t BNGetMemoryRegionFill(BNBinaryView* view, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetMemoryRegionFill" + )] + internal static extern byte BNGetMemoryRegionFill( + + // BNBinaryView* view + IntPtr view , + + // const char* name + string name + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMemoryRegionFlags.cs b/Function/BNGetMemoryRegionFlags.cs new file mode 100644 index 0000000..eddd515 --- /dev/null +++ b/Function/BNGetMemoryRegionFlags.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint32_t BNGetMemoryRegionFlags(BNBinaryView* view, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetMemoryRegionFlags" + )] + internal static extern uint BNGetMemoryRegionFlags( + + // BNBinaryView* view + IntPtr view , + + // const char* name + string name + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMemoryUsageInfo.cs b/Function/BNGetMemoryUsageInfo.cs new file mode 100644 index 0000000..485c605 --- /dev/null +++ b/Function/BNGetMemoryUsageInfo.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNMemoryUsageInfo* BNGetMemoryUsageInfo(uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetMemoryUsageInfo" + )] + internal static extern IntPtr BNGetMemoryUsageInfo( + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMergedVariables.cs b/Function/BNGetMergedVariables.cs new file mode 100644 index 0000000..798da91 --- /dev/null +++ b/Function/BNGetMergedVariables.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNMergedVariable* BNGetMergedVariables(BNFunction* func, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetMergedVariables" + )] + internal static extern IntPtr BNGetMergedVariables( + + // BNFunction* func + IntPtr func , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetMinimumCoreABIVersion.cs b/Function/BNGetMinimumCoreABIVersion.cs new file mode 100644 index 0000000..25c4dcc --- /dev/null +++ b/Function/BNGetMinimumCoreABIVersion.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public static partial class Core + { + public static uint GetMinimumCoreABIVersion() + { + return NativeMethods.BNGetMinimumCoreABIVersion(); + } + } + + internal static partial class NativeMethods + { + /// + /// uint32_t BNGetMinimumCoreABIVersion() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetMinimumCoreABIVersion" + )] + public static extern uint BNGetMinimumCoreABIVersion(); + } +} \ No newline at end of file diff --git a/Function/BNGetModification.cs b/Function/BNGetModification.cs new file mode 100644 index 0000000..17b1464 --- /dev/null +++ b/Function/BNGetModification.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNModificationStatus BNGetModification(BNBinaryView* view, uint64_t offset) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetModification" + )] + internal static extern ModificationStatus BNGetModification( + + // BNBinaryView* view + IntPtr view , + + // uint64_t offset + ulong offset + ); + } +} \ No newline at end of file diff --git a/Function/BNGetModificationArray.cs b/Function/BNGetModificationArray.cs new file mode 100644 index 0000000..0eddeb0 --- /dev/null +++ b/Function/BNGetModificationArray.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetModificationArray(BNBinaryView* view, uint64_t offset, BNModificationStatus* result, uint64_t len) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetModificationArray" + )] + internal static extern ulong BNGetModificationArray( + + // BNBinaryView* view + IntPtr view , + + // uint64_t offset + ulong offset , + + // BNModificationStatus* result + ModificationStatus[] result , + + // uint64_t len + ulong len + ); + } +} \ No newline at end of file diff --git a/Function/BNGetModifiedArchitectureRegistersOnWrite.cs b/Function/BNGetModifiedArchitectureRegistersOnWrite.cs new file mode 100644 index 0000000..b31d53e --- /dev/null +++ b/Function/BNGetModifiedArchitectureRegistersOnWrite.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint32_t* BNGetModifiedArchitectureRegistersOnWrite(BNArchitecture* arch, uint32_t reg, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetModifiedArchitectureRegistersOnWrite" + )] + internal static extern IntPtr BNGetModifiedArchitectureRegistersOnWrite( + + // BNArchitecture* arch + IntPtr arch , + + // uint32_t reg + uint reg , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetNameSpaces.cs b/Function/BNGetNameSpaces.cs new file mode 100644 index 0000000..9d51a51 --- /dev/null +++ b/Function/BNGetNameSpaces.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNNameSpace* BNGetNameSpaces(BNBinaryView* view, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetNameSpaces" + )] + internal static extern IntPtr BNGetNameSpaces( + + // BNBinaryView* view + IntPtr view , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetNameTypeString.cs b/Function/BNGetNameTypeString.cs new file mode 100644 index 0000000..52ddb4d --- /dev/null +++ b/Function/BNGetNameTypeString.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public static partial class Core + { + public static string GetNameTypeString(NameType classFunctionType ) + { + return UnsafeUtils.TakeAnsiString( + + NativeMethods.BNGetNameTypeString( + classFunctionType + ) + ); + } + } + + internal static partial class NativeMethods + { + /// + /// char* BNGetNameTypeString(BNNameType classFunctionType) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetNameTypeString" + )] + internal static extern IntPtr BNGetNameTypeString( + + // BNNameType classFunctionType + NameType classFunctionType + ); + } +} \ No newline at end of file diff --git a/Function/BNGetNativeTypeParserArchitecture.cs b/Function/BNGetNativeTypeParserArchitecture.cs new file mode 100644 index 0000000..d540870 --- /dev/null +++ b/Function/BNGetNativeTypeParserArchitecture.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNArchitecture* BNGetNativeTypeParserArchitecture() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetNativeTypeParserArchitecture" + )] + internal static extern IntPtr BNGetNativeTypeParserArchitecture(); + } +} \ No newline at end of file diff --git a/Function/BNGetNewAutoFunctionAnalysisSuppressed.cs b/Function/BNGetNewAutoFunctionAnalysisSuppressed.cs new file mode 100644 index 0000000..7bd5140 --- /dev/null +++ b/Function/BNGetNewAutoFunctionAnalysisSuppressed.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNGetNewAutoFunctionAnalysisSuppressed(BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetNewAutoFunctionAnalysisSuppressed" + )] + internal static extern bool BNGetNewAutoFunctionAnalysisSuppressed( + + // BNBinaryView* view + IntPtr view + ); + } +} \ No newline at end of file diff --git a/Function/BNGetNextBasicBlockStartAfterAddress.cs b/Function/BNGetNextBasicBlockStartAfterAddress.cs new file mode 100644 index 0000000..8a24a42 --- /dev/null +++ b/Function/BNGetNextBasicBlockStartAfterAddress.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetNextBasicBlockStartAfterAddress(BNBinaryView* view, uint64_t addr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetNextBasicBlockStartAfterAddress" + )] + internal static extern ulong BNGetNextBasicBlockStartAfterAddress( + + // BNBinaryView* view + IntPtr view , + + // uint64_t addr + ulong addr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetNextDataAfterAddress.cs b/Function/BNGetNextDataAfterAddress.cs new file mode 100644 index 0000000..94837f4 --- /dev/null +++ b/Function/BNGetNextDataAfterAddress.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetNextDataAfterAddress(BNBinaryView* view, uint64_t addr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetNextDataAfterAddress" + )] + internal static extern ulong BNGetNextDataAfterAddress( + + // BNBinaryView* view + IntPtr view , + + // uint64_t addr + ulong addr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetNextDataVariableStartAfterAddress.cs b/Function/BNGetNextDataVariableStartAfterAddress.cs new file mode 100644 index 0000000..5e5abe0 --- /dev/null +++ b/Function/BNGetNextDataVariableStartAfterAddress.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetNextDataVariableStartAfterAddress(BNBinaryView* view, uint64_t addr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetNextDataVariableStartAfterAddress" + )] + internal static extern ulong BNGetNextDataVariableStartAfterAddress( + + // BNBinaryView* view + IntPtr view , + + // uint64_t addr + ulong addr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetNextFunctionStartAfterAddress.cs b/Function/BNGetNextFunctionStartAfterAddress.cs new file mode 100644 index 0000000..004b02a --- /dev/null +++ b/Function/BNGetNextFunctionStartAfterAddress.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetNextFunctionStartAfterAddress(BNBinaryView* view, uint64_t addr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetNextFunctionStartAfterAddress" + )] + internal static extern ulong BNGetNextFunctionStartAfterAddress( + + // BNBinaryView* view + IntPtr view , + + // uint64_t addr + ulong addr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetNextLinearViewObjectChild.cs b/Function/BNGetNextLinearViewObjectChild.cs new file mode 100644 index 0000000..831c637 --- /dev/null +++ b/Function/BNGetNextLinearViewObjectChild.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLinearViewObject* BNGetNextLinearViewObjectChild(BNLinearViewObject* parent, BNLinearViewObject* child) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetNextLinearViewObjectChild" + )] + internal static extern IntPtr BNGetNextLinearViewObjectChild( + + // BNLinearViewObject* parent + IntPtr parent , + + // BNLinearViewObject* child + IntPtr child + ); + } +} \ No newline at end of file diff --git a/Function/BNGetNextValidOffset.cs b/Function/BNGetNextValidOffset.cs new file mode 100644 index 0000000..d5a1e49 --- /dev/null +++ b/Function/BNGetNextValidOffset.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetNextValidOffset(BNBinaryView* view, uint64_t offset) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetNextValidOffset" + )] + internal static extern ulong BNGetNextValidOffset( + + // BNBinaryView* view + IntPtr view , + + // uint64_t offset + ulong offset + ); + } +} \ No newline at end of file diff --git a/Function/BNGetOpenFileNameInput.cs b/Function/BNGetOpenFileNameInput.cs new file mode 100644 index 0000000..0a7a6ab --- /dev/null +++ b/Function/BNGetOpenFileNameInput.cs @@ -0,0 +1,53 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public static partial class Core + { + public static string? GetOpenFileNameInput( + string prompt = "Choose a file:" , + string ext = "Executables (*.exe *.dll *.sys);;All Files (*)" + ) + { + bool ok = NativeMethods.BNGetOpenFileNameInput( + out IntPtr result , + prompt , + ext + ); + + if (!ok) + { + return null; + } + + return UnsafeUtils.TakeUtf8String(result); + } + } + + internal static partial class NativeMethods + { + /// + /// bool BNGetOpenFileNameInput(const char** result, const char* prompt, const char* ext) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetOpenFileNameInput" + )] + internal static extern bool BNGetOpenFileNameInput( + + // char** result + out IntPtr result , + + // const char* prompt + string prompt , + + // const char* ext + string ext + ); + } +} \ No newline at end of file diff --git a/Function/BNGetOpenProjects.cs b/Function/BNGetOpenProjects.cs new file mode 100644 index 0000000..0c5b485 --- /dev/null +++ b/Function/BNGetOpenProjects.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNProject** BNGetOpenProjects(uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetOpenProjects" + )] + internal static extern IntPtr BNGetOpenProjects( + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetOriginalFilename.cs b/Function/BNGetOriginalFilename.cs new file mode 100644 index 0000000..dfe47d9 --- /dev/null +++ b/Function/BNGetOriginalFilename.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetOriginalFilename(BNFileMetadata* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetOriginalFilename" + )] + internal static extern IntPtr BNGetOriginalFilename( + + // BNFileMetadata* file + IntPtr file + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetOriginalImageBase.cs b/Function/BNGetOriginalImageBase.cs new file mode 100644 index 0000000..0aa79d7 --- /dev/null +++ b/Function/BNGetOriginalImageBase.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetOriginalImageBase(BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetOriginalImageBase" + )] + internal static extern ulong BNGetOriginalImageBase( + + // BNBinaryView* view + IntPtr view + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetOutgoingDirectTypeReferences.cs b/Function/BNGetOutgoingDirectTypeReferences.cs new file mode 100644 index 0000000..d788420 --- /dev/null +++ b/Function/BNGetOutgoingDirectTypeReferences.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNQualifiedName* BNGetOutgoingDirectTypeReferences(BNBinaryView* view, BNQualifiedName* type, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetOutgoingDirectTypeReferences" + )] + internal static extern IntPtr BNGetOutgoingDirectTypeReferences( + + // BNBinaryView* view + IntPtr view , + + // BNQualifiedName* type + in BNQualifiedName type , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetOutgoingRecursiveTypeReferences.cs b/Function/BNGetOutgoingRecursiveTypeReferences.cs new file mode 100644 index 0000000..9a60433 --- /dev/null +++ b/Function/BNGetOutgoingRecursiveTypeReferences.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNQualifiedName* BNGetOutgoingRecursiveTypeReferences(BNBinaryView* view, BNQualifiedName* types, uint64_t typeCount, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetOutgoingRecursiveTypeReferences" + )] + internal static extern IntPtr BNGetOutgoingRecursiveTypeReferences( + + // BNBinaryView* view + IntPtr view , + + // BNQualifiedName* types + BNQualifiedName[] types , + + // uint64_t typeCount + ulong typeCount , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetParameterOrderingForVariables.cs b/Function/BNGetParameterOrderingForVariables.cs new file mode 100644 index 0000000..900a45c --- /dev/null +++ b/Function/BNGetParameterOrderingForVariables.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNVariable* BNGetParameterOrderingForVariables(BNCallingConvention* cc, BNVariable* paramVars, BNType** paramTypes, uint64_t paramCount, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetParameterOrderingForVariables" + )] + internal static extern IntPtr BNGetParameterOrderingForVariables( + + // BNCallingConvention* cc + IntPtr cc , + + // BNVariable* paramVars + IntPtr paramVars , + + // BNType** paramTypes + IntPtr paramTypes , + + // uint64_t paramCount + ulong paramCount , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetParameterValueAtInstruction.cs b/Function/BNGetParameterValueAtInstruction.cs new file mode 100644 index 0000000..aaa0042 --- /dev/null +++ b/Function/BNGetParameterValueAtInstruction.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRegisterValue BNGetParameterValueAtInstruction(BNFunction* func, BNArchitecture* arch, uint64_t addr, BNType* functionType, uint64_t i) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetParameterValueAtInstruction" + )] + internal static extern BNRegisterValue BNGetParameterValueAtInstruction( + + // BNFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t addr + ulong addr , + + // BNType* functionType + IntPtr functionType , + + // uint64_t i + ulong i + ); + } +} \ No newline at end of file diff --git a/Function/BNGetParameterValueAtLowLevelILInstruction.cs b/Function/BNGetParameterValueAtLowLevelILInstruction.cs new file mode 100644 index 0000000..a15a766 --- /dev/null +++ b/Function/BNGetParameterValueAtLowLevelILInstruction.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRegisterValue BNGetParameterValueAtLowLevelILInstruction(BNFunction* func, uint64_t instr, BNType* functionType, uint64_t i) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetParameterValueAtLowLevelILInstruction" + )] + internal static extern BNRegisterValue BNGetParameterValueAtLowLevelILInstruction( + + // BNFunction* func + IntPtr func , + + // uint64_t instr + ulong instr , + + // BNType* functionType + IntPtr functionType , + + // uint64_t i + ulong i + ); + } +} \ No newline at end of file diff --git a/Function/BNGetParameterVariableForIncomingVariable.cs b/Function/BNGetParameterVariableForIncomingVariable.cs new file mode 100644 index 0000000..1be8181 --- /dev/null +++ b/Function/BNGetParameterVariableForIncomingVariable.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNVariable BNGetParameterVariableForIncomingVariable(BNCallingConvention* cc, BNVariable* var, BNFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetParameterVariableForIncomingVariable" + )] + internal static extern BNVariable BNGetParameterVariableForIncomingVariable( + + // BNCallingConvention* cc + IntPtr cc , + + // BNVariable* _var + IntPtr _var , + + // BNFunction* func + IntPtr func + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetParametersForAnalysis.cs b/Function/BNGetParametersForAnalysis.cs new file mode 100644 index 0000000..80856b2 --- /dev/null +++ b/Function/BNGetParametersForAnalysis.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNAnalysisParameters BNGetParametersForAnalysis(BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetParametersForAnalysis" + )] + internal static extern BNAnalysisParameters BNGetParametersForAnalysis( + + // BNBinaryView* view + IntPtr view + ); + } +} \ No newline at end of file diff --git a/Function/BNGetParentPath.cs b/Function/BNGetParentPath.cs new file mode 100644 index 0000000..c7c445c --- /dev/null +++ b/Function/BNGetParentPath.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetParentPath(const char* path) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetParentPath" + )] + internal static extern IntPtr BNGetParentPath( + + // const char* path + string path + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetParentView.cs b/Function/BNGetParentView.cs new file mode 100644 index 0000000..52b55e2 --- /dev/null +++ b/Function/BNGetParentView.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBinaryView* BNGetParentView(BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetParentView" + )] + internal static extern IntPtr BNGetParentView( + + // BNBinaryView* view + IntPtr view + ); + } +} \ No newline at end of file diff --git a/Function/BNGetPathRelativeToBundledPluginDirectory.cs b/Function/BNGetPathRelativeToBundledPluginDirectory.cs new file mode 100644 index 0000000..bb0ddf4 --- /dev/null +++ b/Function/BNGetPathRelativeToBundledPluginDirectory.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetPathRelativeToBundledPluginDirectory(const char* path) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetPathRelativeToBundledPluginDirectory" + )] + internal static extern IntPtr BNGetPathRelativeToBundledPluginDirectory( + + // const char* path + string path + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetPathRelativeToUserDirectory.cs b/Function/BNGetPathRelativeToUserDirectory.cs new file mode 100644 index 0000000..d69ac27 --- /dev/null +++ b/Function/BNGetPathRelativeToUserDirectory.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetPathRelativeToUserDirectory(const char* path) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetPathRelativeToUserDirectory" + )] + internal static extern IntPtr BNGetPathRelativeToUserDirectory( + + // const char* path + string path + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetPathRelativeToUserPluginDirectory.cs b/Function/BNGetPathRelativeToUserPluginDirectory.cs new file mode 100644 index 0000000..bb040b8 --- /dev/null +++ b/Function/BNGetPathRelativeToUserPluginDirectory.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetPathRelativeToUserPluginDirectory(const char* path) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetPathRelativeToUserPluginDirectory" + )] + internal static extern IntPtr BNGetPathRelativeToUserPluginDirectory( + + // const char* path + string path + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetPlatformAddressSize.cs b/Function/BNGetPlatformAddressSize.cs new file mode 100644 index 0000000..efe8e7e --- /dev/null +++ b/Function/BNGetPlatformAddressSize.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetPlatformAddressSize(BNPlatform* platform) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetPlatformAddressSize" + )] + internal static extern ulong BNGetPlatformAddressSize( + + // BNPlatform* platform + IntPtr platform + ); + } +} \ No newline at end of file diff --git a/Function/BNGetPlatformArchitecture.cs b/Function/BNGetPlatformArchitecture.cs new file mode 100644 index 0000000..ffd3eef --- /dev/null +++ b/Function/BNGetPlatformArchitecture.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNArchitecture* BNGetPlatformArchitecture(BNPlatform* platform) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetPlatformArchitecture" + )] + internal static extern IntPtr BNGetPlatformArchitecture( + + // BNPlatform* platform + IntPtr platform + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetPlatformByName.cs b/Function/BNGetPlatformByName.cs new file mode 100644 index 0000000..8d62ffb --- /dev/null +++ b/Function/BNGetPlatformByName.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNPlatform* BNGetPlatformByName(const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetPlatformByName" + )] + internal static extern IntPtr BNGetPlatformByName( + + // const char* name + string name + ); + } +} \ No newline at end of file diff --git a/Function/BNGetPlatformCallingConventions.cs b/Function/BNGetPlatformCallingConventions.cs new file mode 100644 index 0000000..1db729d --- /dev/null +++ b/Function/BNGetPlatformCallingConventions.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNCallingConvention** BNGetPlatformCallingConventions(BNPlatform* platform, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetPlatformCallingConventions" + )] + internal static extern IntPtr BNGetPlatformCallingConventions( + + // BNPlatform* platform + IntPtr platform , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetPlatformCdeclCallingConvention.cs b/Function/BNGetPlatformCdeclCallingConvention.cs new file mode 100644 index 0000000..51ad298 --- /dev/null +++ b/Function/BNGetPlatformCdeclCallingConvention.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNCallingConvention* BNGetPlatformCdeclCallingConvention(BNPlatform* platform) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetPlatformCdeclCallingConvention" + )] + internal static extern IntPtr BNGetPlatformCdeclCallingConvention( + + // BNPlatform* platform + IntPtr platform + ); + } +} \ No newline at end of file diff --git a/Function/BNGetPlatformDefaultCallingConvention.cs b/Function/BNGetPlatformDefaultCallingConvention.cs new file mode 100644 index 0000000..fc57b03 --- /dev/null +++ b/Function/BNGetPlatformDefaultCallingConvention.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNCallingConvention* BNGetPlatformDefaultCallingConvention(BNPlatform* platform) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetPlatformDefaultCallingConvention" + )] + internal static extern IntPtr BNGetPlatformDefaultCallingConvention( + + // BNPlatform* platform + IntPtr platform + ); + } +} \ No newline at end of file diff --git a/Function/BNGetPlatformFastcallCallingConvention.cs b/Function/BNGetPlatformFastcallCallingConvention.cs new file mode 100644 index 0000000..67a6fa6 --- /dev/null +++ b/Function/BNGetPlatformFastcallCallingConvention.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNCallingConvention* BNGetPlatformFastcallCallingConvention(BNPlatform* platform) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetPlatformFastcallCallingConvention" + )] + internal static extern IntPtr BNGetPlatformFastcallCallingConvention( + + // BNPlatform* platform + IntPtr platform + ); + } +} \ No newline at end of file diff --git a/Function/BNGetPlatformForViewType.cs b/Function/BNGetPlatformForViewType.cs new file mode 100644 index 0000000..73c7239 --- /dev/null +++ b/Function/BNGetPlatformForViewType.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNPlatform* BNGetPlatformForViewType(BNBinaryViewType* type, uint32_t id, BNArchitecture* arch) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetPlatformForViewType" + )] + internal static extern IntPtr BNGetPlatformForViewType( + + // BNBinaryViewType* type + IntPtr type , + + // uint32_t id + uint id , + + // BNArchitecture* arch + IntPtr arch + ); + } +} \ No newline at end of file diff --git a/Function/BNGetPlatformFunctionByName.cs b/Function/BNGetPlatformFunctionByName.cs new file mode 100644 index 0000000..305d440 --- /dev/null +++ b/Function/BNGetPlatformFunctionByName.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNType* BNGetPlatformFunctionByName(BNPlatform* platform, BNQualifiedName* name, bool exactMatch) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetPlatformFunctionByName" + )] + internal static extern IntPtr BNGetPlatformFunctionByName( + + // BNPlatform* platform + IntPtr platform , + + // BNQualifiedName* name + in BNQualifiedName name , + + // bool exactMatch + bool exactMatch + ); + } +} \ No newline at end of file diff --git a/Function/BNGetPlatformFunctions.cs b/Function/BNGetPlatformFunctions.cs new file mode 100644 index 0000000..d70c238 --- /dev/null +++ b/Function/BNGetPlatformFunctions.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNQualifiedNameAndType* BNGetPlatformFunctions(BNPlatform* platform, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetPlatformFunctions" + )] + internal static extern IntPtr BNGetPlatformFunctions( + + // BNPlatform* platform + IntPtr platform , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetPlatformGlobalRegisterType.cs b/Function/BNGetPlatformGlobalRegisterType.cs new file mode 100644 index 0000000..7676c5f --- /dev/null +++ b/Function/BNGetPlatformGlobalRegisterType.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNType* BNGetPlatformGlobalRegisterType(BNPlatform* platform, uint32_t reg) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetPlatformGlobalRegisterType" + )] + internal static extern IntPtr BNGetPlatformGlobalRegisterType( + + // BNPlatform* platform + IntPtr platform , + + // uint32_t reg + uint reg + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetPlatformGlobalRegisters.cs b/Function/BNGetPlatformGlobalRegisters.cs new file mode 100644 index 0000000..89df590 --- /dev/null +++ b/Function/BNGetPlatformGlobalRegisters.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint32_t* BNGetPlatformGlobalRegisters(BNPlatform* platform, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetPlatformGlobalRegisters" + )] + internal static extern IntPtr BNGetPlatformGlobalRegisters( + + // BNPlatform* platform + IntPtr platform , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetPlatformList.cs b/Function/BNGetPlatformList.cs new file mode 100644 index 0000000..435ae6a --- /dev/null +++ b/Function/BNGetPlatformList.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNPlatform** BNGetPlatformList(uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetPlatformList" + )] + internal static extern IntPtr BNGetPlatformList( + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetPlatformListByArchitecture.cs b/Function/BNGetPlatformListByArchitecture.cs new file mode 100644 index 0000000..4edfa4d --- /dev/null +++ b/Function/BNGetPlatformListByArchitecture.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNPlatform** BNGetPlatformListByArchitecture(BNArchitecture* arch, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetPlatformListByArchitecture" + )] + internal static extern IntPtr BNGetPlatformListByArchitecture( + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetPlatformListByOS.cs b/Function/BNGetPlatformListByOS.cs new file mode 100644 index 0000000..6fcaa94 --- /dev/null +++ b/Function/BNGetPlatformListByOS.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNPlatform** BNGetPlatformListByOS(const char* os, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetPlatformListByOS" + )] + internal static extern IntPtr BNGetPlatformListByOS( + + // const char* os + string os , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetPlatformListByOSAndArchitecture.cs b/Function/BNGetPlatformListByOSAndArchitecture.cs new file mode 100644 index 0000000..17ee120 --- /dev/null +++ b/Function/BNGetPlatformListByOSAndArchitecture.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNPlatform** BNGetPlatformListByOSAndArchitecture(const char* os, BNArchitecture* arch, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetPlatformListByOSAndArchitecture" + )] + internal static extern IntPtr BNGetPlatformListByOSAndArchitecture( + + // const char* os + string os , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetPlatformName.cs b/Function/BNGetPlatformName.cs new file mode 100644 index 0000000..32d247b --- /dev/null +++ b/Function/BNGetPlatformName.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// char* BNGetPlatformName(BNPlatform* platform) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetPlatformName" + )] + internal static extern IntPtr BNGetPlatformName( + + // BNPlatform* platform + IntPtr platform + ); + } +} \ No newline at end of file diff --git a/Function/BNGetPlatformOSList.cs b/Function/BNGetPlatformOSList.cs new file mode 100644 index 0000000..0438838 --- /dev/null +++ b/Function/BNGetPlatformOSList.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// char** BNGetPlatformOSList(uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetPlatformOSList" + )] + internal static extern IntPtr BNGetPlatformOSList( + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetPlatformStdcallCallingConvention.cs b/Function/BNGetPlatformStdcallCallingConvention.cs new file mode 100644 index 0000000..2135bec --- /dev/null +++ b/Function/BNGetPlatformStdcallCallingConvention.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNCallingConvention* BNGetPlatformStdcallCallingConvention(BNPlatform* platform) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetPlatformStdcallCallingConvention" + )] + internal static extern IntPtr BNGetPlatformStdcallCallingConvention( + + // BNPlatform* platform + IntPtr platform + ); + } +} \ No newline at end of file diff --git a/Function/BNGetPlatformSystemCallConvention.cs b/Function/BNGetPlatformSystemCallConvention.cs new file mode 100644 index 0000000..06ebcab --- /dev/null +++ b/Function/BNGetPlatformSystemCallConvention.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNCallingConvention* BNGetPlatformSystemCallConvention(BNPlatform* platform) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetPlatformSystemCallConvention" + )] + internal static extern IntPtr BNGetPlatformSystemCallConvention( + + // BNPlatform* platform + IntPtr platform + ); + } +} \ No newline at end of file diff --git a/Function/BNGetPlatformSystemCallName.cs b/Function/BNGetPlatformSystemCallName.cs new file mode 100644 index 0000000..0573006 --- /dev/null +++ b/Function/BNGetPlatformSystemCallName.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetPlatformSystemCallName(BNPlatform* platform, uint32_t number) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetPlatformSystemCallName" + )] + internal static extern IntPtr BNGetPlatformSystemCallName( + + // BNPlatform* platform + IntPtr platform , + + // uint32_t number + uint number + ); + } +} \ No newline at end of file diff --git a/Function/BNGetPlatformSystemCallType.cs b/Function/BNGetPlatformSystemCallType.cs new file mode 100644 index 0000000..ac2cc45 --- /dev/null +++ b/Function/BNGetPlatformSystemCallType.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNType* BNGetPlatformSystemCallType(BNPlatform* platform, uint32_t number) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetPlatformSystemCallType" + )] + internal static extern IntPtr BNGetPlatformSystemCallType( + + // BNPlatform* platform + IntPtr platform , + + // uint32_t number + uint number + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetPlatformSystemCalls.cs b/Function/BNGetPlatformSystemCalls.cs new file mode 100644 index 0000000..ef40d4a --- /dev/null +++ b/Function/BNGetPlatformSystemCalls.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNSystemCallInfo* BNGetPlatformSystemCalls(BNPlatform* platform, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetPlatformSystemCalls" + )] + internal static extern IntPtr BNGetPlatformSystemCalls( + + // BNPlatform* platform + IntPtr platform , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetPlatformTypeByName.cs b/Function/BNGetPlatformTypeByName.cs new file mode 100644 index 0000000..f885789 --- /dev/null +++ b/Function/BNGetPlatformTypeByName.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNType* BNGetPlatformTypeByName(BNPlatform* platform, BNQualifiedName* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetPlatformTypeByName" + )] + internal static extern IntPtr BNGetPlatformTypeByName( + + // BNPlatform* platform + IntPtr platform , + + // BNQualifiedName* name + in BNQualifiedName name + ); + } +} \ No newline at end of file diff --git a/Function/BNGetPlatformTypeContainer.cs b/Function/BNGetPlatformTypeContainer.cs new file mode 100644 index 0000000..3b5d749 --- /dev/null +++ b/Function/BNGetPlatformTypeContainer.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeContainer* BNGetPlatformTypeContainer(BNPlatform* platform) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetPlatformTypeContainer" + )] + internal static extern IntPtr BNGetPlatformTypeContainer( + + // BNPlatform* platform + IntPtr platform + ); + } +} \ No newline at end of file diff --git a/Function/BNGetPlatformTypeLibraries.cs b/Function/BNGetPlatformTypeLibraries.cs new file mode 100644 index 0000000..554d9a0 --- /dev/null +++ b/Function/BNGetPlatformTypeLibraries.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeLibrary** BNGetPlatformTypeLibraries(BNPlatform* platform, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetPlatformTypeLibraries" + )] + internal static extern IntPtr BNGetPlatformTypeLibraries( + + // BNPlatform* platform + IntPtr platform , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetPlatformTypeLibrariesByName.cs b/Function/BNGetPlatformTypeLibrariesByName.cs new file mode 100644 index 0000000..186bb39 --- /dev/null +++ b/Function/BNGetPlatformTypeLibrariesByName.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeLibrary** BNGetPlatformTypeLibrariesByName(BNPlatform* platform, const char* depName, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetPlatformTypeLibrariesByName" + )] + internal static extern IntPtr BNGetPlatformTypeLibrariesByName( + + // BNPlatform* platform + IntPtr platform , + + // const char* depName + string depName , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetPlatformTypes.cs b/Function/BNGetPlatformTypes.cs new file mode 100644 index 0000000..d8f5eff --- /dev/null +++ b/Function/BNGetPlatformTypes.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNQualifiedNameAndType* BNGetPlatformTypes(BNPlatform* platform, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetPlatformTypes" + )] + internal static extern IntPtr BNGetPlatformTypes( + + // BNPlatform* platform + IntPtr platform , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetPlatformVariableByName.cs b/Function/BNGetPlatformVariableByName.cs new file mode 100644 index 0000000..d188499 --- /dev/null +++ b/Function/BNGetPlatformVariableByName.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNType* BNGetPlatformVariableByName(BNPlatform* platform, BNQualifiedName* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetPlatformVariableByName" + )] + internal static extern IntPtr BNGetPlatformVariableByName( + + // BNPlatform* platform + IntPtr platform , + + // BNQualifiedName* name + in BNQualifiedName name + ); + } +} \ No newline at end of file diff --git a/Function/BNGetPlatformVariables.cs b/Function/BNGetPlatformVariables.cs new file mode 100644 index 0000000..da3d563 --- /dev/null +++ b/Function/BNGetPlatformVariables.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNQualifiedNameAndType* BNGetPlatformVariables(BNPlatform* platform, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetPlatformVariables" + )] + internal static extern IntPtr BNGetPlatformVariables( + + // BNPlatform* platform + IntPtr platform , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetPreviousBasicBlockEndBeforeAddress.cs b/Function/BNGetPreviousBasicBlockEndBeforeAddress.cs new file mode 100644 index 0000000..6b28356 --- /dev/null +++ b/Function/BNGetPreviousBasicBlockEndBeforeAddress.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetPreviousBasicBlockEndBeforeAddress(BNBinaryView* view, uint64_t addr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetPreviousBasicBlockEndBeforeAddress" + )] + internal static extern ulong BNGetPreviousBasicBlockEndBeforeAddress( + + // BNBinaryView* view + IntPtr view , + + // uint64_t addr + ulong addr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetPreviousBasicBlockStartBeforeAddress.cs b/Function/BNGetPreviousBasicBlockStartBeforeAddress.cs new file mode 100644 index 0000000..13e67d2 --- /dev/null +++ b/Function/BNGetPreviousBasicBlockStartBeforeAddress.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetPreviousBasicBlockStartBeforeAddress(BNBinaryView* view, uint64_t addr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetPreviousBasicBlockStartBeforeAddress" + )] + internal static extern ulong BNGetPreviousBasicBlockStartBeforeAddress( + + // BNBinaryView* view + IntPtr view , + + // uint64_t addr + ulong addr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetPreviousDataBeforeAddress.cs b/Function/BNGetPreviousDataBeforeAddress.cs new file mode 100644 index 0000000..5d35971 --- /dev/null +++ b/Function/BNGetPreviousDataBeforeAddress.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetPreviousDataBeforeAddress(BNBinaryView* view, uint64_t addr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetPreviousDataBeforeAddress" + )] + internal static extern ulong BNGetPreviousDataBeforeAddress( + + // BNBinaryView* view + IntPtr view , + + // uint64_t addr + ulong addr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetPreviousDataVariableStartBeforeAddress.cs b/Function/BNGetPreviousDataVariableStartBeforeAddress.cs new file mode 100644 index 0000000..0c92551 --- /dev/null +++ b/Function/BNGetPreviousDataVariableStartBeforeAddress.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetPreviousDataVariableStartBeforeAddress(BNBinaryView* view, uint64_t addr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetPreviousDataVariableStartBeforeAddress" + )] + internal static extern ulong BNGetPreviousDataVariableStartBeforeAddress( + + // BNBinaryView* view + IntPtr view , + + // uint64_t addr + ulong addr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetPreviousFunctionStartBeforeAddress.cs b/Function/BNGetPreviousFunctionStartBeforeAddress.cs new file mode 100644 index 0000000..a5af20e --- /dev/null +++ b/Function/BNGetPreviousFunctionStartBeforeAddress.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetPreviousFunctionStartBeforeAddress(BNBinaryView* view, uint64_t addr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetPreviousFunctionStartBeforeAddress" + )] + internal static extern ulong BNGetPreviousFunctionStartBeforeAddress( + + // BNBinaryView* view + IntPtr view , + + // uint64_t addr + ulong addr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetPreviousLinearViewObjectChild.cs b/Function/BNGetPreviousLinearViewObjectChild.cs new file mode 100644 index 0000000..ad9e096 --- /dev/null +++ b/Function/BNGetPreviousLinearViewObjectChild.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLinearViewObject* BNGetPreviousLinearViewObjectChild(BNLinearViewObject* parent, BNLinearViewObject* child) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetPreviousLinearViewObjectChild" + )] + internal static extern IntPtr BNGetPreviousLinearViewObjectChild( + + // BNLinearViewObject* parent + IntPtr parent , + + // BNLinearViewObject* child + IntPtr child + ); + } +} \ No newline at end of file diff --git a/Function/BNGetProduct.cs b/Function/BNGetProduct.cs new file mode 100644 index 0000000..c4e5306 --- /dev/null +++ b/Function/BNGetProduct.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetProduct() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetProduct" + )] + internal static extern IntPtr BNGetProduct( + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetProductType.cs b/Function/BNGetProductType.cs new file mode 100644 index 0000000..7704652 --- /dev/null +++ b/Function/BNGetProductType.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetProductType() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetProductType" + )] + internal static extern IntPtr BNGetProductType( + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetProjectFile.cs b/Function/BNGetProjectFile.cs new file mode 100644 index 0000000..ad2fec4 --- /dev/null +++ b/Function/BNGetProjectFile.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNProjectFile* BNGetProjectFile(BNFileMetadata* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetProjectFile" + )] + internal static extern IntPtr BNGetProjectFile( + + // BNFileMetadata* file + IntPtr file + ); + } +} \ No newline at end of file diff --git a/Function/BNGetProvenanceString.cs b/Function/BNGetProvenanceString.cs new file mode 100644 index 0000000..6ca4fad --- /dev/null +++ b/Function/BNGetProvenanceString.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetProvenanceString(BNFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetProvenanceString" + )] + internal static extern IntPtr BNGetProvenanceString( + + // BNFunction* func + IntPtr func + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetReaderPosition.cs b/Function/BNGetReaderPosition.cs new file mode 100644 index 0000000..dc479c6 --- /dev/null +++ b/Function/BNGetReaderPosition.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetReaderPosition(BNBinaryReader* stream) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetReaderPosition" + )] + internal static extern ulong BNGetReaderPosition( + + // BNBinaryReader* stream + IntPtr stream + ); + } +} \ No newline at end of file diff --git a/Function/BNGetRecentAnalysisFunctionForAddress.cs b/Function/BNGetRecentAnalysisFunctionForAddress.cs new file mode 100644 index 0000000..878410a --- /dev/null +++ b/Function/BNGetRecentAnalysisFunctionForAddress.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFunction* BNGetRecentAnalysisFunctionForAddress(BNBinaryView* view, uint64_t addr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetRecentAnalysisFunctionForAddress" + )] + internal static extern IntPtr BNGetRecentAnalysisFunctionForAddress( + + // BNBinaryView* view + IntPtr view , + + // uint64_t addr + ulong addr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetRecentBasicBlockForAddress.cs b/Function/BNGetRecentBasicBlockForAddress.cs new file mode 100644 index 0000000..1a52637 --- /dev/null +++ b/Function/BNGetRecentBasicBlockForAddress.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBasicBlock* BNGetRecentBasicBlockForAddress(BNBinaryView* view, uint64_t addr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetRecentBasicBlockForAddress" + )] + internal static extern IntPtr BNGetRecentBasicBlockForAddress( + + // BNBinaryView* view + IntPtr view , + + // uint64_t addr + ulong addr + ); + } +} \ No newline at end of file diff --git a/Function/BNGetRedoEntries.cs b/Function/BNGetRedoEntries.cs new file mode 100644 index 0000000..5153fb9 --- /dev/null +++ b/Function/BNGetRedoEntries.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNUndoEntry** BNGetRedoEntries(BNFileMetadata* file, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetRedoEntries" + )] + internal static extern IntPtr BNGetRedoEntries( + + // BNFileMetadata* file + IntPtr file , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetRegisterStackAdjustments.cs b/Function/BNGetRegisterStackAdjustments.cs new file mode 100644 index 0000000..de2c52e --- /dev/null +++ b/Function/BNGetRegisterStackAdjustments.cs @@ -0,0 +1,53 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetRegisterStackAdjustments(BNCallingConvention* cc, uint32_t* returnRegs, uint64_t returnRegCount, BNType* returnType, BNVariable* @params, uint64_t paramCount, BNType** types, uint64_t typeCount, uint32_t** resultRegisters, uint32_t** resultAdjustments) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetRegisterStackAdjustments" + )] + internal static extern ulong BNGetRegisterStackAdjustments( + + // BNCallingConvention* cc + IntPtr cc , + + // uint32_t* returnRegs + IntPtr returnRegs , + + // uint64_t returnRegCount + ulong returnRegCount , + + // BNType* returnType + IntPtr returnType , + + // BNVariable* _params + IntPtr _params , + + // uint64_t paramCount + ulong paramCount , + + // BNType** types + IntPtr types , + + // uint64_t typeCount + ulong typeCount , + + // uint32_t** resultRegisters + IntPtr resultRegisters , + + // uint32_t** resultAdjustments + IntPtr resultAdjustments + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetRegisterValueAfterInstruction.cs b/Function/BNGetRegisterValueAfterInstruction.cs new file mode 100644 index 0000000..3964aa4 --- /dev/null +++ b/Function/BNGetRegisterValueAfterInstruction.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRegisterValue BNGetRegisterValueAfterInstruction(BNFunction* func, BNArchitecture* arch, uint64_t addr, uint32_t reg) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetRegisterValueAfterInstruction" + )] + internal static extern BNRegisterValue BNGetRegisterValueAfterInstruction( + + // BNFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t addr + ulong addr , + + // uint32_t reg + RegisterIndex reg + ); + } +} \ No newline at end of file diff --git a/Function/BNGetRegisterValueAtInstruction.cs b/Function/BNGetRegisterValueAtInstruction.cs new file mode 100644 index 0000000..655fe7d --- /dev/null +++ b/Function/BNGetRegisterValueAtInstruction.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRegisterValue BNGetRegisterValueAtInstruction(BNFunction* func, BNArchitecture* arch, uint64_t addr, uint32_t reg) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetRegisterValueAtInstruction" + )] + internal static extern BNRegisterValue BNGetRegisterValueAtInstruction( + + // BNFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t addr + ulong addr , + + // uint32_t reg + RegisterIndex reg + ); + } +} \ No newline at end of file diff --git a/Function/BNGetRegisteredTypeName.cs b/Function/BNGetRegisteredTypeName.cs new file mode 100644 index 0000000..c2825c2 --- /dev/null +++ b/Function/BNGetRegisteredTypeName.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNNamedTypeReference* BNGetRegisteredTypeName(BNType* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetRegisteredTypeName" + )] + internal static extern IntPtr BNGetRegisteredTypeName( + + // BNType* type + IntPtr type + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetRegistersReadByInstruction.cs b/Function/BNGetRegistersReadByInstruction.cs new file mode 100644 index 0000000..f7a687f --- /dev/null +++ b/Function/BNGetRegistersReadByInstruction.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint32_t* BNGetRegistersReadByInstruction(BNFunction* func, BNArchitecture* arch, uint64_t addr, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetRegistersReadByInstruction" + )] + internal static extern IntPtr BNGetRegistersReadByInstruction( + + // BNFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t addr + ulong addr , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetRegistersWrittenByInstruction.cs b/Function/BNGetRegistersWrittenByInstruction.cs new file mode 100644 index 0000000..5b27de2 --- /dev/null +++ b/Function/BNGetRegistersWrittenByInstruction.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint32_t* BNGetRegistersWrittenByInstruction(BNFunction* func, BNArchitecture* arch, uint64_t addr, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetRegistersWrittenByInstruction" + )] + internal static extern IntPtr BNGetRegistersWrittenByInstruction( + + // BNFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t addr + ulong addr , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetRelatedPlatform.cs b/Function/BNGetRelatedPlatform.cs new file mode 100644 index 0000000..4066eff --- /dev/null +++ b/Function/BNGetRelatedPlatform.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNPlatform* BNGetRelatedPlatform(BNPlatform* platform, BNArchitecture* arch) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetRelatedPlatform" + )] + internal static extern IntPtr BNGetRelatedPlatform( + + // BNPlatform* platform + IntPtr platform , + + // BNArchitecture* arch + IntPtr arch + ); + } +} \ No newline at end of file diff --git a/Function/BNGetRelatedPlatforms.cs b/Function/BNGetRelatedPlatforms.cs new file mode 100644 index 0000000..ccfd9bd --- /dev/null +++ b/Function/BNGetRelatedPlatforms.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNPlatform** BNGetRelatedPlatforms(BNPlatform* platform, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetRelatedPlatforms" + )] + internal static extern IntPtr BNGetRelatedPlatforms( + + // BNPlatform* platform + IntPtr platform , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetRelocationRanges.cs b/Function/BNGetRelocationRanges.cs new file mode 100644 index 0000000..73963db --- /dev/null +++ b/Function/BNGetRelocationRanges.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRange* BNGetRelocationRanges(BNBinaryView* view, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetRelocationRanges" + )] + internal static extern IntPtr BNGetRelocationRanges( + + // BNBinaryView* view + IntPtr view , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetRelocationRangesAtAddress.cs b/Function/BNGetRelocationRangesAtAddress.cs new file mode 100644 index 0000000..9d814b9 --- /dev/null +++ b/Function/BNGetRelocationRangesAtAddress.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRange* BNGetRelocationRangesAtAddress(BNBinaryView* view, uint64_t addr, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetRelocationRangesAtAddress" + )] + internal static extern IntPtr BNGetRelocationRangesAtAddress( + + // BNBinaryView* view + IntPtr view , + + // uint64_t addr + ulong addr , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetRelocationRangesInRange.cs b/Function/BNGetRelocationRangesInRange.cs new file mode 100644 index 0000000..8ee750c --- /dev/null +++ b/Function/BNGetRelocationRangesInRange.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRange* BNGetRelocationRangesInRange(BNBinaryView* view, uint64_t addr, uint64_t size, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetRelocationRangesInRange" + )] + internal static extern IntPtr BNGetRelocationRangesInRange( + + // BNBinaryView* view + IntPtr view , + + // uint64_t addr + ulong addr , + + // uint64_t size + ulong size , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetRelocationsAt.cs b/Function/BNGetRelocationsAt.cs new file mode 100644 index 0000000..e71fd2e --- /dev/null +++ b/Function/BNGetRelocationsAt.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRelocation** BNGetRelocationsAt(BNBinaryView* view, uint64_t addr, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetRelocationsAt" + )] + internal static extern IntPtr BNGetRelocationsAt( + + // BNBinaryView* view + IntPtr view , + + // uint64_t addr + ulong addr , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetRenderLayerByName.cs b/Function/BNGetRenderLayerByName.cs new file mode 100644 index 0000000..d1dd284 --- /dev/null +++ b/Function/BNGetRenderLayerByName.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRenderLayer* BNGetRenderLayerByName(const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetRenderLayerByName" + )] + internal static extern IntPtr BNGetRenderLayerByName( + + // const char* name + string name + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetRenderLayerDefaultEnableState.cs b/Function/BNGetRenderLayerDefaultEnableState.cs new file mode 100644 index 0000000..72893ce --- /dev/null +++ b/Function/BNGetRenderLayerDefaultEnableState.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRenderLayerDefaultEnableState BNGetRenderLayerDefaultEnableState(BNRenderLayer* renderLayer) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetRenderLayerDefaultEnableState" + )] + internal static extern RenderLayerDefaultEnableState BNGetRenderLayerDefaultEnableState( + + // BNRenderLayer* renderLayer + IntPtr renderLayer + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetRenderLayerList.cs b/Function/BNGetRenderLayerList.cs new file mode 100644 index 0000000..bb0b08d --- /dev/null +++ b/Function/BNGetRenderLayerList.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRenderLayer** BNGetRenderLayerList(uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetRenderLayerList" + )] + internal static extern IntPtr BNGetRenderLayerList( + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetRenderLayerName.cs b/Function/BNGetRenderLayerName.cs new file mode 100644 index 0000000..c3b1eee --- /dev/null +++ b/Function/BNGetRenderLayerName.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetRenderLayerName(BNRenderLayer* renderLayer) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetRenderLayerName" + )] + internal static extern IntPtr BNGetRenderLayerName( + + // BNRenderLayer* renderLayer + IntPtr renderLayer + ); + } +} \ No newline at end of file diff --git a/Function/BNGetReportCollectionCount.cs b/Function/BNGetReportCollectionCount.cs new file mode 100644 index 0000000..681eef5 --- /dev/null +++ b/Function/BNGetReportCollectionCount.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetReportCollectionCount(BNReportCollection* reports) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetReportCollectionCount" + )] + internal static extern ulong BNGetReportCollectionCount( + + // BNReportCollection* reports + IntPtr reports + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetReportContents.cs b/Function/BNGetReportContents.cs new file mode 100644 index 0000000..7558d5e --- /dev/null +++ b/Function/BNGetReportContents.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// char* BNGetReportContents(BNReportCollection* reports, uint64_t i) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetReportContents" + )] + internal static extern IntPtr BNGetReportContents( + + // BNReportCollection* reports + IntPtr reports , + + // uint64_t i + ulong i + ); + } +} \ No newline at end of file diff --git a/Function/BNGetReportFlowGraph.cs b/Function/BNGetReportFlowGraph.cs new file mode 100644 index 0000000..7165c50 --- /dev/null +++ b/Function/BNGetReportFlowGraph.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFlowGraph* BNGetReportFlowGraph(BNReportCollection* reports, uint64_t i) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetReportFlowGraph" + )] + internal static extern IntPtr BNGetReportFlowGraph( + + // BNReportCollection* reports + IntPtr reports , + + // uint64_t i + ulong i + ); + } +} \ No newline at end of file diff --git a/Function/BNGetReportPlainText.cs b/Function/BNGetReportPlainText.cs new file mode 100644 index 0000000..f41a05e --- /dev/null +++ b/Function/BNGetReportPlainText.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// char* BNGetReportPlainText(BNReportCollection* reports, uint64_t i) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetReportPlainText" + )] + internal static extern IntPtr BNGetReportPlainText( + + // BNReportCollection* reports + IntPtr reports , + + // uint64_t i + ulong i + ); + } +} \ No newline at end of file diff --git a/Function/BNGetReportTitle.cs b/Function/BNGetReportTitle.cs new file mode 100644 index 0000000..481a3c5 --- /dev/null +++ b/Function/BNGetReportTitle.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// char* BNGetReportTitle(BNReportCollection* reports, uint64_t i) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetReportTitle" + )] + internal static extern IntPtr BNGetReportTitle( + + // BNReportCollection* reports + IntPtr reports , + + // uint64_t i + ulong i + ); + } +} \ No newline at end of file diff --git a/Function/BNGetReportType.cs b/Function/BNGetReportType.cs new file mode 100644 index 0000000..de1a576 --- /dev/null +++ b/Function/BNGetReportType.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNReportType BNGetReportType(BNReportCollection* reports, uint64_t i) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetReportType" + )] + internal static extern ReportType BNGetReportType( + + // BNReportCollection* reports + IntPtr reports , + + // uint64_t i + ulong i + ); + } +} \ No newline at end of file diff --git a/Function/BNGetReportView.cs b/Function/BNGetReportView.cs new file mode 100644 index 0000000..187daaf --- /dev/null +++ b/Function/BNGetReportView.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBinaryView* BNGetReportView(BNReportCollection* reports, uint64_t i) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetReportView" + )] + internal static extern IntPtr BNGetReportView( + + // BNReportCollection* reports + IntPtr reports , + + // uint64_t i + ulong i + ); + } +} \ No newline at end of file diff --git a/Function/BNGetRepositoriesDirectory.cs b/Function/BNGetRepositoriesDirectory.cs new file mode 100644 index 0000000..2bc3a71 --- /dev/null +++ b/Function/BNGetRepositoriesDirectory.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + public static string GetRepositoriesDirectory() + { + return UnsafeUtils.TakeUtf8String( + BinaryNinja.NativeMethods.BNGetRepositoriesDirectory() + ); + } + } + + internal static partial class NativeMethods + { + /// + /// char* BNGetRepositoriesDirectory() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetRepositoriesDirectory" + )] + internal static extern IntPtr BNGetRepositoriesDirectory(); + } +} \ No newline at end of file diff --git a/Function/BNGetRepositoryManager.cs b/Function/BNGetRepositoryManager.cs new file mode 100644 index 0000000..8ef442f --- /dev/null +++ b/Function/BNGetRepositoryManager.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRepositoryManager* BNGetRepositoryManager() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetRepositoryManager" + )] + internal static extern IntPtr BNGetRepositoryManager( + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetRootComponent.cs b/Function/BNGetRootComponent.cs new file mode 100644 index 0000000..a28c577 --- /dev/null +++ b/Function/BNGetRootComponent.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNComponent* BNGetRootComponent(BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetRootComponent" + )] + internal static extern IntPtr BNGetRootComponent( + + // BNBinaryView* view + IntPtr view + ); + } +} \ No newline at end of file diff --git a/Function/BNGetRunningBackgroundTasks.cs b/Function/BNGetRunningBackgroundTasks.cs new file mode 100644 index 0000000..0e17d6d --- /dev/null +++ b/Function/BNGetRunningBackgroundTasks.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBackgroundTask** BNGetRunningBackgroundTasks(uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetRunningBackgroundTasks" + )] + internal static extern IntPtr BNGetRunningBackgroundTasks( + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetSaveFileNameInput.cs b/Function/BNGetSaveFileNameInput.cs new file mode 100644 index 0000000..1dc548a --- /dev/null +++ b/Function/BNGetSaveFileNameInput.cs @@ -0,0 +1,58 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public static partial class Core + { + public static string? GetSaveFileNameInput( + string prompt = "Choose a file:" , + string ext = "Executables (*.exe *.dll *.sys);;All Files (*)", + string defaultName = "foo.exe" + ) + { + bool ok = NativeMethods.BNGetSaveFileNameInput( + out IntPtr result , + prompt , + ext, + defaultName + ); + + if (!ok) + { + return null; + } + + return UnsafeUtils.TakeUtf8String(result); + } + } + + internal static partial class NativeMethods + { + /// + /// bool BNGetSaveFileNameInput(const char** result, const char* prompt, const char* ext, const char* defaultName) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetSaveFileNameInput" + )] + internal static extern bool BNGetSaveFileNameInput( + + // char** result + out IntPtr result , + + // const char* prompt + string prompt , + + // const char* ext + string ext , + + // const char* defaultName + string defaultName + ); + } +} \ No newline at end of file diff --git a/Function/BNGetSaveSettingsName.cs b/Function/BNGetSaveSettingsName.cs new file mode 100644 index 0000000..eaffa44 --- /dev/null +++ b/Function/BNGetSaveSettingsName.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// char* BNGetSaveSettingsName(BNSaveSettings* settings) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetSaveSettingsName" + )] + internal static extern IntPtr BNGetSaveSettingsName( + + // BNSaveSettings* settings + IntPtr settings + ); + } +} \ No newline at end of file diff --git a/Function/BNGetScriptingInstanceDelimiters.cs b/Function/BNGetScriptingInstanceDelimiters.cs new file mode 100644 index 0000000..e45ac80 --- /dev/null +++ b/Function/BNGetScriptingInstanceDelimiters.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetScriptingInstanceDelimiters(BNScriptingInstance* instance) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetScriptingInstanceDelimiters" + )] + internal static extern IntPtr BNGetScriptingInstanceDelimiters( + + // BNScriptingInstance* instance + IntPtr instance + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetScriptingInstanceInputReadyState.cs b/Function/BNGetScriptingInstanceInputReadyState.cs new file mode 100644 index 0000000..f06b199 --- /dev/null +++ b/Function/BNGetScriptingInstanceInputReadyState.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNScriptingProviderInputReadyState BNGetScriptingInstanceInputReadyState(BNScriptingInstance* instance) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetScriptingInstanceInputReadyState" + )] + internal static extern ScriptingProviderInputReadyState BNGetScriptingInstanceInputReadyState( + + // BNScriptingInstance* instance + IntPtr instance + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetScriptingProviderAPIName.cs b/Function/BNGetScriptingProviderAPIName.cs new file mode 100644 index 0000000..a650e5d --- /dev/null +++ b/Function/BNGetScriptingProviderAPIName.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetScriptingProviderAPIName(BNScriptingProvider* provider) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetScriptingProviderAPIName" + )] + internal static extern IntPtr BNGetScriptingProviderAPIName( + + // BNScriptingProvider* provider + IntPtr provider + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetScriptingProviderByAPIName.cs b/Function/BNGetScriptingProviderByAPIName.cs new file mode 100644 index 0000000..4c73687 --- /dev/null +++ b/Function/BNGetScriptingProviderByAPIName.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNScriptingProvider* BNGetScriptingProviderByAPIName(const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetScriptingProviderByAPIName" + )] + internal static extern IntPtr BNGetScriptingProviderByAPIName( + + // const char* name + string name + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetScriptingProviderByName.cs b/Function/BNGetScriptingProviderByName.cs new file mode 100644 index 0000000..714768a --- /dev/null +++ b/Function/BNGetScriptingProviderByName.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNScriptingProvider* BNGetScriptingProviderByName(const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetScriptingProviderByName" + )] + internal static extern IntPtr BNGetScriptingProviderByName( + + // const char* name + string name + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetScriptingProviderList.cs b/Function/BNGetScriptingProviderList.cs new file mode 100644 index 0000000..d6a0ba4 --- /dev/null +++ b/Function/BNGetScriptingProviderList.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNScriptingProvider** BNGetScriptingProviderList(uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetScriptingProviderList" + )] + internal static extern IntPtr BNGetScriptingProviderList( + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetScriptingProviderName.cs b/Function/BNGetScriptingProviderName.cs new file mode 100644 index 0000000..614454a --- /dev/null +++ b/Function/BNGetScriptingProviderName.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetScriptingProviderName(BNScriptingProvider* provider) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetScriptingProviderName" + )] + internal static extern IntPtr BNGetScriptingProviderName( + + // BNScriptingProvider* provider + IntPtr provider + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetSecretsProviderByName.cs b/Function/BNGetSecretsProviderByName.cs new file mode 100644 index 0000000..77c8285 --- /dev/null +++ b/Function/BNGetSecretsProviderByName.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNSecretsProvider* BNGetSecretsProviderByName(const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetSecretsProviderByName" + )] + internal static extern IntPtr BNGetSecretsProviderByName( + + // const char* name + string name + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetSecretsProviderData.cs b/Function/BNGetSecretsProviderData.cs new file mode 100644 index 0000000..b521579 --- /dev/null +++ b/Function/BNGetSecretsProviderData.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetSecretsProviderData(BNSecretsProvider* provider, const char* key) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetSecretsProviderData" + )] + internal static extern IntPtr BNGetSecretsProviderData( + + // BNSecretsProvider* provider + IntPtr provider , + + // const char* key + string key + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetSecretsProviderList.cs b/Function/BNGetSecretsProviderList.cs new file mode 100644 index 0000000..f9b309f --- /dev/null +++ b/Function/BNGetSecretsProviderList.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNSecretsProvider** BNGetSecretsProviderList(uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetSecretsProviderList" + )] + internal static extern IntPtr BNGetSecretsProviderList( + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetSecretsProviderName.cs b/Function/BNGetSecretsProviderName.cs new file mode 100644 index 0000000..9d26180 --- /dev/null +++ b/Function/BNGetSecretsProviderName.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetSecretsProviderName(BNSecretsProvider* provider) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetSecretsProviderName" + )] + internal static extern IntPtr BNGetSecretsProviderName( + + // BNSecretsProvider* provider + IntPtr provider + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetSectionByName.cs b/Function/BNGetSectionByName.cs new file mode 100644 index 0000000..4e38c66 --- /dev/null +++ b/Function/BNGetSectionByName.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNSection* BNGetSectionByName(BNBinaryView* view, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetSectionByName" + )] + internal static extern IntPtr BNGetSectionByName( + + // BNBinaryView* view + IntPtr view , + + // const char* name + string name + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetSections.cs b/Function/BNGetSections.cs new file mode 100644 index 0000000..93873a5 --- /dev/null +++ b/Function/BNGetSections.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNSection** BNGetSections(BNBinaryView* view, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetSections" + )] + internal static extern IntPtr BNGetSections( + + // BNBinaryView* view + IntPtr view , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetSectionsAt.cs b/Function/BNGetSectionsAt.cs new file mode 100644 index 0000000..976d8cd --- /dev/null +++ b/Function/BNGetSectionsAt.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNSection** BNGetSectionsAt(BNBinaryView* view, uint64_t addr, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetSectionsAt" + )] + internal static extern IntPtr BNGetSectionsAt( + + // BNBinaryView* view + IntPtr view , + + // uint64_t addr + ulong addr , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetSegmentAt.cs b/Function/BNGetSegmentAt.cs new file mode 100644 index 0000000..daf11b9 --- /dev/null +++ b/Function/BNGetSegmentAt.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNSegment* BNGetSegmentAt(BNBinaryView* view, uint64_t addr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetSegmentAt" + )] + internal static extern IntPtr BNGetSegmentAt( + + // BNBinaryView* view + IntPtr view , + + // uint64_t addr + ulong addr + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetSegments.cs b/Function/BNGetSegments.cs new file mode 100644 index 0000000..bf5120b --- /dev/null +++ b/Function/BNGetSegments.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNSegment** BNGetSegments(BNBinaryView* view, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetSegments" + )] + internal static extern IntPtr BNGetSegments( + + // BNBinaryView* view + IntPtr view , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetSerialNumber.cs b/Function/BNGetSerialNumber.cs new file mode 100644 index 0000000..21daa61 --- /dev/null +++ b/Function/BNGetSerialNumber.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public static partial class Core + { + public static string GetSerialNumber() + { + return UnsafeUtils.TakeAnsiString( + NativeMethods.BNGetSerialNumber() + ); + } + } + + internal static partial class NativeMethods + { + /// + /// const char* BNGetSerialNumber() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetSerialNumber" + )] + internal static extern IntPtr BNGetSerialNumber(); + } +} \ No newline at end of file diff --git a/Function/BNGetSettingsFileName.cs b/Function/BNGetSettingsFileName.cs new file mode 100644 index 0000000..97938c5 --- /dev/null +++ b/Function/BNGetSettingsFileName.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public static partial class Core + { + public static string GetSettingsFileName() + { + return UnsafeUtils.TakeUtf8String( + NativeMethods.BNGetSettingsFileName() + ); + } + } + + internal static partial class NativeMethods + { + /// + /// char* BNGetSettingsFileName() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetSettingsFileName" + )] + internal static extern IntPtr BNGetSettingsFileName(); + } +} \ No newline at end of file diff --git a/Function/BNGetSizesReferenced.cs b/Function/BNGetSizesReferenced.cs new file mode 100644 index 0000000..7891da0 --- /dev/null +++ b/Function/BNGetSizesReferenced.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t* BNGetSizesReferenced(BNBinaryView* view, BNQualifiedName* type, uint64_t offset, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetSizesReferenced" + )] + internal static extern IntPtr BNGetSizesReferenced( + + // BNBinaryView* view + IntPtr view , + + // BNQualifiedName* type + in BNQualifiedName type , + + // uint64_t offset + ulong offset , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetSnapshotChildren.cs b/Function/BNGetSnapshotChildren.cs new file mode 100644 index 0000000..a2b80b3 --- /dev/null +++ b/Function/BNGetSnapshotChildren.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNSnapshot** BNGetSnapshotChildren(BNSnapshot* snapshot, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetSnapshotChildren" + )] + internal static extern IntPtr BNGetSnapshotChildren( + + // BNSnapshot* snapshot + IntPtr snapshot , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetSnapshotData.cs b/Function/BNGetSnapshotData.cs new file mode 100644 index 0000000..2b7ffc8 --- /dev/null +++ b/Function/BNGetSnapshotData.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNGetSnapshotData(BNFileMetadata* file, BNKeyValueStore* data, BNKeyValueStore* cache, void* ctxt, void** progress) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetSnapshotData" + )] + internal static extern void BNGetSnapshotData( + + // BNFileMetadata* file + IntPtr file , + + // BNKeyValueStore* data + IntPtr data , + + // BNKeyValueStore* cache + IntPtr cache , + + // void* ctxt + IntPtr ctxt , + + // void* progress + IntPtr progress + ); + } +} \ No newline at end of file diff --git a/Function/BNGetSnapshotDatabase.cs b/Function/BNGetSnapshotDatabase.cs new file mode 100644 index 0000000..768fe73 --- /dev/null +++ b/Function/BNGetSnapshotDatabase.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDatabase* BNGetSnapshotDatabase(BNSnapshot* snapshot) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetSnapshotDatabase" + )] + internal static extern IntPtr BNGetSnapshotDatabase( + + // BNSnapshot* snapshot + IntPtr snapshot + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetSnapshotFileContents.cs b/Function/BNGetSnapshotFileContents.cs new file mode 100644 index 0000000..667dda6 --- /dev/null +++ b/Function/BNGetSnapshotFileContents.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDataBuffer* BNGetSnapshotFileContents(BNSnapshot* snapshot) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetSnapshotFileContents" + )] + internal static extern IntPtr BNGetSnapshotFileContents( + + // BNSnapshot* snapshot + IntPtr snapshot + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetSnapshotFileContentsHash.cs b/Function/BNGetSnapshotFileContentsHash.cs new file mode 100644 index 0000000..9e86795 --- /dev/null +++ b/Function/BNGetSnapshotFileContentsHash.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDataBuffer* BNGetSnapshotFileContentsHash(BNSnapshot* snapshot) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetSnapshotFileContentsHash" + )] + internal static extern IntPtr BNGetSnapshotFileContentsHash( + + // BNSnapshot* snapshot + IntPtr snapshot + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetSnapshotFirstParent.cs b/Function/BNGetSnapshotFirstParent.cs new file mode 100644 index 0000000..2d5c08c --- /dev/null +++ b/Function/BNGetSnapshotFirstParent.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNSnapshot* BNGetSnapshotFirstParent(BNSnapshot* snapshot) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetSnapshotFirstParent" + )] + internal static extern IntPtr BNGetSnapshotFirstParent( + + // BNSnapshot* snapshot + IntPtr snapshot + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetSnapshotId.cs b/Function/BNGetSnapshotId.cs new file mode 100644 index 0000000..e1f139f --- /dev/null +++ b/Function/BNGetSnapshotId.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// int64_t BNGetSnapshotId(BNSnapshot* snapshot) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetSnapshotId" + )] + internal static extern long BNGetSnapshotId( + + // BNSnapshot* snapshot + IntPtr snapshot + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetSnapshotName.cs b/Function/BNGetSnapshotName.cs new file mode 100644 index 0000000..40ceed9 --- /dev/null +++ b/Function/BNGetSnapshotName.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetSnapshotName(BNSnapshot* snapshot) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetSnapshotName" + )] + internal static extern IntPtr BNGetSnapshotName( + + // BNSnapshot* snapshot + IntPtr snapshot + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetSnapshotParents.cs b/Function/BNGetSnapshotParents.cs new file mode 100644 index 0000000..b711327 --- /dev/null +++ b/Function/BNGetSnapshotParents.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNSnapshot** BNGetSnapshotParents(BNSnapshot* snapshot, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetSnapshotParents" + )] + internal static extern IntPtr BNGetSnapshotParents( + + // BNSnapshot* snapshot + IntPtr snapshot , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetSnapshotUndoData.cs b/Function/BNGetSnapshotUndoData.cs new file mode 100644 index 0000000..7b3b69a --- /dev/null +++ b/Function/BNGetSnapshotUndoData.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDataBuffer* BNGetSnapshotUndoData(BNSnapshot* snapshot) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetSnapshotUndoData" + )] + internal static extern IntPtr BNGetSnapshotUndoData( + + // BNSnapshot* snapshot + IntPtr snapshot + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetSnapshotUndoEntries.cs b/Function/BNGetSnapshotUndoEntries.cs new file mode 100644 index 0000000..de3a643 --- /dev/null +++ b/Function/BNGetSnapshotUndoEntries.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNUndoEntry** BNGetSnapshotUndoEntries(BNSnapshot* snapshot, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetSnapshotUndoEntries" + )] + internal static extern IntPtr BNGetSnapshotUndoEntries( + + // BNSnapshot* snapshot + IntPtr snapshot , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetSnapshotUndoEntriesWithProgress.cs b/Function/BNGetSnapshotUndoEntriesWithProgress.cs new file mode 100644 index 0000000..7e46f01 --- /dev/null +++ b/Function/BNGetSnapshotUndoEntriesWithProgress.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNUndoEntry** BNGetSnapshotUndoEntriesWithProgress(BNSnapshot* snapshot, void* ctxt, void** progress, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetSnapshotUndoEntriesWithProgress" + )] + internal static extern IntPtr BNGetSnapshotUndoEntriesWithProgress( + + // BNSnapshot* snapshot + IntPtr snapshot , + + // void* ctxt + IntPtr ctxt , + + // void** progress + IntPtr progress , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetSplitVariables.cs b/Function/BNGetSplitVariables.cs new file mode 100644 index 0000000..7e61351 --- /dev/null +++ b/Function/BNGetSplitVariables.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNVariable* BNGetSplitVariables(BNFunction* func, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetSplitVariables" + )] + internal static extern IntPtr BNGetSplitVariables( + + // BNFunction* func + IntPtr func , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetStackAdjustmentForVariables.cs b/Function/BNGetStackAdjustmentForVariables.cs new file mode 100644 index 0000000..89b0c47 --- /dev/null +++ b/Function/BNGetStackAdjustmentForVariables.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// int64_t BNGetStackAdjustmentForVariables(BNCallingConvention* cc, BNVariable* paramVars, BNType** paramTypes, uint64_t paramCount) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetStackAdjustmentForVariables" + )] + internal static extern long BNGetStackAdjustmentForVariables( + + // BNCallingConvention* cc + IntPtr cc , + + // BNVariable* paramVars + IntPtr paramVars , + + // BNType** paramTypes + IntPtr paramTypes , + + // uint64_t paramCount + ulong paramCount + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetStackContentsAfterInstruction.cs b/Function/BNGetStackContentsAfterInstruction.cs new file mode 100644 index 0000000..817b96a --- /dev/null +++ b/Function/BNGetStackContentsAfterInstruction.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRegisterValue BNGetStackContentsAfterInstruction(BNFunction* func, BNArchitecture* arch, uint64_t addr, int64_t offset, uint64_t size) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetStackContentsAfterInstruction" + )] + internal static extern BNRegisterValue BNGetStackContentsAfterInstruction( + + // BNFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t addr + ulong addr , + + // int64_t offset + long offset , + + // uint64_t size + ulong size + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetStackContentsAtInstruction.cs b/Function/BNGetStackContentsAtInstruction.cs new file mode 100644 index 0000000..3f99fe7 --- /dev/null +++ b/Function/BNGetStackContentsAtInstruction.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRegisterValue BNGetStackContentsAtInstruction(BNFunction* func, BNArchitecture* arch, uint64_t addr, int64_t offset, uint64_t size) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetStackContentsAtInstruction" + )] + internal static extern BNRegisterValue BNGetStackContentsAtInstruction( + + // BNFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t addr + ulong addr , + + // int64_t offset + long offset , + + // uint64_t size + ulong size + ); + } +} \ No newline at end of file diff --git a/Function/BNGetStackLayout.cs b/Function/BNGetStackLayout.cs new file mode 100644 index 0000000..33dfaab --- /dev/null +++ b/Function/BNGetStackLayout.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNVariableNameAndType* BNGetStackLayout(BNFunction* func, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetStackLayout" + )] + internal static extern IntPtr BNGetStackLayout( + + // BNFunction* func + IntPtr func , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetStackVariableAtFrameOffset.cs b/Function/BNGetStackVariableAtFrameOffset.cs new file mode 100644 index 0000000..68217ac --- /dev/null +++ b/Function/BNGetStackVariableAtFrameOffset.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNGetStackVariableAtFrameOffset(BNFunction* func, BNArchitecture* arch, uint64_t addr, int64_t offset, BNVariableNameAndType* var) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetStackVariableAtFrameOffset" + )] + internal static extern bool BNGetStackVariableAtFrameOffset( + + // BNFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t addr + ulong addr , + + // int64_t offset + long offset , + + // BNVariableNameAndType* _var + IntPtr _var + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetStackVariableAtFrameOffsetAfterInstruction.cs b/Function/BNGetStackVariableAtFrameOffsetAfterInstruction.cs new file mode 100644 index 0000000..052a3f3 --- /dev/null +++ b/Function/BNGetStackVariableAtFrameOffsetAfterInstruction.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNGetStackVariableAtFrameOffsetAfterInstruction(BNFunction* func, BNArchitecture* arch, uint64_t addr, int64_t offset, BNVariableNameAndType* var) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetStackVariableAtFrameOffsetAfterInstruction" + )] + internal static extern bool BNGetStackVariableAtFrameOffsetAfterInstruction( + + // BNFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t addr + ulong addr , + + // int64_t offset + long offset , + + // BNVariableNameAndType* _var + IntPtr _var + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetStackVariablesReferencedByInstruction.cs b/Function/BNGetStackVariablesReferencedByInstruction.cs new file mode 100644 index 0000000..23b3b40 --- /dev/null +++ b/Function/BNGetStackVariablesReferencedByInstruction.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNStackVariableReference* BNGetStackVariablesReferencedByInstruction(BNFunction* func, BNArchitecture* arch, uint64_t addr, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetStackVariablesReferencedByInstruction" + )] + internal static extern IntPtr BNGetStackVariablesReferencedByInstruction( + + // BNFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t addr + ulong addr , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetStackVariablesReferencedByInstructionIfAvailable.cs b/Function/BNGetStackVariablesReferencedByInstructionIfAvailable.cs new file mode 100644 index 0000000..6c8c5cd --- /dev/null +++ b/Function/BNGetStackVariablesReferencedByInstructionIfAvailable.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNStackVariableReference* BNGetStackVariablesReferencedByInstructionIfAvailable(BNFunction* func, BNArchitecture* arch, uint64_t addr, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetStackVariablesReferencedByInstructionIfAvailable" + )] + internal static extern IntPtr BNGetStackVariablesReferencedByInstructionIfAvailable( + + // BNFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t addr + ulong addr , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetStartOffset.cs b/Function/BNGetStartOffset.cs new file mode 100644 index 0000000..ccfa7bc --- /dev/null +++ b/Function/BNGetStartOffset.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetStartOffset(BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetStartOffset" + )] + internal static extern ulong BNGetStartOffset( + + // BNBinaryView* view + IntPtr view + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetStringAtAddress.cs b/Function/BNGetStringAtAddress.cs new file mode 100644 index 0000000..a8a72c3 --- /dev/null +++ b/Function/BNGetStringAtAddress.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNGetStringAtAddress(BNBinaryView* view, uint64_t addr, BNStringReference* strRef) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetStringAtAddress" + )] + internal static extern bool BNGetStringAtAddress( + + // BNBinaryView* view + IntPtr view , + + // uint64_t addr + ulong addr , + + // BNStringReference* strRef + out BNStringReference strRef + ); + } +} \ No newline at end of file diff --git a/Function/BNGetStringLiteralPrefix.cs b/Function/BNGetStringLiteralPrefix.cs new file mode 100644 index 0000000..ad3f77c --- /dev/null +++ b/Function/BNGetStringLiteralPrefix.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetStringLiteralPrefix(BNStringType type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetStringLiteralPrefix" + )] + internal static extern IntPtr BNGetStringLiteralPrefix( + + // BNStringType type + StringType type + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetStringRefContents.cs b/Function/BNGetStringRefContents.cs new file mode 100644 index 0000000..197088c --- /dev/null +++ b/Function/BNGetStringRefContents.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetStringRefContents(BNStringRef* @ref) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetStringRefContents" + )] + internal static extern IntPtr BNGetStringRefContents( + + // BNStringRef* _ref + IntPtr _ref + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetStringRefSize.cs b/Function/BNGetStringRefSize.cs new file mode 100644 index 0000000..83cd2cd --- /dev/null +++ b/Function/BNGetStringRefSize.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetStringRefSize(BNStringRef* @ref) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetStringRefSize" + )] + internal static extern ulong BNGetStringRefSize( + + // BNStringRef* _ref + IntPtr _ref + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetStrings.cs b/Function/BNGetStrings.cs new file mode 100644 index 0000000..5237577 --- /dev/null +++ b/Function/BNGetStrings.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNStringReference* BNGetStrings(BNBinaryView* view, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetStrings" + )] + internal static extern IntPtr BNGetStrings( + + // BNBinaryView* view + IntPtr view , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetStringsInRange.cs b/Function/BNGetStringsInRange.cs new file mode 100644 index 0000000..4484dd2 --- /dev/null +++ b/Function/BNGetStringsInRange.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNStringReference* BNGetStringsInRange(BNBinaryView* view, uint64_t start, uint64_t len, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetStringsInRange" + )] + internal static extern IntPtr BNGetStringsInRange( + + // BNBinaryView* view + IntPtr view , + + // uint64_t start + ulong start , + + // uint64_t len + ulong len , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetStructureAlignment.cs b/Function/BNGetStructureAlignment.cs new file mode 100644 index 0000000..774c2c0 --- /dev/null +++ b/Function/BNGetStructureAlignment.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetStructureAlignment(BNStructure* s) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetStructureAlignment" + )] + internal static extern ulong BNGetStructureAlignment( + + // BNStructure* s + IntPtr s + ); + } +} \ No newline at end of file diff --git a/Function/BNGetStructureBuilderAlignment.cs b/Function/BNGetStructureBuilderAlignment.cs new file mode 100644 index 0000000..88bc9a0 --- /dev/null +++ b/Function/BNGetStructureBuilderAlignment.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetStructureBuilderAlignment(BNStructureBuilder* s) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetStructureBuilderAlignment" + )] + internal static extern ulong BNGetStructureBuilderAlignment( + + // BNStructureBuilder* s + IntPtr s + ); + } +} \ No newline at end of file diff --git a/Function/BNGetStructureBuilderMemberAtOffset.cs b/Function/BNGetStructureBuilderMemberAtOffset.cs new file mode 100644 index 0000000..82e589c --- /dev/null +++ b/Function/BNGetStructureBuilderMemberAtOffset.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNStructureMember* BNGetStructureBuilderMemberAtOffset(BNStructureBuilder* s, int64_t offset, uint64_t* idx) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetStructureBuilderMemberAtOffset" + )] + internal static extern IntPtr BNGetStructureBuilderMemberAtOffset( + + // BNStructureBuilder* s + IntPtr s , + + // int64_t offset + long offset , + + // uint64_t* idx + IntPtr idx + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetStructureBuilderMemberByName.cs b/Function/BNGetStructureBuilderMemberByName.cs new file mode 100644 index 0000000..322c58a --- /dev/null +++ b/Function/BNGetStructureBuilderMemberByName.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNStructureMember* BNGetStructureBuilderMemberByName(BNStructureBuilder* s, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetStructureBuilderMemberByName" + )] + internal static extern IntPtr BNGetStructureBuilderMemberByName( + + // BNStructureBuilder* s + IntPtr s , + + // const char* name + string name + ); + } +} \ No newline at end of file diff --git a/Function/BNGetStructureBuilderMembers.cs b/Function/BNGetStructureBuilderMembers.cs new file mode 100644 index 0000000..a074041 --- /dev/null +++ b/Function/BNGetStructureBuilderMembers.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNStructureMember* BNGetStructureBuilderMembers(BNStructureBuilder* s, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetStructureBuilderMembers" + )] + internal static extern IntPtr BNGetStructureBuilderMembers( + + // BNStructureBuilder* s + IntPtr s , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetStructureBuilderPointerOffset.cs b/Function/BNGetStructureBuilderPointerOffset.cs new file mode 100644 index 0000000..7e25cc4 --- /dev/null +++ b/Function/BNGetStructureBuilderPointerOffset.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// int64_t BNGetStructureBuilderPointerOffset(BNStructureBuilder* s) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetStructureBuilderPointerOffset" + )] + internal static extern long BNGetStructureBuilderPointerOffset( + + // BNStructureBuilder* s + IntPtr s + ); + } +} \ No newline at end of file diff --git a/Function/BNGetStructureBuilderType.cs b/Function/BNGetStructureBuilderType.cs new file mode 100644 index 0000000..f5f7c32 --- /dev/null +++ b/Function/BNGetStructureBuilderType.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNStructureVariant BNGetStructureBuilderType(BNStructureBuilder* s) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetStructureBuilderType" + )] + internal static extern StructureVariant BNGetStructureBuilderType( + + // BNStructureBuilder* s + IntPtr s + ); + } +} \ No newline at end of file diff --git a/Function/BNGetStructureBuilderWidth.cs b/Function/BNGetStructureBuilderWidth.cs new file mode 100644 index 0000000..3f8f586 --- /dev/null +++ b/Function/BNGetStructureBuilderWidth.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetStructureBuilderWidth(BNStructureBuilder* s) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetStructureBuilderWidth" + )] + internal static extern ulong BNGetStructureBuilderWidth( + + // BNStructureBuilder* s + IntPtr s + ); + } +} \ No newline at end of file diff --git a/Function/BNGetStructureMemberAtOffset.cs b/Function/BNGetStructureMemberAtOffset.cs new file mode 100644 index 0000000..9300fd3 --- /dev/null +++ b/Function/BNGetStructureMemberAtOffset.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNStructureMember* BNGetStructureMemberAtOffset(BNStructure* s, int64_t offset, uint64_t* idx) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetStructureMemberAtOffset" + )] + internal static extern IntPtr BNGetStructureMemberAtOffset( + + // BNStructure* s + IntPtr s , + + // int64_t offset + long offset , + + // uint64_t* idx + out ulong idx + ); + } +} \ No newline at end of file diff --git a/Function/BNGetStructureMemberByName.cs b/Function/BNGetStructureMemberByName.cs new file mode 100644 index 0000000..4a6762b --- /dev/null +++ b/Function/BNGetStructureMemberByName.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNStructureMember* BNGetStructureMemberByName(BNStructure* s, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetStructureMemberByName" + )] + internal static extern IntPtr BNGetStructureMemberByName( + + // BNStructure* s + IntPtr s , + + // const char* name + string name + ); + } +} \ No newline at end of file diff --git a/Function/BNGetStructureMembers.cs b/Function/BNGetStructureMembers.cs new file mode 100644 index 0000000..5b1db40 --- /dev/null +++ b/Function/BNGetStructureMembers.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNStructureMember* BNGetStructureMembers(BNStructure* s, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetStructureMembers" + )] + internal static extern IntPtr BNGetStructureMembers( + + // BNStructure* s + IntPtr s , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetStructureMembersIncludingInherited.cs b/Function/BNGetStructureMembersIncludingInherited.cs new file mode 100644 index 0000000..308a4fd --- /dev/null +++ b/Function/BNGetStructureMembersIncludingInherited.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNInheritedStructureMember* BNGetStructureMembersIncludingInherited(BNStructure* s, BNTypeContainer* types, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetStructureMembersIncludingInherited" + )] + internal static extern IntPtr BNGetStructureMembersIncludingInherited( + + // BNStructure* s + IntPtr s , + + // BNTypeContainer* types + IntPtr types , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetStructurePointerOffset.cs b/Function/BNGetStructurePointerOffset.cs new file mode 100644 index 0000000..47864be --- /dev/null +++ b/Function/BNGetStructurePointerOffset.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// int64_t BNGetStructurePointerOffset(BNStructure* s) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetStructurePointerOffset" + )] + internal static extern long BNGetStructurePointerOffset( + + // BNStructure* s + IntPtr s + ); + } +} \ No newline at end of file diff --git a/Function/BNGetStructureType.cs b/Function/BNGetStructureType.cs new file mode 100644 index 0000000..efdd9db --- /dev/null +++ b/Function/BNGetStructureType.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNStructureVariant BNGetStructureType(BNStructure* s) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetStructureType" + )] + internal static extern StructureVariant BNGetStructureType( + + // BNStructure* s + IntPtr s + ); + } +} \ No newline at end of file diff --git a/Function/BNGetStructureWidth.cs b/Function/BNGetStructureWidth.cs new file mode 100644 index 0000000..7283901 --- /dev/null +++ b/Function/BNGetStructureWidth.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetStructureWidth(BNStructure* s) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetStructureWidth" + )] + internal static extern ulong BNGetStructureWidth( + + // BNStructure* s + IntPtr s + ); + } +} \ No newline at end of file diff --git a/Function/BNGetSwitchRecovery.cs b/Function/BNGetSwitchRecovery.cs new file mode 100644 index 0000000..d33078a --- /dev/null +++ b/Function/BNGetSwitchRecovery.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNSwitchRecovery BNGetSwitchRecovery(BNFunction* func, uint64_t addr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetSwitchRecovery" + )] + internal static extern SwitchRecovery BNGetSwitchRecovery( + + // BNFunction* func + IntPtr func , + + // uint64_t addr + ulong addr + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetSymbolAddress.cs b/Function/BNGetSymbolAddress.cs new file mode 100644 index 0000000..a36d690 --- /dev/null +++ b/Function/BNGetSymbolAddress.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetSymbolAddress(BNSymbol* sym) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetSymbolAddress" + )] + internal static extern ulong BNGetSymbolAddress( + + // BNSymbol* sym + IntPtr sym + ); + } +} \ No newline at end of file diff --git a/Function/BNGetSymbolBinding.cs b/Function/BNGetSymbolBinding.cs new file mode 100644 index 0000000..5f717f0 --- /dev/null +++ b/Function/BNGetSymbolBinding.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNSymbolBinding BNGetSymbolBinding(BNSymbol* sym) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetSymbolBinding" + )] + internal static extern SymbolBinding BNGetSymbolBinding( + + // BNSymbol* sym + IntPtr sym + ); + } +} \ No newline at end of file diff --git a/Function/BNGetSymbolByAddress.cs b/Function/BNGetSymbolByAddress.cs new file mode 100644 index 0000000..d794e16 --- /dev/null +++ b/Function/BNGetSymbolByAddress.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNSymbol* BNGetSymbolByAddress(BNBinaryView* view, uint64_t addr, BNNameSpace* nameSpace) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetSymbolByAddress" + )] + internal static extern IntPtr BNGetSymbolByAddress( + + // BNBinaryView* view + IntPtr view , + + // uint64_t addr + ulong addr , + + // BNNameSpace* _nameSpace + IntPtr ns + ); + } +} \ No newline at end of file diff --git a/Function/BNGetSymbolByRawName.cs b/Function/BNGetSymbolByRawName.cs new file mode 100644 index 0000000..3e906c9 --- /dev/null +++ b/Function/BNGetSymbolByRawName.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNSymbol* BNGetSymbolByRawName(BNBinaryView* view, const char* name, BNNameSpace* nameSpace) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetSymbolByRawName" + )] + internal static extern IntPtr BNGetSymbolByRawName( + + // BNBinaryView* view + IntPtr view , + + // const char* name + string name , + + // BNNameSpace* _nameSpace + IntPtr _nameSpace + ); + } +} \ No newline at end of file diff --git a/Function/BNGetSymbolFullName.cs b/Function/BNGetSymbolFullName.cs new file mode 100644 index 0000000..70390c1 --- /dev/null +++ b/Function/BNGetSymbolFullName.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// char* BNGetSymbolFullName(BNSymbol* sym) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetSymbolFullName" + )] + internal static extern IntPtr BNGetSymbolFullName( + + // BNSymbol* sym + IntPtr sym + ); + } +} \ No newline at end of file diff --git a/Function/BNGetSymbolFullNameRef.cs b/Function/BNGetSymbolFullNameRef.cs new file mode 100644 index 0000000..0a62c61 --- /dev/null +++ b/Function/BNGetSymbolFullNameRef.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNStringRef* BNGetSymbolFullNameRef(BNSymbol* sym) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetSymbolFullNameRef" + )] + internal static extern IntPtr BNGetSymbolFullNameRef( + + // BNSymbol* sym + IntPtr sym + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetSymbolNameSpace.cs b/Function/BNGetSymbolNameSpace.cs new file mode 100644 index 0000000..62ebdb6 --- /dev/null +++ b/Function/BNGetSymbolNameSpace.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNNameSpace BNGetSymbolNameSpace(BNSymbol* sym) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetSymbolNameSpace" + )] + internal static extern BNNameSpace BNGetSymbolNameSpace( + + // BNSymbol* sym + IntPtr sym + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetSymbolOrdinal.cs b/Function/BNGetSymbolOrdinal.cs new file mode 100644 index 0000000..42946e2 --- /dev/null +++ b/Function/BNGetSymbolOrdinal.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetSymbolOrdinal(BNSymbol* sym) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetSymbolOrdinal" + )] + internal static extern ulong BNGetSymbolOrdinal( + + // BNSymbol* sym + IntPtr sym + ); + } +} \ No newline at end of file diff --git a/Function/BNGetSymbolRawBytes.cs b/Function/BNGetSymbolRawBytes.cs new file mode 100644 index 0000000..2515f86 --- /dev/null +++ b/Function/BNGetSymbolRawBytes.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void* BNGetSymbolRawBytes(BNSymbol* sym, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetSymbolRawBytes" + )] + internal static extern IntPtr BNGetSymbolRawBytes( + + // BNSymbol* sym + IntPtr sym , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetSymbolRawName.cs b/Function/BNGetSymbolRawName.cs new file mode 100644 index 0000000..95441e4 --- /dev/null +++ b/Function/BNGetSymbolRawName.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// char* BNGetSymbolRawName(BNSymbol* sym) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetSymbolRawName" + )] + internal static extern IntPtr BNGetSymbolRawName( + + // BNSymbol* sym + IntPtr sym + ); + } +} \ No newline at end of file diff --git a/Function/BNGetSymbolRawNameRef.cs b/Function/BNGetSymbolRawNameRef.cs new file mode 100644 index 0000000..ca5789c --- /dev/null +++ b/Function/BNGetSymbolRawNameRef.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNStringRef* BNGetSymbolRawNameRef(BNSymbol* sym) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetSymbolRawNameRef" + )] + internal static extern IntPtr BNGetSymbolRawNameRef( + + // BNSymbol* sym + IntPtr sym + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetSymbolShortName.cs b/Function/BNGetSymbolShortName.cs new file mode 100644 index 0000000..bc6cfba --- /dev/null +++ b/Function/BNGetSymbolShortName.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// char* BNGetSymbolShortName(BNSymbol* sym) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetSymbolShortName" + )] + internal static extern IntPtr BNGetSymbolShortName( + + // BNSymbol* sym + IntPtr sym + ); + } +} \ No newline at end of file diff --git a/Function/BNGetSymbolShortNameRef.cs b/Function/BNGetSymbolShortNameRef.cs new file mode 100644 index 0000000..578488d --- /dev/null +++ b/Function/BNGetSymbolShortNameRef.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNStringRef* BNGetSymbolShortNameRef(BNSymbol* sym) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetSymbolShortNameRef" + )] + internal static extern IntPtr BNGetSymbolShortNameRef( + + // BNSymbol* sym + IntPtr sym + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetSymbolType.cs b/Function/BNGetSymbolType.cs new file mode 100644 index 0000000..688ffce --- /dev/null +++ b/Function/BNGetSymbolType.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNSymbolType BNGetSymbolType(BNSymbol* sym) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetSymbolType" + )] + internal static extern SymbolType BNGetSymbolType( + + // BNSymbol* sym + IntPtr sym + ); + } +} \ No newline at end of file diff --git a/Function/BNGetSymbols.cs b/Function/BNGetSymbols.cs new file mode 100644 index 0000000..e3e44d2 --- /dev/null +++ b/Function/BNGetSymbols.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNSymbol** BNGetSymbols(BNBinaryView* view, uint64_t* count, BNNameSpace* nameSpace) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetSymbols" + )] + internal static extern IntPtr BNGetSymbols( + + // BNBinaryView* view + IntPtr view , + + // uint64_t* count + out ulong count , + + // BNNameSpace* _nameSpace + IntPtr ns + ); + } +} \ No newline at end of file diff --git a/Function/BNGetSymbolsByName.cs b/Function/BNGetSymbolsByName.cs new file mode 100644 index 0000000..f4c52d9 --- /dev/null +++ b/Function/BNGetSymbolsByName.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNSymbol** BNGetSymbolsByName(BNBinaryView* view, const char* name, uint64_t* count, BNNameSpace* nameSpace) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetSymbolsByName" + )] + internal static extern IntPtr BNGetSymbolsByName( + + // BNBinaryView* view + IntPtr view , + + // const char* name + string name , + + // uint64_t* count + out ulong count , + + // BNNameSpace* _nameSpace + IntPtr _nameSpace + ); + } +} \ No newline at end of file diff --git a/Function/BNGetSymbolsByRawName.cs b/Function/BNGetSymbolsByRawName.cs new file mode 100644 index 0000000..a2fae59 --- /dev/null +++ b/Function/BNGetSymbolsByRawName.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNSymbol** BNGetSymbolsByRawName(BNBinaryView* view, const char* name, uint64_t* count, BNNameSpace* nameSpace) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetSymbolsByRawName" + )] + internal static extern IntPtr BNGetSymbolsByRawName( + + // BNBinaryView* view + IntPtr view , + + // const char* name + string name , + + // uint64_t* count + out ulong count , + + // BNNameSpace* _nameSpace + IntPtr _nameSpace + ); + } +} \ No newline at end of file diff --git a/Function/BNGetSymbolsInRange.cs b/Function/BNGetSymbolsInRange.cs new file mode 100644 index 0000000..a1fde85 --- /dev/null +++ b/Function/BNGetSymbolsInRange.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNSymbol** BNGetSymbolsInRange(BNBinaryView* view, uint64_t start, uint64_t len, uint64_t* count, BNNameSpace* nameSpace) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetSymbolsInRange" + )] + internal static extern IntPtr BNGetSymbolsInRange( + + // BNBinaryView* view + IntPtr view , + + // uint64_t start + ulong start , + + // uint64_t len + ulong len , + + // uint64_t* count + out ulong count , + + // BNNameSpace* _nameSpace + IntPtr _nameSpace + ); + } +} \ No newline at end of file diff --git a/Function/BNGetSymbolsOfType.cs b/Function/BNGetSymbolsOfType.cs new file mode 100644 index 0000000..0982128 --- /dev/null +++ b/Function/BNGetSymbolsOfType.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNSymbol** BNGetSymbolsOfType(BNBinaryView* view, BNSymbolType type, uint64_t* count, BNNameSpace* nameSpace) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetSymbolsOfType" + )] + internal static extern IntPtr BNGetSymbolsOfType( + + // BNBinaryView* view + IntPtr view , + + // BNSymbolType type + SymbolType type , + + // uint64_t* count + out ulong count , + + // BNNameSpace* _nameSpace + IntPtr _nameSpace + ); + } +} \ No newline at end of file diff --git a/Function/BNGetSymbolsOfTypeInRange.cs b/Function/BNGetSymbolsOfTypeInRange.cs new file mode 100644 index 0000000..b8acbde --- /dev/null +++ b/Function/BNGetSymbolsOfTypeInRange.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNSymbol** BNGetSymbolsOfTypeInRange(BNBinaryView* view, BNSymbolType type, uint64_t start, uint64_t len, uint64_t* count, BNNameSpace* nameSpace) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetSymbolsOfTypeInRange" + )] + internal static extern IntPtr BNGetSymbolsOfTypeInRange( + + // BNBinaryView* view + IntPtr view , + + // BNSymbolType type + SymbolType type , + + // uint64_t start + ulong start , + + // uint64_t len + ulong len , + + // uint64_t* count + out ulong count , + + // BNNameSpace* _nameSpace + IntPtr _nameSpace + ); + } +} \ No newline at end of file diff --git a/Function/BNGetSystemCacheDirectory.cs b/Function/BNGetSystemCacheDirectory.cs new file mode 100644 index 0000000..afc6301 --- /dev/null +++ b/Function/BNGetSystemCacheDirectory.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetSystemCacheDirectory() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetSystemCacheDirectory" + )] + internal static extern IntPtr BNGetSystemCacheDirectory( + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTag.cs b/Function/BNGetTag.cs new file mode 100644 index 0000000..e46883a --- /dev/null +++ b/Function/BNGetTag.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTag* BNGetTag(BNBinaryView* view, const char* tagId) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetTag" + )] + internal static extern IntPtr BNGetTag( + + // BNBinaryView* view + IntPtr view , + + // const char* tagId + string tagId + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTagReferencesOfType.cs b/Function/BNGetTagReferencesOfType.cs new file mode 100644 index 0000000..239f863 --- /dev/null +++ b/Function/BNGetTagReferencesOfType.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTagReference* BNGetTagReferencesOfType(BNBinaryView* view, BNTagType* tagType, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetTagReferencesOfType" + )] + internal static extern IntPtr BNGetTagReferencesOfType( + + // BNBinaryView* view + IntPtr view , + + // BNTagType* tagType + IntPtr tagType , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTagReferencesOfTypeCount.cs b/Function/BNGetTagReferencesOfTypeCount.cs new file mode 100644 index 0000000..81a1d6f --- /dev/null +++ b/Function/BNGetTagReferencesOfTypeCount.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetTagReferencesOfTypeCount(BNBinaryView* view, BNTagType* tagType) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetTagReferencesOfTypeCount" + )] + internal static extern ulong BNGetTagReferencesOfTypeCount( + + // BNBinaryView* view + IntPtr view , + + // BNTagType* tagType + IntPtr tagType + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTagType.cs b/Function/BNGetTagType.cs new file mode 100644 index 0000000..a1f8a83 --- /dev/null +++ b/Function/BNGetTagType.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTagType* BNGetTagType(BNBinaryView* view, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetTagType" + )] + internal static extern IntPtr BNGetTagType( + + // BNBinaryView* view + IntPtr view , + + // const char* name + string name + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTagTypeById.cs b/Function/BNGetTagTypeById.cs new file mode 100644 index 0000000..1d6f24e --- /dev/null +++ b/Function/BNGetTagTypeById.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTagType* BNGetTagTypeById(BNBinaryView* view, const char* id) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetTagTypeById" + )] + internal static extern IntPtr BNGetTagTypeById( + + // BNBinaryView* view + IntPtr view , + + // const char* id + string id + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTagTypeByIdWithType.cs b/Function/BNGetTagTypeByIdWithType.cs new file mode 100644 index 0000000..42bbd56 --- /dev/null +++ b/Function/BNGetTagTypeByIdWithType.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTagType* BNGetTagTypeByIdWithType(BNBinaryView* view, const char* id, BNTagTypeType type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetTagTypeByIdWithType" + )] + internal static extern IntPtr BNGetTagTypeByIdWithType( + + // BNBinaryView* view + IntPtr view , + + // const char* id + string id , + + // BNTagTypeType type + TagTypeType type + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTagTypeWithType.cs b/Function/BNGetTagTypeWithType.cs new file mode 100644 index 0000000..ccf5717 --- /dev/null +++ b/Function/BNGetTagTypeWithType.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTagType* BNGetTagTypeWithType(BNBinaryView* view, const char* name, BNTagTypeType type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetTagTypeWithType" + )] + internal static extern IntPtr BNGetTagTypeWithType( + + // BNBinaryView* view + IntPtr view , + + // const char* name + string name , + + // BNTagTypeType type + TagTypeType type + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTagTypes.cs b/Function/BNGetTagTypes.cs new file mode 100644 index 0000000..7197e58 --- /dev/null +++ b/Function/BNGetTagTypes.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTagType** BNGetTagTypes(BNBinaryView* view, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetTagTypes" + )] + internal static extern IntPtr BNGetTagTypes( + + // BNBinaryView* view + IntPtr view , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTemporaryFileContents.cs b/Function/BNGetTemporaryFileContents.cs new file mode 100644 index 0000000..ff77cf0 --- /dev/null +++ b/Function/BNGetTemporaryFileContents.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDataBuffer* BNGetTemporaryFileContents(BNTemporaryFile* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetTemporaryFileContents" + )] + internal static extern IntPtr BNGetTemporaryFileContents( + + // BNTemporaryFile* file + IntPtr file + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTemporaryFilePath.cs b/Function/BNGetTemporaryFilePath.cs new file mode 100644 index 0000000..a9572bd --- /dev/null +++ b/Function/BNGetTemporaryFilePath.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// char* BNGetTemporaryFilePath(BNTemporaryFile* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetTemporaryFilePath" + )] + internal static extern IntPtr BNGetTemporaryFilePath( + + // BNTemporaryFile* file + IntPtr file + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTextLineInput.cs b/Function/BNGetTextLineInput.cs new file mode 100644 index 0000000..6fa1b3e --- /dev/null +++ b/Function/BNGetTextLineInput.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public static partial class Core + { + public static string? GetTextLineInput(string prompt , string title ) + { + bool ok = NativeMethods.BNGetTextLineInput( + out IntPtr result , + prompt , + title + ); + + if (!ok) + { + return null; + } + + return UnsafeUtils.TakeUtf8String(result); + } + } + + internal static partial class NativeMethods + { + /// + /// bool BNGetTextLineInput(const char** result, const char* prompt, const char* title) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetTextLineInput" + )] + internal static extern bool BNGetTextLineInput( + + // char** result + out IntPtr result , + + // const char* prompt + string prompt , + + // const char* title + string title + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTimeSinceLastUpdateCheck.cs b/Function/BNGetTimeSinceLastUpdateCheck.cs new file mode 100644 index 0000000..35034e5 --- /dev/null +++ b/Function/BNGetTimeSinceLastUpdateCheck.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetTimeSinceLastUpdateCheck() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetTimeSinceLastUpdateCheck" + )] + internal static extern ulong BNGetTimeSinceLastUpdateCheck( + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTransformByName.cs b/Function/BNGetTransformByName.cs new file mode 100644 index 0000000..960f34d --- /dev/null +++ b/Function/BNGetTransformByName.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTransform* BNGetTransformByName(const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetTransformByName" + )] + internal static extern IntPtr BNGetTransformByName( + + // const char* name + string name + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTransformCapabilities.cs b/Function/BNGetTransformCapabilities.cs new file mode 100644 index 0000000..1be1303 --- /dev/null +++ b/Function/BNGetTransformCapabilities.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint32_t BNGetTransformCapabilities(BNTransform* xform) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetTransformCapabilities" + )] + internal static extern uint BNGetTransformCapabilities( + + // BNTransform* xform + IntPtr xform + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTransformGroup.cs b/Function/BNGetTransformGroup.cs new file mode 100644 index 0000000..d4d3f18 --- /dev/null +++ b/Function/BNGetTransformGroup.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// char* BNGetTransformGroup(BNTransform* xform) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetTransformGroup" + )] + internal static extern IntPtr BNGetTransformGroup( + + // BNTransform* xform + IntPtr xform + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTransformLongName.cs b/Function/BNGetTransformLongName.cs new file mode 100644 index 0000000..b9bbd51 --- /dev/null +++ b/Function/BNGetTransformLongName.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// char* BNGetTransformLongName(BNTransform* xform) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetTransformLongName" + )] + internal static extern IntPtr BNGetTransformLongName( + + // BNTransform* xform + IntPtr xform + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTransformName.cs b/Function/BNGetTransformName.cs new file mode 100644 index 0000000..f8ff38f --- /dev/null +++ b/Function/BNGetTransformName.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// char* BNGetTransformName(BNTransform* xform) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetTransformName" + )] + internal static extern IntPtr BNGetTransformName( + + // BNTransform* xform + IntPtr xform + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTransformParameterList.cs b/Function/BNGetTransformParameterList.cs new file mode 100644 index 0000000..96a8824 --- /dev/null +++ b/Function/BNGetTransformParameterList.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTransformParameterInfo* BNGetTransformParameterList(BNTransform* xform, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetTransformParameterList" + )] + internal static extern IntPtr BNGetTransformParameterList( + + // BNTransform* xform + IntPtr xform , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTransformType.cs b/Function/BNGetTransformType.cs new file mode 100644 index 0000000..03381b7 --- /dev/null +++ b/Function/BNGetTransformType.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTransformType BNGetTransformType(BNTransform* xform) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetTransformType" + )] + internal static extern TransformType BNGetTransformType( + + // BNTransform* xform + IntPtr xform + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTransformTypeList.cs b/Function/BNGetTransformTypeList.cs new file mode 100644 index 0000000..bc62d1a --- /dev/null +++ b/Function/BNGetTransformTypeList.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTransform** BNGetTransformTypeList(uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetTransformTypeList" + )] + internal static extern IntPtr BNGetTransformTypeList( + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeAlignment.cs b/Function/BNGetTypeAlignment.cs new file mode 100644 index 0000000..f1dfd11 --- /dev/null +++ b/Function/BNGetTypeAlignment.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetTypeAlignment(BNType* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetTypeAlignment" + )] + internal static extern ulong BNGetTypeAlignment( + + // BNType* type + IntPtr type + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeAlternateName.cs b/Function/BNGetTypeAlternateName.cs new file mode 100644 index 0000000..a3fef32 --- /dev/null +++ b/Function/BNGetTypeAlternateName.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// char* BNGetTypeAlternateName(BNType* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetTypeAlternateName" + )] + internal static extern IntPtr BNGetTypeAlternateName( + + // BNType* type + IntPtr type + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeAndName.cs b/Function/BNGetTypeAndName.cs new file mode 100644 index 0000000..bf90eea --- /dev/null +++ b/Function/BNGetTypeAndName.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetTypeAndName(BNType* type, BNQualifiedName* name, BNTokenEscapingType escaping) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetTypeAndName" + )] + internal static extern IntPtr BNGetTypeAndName( + + // BNType* type + IntPtr type , + + // BNQualifiedName* name + IntPtr name , + + // BNTokenEscapingType escaping + TokenEscapingType escaping + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeArchiveAllSnapshotIds.cs b/Function/BNGetTypeArchiveAllSnapshotIds.cs new file mode 100644 index 0000000..3015bdc --- /dev/null +++ b/Function/BNGetTypeArchiveAllSnapshotIds.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char** BNGetTypeArchiveAllSnapshotIds(BNTypeArchive* archive, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetTypeArchiveAllSnapshotIds" + )] + internal static extern IntPtr BNGetTypeArchiveAllSnapshotIds( + + // BNTypeArchive* archive + IntPtr archive , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeArchiveCurrentSnapshotId.cs b/Function/BNGetTypeArchiveCurrentSnapshotId.cs new file mode 100644 index 0000000..a90c057 --- /dev/null +++ b/Function/BNGetTypeArchiveCurrentSnapshotId.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetTypeArchiveCurrentSnapshotId(BNTypeArchive* archive) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetTypeArchiveCurrentSnapshotId" + )] + internal static extern IntPtr BNGetTypeArchiveCurrentSnapshotId( + + // BNTypeArchive* archive + IntPtr archive + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeArchiveId.cs b/Function/BNGetTypeArchiveId.cs new file mode 100644 index 0000000..a7bff86 --- /dev/null +++ b/Function/BNGetTypeArchiveId.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetTypeArchiveId(BNTypeArchive* archive) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetTypeArchiveId" + )] + internal static extern IntPtr BNGetTypeArchiveId( + + // BNTypeArchive* archive + IntPtr archive + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeArchiveIncomingDirectTypeReferences.cs b/Function/BNGetTypeArchiveIncomingDirectTypeReferences.cs new file mode 100644 index 0000000..44cd8a3 --- /dev/null +++ b/Function/BNGetTypeArchiveIncomingDirectTypeReferences.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char** BNGetTypeArchiveIncomingDirectTypeReferences(BNTypeArchive* archive, const char* id, const char* snapshot, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetTypeArchiveIncomingDirectTypeReferences" + )] + internal static extern IntPtr BNGetTypeArchiveIncomingDirectTypeReferences( + + // BNTypeArchive* archive + IntPtr archive , + + // const char* id + string id , + + // const char* snapshot + string snapshot , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeArchiveIncomingRecursiveTypeReferences.cs b/Function/BNGetTypeArchiveIncomingRecursiveTypeReferences.cs new file mode 100644 index 0000000..b0514bd --- /dev/null +++ b/Function/BNGetTypeArchiveIncomingRecursiveTypeReferences.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char** BNGetTypeArchiveIncomingRecursiveTypeReferences(BNTypeArchive* archive, const char* id, const char* snapshot, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetTypeArchiveIncomingRecursiveTypeReferences" + )] + internal static extern IntPtr BNGetTypeArchiveIncomingRecursiveTypeReferences( + + // BNTypeArchive* archive + IntPtr archive , + + // const char* id + string id , + + // const char* snapshot + string snapshot , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeArchiveOutgoingDirectTypeReferences.cs b/Function/BNGetTypeArchiveOutgoingDirectTypeReferences.cs new file mode 100644 index 0000000..3e989b4 --- /dev/null +++ b/Function/BNGetTypeArchiveOutgoingDirectTypeReferences.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char** BNGetTypeArchiveOutgoingDirectTypeReferences(BNTypeArchive* archive, const char* id, const char* snapshot, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetTypeArchiveOutgoingDirectTypeReferences" + )] + internal static extern IntPtr BNGetTypeArchiveOutgoingDirectTypeReferences( + + // BNTypeArchive* archive + IntPtr archive , + + // const char* id + string id , + + // const char* snapshot + string snapshot , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeArchiveOutgoingRecursiveTypeReferences.cs b/Function/BNGetTypeArchiveOutgoingRecursiveTypeReferences.cs new file mode 100644 index 0000000..1196c4c --- /dev/null +++ b/Function/BNGetTypeArchiveOutgoingRecursiveTypeReferences.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char** BNGetTypeArchiveOutgoingRecursiveTypeReferences(BNTypeArchive* archive, const char* id, const char* snapshot, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetTypeArchiveOutgoingRecursiveTypeReferences" + )] + internal static extern IntPtr BNGetTypeArchiveOutgoingRecursiveTypeReferences( + + // BNTypeArchive* archive + IntPtr archive , + + // const char* id + string id , + + // const char* snapshot + string snapshot , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeArchivePath.cs b/Function/BNGetTypeArchivePath.cs new file mode 100644 index 0000000..91addb5 --- /dev/null +++ b/Function/BNGetTypeArchivePath.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetTypeArchivePath(BNTypeArchive* archive) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetTypeArchivePath" + )] + internal static extern IntPtr BNGetTypeArchivePath( + + // BNTypeArchive* archive + IntPtr archive + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeArchivePlatform.cs b/Function/BNGetTypeArchivePlatform.cs new file mode 100644 index 0000000..5753afb --- /dev/null +++ b/Function/BNGetTypeArchivePlatform.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNPlatform* BNGetTypeArchivePlatform(BNTypeArchive* archive) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetTypeArchivePlatform" + )] + internal static extern IntPtr BNGetTypeArchivePlatform( + + // BNTypeArchive* archive + IntPtr archive + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeArchiveSnapshotChildIds.cs b/Function/BNGetTypeArchiveSnapshotChildIds.cs new file mode 100644 index 0000000..2c68582 --- /dev/null +++ b/Function/BNGetTypeArchiveSnapshotChildIds.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char** BNGetTypeArchiveSnapshotChildIds(BNTypeArchive* archive, const char* id, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetTypeArchiveSnapshotChildIds" + )] + internal static extern IntPtr BNGetTypeArchiveSnapshotChildIds( + + // BNTypeArchive* archive + IntPtr archive , + + // const char* id + string id , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeArchiveSnapshotParentIds.cs b/Function/BNGetTypeArchiveSnapshotParentIds.cs new file mode 100644 index 0000000..816e672 --- /dev/null +++ b/Function/BNGetTypeArchiveSnapshotParentIds.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char** BNGetTypeArchiveSnapshotParentIds(BNTypeArchive* archive, const char* id, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetTypeArchiveSnapshotParentIds" + )] + internal static extern IntPtr BNGetTypeArchiveSnapshotParentIds( + + // BNTypeArchive* archive + IntPtr archive , + + // const char* id + string id , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeArchiveTypeById.cs b/Function/BNGetTypeArchiveTypeById.cs new file mode 100644 index 0000000..ec14a65 --- /dev/null +++ b/Function/BNGetTypeArchiveTypeById.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNType* BNGetTypeArchiveTypeById(BNTypeArchive* archive, const char* id, const char* snapshot) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetTypeArchiveTypeById" + )] + internal static extern IntPtr BNGetTypeArchiveTypeById( + + // BNTypeArchive* archive + IntPtr archive , + + // const char* id + string id , + + // const char* snapshot + string snapshot + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeArchiveTypeByName.cs b/Function/BNGetTypeArchiveTypeByName.cs new file mode 100644 index 0000000..5e722ae --- /dev/null +++ b/Function/BNGetTypeArchiveTypeByName.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNType* BNGetTypeArchiveTypeByName(BNTypeArchive* archive, BNQualifiedName* name, const char* snapshot) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetTypeArchiveTypeByName" + )] + internal static extern IntPtr BNGetTypeArchiveTypeByName( + + // BNTypeArchive* archive + IntPtr archive , + + // BNQualifiedName* name + IntPtr name , + + // const char* snapshot + string snapshot + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeArchiveTypeContainer.cs b/Function/BNGetTypeArchiveTypeContainer.cs new file mode 100644 index 0000000..c60f0e4 --- /dev/null +++ b/Function/BNGetTypeArchiveTypeContainer.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeContainer* BNGetTypeArchiveTypeContainer(BNTypeArchive* archive) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetTypeArchiveTypeContainer" + )] + internal static extern IntPtr BNGetTypeArchiveTypeContainer( + + // BNTypeArchive* archive + IntPtr archive + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeArchiveTypeId.cs b/Function/BNGetTypeArchiveTypeId.cs new file mode 100644 index 0000000..1950f70 --- /dev/null +++ b/Function/BNGetTypeArchiveTypeId.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetTypeArchiveTypeId(BNTypeArchive* archive, BNQualifiedName* name, const char* snapshot) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetTypeArchiveTypeId" + )] + internal static extern IntPtr BNGetTypeArchiveTypeId( + + // BNTypeArchive* archive + IntPtr archive , + + // BNQualifiedName* name + IntPtr name , + + // const char* snapshot + string snapshot + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeArchiveTypeIds.cs b/Function/BNGetTypeArchiveTypeIds.cs new file mode 100644 index 0000000..10842e7 --- /dev/null +++ b/Function/BNGetTypeArchiveTypeIds.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char** BNGetTypeArchiveTypeIds(BNTypeArchive* archive, const char* snapshot, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetTypeArchiveTypeIds" + )] + internal static extern IntPtr BNGetTypeArchiveTypeIds( + + // BNTypeArchive* archive + IntPtr archive , + + // const char* snapshot + string snapshot , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeArchiveTypeName.cs b/Function/BNGetTypeArchiveTypeName.cs new file mode 100644 index 0000000..7b122f2 --- /dev/null +++ b/Function/BNGetTypeArchiveTypeName.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNQualifiedName BNGetTypeArchiveTypeName(BNTypeArchive* archive, const char* id, const char* snapshot) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetTypeArchiveTypeName" + )] + internal static extern BNQualifiedName BNGetTypeArchiveTypeName( + + // BNTypeArchive* archive + IntPtr archive , + + // const char* id + string id , + + // const char* snapshot + string snapshot + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeArchiveTypeNames.cs b/Function/BNGetTypeArchiveTypeNames.cs new file mode 100644 index 0000000..6a6d451 --- /dev/null +++ b/Function/BNGetTypeArchiveTypeNames.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNQualifiedName* BNGetTypeArchiveTypeNames(BNTypeArchive* archive, const char* snapshot, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetTypeArchiveTypeNames" + )] + internal static extern IntPtr BNGetTypeArchiveTypeNames( + + // BNTypeArchive* archive + IntPtr archive , + + // const char* snapshot + string snapshot , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeArchiveTypeNamesAndIds.cs b/Function/BNGetTypeArchiveTypeNamesAndIds.cs new file mode 100644 index 0000000..4c77642 --- /dev/null +++ b/Function/BNGetTypeArchiveTypeNamesAndIds.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNGetTypeArchiveTypeNamesAndIds(BNTypeArchive* archive, const char* snapshot, BNQualifiedName** names, const char*** ids, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetTypeArchiveTypeNamesAndIds" + )] + internal static extern bool BNGetTypeArchiveTypeNamesAndIds( + + // BNTypeArchive* archive + IntPtr archive , + + // const char* snapshot + string snapshot , + + // BNQualifiedName** names + IntPtr names , + + // const char*** ids + IntPtr ids , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeArchiveTypes.cs b/Function/BNGetTypeArchiveTypes.cs new file mode 100644 index 0000000..3fbdb05 --- /dev/null +++ b/Function/BNGetTypeArchiveTypes.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNQualifiedNameTypeAndId* BNGetTypeArchiveTypes(BNTypeArchive* archive, const char* snapshot, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetTypeArchiveTypes" + )] + internal static extern IntPtr BNGetTypeArchiveTypes( + + // BNTypeArchive* archive + IntPtr archive , + + // const char* snapshot + string snapshot , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeAttributeByName.cs b/Function/BNGetTypeAttributeByName.cs new file mode 100644 index 0000000..ea088492 --- /dev/null +++ b/Function/BNGetTypeAttributeByName.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetTypeAttributeByName(BNType* type, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetTypeAttributeByName" + )] + internal static extern IntPtr BNGetTypeAttributeByName( + + // BNType* type + IntPtr type , + + // const char* name + string name + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeAttributes.cs b/Function/BNGetTypeAttributes.cs new file mode 100644 index 0000000..80b5810 --- /dev/null +++ b/Function/BNGetTypeAttributes.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeAttribute* BNGetTypeAttributes(BNType* type, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetTypeAttributes" + )] + internal static extern IntPtr BNGetTypeAttributes( + + // BNType* type + IntPtr type , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeBuilderAlignment.cs b/Function/BNGetTypeBuilderAlignment.cs new file mode 100644 index 0000000..1900808 --- /dev/null +++ b/Function/BNGetTypeBuilderAlignment.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetTypeBuilderAlignment(BNTypeBuilder* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetTypeBuilderAlignment" + )] + internal static extern ulong BNGetTypeBuilderAlignment( + + // BNTypeBuilder* type + IntPtr type + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeBuilderAlternateName.cs b/Function/BNGetTypeBuilderAlternateName.cs new file mode 100644 index 0000000..a99156e --- /dev/null +++ b/Function/BNGetTypeBuilderAlternateName.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// char* BNGetTypeBuilderAlternateName(BNTypeBuilder* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetTypeBuilderAlternateName" + )] + internal static extern IntPtr BNGetTypeBuilderAlternateName( + + // BNTypeBuilder* type + IntPtr type + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeBuilderAttributeByName.cs b/Function/BNGetTypeBuilderAttributeByName.cs new file mode 100644 index 0000000..8bb4917 --- /dev/null +++ b/Function/BNGetTypeBuilderAttributeByName.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetTypeBuilderAttributeByName(BNTypeBuilder* type, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetTypeBuilderAttributeByName" + )] + internal static extern IntPtr BNGetTypeBuilderAttributeByName( + + // BNTypeBuilder* type + IntPtr type , + + // const char* name + string name + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeBuilderAttributes.cs b/Function/BNGetTypeBuilderAttributes.cs new file mode 100644 index 0000000..ab81a85 --- /dev/null +++ b/Function/BNGetTypeBuilderAttributes.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeAttribute* BNGetTypeBuilderAttributes(BNTypeBuilder* type, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetTypeBuilderAttributes" + )] + internal static extern IntPtr BNGetTypeBuilderAttributes( + + // BNTypeBuilder* type + IntPtr type , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeBuilderCallingConvention.cs b/Function/BNGetTypeBuilderCallingConvention.cs new file mode 100644 index 0000000..97770dd --- /dev/null +++ b/Function/BNGetTypeBuilderCallingConvention.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNCallingConventionWithConfidence BNGetTypeBuilderCallingConvention(BNTypeBuilder* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetTypeBuilderCallingConvention" + )] + internal static extern BNCallingConventionWithConfidence BNGetTypeBuilderCallingConvention( + + // BNTypeBuilder* type + IntPtr type + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeBuilderCallingConventionName.cs b/Function/BNGetTypeBuilderCallingConventionName.cs new file mode 100644 index 0000000..3e01c6b --- /dev/null +++ b/Function/BNGetTypeBuilderCallingConventionName.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNCallingConventionName BNGetTypeBuilderCallingConventionName(BNTypeBuilder* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetTypeBuilderCallingConventionName" + )] + internal static extern CallingConventionName BNGetTypeBuilderCallingConventionName( + + // BNTypeBuilder* type + IntPtr type + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeBuilderChildType.cs b/Function/BNGetTypeBuilderChildType.cs new file mode 100644 index 0000000..53b13bc --- /dev/null +++ b/Function/BNGetTypeBuilderChildType.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeWithConfidence BNGetTypeBuilderChildType(BNTypeBuilder* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetTypeBuilderChildType" + )] + internal static extern BNTypeWithConfidence BNGetTypeBuilderChildType( + + // BNTypeBuilder* type + IntPtr type + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeBuilderClass.cs b/Function/BNGetTypeBuilderClass.cs new file mode 100644 index 0000000..473e0a1 --- /dev/null +++ b/Function/BNGetTypeBuilderClass.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeClass BNGetTypeBuilderClass(BNTypeBuilder* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetTypeBuilderClass" + )] + internal static extern TypeClass BNGetTypeBuilderClass( + + // BNTypeBuilder* type + IntPtr type + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeBuilderElementCount.cs b/Function/BNGetTypeBuilderElementCount.cs new file mode 100644 index 0000000..b3f3049 --- /dev/null +++ b/Function/BNGetTypeBuilderElementCount.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetTypeBuilderElementCount(BNTypeBuilder* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetTypeBuilderElementCount" + )] + internal static extern ulong BNGetTypeBuilderElementCount( + + // BNTypeBuilder* type + IntPtr type + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeBuilderEnumeration.cs b/Function/BNGetTypeBuilderEnumeration.cs new file mode 100644 index 0000000..df361bb --- /dev/null +++ b/Function/BNGetTypeBuilderEnumeration.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNEnumeration* BNGetTypeBuilderEnumeration(BNTypeBuilder* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetTypeBuilderEnumeration" + )] + internal static extern IntPtr BNGetTypeBuilderEnumeration( + + // BNTypeBuilder* type + IntPtr type + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeBuilderNameType.cs b/Function/BNGetTypeBuilderNameType.cs new file mode 100644 index 0000000..86f5535 --- /dev/null +++ b/Function/BNGetTypeBuilderNameType.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNNameType BNGetTypeBuilderNameType(BNTypeBuilder* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetTypeBuilderNameType" + )] + internal static extern NameType BNGetTypeBuilderNameType( + + // BNTypeBuilder* type + IntPtr type + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeBuilderNamedTypeReference.cs b/Function/BNGetTypeBuilderNamedTypeReference.cs new file mode 100644 index 0000000..568982c --- /dev/null +++ b/Function/BNGetTypeBuilderNamedTypeReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNNamedTypeReference* BNGetTypeBuilderNamedTypeReference(BNTypeBuilder* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetTypeBuilderNamedTypeReference" + )] + internal static extern IntPtr BNGetTypeBuilderNamedTypeReference( + + // BNTypeBuilder* type + IntPtr type + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeBuilderOffset.cs b/Function/BNGetTypeBuilderOffset.cs new file mode 100644 index 0000000..3988c2f --- /dev/null +++ b/Function/BNGetTypeBuilderOffset.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetTypeBuilderOffset(BNTypeBuilder* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetTypeBuilderOffset" + )] + internal static extern ulong BNGetTypeBuilderOffset( + + // BNTypeBuilder* type + IntPtr type + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeBuilderParameters.cs b/Function/BNGetTypeBuilderParameters.cs new file mode 100644 index 0000000..e31d28e --- /dev/null +++ b/Function/BNGetTypeBuilderParameters.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFunctionParameter* BNGetTypeBuilderParameters(BNTypeBuilder* type, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetTypeBuilderParameters" + )] + internal static extern IntPtr BNGetTypeBuilderParameters( + + // BNTypeBuilder* type + IntPtr type , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeBuilderPointerSuffix.cs b/Function/BNGetTypeBuilderPointerSuffix.cs new file mode 100644 index 0000000..0d163b1 --- /dev/null +++ b/Function/BNGetTypeBuilderPointerSuffix.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNPointerSuffix* BNGetTypeBuilderPointerSuffix(BNTypeBuilder* type, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetTypeBuilderPointerSuffix" + )] + internal static extern IntPtr BNGetTypeBuilderPointerSuffix( + + // BNTypeBuilder* type + IntPtr type , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeBuilderPointerSuffixString.cs b/Function/BNGetTypeBuilderPointerSuffixString.cs new file mode 100644 index 0000000..d18cedb --- /dev/null +++ b/Function/BNGetTypeBuilderPointerSuffixString.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetTypeBuilderPointerSuffixString(BNTypeBuilder* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetTypeBuilderPointerSuffixString" + )] + internal static extern IntPtr BNGetTypeBuilderPointerSuffixString( + + // BNTypeBuilder* type + IntPtr type + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeBuilderPointerSuffixTokens.cs b/Function/BNGetTypeBuilderPointerSuffixTokens.cs new file mode 100644 index 0000000..7b6369e --- /dev/null +++ b/Function/BNGetTypeBuilderPointerSuffixTokens.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNInstructionTextToken* BNGetTypeBuilderPointerSuffixTokens(BNTypeBuilder* type, uint8_t baseConfidence, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetTypeBuilderPointerSuffixTokens" + )] + internal static extern IntPtr BNGetTypeBuilderPointerSuffixTokens( + + // BNTypeBuilder* type + IntPtr type , + + // uint8_t baseConfidence + byte baseConfidence , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeBuilderStackAdjustment.cs b/Function/BNGetTypeBuilderStackAdjustment.cs new file mode 100644 index 0000000..9202195 --- /dev/null +++ b/Function/BNGetTypeBuilderStackAdjustment.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNOffsetWithConfidence BNGetTypeBuilderStackAdjustment(BNTypeBuilder* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetTypeBuilderStackAdjustment" + )] + internal static extern BNOffsetWithConfidence BNGetTypeBuilderStackAdjustment( + + // BNTypeBuilder* type + IntPtr type + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeBuilderString.cs b/Function/BNGetTypeBuilderString.cs new file mode 100644 index 0000000..335d430 --- /dev/null +++ b/Function/BNGetTypeBuilderString.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetTypeBuilderString(BNTypeBuilder* type, BNPlatform* platform) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetTypeBuilderString" + )] + internal static extern IntPtr BNGetTypeBuilderString( + + // BNTypeBuilder* type + IntPtr type , + + // BNPlatform* platform + IntPtr platform + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeBuilderStringAfterName.cs b/Function/BNGetTypeBuilderStringAfterName.cs new file mode 100644 index 0000000..98d6dfa --- /dev/null +++ b/Function/BNGetTypeBuilderStringAfterName.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetTypeBuilderStringAfterName(BNTypeBuilder* type, BNPlatform* platform) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetTypeBuilderStringAfterName" + )] + internal static extern IntPtr BNGetTypeBuilderStringAfterName( + + // BNTypeBuilder* type + IntPtr type , + + // BNPlatform* platform + IntPtr platform + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeBuilderStringBeforeName.cs b/Function/BNGetTypeBuilderStringBeforeName.cs new file mode 100644 index 0000000..bbea9fa --- /dev/null +++ b/Function/BNGetTypeBuilderStringBeforeName.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetTypeBuilderStringBeforeName(BNTypeBuilder* type, BNPlatform* platform) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetTypeBuilderStringBeforeName" + )] + internal static extern IntPtr BNGetTypeBuilderStringBeforeName( + + // BNTypeBuilder* type + IntPtr type , + + // BNPlatform* platform + IntPtr platform + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeBuilderStructure.cs b/Function/BNGetTypeBuilderStructure.cs new file mode 100644 index 0000000..37cdb55 --- /dev/null +++ b/Function/BNGetTypeBuilderStructure.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNStructure* BNGetTypeBuilderStructure(BNTypeBuilder* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetTypeBuilderStructure" + )] + internal static extern IntPtr BNGetTypeBuilderStructure( + + // BNTypeBuilder* type + IntPtr type + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeBuilderTokens.cs b/Function/BNGetTypeBuilderTokens.cs new file mode 100644 index 0000000..11e7d26 --- /dev/null +++ b/Function/BNGetTypeBuilderTokens.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNInstructionTextToken* BNGetTypeBuilderTokens(BNTypeBuilder* type, BNPlatform* platform, uint8_t baseConfidence, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetTypeBuilderTokens" + )] + internal static extern IntPtr BNGetTypeBuilderTokens( + + // BNTypeBuilder* type + IntPtr type , + + // BNPlatform* platform + IntPtr platform , + + // uint8_t baseConfidence + byte baseConfidence , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeBuilderTokensAfterName.cs b/Function/BNGetTypeBuilderTokensAfterName.cs new file mode 100644 index 0000000..03b6663 --- /dev/null +++ b/Function/BNGetTypeBuilderTokensAfterName.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNInstructionTextToken* BNGetTypeBuilderTokensAfterName(BNTypeBuilder* type, BNPlatform* platform, uint8_t baseConfidence, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetTypeBuilderTokensAfterName" + )] + internal static extern IntPtr BNGetTypeBuilderTokensAfterName( + + // BNTypeBuilder* type + IntPtr type , + + // BNPlatform* platform + IntPtr platform , + + // uint8_t baseConfidence + byte baseConfidence , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeBuilderTokensBeforeName.cs b/Function/BNGetTypeBuilderTokensBeforeName.cs new file mode 100644 index 0000000..4251cba --- /dev/null +++ b/Function/BNGetTypeBuilderTokensBeforeName.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNInstructionTextToken* BNGetTypeBuilderTokensBeforeName(BNTypeBuilder* type, BNPlatform* platform, uint8_t baseConfidence, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetTypeBuilderTokensBeforeName" + )] + internal static extern IntPtr BNGetTypeBuilderTokensBeforeName( + + // BNTypeBuilder* type + IntPtr type , + + // BNPlatform* platform + IntPtr platform , + + // uint8_t baseConfidence + byte baseConfidence , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeBuilderTypeAndName.cs b/Function/BNGetTypeBuilderTypeAndName.cs new file mode 100644 index 0000000..5233c2c --- /dev/null +++ b/Function/BNGetTypeBuilderTypeAndName.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetTypeBuilderTypeAndName(BNTypeBuilder* type, BNQualifiedName* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetTypeBuilderTypeAndName" + )] + internal static extern IntPtr BNGetTypeBuilderTypeAndName( + + // BNTypeBuilder* type + IntPtr type , + + // BNQualifiedName* name + IntPtr name + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeBuilderWidth.cs b/Function/BNGetTypeBuilderWidth.cs new file mode 100644 index 0000000..ef6dcb0 --- /dev/null +++ b/Function/BNGetTypeBuilderWidth.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetTypeBuilderWidth(BNTypeBuilder* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetTypeBuilderWidth" + )] + internal static extern ulong BNGetTypeBuilderWidth( + + // BNTypeBuilder* type + IntPtr type + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeCallingConvention.cs b/Function/BNGetTypeCallingConvention.cs new file mode 100644 index 0000000..8588424 --- /dev/null +++ b/Function/BNGetTypeCallingConvention.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNCallingConventionWithConfidence BNGetTypeCallingConvention(BNType* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetTypeCallingConvention" + )] + internal static extern BNCallingConventionWithConfidence BNGetTypeCallingConvention( + + // BNType* type + IntPtr type + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeCallingConventionName.cs b/Function/BNGetTypeCallingConventionName.cs new file mode 100644 index 0000000..bd1cbdd --- /dev/null +++ b/Function/BNGetTypeCallingConventionName.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNCallingConventionName BNGetTypeCallingConventionName(BNType* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetTypeCallingConventionName" + )] + internal static extern CallingConventionName BNGetTypeCallingConventionName( + + // BNType* type + IntPtr type + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeClass.cs b/Function/BNGetTypeClass.cs new file mode 100644 index 0000000..d144f54 --- /dev/null +++ b/Function/BNGetTypeClass.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeClass BNGetTypeClass(BNType* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetTypeClass" + )] + internal static extern TypeClass BNGetTypeClass( + + // BNType* type + IntPtr type + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeElementCount.cs b/Function/BNGetTypeElementCount.cs new file mode 100644 index 0000000..3f8662c --- /dev/null +++ b/Function/BNGetTypeElementCount.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetTypeElementCount(BNType* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetTypeElementCount" + )] + internal static extern ulong BNGetTypeElementCount( + + // BNType* type + IntPtr type + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeEnumeration.cs b/Function/BNGetTypeEnumeration.cs new file mode 100644 index 0000000..5212be1 --- /dev/null +++ b/Function/BNGetTypeEnumeration.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNEnumeration* BNGetTypeEnumeration(BNType* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetTypeEnumeration" + )] + internal static extern IntPtr BNGetTypeEnumeration( + + // BNType* type + IntPtr type + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeLibraryAlternateNames.cs b/Function/BNGetTypeLibraryAlternateNames.cs new file mode 100644 index 0000000..1ad6c62 --- /dev/null +++ b/Function/BNGetTypeLibraryAlternateNames.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char** BNGetTypeLibraryAlternateNames(BNTypeLibrary* lib, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetTypeLibraryAlternateNames" + )] + internal static extern IntPtr BNGetTypeLibraryAlternateNames( + + // BNTypeLibrary* lib + IntPtr lib , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeLibraryArchitecture.cs b/Function/BNGetTypeLibraryArchitecture.cs new file mode 100644 index 0000000..258e180 --- /dev/null +++ b/Function/BNGetTypeLibraryArchitecture.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNArchitecture* BNGetTypeLibraryArchitecture(BNTypeLibrary* lib) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetTypeLibraryArchitecture" + )] + internal static extern IntPtr BNGetTypeLibraryArchitecture( + + // BNTypeLibrary* lib + IntPtr lib + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeLibraryDependencyName.cs b/Function/BNGetTypeLibraryDependencyName.cs new file mode 100644 index 0000000..51afdeb --- /dev/null +++ b/Function/BNGetTypeLibraryDependencyName.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetTypeLibraryDependencyName(BNTypeLibrary* lib) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetTypeLibraryDependencyName" + )] + internal static extern IntPtr BNGetTypeLibraryDependencyName( + + // BNTypeLibrary* lib + IntPtr lib + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeLibraryGuid.cs b/Function/BNGetTypeLibraryGuid.cs new file mode 100644 index 0000000..a8278fc --- /dev/null +++ b/Function/BNGetTypeLibraryGuid.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetTypeLibraryGuid(BNTypeLibrary* lib) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetTypeLibraryGuid" + )] + internal static extern IntPtr BNGetTypeLibraryGuid( + + // BNTypeLibrary* lib + IntPtr lib + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeLibraryName.cs b/Function/BNGetTypeLibraryName.cs new file mode 100644 index 0000000..1365b86 --- /dev/null +++ b/Function/BNGetTypeLibraryName.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetTypeLibraryName(BNTypeLibrary* lib) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetTypeLibraryName" + )] + internal static extern IntPtr BNGetTypeLibraryName( + + // BNTypeLibrary* lib + IntPtr lib + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeLibraryNamedObject.cs b/Function/BNGetTypeLibraryNamedObject.cs new file mode 100644 index 0000000..4815b3d --- /dev/null +++ b/Function/BNGetTypeLibraryNamedObject.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNType* BNGetTypeLibraryNamedObject(BNTypeLibrary* lib, BNQualifiedName* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetTypeLibraryNamedObject" + )] + internal static extern IntPtr BNGetTypeLibraryNamedObject( + + // BNTypeLibrary* lib + IntPtr lib , + + // BNQualifiedName* name + in BNQualifiedName name + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeLibraryNamedObjects.cs b/Function/BNGetTypeLibraryNamedObjects.cs new file mode 100644 index 0000000..b97d379 --- /dev/null +++ b/Function/BNGetTypeLibraryNamedObjects.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNQualifiedNameAndType* BNGetTypeLibraryNamedObjects(BNTypeLibrary* lib, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetTypeLibraryNamedObjects" + )] + internal static extern IntPtr BNGetTypeLibraryNamedObjects( + + // BNTypeLibrary* lib + IntPtr lib , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeLibraryNamedType.cs b/Function/BNGetTypeLibraryNamedType.cs new file mode 100644 index 0000000..93d673e --- /dev/null +++ b/Function/BNGetTypeLibraryNamedType.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNType* BNGetTypeLibraryNamedType(BNTypeLibrary* lib, BNQualifiedName* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetTypeLibraryNamedType" + )] + internal static extern IntPtr BNGetTypeLibraryNamedType( + + // BNTypeLibrary* lib + IntPtr lib , + + // BNQualifiedName* name + in BNQualifiedName name + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeLibraryNamedTypes.cs b/Function/BNGetTypeLibraryNamedTypes.cs new file mode 100644 index 0000000..0894ce5 --- /dev/null +++ b/Function/BNGetTypeLibraryNamedTypes.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNQualifiedNameAndType* BNGetTypeLibraryNamedTypes(BNTypeLibrary* lib, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetTypeLibraryNamedTypes" + )] + internal static extern IntPtr BNGetTypeLibraryNamedTypes( + + // BNTypeLibrary* lib + IntPtr lib , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeLibraryPlatforms.cs b/Function/BNGetTypeLibraryPlatforms.cs new file mode 100644 index 0000000..8195d2c --- /dev/null +++ b/Function/BNGetTypeLibraryPlatforms.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// char** BNGetTypeLibraryPlatforms(BNTypeLibrary* lib, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetTypeLibraryPlatforms" + )] + internal static extern IntPtr BNGetTypeLibraryPlatforms( + + // BNTypeLibrary* lib + IntPtr lib , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeLibraryTypeContainer.cs b/Function/BNGetTypeLibraryTypeContainer.cs new file mode 100644 index 0000000..a9d02a3 --- /dev/null +++ b/Function/BNGetTypeLibraryTypeContainer.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeContainer* BNGetTypeLibraryTypeContainer(BNTypeLibrary* lib) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetTypeLibraryTypeContainer" + )] + internal static extern IntPtr BNGetTypeLibraryTypeContainer( + + // BNTypeLibrary* lib + IntPtr lib + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeLines.cs b/Function/BNGetTypeLines.cs new file mode 100644 index 0000000..2bc9340 --- /dev/null +++ b/Function/BNGetTypeLines.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeDefinitionLine* BNGetTypeLines(BNType* type, BNTypeContainer* types, const char* name, int32_t paddingCols, bool collapsed, BNTokenEscapingType escaping, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetTypeLines" + )] + internal static extern IntPtr BNGetTypeLines( + + // BNType* type + IntPtr type , + + // BNTypeContainer* types + IntPtr types , + + // const char* name + string name , + + // int32_t paddingCols + int paddingCols , + + // bool collapsed + bool collapsed , + + // BNTokenEscapingType escaping + TokenEscapingType escaping , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeNamedTypeReference.cs b/Function/BNGetTypeNamedTypeReference.cs new file mode 100644 index 0000000..a778f6e --- /dev/null +++ b/Function/BNGetTypeNamedTypeReference.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNNamedTypeReference* BNGetTypeNamedTypeReference(BNType* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetTypeNamedTypeReference" + )] + internal static extern IntPtr BNGetTypeNamedTypeReference( + + // BNType* type + IntPtr type + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeOffset.cs b/Function/BNGetTypeOffset.cs new file mode 100644 index 0000000..04ddb2a --- /dev/null +++ b/Function/BNGetTypeOffset.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetTypeOffset(BNType* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetTypeOffset" + )] + internal static extern ulong BNGetTypeOffset( + + // BNType* type + IntPtr type + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeParameters.cs b/Function/BNGetTypeParameters.cs new file mode 100644 index 0000000..18f74ed --- /dev/null +++ b/Function/BNGetTypeParameters.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFunctionParameter* BNGetTypeParameters(BNType* type, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetTypeParameters" + )] + internal static extern IntPtr BNGetTypeParameters( + + // BNType* type + IntPtr type , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeParserByName.cs b/Function/BNGetTypeParserByName.cs new file mode 100644 index 0000000..97b19cc --- /dev/null +++ b/Function/BNGetTypeParserByName.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeParser* BNGetTypeParserByName(const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetTypeParserByName" + )] + internal static extern IntPtr BNGetTypeParserByName( + + // const char* name + string name + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeParserList.cs b/Function/BNGetTypeParserList.cs new file mode 100644 index 0000000..ddd19c6 --- /dev/null +++ b/Function/BNGetTypeParserList.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeParser** BNGetTypeParserList(uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetTypeParserList" + )] + internal static extern IntPtr BNGetTypeParserList( + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeParserName.cs b/Function/BNGetTypeParserName.cs new file mode 100644 index 0000000..9e20493 --- /dev/null +++ b/Function/BNGetTypeParserName.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetTypeParserName(BNTypeParser* parser) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetTypeParserName" + )] + internal static extern IntPtr BNGetTypeParserName( + + // BNTypeParser* parser + IntPtr parser + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeParserOptionText.cs b/Function/BNGetTypeParserOptionText.cs new file mode 100644 index 0000000..4c54fb7 --- /dev/null +++ b/Function/BNGetTypeParserOptionText.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNGetTypeParserOptionText(BNTypeParser* parser, BNTypeParserOption option, const char* value, const char** result) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetTypeParserOptionText" + )] + internal static extern bool BNGetTypeParserOptionText( + + // BNTypeParser* parser + IntPtr parser , + + // BNTypeParserOption option + TypeParserOption option , + + // const char* _value + string _value , + + // const char** result + string[] result + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypePointerSuffix.cs b/Function/BNGetTypePointerSuffix.cs new file mode 100644 index 0000000..f8b6a81 --- /dev/null +++ b/Function/BNGetTypePointerSuffix.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNPointerSuffix* BNGetTypePointerSuffix(BNType* type, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetTypePointerSuffix" + )] + internal static extern IntPtr BNGetTypePointerSuffix( + + // BNType* type + IntPtr type , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypePointerSuffixString.cs b/Function/BNGetTypePointerSuffixString.cs new file mode 100644 index 0000000..f9d4eab --- /dev/null +++ b/Function/BNGetTypePointerSuffixString.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + + + internal static partial class NativeMethods + { + /// + /// char* BNGetTypePointerSuffixString(BNType* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetTypePointerSuffixString" + )] + internal static extern IntPtr BNGetTypePointerSuffixString( + + // BNType* type + IntPtr type + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypePointerSuffixTokens.cs b/Function/BNGetTypePointerSuffixTokens.cs new file mode 100644 index 0000000..ad9e7fe --- /dev/null +++ b/Function/BNGetTypePointerSuffixTokens.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNInstructionTextToken* BNGetTypePointerSuffixTokens(BNType* type, uint8_t baseConfidence, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetTypePointerSuffixTokens" + )] + internal static extern IntPtr BNGetTypePointerSuffixTokens( + + // BNType* type + IntPtr type , + + // uint8_t baseConfidence + byte baseConfidence , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypePrinterByName.cs b/Function/BNGetTypePrinterByName.cs new file mode 100644 index 0000000..60993c0 --- /dev/null +++ b/Function/BNGetTypePrinterByName.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypePrinter* BNGetTypePrinterByName(const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetTypePrinterByName" + )] + internal static extern IntPtr BNGetTypePrinterByName( + + // const char* name + string name + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypePrinterList.cs b/Function/BNGetTypePrinterList.cs new file mode 100644 index 0000000..3286e00 --- /dev/null +++ b/Function/BNGetTypePrinterList.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypePrinter** BNGetTypePrinterList(uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetTypePrinterList" + )] + internal static extern IntPtr BNGetTypePrinterList( + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypePrinterName.cs b/Function/BNGetTypePrinterName.cs new file mode 100644 index 0000000..661bae5 --- /dev/null +++ b/Function/BNGetTypePrinterName.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetTypePrinterName(BNTypePrinter* printer) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetTypePrinterName" + )] + internal static extern IntPtr BNGetTypePrinterName( + + // BNTypePrinter* printer + IntPtr printer + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypePrinterTypeLines.cs b/Function/BNGetTypePrinterTypeLines.cs new file mode 100644 index 0000000..58d4907 --- /dev/null +++ b/Function/BNGetTypePrinterTypeLines.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNGetTypePrinterTypeLines(BNTypePrinter* printer, BNType* type, BNTypeContainer* types, BNQualifiedName* name, int32_t paddingCols, bool collapsed, BNTokenEscapingType escaping, BNTypeDefinitionLine** result, uint64_t* resultCount) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetTypePrinterTypeLines" + )] + internal static extern bool BNGetTypePrinterTypeLines( + + // BNTypePrinter* printer + IntPtr printer , + + // BNType* type + IntPtr type , + + // BNTypeContainer* types + IntPtr types , + + // BNQualifiedName* name + IntPtr name , + + // int32_t paddingCols + int paddingCols , + + // bool collapsed + bool collapsed , + + // BNTokenEscapingType escaping + TokenEscapingType escaping , + + // BNTypeDefinitionLine** result + IntPtr result , + + // uint64_t* resultCount + IntPtr resultCount + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypePrinterTypeString.cs b/Function/BNGetTypePrinterTypeString.cs new file mode 100644 index 0000000..a80abfc --- /dev/null +++ b/Function/BNGetTypePrinterTypeString.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNGetTypePrinterTypeString(BNTypePrinter* printer, BNType* type, BNPlatform* platform, BNQualifiedName* name, BNTokenEscapingType escaping, const char** result) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetTypePrinterTypeString" + )] + internal static extern bool BNGetTypePrinterTypeString( + + // BNTypePrinter* printer + IntPtr printer , + + // BNType* type + IntPtr type , + + // BNPlatform* platform + IntPtr platform , + + // BNQualifiedName* name + IntPtr name , + + // BNTokenEscapingType escaping + TokenEscapingType escaping , + + // const char** result + string[] result + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypePrinterTypeStringAfterName.cs b/Function/BNGetTypePrinterTypeStringAfterName.cs new file mode 100644 index 0000000..3731f5e --- /dev/null +++ b/Function/BNGetTypePrinterTypeStringAfterName.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNGetTypePrinterTypeStringAfterName(BNTypePrinter* printer, BNType* type, BNPlatform* platform, BNTokenEscapingType escaping, const char** result) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetTypePrinterTypeStringAfterName" + )] + internal static extern bool BNGetTypePrinterTypeStringAfterName( + + // BNTypePrinter* printer + IntPtr printer , + + // BNType* type + IntPtr type , + + // BNPlatform* platform + IntPtr platform , + + // BNTokenEscapingType escaping + TokenEscapingType escaping , + + // const char** result + string[] result + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypePrinterTypeStringBeforeName.cs b/Function/BNGetTypePrinterTypeStringBeforeName.cs new file mode 100644 index 0000000..673f4e9 --- /dev/null +++ b/Function/BNGetTypePrinterTypeStringBeforeName.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNGetTypePrinterTypeStringBeforeName(BNTypePrinter* printer, BNType* type, BNPlatform* platform, BNTokenEscapingType escaping, const char** result) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetTypePrinterTypeStringBeforeName" + )] + internal static extern bool BNGetTypePrinterTypeStringBeforeName( + + // BNTypePrinter* printer + IntPtr printer , + + // BNType* type + IntPtr type , + + // BNPlatform* platform + IntPtr platform , + + // BNTokenEscapingType escaping + TokenEscapingType escaping , + + // const char** result + string[] result + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypePrinterTypeTokens.cs b/Function/BNGetTypePrinterTypeTokens.cs new file mode 100644 index 0000000..fb9bafb --- /dev/null +++ b/Function/BNGetTypePrinterTypeTokens.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNGetTypePrinterTypeTokens(BNTypePrinter* printer, BNType* type, BNPlatform* platform, BNQualifiedName* name, uint8_t baseConfidence, BNTokenEscapingType escaping, BNInstructionTextToken** result, uint64_t* resultCount) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetTypePrinterTypeTokens" + )] + internal static extern bool BNGetTypePrinterTypeTokens( + + // BNTypePrinter* printer + IntPtr printer , + + // BNType* type + IntPtr type , + + // BNPlatform* platform + IntPtr platform , + + // BNQualifiedName* name + IntPtr name , + + // uint8_t baseConfidence + byte baseConfidence , + + // BNTokenEscapingType escaping + TokenEscapingType escaping , + + // BNInstructionTextToken** result + IntPtr result , + + // uint64_t* resultCount + IntPtr resultCount + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypePrinterTypeTokensAfterName.cs b/Function/BNGetTypePrinterTypeTokensAfterName.cs new file mode 100644 index 0000000..c5d00f5 --- /dev/null +++ b/Function/BNGetTypePrinterTypeTokensAfterName.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNGetTypePrinterTypeTokensAfterName(BNTypePrinter* printer, BNType* type, BNPlatform* platform, uint8_t baseConfidence, BNType* parentType, BNTokenEscapingType escaping, BNInstructionTextToken** result, uint64_t* resultCount) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetTypePrinterTypeTokensAfterName" + )] + internal static extern bool BNGetTypePrinterTypeTokensAfterName( + + // BNTypePrinter* printer + IntPtr printer , + + // BNType* type + IntPtr type , + + // BNPlatform* platform + IntPtr platform , + + // uint8_t baseConfidence + byte baseConfidence , + + // BNType* parentType + IntPtr parentType , + + // BNTokenEscapingType escaping + TokenEscapingType escaping , + + // BNInstructionTextToken** result + IntPtr result , + + // uint64_t* resultCount + IntPtr resultCount + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypePrinterTypeTokensBeforeName.cs b/Function/BNGetTypePrinterTypeTokensBeforeName.cs new file mode 100644 index 0000000..d489fd7 --- /dev/null +++ b/Function/BNGetTypePrinterTypeTokensBeforeName.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNGetTypePrinterTypeTokensBeforeName(BNTypePrinter* printer, BNType* type, BNPlatform* platform, uint8_t baseConfidence, BNType* parentType, BNTokenEscapingType escaping, BNInstructionTextToken** result, uint64_t* resultCount) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetTypePrinterTypeTokensBeforeName" + )] + internal static extern bool BNGetTypePrinterTypeTokensBeforeName( + + // BNTypePrinter* printer + IntPtr printer , + + // BNType* type + IntPtr type , + + // BNPlatform* platform + IntPtr platform , + + // uint8_t baseConfidence + byte baseConfidence , + + // BNType* parentType + IntPtr parentType , + + // BNTokenEscapingType escaping + TokenEscapingType escaping , + + // BNInstructionTextToken** result + IntPtr result , + + // uint64_t* resultCount + IntPtr resultCount + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeReferenceBuilderClass.cs b/Function/BNGetTypeReferenceBuilderClass.cs new file mode 100644 index 0000000..b9cc530 --- /dev/null +++ b/Function/BNGetTypeReferenceBuilderClass.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNNamedTypeReferenceClass BNGetTypeReferenceBuilderClass(BNNamedTypeReferenceBuilder* nt) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetTypeReferenceBuilderClass" + )] + internal static extern NamedTypeReferenceClass BNGetTypeReferenceBuilderClass( + + // BNNamedTypeReferenceBuilder* nt + IntPtr nt + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeReferenceBuilderId.cs b/Function/BNGetTypeReferenceBuilderId.cs new file mode 100644 index 0000000..d1aafc3 --- /dev/null +++ b/Function/BNGetTypeReferenceBuilderId.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetTypeReferenceBuilderId(BNNamedTypeReferenceBuilder* nt) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetTypeReferenceBuilderId" + )] + internal static extern IntPtr BNGetTypeReferenceBuilderId( + + // BNNamedTypeReferenceBuilder* nt + IntPtr nt + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeReferenceBuilderName.cs b/Function/BNGetTypeReferenceBuilderName.cs new file mode 100644 index 0000000..a6cd933 --- /dev/null +++ b/Function/BNGetTypeReferenceBuilderName.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNQualifiedName BNGetTypeReferenceBuilderName(BNNamedTypeReferenceBuilder* nt) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetTypeReferenceBuilderName" + )] + internal static extern BNQualifiedName BNGetTypeReferenceBuilderName( + + // BNNamedTypeReferenceBuilder* nt + IntPtr nt + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeReferenceClass.cs b/Function/BNGetTypeReferenceClass.cs new file mode 100644 index 0000000..291d68d --- /dev/null +++ b/Function/BNGetTypeReferenceClass.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNNamedTypeReferenceClass BNGetTypeReferenceClass(BNNamedTypeReference* nt) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetTypeReferenceClass" + )] + internal static extern NamedTypeReferenceClass BNGetTypeReferenceClass( + + // BNNamedTypeReference* nt + IntPtr nt + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeReferenceId.cs b/Function/BNGetTypeReferenceId.cs new file mode 100644 index 0000000..543c6dc --- /dev/null +++ b/Function/BNGetTypeReferenceId.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetTypeReferenceId(BNNamedTypeReference* nt) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetTypeReferenceId" + )] + internal static extern IntPtr BNGetTypeReferenceId( + + // BNNamedTypeReference* nt + IntPtr nt + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeReferenceName.cs b/Function/BNGetTypeReferenceName.cs new file mode 100644 index 0000000..5e89dcb --- /dev/null +++ b/Function/BNGetTypeReferenceName.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNQualifiedName BNGetTypeReferenceName(BNNamedTypeReference* nt) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetTypeReferenceName" + )] + internal static extern BNQualifiedName BNGetTypeReferenceName( + + // BNNamedTypeReference* nt + IntPtr nt + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeReferencesForType.cs b/Function/BNGetTypeReferencesForType.cs new file mode 100644 index 0000000..06b15ac --- /dev/null +++ b/Function/BNGetTypeReferencesForType.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeReferenceSource* BNGetTypeReferencesForType(BNBinaryView* view, BNQualifiedName* type, uint64_t* count, bool limit, uint64_t maxItems) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetTypeReferencesForType" + )] + internal static extern IntPtr BNGetTypeReferencesForType( + + // BNBinaryView* view + IntPtr view , + + // BNQualifiedName* type + in BNQualifiedName type , + + // uint64_t* count + out ulong count , + + // bool limit + bool limit , + + // uint64_t maxItems + ulong maxItems + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeReferencesForTypeField.cs b/Function/BNGetTypeReferencesForTypeField.cs new file mode 100644 index 0000000..a91adb4 --- /dev/null +++ b/Function/BNGetTypeReferencesForTypeField.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeReferenceSource* BNGetTypeReferencesForTypeField(BNBinaryView* view, BNQualifiedName* type, uint64_t offset, uint64_t* count, bool limit, uint64_t maxItems) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetTypeReferencesForTypeField" + )] + internal static extern IntPtr BNGetTypeReferencesForTypeField( + + // BNBinaryView* view + IntPtr view , + + // BNQualifiedName* type + in BNQualifiedName type , + + // uint64_t offset + ulong offset , + + // uint64_t* count + out ulong count , + + // bool limit + bool limit , + + // uint64_t maxItems + ulong maxItems + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeStackAdjustment.cs b/Function/BNGetTypeStackAdjustment.cs new file mode 100644 index 0000000..6635c0b --- /dev/null +++ b/Function/BNGetTypeStackAdjustment.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNOffsetWithConfidence BNGetTypeStackAdjustment(BNType* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetTypeStackAdjustment" + )] + internal static extern BNOffsetWithConfidence BNGetTypeStackAdjustment( + + // BNType* type + IntPtr type + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeString.cs b/Function/BNGetTypeString.cs new file mode 100644 index 0000000..379782f --- /dev/null +++ b/Function/BNGetTypeString.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// char* BNGetTypeString(BNType* type, BNPlatform* platform, BNTokenEscapingType escaping) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetTypeString" + )] + internal static extern IntPtr BNGetTypeString( + + // BNType* type + IntPtr type , + + // BNPlatform* platform + IntPtr platform , + + // BNTokenEscapingType escaping + TokenEscapingType escaping + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeStringAfterName.cs b/Function/BNGetTypeStringAfterName.cs new file mode 100644 index 0000000..7ca164a --- /dev/null +++ b/Function/BNGetTypeStringAfterName.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// char* BNGetTypeStringAfterName(BNType* type, BNPlatform* platform, BNTokenEscapingType escaping) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetTypeStringAfterName" + )] + internal static extern IntPtr BNGetTypeStringAfterName( + + // BNType* type + IntPtr type , + + // BNPlatform* platform + IntPtr platform , + + // BNTokenEscapingType escaping + TokenEscapingType escaping + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeStringBeforeName.cs b/Function/BNGetTypeStringBeforeName.cs new file mode 100644 index 0000000..bba9835 --- /dev/null +++ b/Function/BNGetTypeStringBeforeName.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// char* BNGetTypeStringBeforeName(BNType* type, BNPlatform* platform, BNTokenEscapingType escaping) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetTypeStringBeforeName" + )] + internal static extern IntPtr BNGetTypeStringBeforeName( + + // BNType* type + IntPtr type , + + // BNPlatform* platform + IntPtr platform , + + // BNTokenEscapingType escaping + TokenEscapingType escaping + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeStructure.cs b/Function/BNGetTypeStructure.cs new file mode 100644 index 0000000..db67993 --- /dev/null +++ b/Function/BNGetTypeStructure.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNStructure* BNGetTypeStructure(BNType* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetTypeStructure" + )] + internal static extern IntPtr BNGetTypeStructure( + + // BNType* type + IntPtr type + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeTokens.cs b/Function/BNGetTypeTokens.cs new file mode 100644 index 0000000..f49cee4 --- /dev/null +++ b/Function/BNGetTypeTokens.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNInstructionTextToken* BNGetTypeTokens(BNType* type, BNPlatform* platform, uint8_t baseConfidence, BNTokenEscapingType escaping, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetTypeTokens" + )] + internal static extern IntPtr BNGetTypeTokens( + + // BNType* type + IntPtr type , + + // BNPlatform* platform + IntPtr platform , + + // uint8_t baseConfidence + byte baseConfidence , + + // BNTokenEscapingType escaping + TokenEscapingType escaping , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeTokensAfterName.cs b/Function/BNGetTypeTokensAfterName.cs new file mode 100644 index 0000000..a2d1617 --- /dev/null +++ b/Function/BNGetTypeTokensAfterName.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNInstructionTextToken* BNGetTypeTokensAfterName(BNType* type, BNPlatform* platform, uint8_t baseConfidence, BNTokenEscapingType escaping, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetTypeTokensAfterName" + )] + internal static extern IntPtr BNGetTypeTokensAfterName( + + // BNType* type + IntPtr type , + + // BNPlatform* platform + IntPtr platform , + + // uint8_t baseConfidence + byte baseConfidence , + + // BNTokenEscapingType escaping + TokenEscapingType escaping , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeTokensBeforeName.cs b/Function/BNGetTypeTokensBeforeName.cs new file mode 100644 index 0000000..7006922 --- /dev/null +++ b/Function/BNGetTypeTokensBeforeName.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNInstructionTextToken* BNGetTypeTokensBeforeName(BNType* type, BNPlatform* platform, uint8_t baseConfidence, BNTokenEscapingType escaping, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetTypeTokensBeforeName" + )] + internal static extern IntPtr BNGetTypeTokensBeforeName( + + // BNType* type + IntPtr type , + + // BNPlatform* platform + IntPtr platform , + + // uint8_t baseConfidence + byte baseConfidence , + + // BNTokenEscapingType escaping + TokenEscapingType escaping , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypeWidth.cs b/Function/BNGetTypeWidth.cs new file mode 100644 index 0000000..89879e3 --- /dev/null +++ b/Function/BNGetTypeWidth.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetTypeWidth(BNType* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetTypeWidth" + )] + internal static extern ulong BNGetTypeWidth( + + // BNType* type + IntPtr type + ); + } +} \ No newline at end of file diff --git a/Function/BNGetTypesReferenced.cs b/Function/BNGetTypesReferenced.cs new file mode 100644 index 0000000..6d244a5 --- /dev/null +++ b/Function/BNGetTypesReferenced.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeWithConfidence* BNGetTypesReferenced(BNBinaryView* view, BNQualifiedName* type, uint64_t offset, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetTypesReferenced" + )] + internal static extern IntPtr BNGetTypesReferenced( + + // BNBinaryView* view + IntPtr view , + + // BNQualifiedName* type + in BNQualifiedName type , + + // uint64_t offset + ulong offset , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetUndoEntries.cs b/Function/BNGetUndoEntries.cs new file mode 100644 index 0000000..ebb367a --- /dev/null +++ b/Function/BNGetUndoEntries.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNUndoEntry** BNGetUndoEntries(BNFileMetadata* file, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetUndoEntries" + )] + internal static extern IntPtr BNGetUndoEntries( + + // BNFileMetadata* file + IntPtr file , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetUniqueIdentifierString.cs b/Function/BNGetUniqueIdentifierString.cs new file mode 100644 index 0000000..8f57e88 --- /dev/null +++ b/Function/BNGetUniqueIdentifierString.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public static partial class Core + { + public static string GetUniqueIdentifierString() + { + return UnsafeUtils.TakeAnsiString( + BinaryNinja.NativeMethods.BNGetUniqueIdentifierString() + ); + } + } + + internal static partial class NativeMethods + { + /// + /// char* BNGetUniqueIdentifierString() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetUniqueIdentifierString" + )] + internal static extern IntPtr BNGetUniqueIdentifierString(); + } +} \ No newline at end of file diff --git a/Function/BNGetUniqueSectionNames.cs b/Function/BNGetUniqueSectionNames.cs new file mode 100644 index 0000000..ffca22c --- /dev/null +++ b/Function/BNGetUniqueSectionNames.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// char** BNGetUniqueSectionNames(BNBinaryView* view, const char** names, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetUniqueSectionNames" + )] + internal static extern IntPtr BNGetUniqueSectionNames( + + // BNBinaryView* view + IntPtr view , + + // const char** names + string[] names , + + // uint64_t count + ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetUnresolvedIndirectBranches.cs b/Function/BNGetUnresolvedIndirectBranches.cs new file mode 100644 index 0000000..7fcc34e --- /dev/null +++ b/Function/BNGetUnresolvedIndirectBranches.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNArchitectureAndAddress* BNGetUnresolvedIndirectBranches(BNFunction* func, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetUnresolvedIndirectBranches" + )] + internal static extern IntPtr BNGetUnresolvedIndirectBranches( + + // BNFunction* func + IntPtr func , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetUnresolvedStackAdjustmentGraph.cs b/Function/BNGetUnresolvedStackAdjustmentGraph.cs new file mode 100644 index 0000000..fc0d1c0 --- /dev/null +++ b/Function/BNGetUnresolvedStackAdjustmentGraph.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFlowGraph* BNGetUnresolvedStackAdjustmentGraph(BNFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetUnresolvedStackAdjustmentGraph" + )] + internal static extern IntPtr BNGetUnresolvedStackAdjustmentGraph( + + // BNFunction* func + IntPtr func + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetUpdateChannelVersions.cs b/Function/BNGetUpdateChannelVersions.cs new file mode 100644 index 0000000..9c18142 --- /dev/null +++ b/Function/BNGetUpdateChannelVersions.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNUpdateVersion* BNGetUpdateChannelVersions(const char* channel, uint64_t* count, const char** errors) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetUpdateChannelVersions" + )] + internal static extern IntPtr BNGetUpdateChannelVersions( + + // const char* channel + string channel , + + // uint64_t* count + IntPtr count , + + // const char** errors + string[] errors + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetUpdateChannels.cs b/Function/BNGetUpdateChannels.cs new file mode 100644 index 0000000..a8a26ee --- /dev/null +++ b/Function/BNGetUpdateChannels.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNUpdateChannel* BNGetUpdateChannels(uint64_t* count, const char** errors) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetUpdateChannels" + )] + internal static extern IntPtr BNGetUpdateChannels( + + // uint64_t* count + IntPtr count , + + // const char** errors + string[] errors + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetUserAddressTagReferences.cs b/Function/BNGetUserAddressTagReferences.cs new file mode 100644 index 0000000..8cbe930 --- /dev/null +++ b/Function/BNGetUserAddressTagReferences.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTagReference* BNGetUserAddressTagReferences(BNFunction* func, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetUserAddressTagReferences" + )] + internal static extern IntPtr BNGetUserAddressTagReferences( + + // BNFunction* func + IntPtr func , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetUserAddressTags.cs b/Function/BNGetUserAddressTags.cs new file mode 100644 index 0000000..74c262a --- /dev/null +++ b/Function/BNGetUserAddressTags.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTag** BNGetUserAddressTags(BNFunction* func, BNArchitecture* arch, uint64_t addr, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetUserAddressTags" + )] + internal static extern IntPtr BNGetUserAddressTags( + + // BNFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t addr + ulong addr , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetUserAddressTagsInRange.cs b/Function/BNGetUserAddressTagsInRange.cs new file mode 100644 index 0000000..79a608e --- /dev/null +++ b/Function/BNGetUserAddressTagsInRange.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTagReference* BNGetUserAddressTagsInRange(BNFunction* func, BNArchitecture* arch, uint64_t start, uint64_t end, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetUserAddressTagsInRange" + )] + internal static extern IntPtr BNGetUserAddressTagsInRange( + + // BNFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t start + ulong start , + + // uint64_t end + ulong end , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetUserAddressTagsOfType.cs b/Function/BNGetUserAddressTagsOfType.cs new file mode 100644 index 0000000..8fa0c4a --- /dev/null +++ b/Function/BNGetUserAddressTagsOfType.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTag** BNGetUserAddressTagsOfType(BNFunction* func, BNArchitecture* arch, uint64_t addr, BNTagType* tagType, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetUserAddressTagsOfType" + )] + internal static extern IntPtr BNGetUserAddressTagsOfType( + + // BNFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t addr + ulong addr , + + // BNTagType* tagType + IntPtr tagType , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetUserDataTagReferences.cs b/Function/BNGetUserDataTagReferences.cs new file mode 100644 index 0000000..bc787ed --- /dev/null +++ b/Function/BNGetUserDataTagReferences.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTagReference* BNGetUserDataTagReferences(BNBinaryView* view, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetUserDataTagReferences" + )] + internal static extern IntPtr BNGetUserDataTagReferences( + + // BNBinaryView* view + IntPtr view , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetUserDataTags.cs b/Function/BNGetUserDataTags.cs new file mode 100644 index 0000000..5cedfd6 --- /dev/null +++ b/Function/BNGetUserDataTags.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTag** BNGetUserDataTags(BNBinaryView* view, uint64_t addr, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetUserDataTags" + )] + internal static extern IntPtr BNGetUserDataTags( + + // BNBinaryView* view + IntPtr view , + + // uint64_t addr + ulong addr , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetUserDataTagsInRange.cs b/Function/BNGetUserDataTagsInRange.cs new file mode 100644 index 0000000..68c46b3 --- /dev/null +++ b/Function/BNGetUserDataTagsInRange.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTagReference* BNGetUserDataTagsInRange(BNBinaryView* view, uint64_t start, uint64_t end, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetUserDataTagsInRange" + )] + internal static extern IntPtr BNGetUserDataTagsInRange( + + // BNBinaryView* view + IntPtr view , + + // uint64_t start + ulong start , + + // uint64_t end + ulong end , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetUserDataTagsOfType.cs b/Function/BNGetUserDataTagsOfType.cs new file mode 100644 index 0000000..a8acc46 --- /dev/null +++ b/Function/BNGetUserDataTagsOfType.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTag** BNGetUserDataTagsOfType(BNBinaryView* view, uint64_t addr, BNTagType* tagType, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetUserDataTagsOfType" + )] + internal static extern IntPtr BNGetUserDataTagsOfType( + + // BNBinaryView* view + IntPtr view , + + // uint64_t addr + ulong addr , + + // BNTagType* tagType + IntPtr tagType , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetUserDirectory.cs b/Function/BNGetUserDirectory.cs new file mode 100644 index 0000000..29fba71 --- /dev/null +++ b/Function/BNGetUserDirectory.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public static partial class Core + { + public static string GetUserDirectory() + { + return UnsafeUtils.TakeUtf8String( + NativeMethods.BNGetUserDirectory() + ); + } + } + + internal static partial class NativeMethods + { + /// + /// char* BNGetUserDirectory() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetUserDirectory" + )] + internal static extern IntPtr BNGetUserDirectory(); + } +} \ No newline at end of file diff --git a/Function/BNGetUserEmail.cs b/Function/BNGetUserEmail.cs new file mode 100644 index 0000000..8613ebf --- /dev/null +++ b/Function/BNGetUserEmail.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetUserEmail(BNUser* user) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetUserEmail" + )] + internal static extern IntPtr BNGetUserEmail( + + // BNUser* user + IntPtr user + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetUserFunctionTagReferences.cs b/Function/BNGetUserFunctionTagReferences.cs new file mode 100644 index 0000000..8223fba --- /dev/null +++ b/Function/BNGetUserFunctionTagReferences.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTagReference* BNGetUserFunctionTagReferences(BNFunction* func, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetUserFunctionTagReferences" + )] + internal static extern IntPtr BNGetUserFunctionTagReferences( + + // BNFunction* func + IntPtr func , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetUserFunctionTags.cs b/Function/BNGetUserFunctionTags.cs new file mode 100644 index 0000000..25655b8 --- /dev/null +++ b/Function/BNGetUserFunctionTags.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTag** BNGetUserFunctionTags(BNFunction* func, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetUserFunctionTags" + )] + internal static extern IntPtr BNGetUserFunctionTags( + + // BNFunction* func + IntPtr func , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetUserFunctionTagsOfType.cs b/Function/BNGetUserFunctionTagsOfType.cs new file mode 100644 index 0000000..df8b390 --- /dev/null +++ b/Function/BNGetUserFunctionTagsOfType.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTag** BNGetUserFunctionTagsOfType(BNFunction* func, BNTagType* tagType, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetUserFunctionTagsOfType" + )] + internal static extern IntPtr BNGetUserFunctionTagsOfType( + + // BNFunction* func + IntPtr func , + + // BNTagType* tagType + IntPtr tagType , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetUserId.cs b/Function/BNGetUserId.cs new file mode 100644 index 0000000..90bf236 --- /dev/null +++ b/Function/BNGetUserId.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetUserId(BNUser* user) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetUserId" + )] + internal static extern IntPtr BNGetUserId( + + // BNUser* user + IntPtr user + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetUserName.cs b/Function/BNGetUserName.cs new file mode 100644 index 0000000..3d88680 --- /dev/null +++ b/Function/BNGetUserName.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetUserName(BNUser* user) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetUserName" + )] + internal static extern IntPtr BNGetUserName( + + // BNUser* user + IntPtr user + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetUserPluginDirectory.cs b/Function/BNGetUserPluginDirectory.cs new file mode 100644 index 0000000..8fe2bd7 --- /dev/null +++ b/Function/BNGetUserPluginDirectory.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public static partial class Core + { + public static string GetUserPluginDirectory() + { + return UnsafeUtils.TakeUtf8String( + NativeMethods.BNGetUserPluginDirectory() + ); + } + } + + internal static partial class NativeMethods + { + /// + /// char* BNGetUserPluginDirectory() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetUserPluginDirectory" + )] + internal static extern IntPtr BNGetUserPluginDirectory(); + } +} \ No newline at end of file diff --git a/Function/BNGetUsers.cs b/Function/BNGetUsers.cs new file mode 100644 index 0000000..9190e8f --- /dev/null +++ b/Function/BNGetUsers.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNUser** BNGetUsers(BNFileMetadata* file, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetUsers" + )] + internal static extern IntPtr BNGetUsers( + + // BNFileMetadata* file + IntPtr file , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetValidPluginCommands.cs b/Function/BNGetValidPluginCommands.cs new file mode 100644 index 0000000..7373ab0 --- /dev/null +++ b/Function/BNGetValidPluginCommands.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNPluginCommand* BNGetValidPluginCommands(BNBinaryView* view, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetValidPluginCommands" + )] + internal static extern IntPtr BNGetValidPluginCommands( + + // BNBinaryView* view + IntPtr view , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetValidPluginCommandsForAddress.cs b/Function/BNGetValidPluginCommandsForAddress.cs new file mode 100644 index 0000000..623bbc3 --- /dev/null +++ b/Function/BNGetValidPluginCommandsForAddress.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNPluginCommand* BNGetValidPluginCommandsForAddress(BNBinaryView* view, uint64_t addr, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetValidPluginCommandsForAddress" + )] + internal static extern IntPtr BNGetValidPluginCommandsForAddress( + + // BNBinaryView* view + IntPtr view , + + // uint64_t addr + ulong address , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetValidPluginCommandsForFunction.cs b/Function/BNGetValidPluginCommandsForFunction.cs new file mode 100644 index 0000000..a478f83 --- /dev/null +++ b/Function/BNGetValidPluginCommandsForFunction.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNPluginCommand* BNGetValidPluginCommandsForFunction(BNBinaryView* view, BNFunction* func, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetValidPluginCommandsForFunction" + )] + internal static extern IntPtr BNGetValidPluginCommandsForFunction( + + // BNBinaryView* view + IntPtr view , + + // BNFunction* func + IntPtr func , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetValidPluginCommandsForHighLevelILFunction.cs b/Function/BNGetValidPluginCommandsForHighLevelILFunction.cs new file mode 100644 index 0000000..b9ac4ce --- /dev/null +++ b/Function/BNGetValidPluginCommandsForHighLevelILFunction.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNPluginCommand* BNGetValidPluginCommandsForHighLevelILFunction(BNBinaryView* view, BNHighLevelILFunction* func, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetValidPluginCommandsForHighLevelILFunction" + )] + internal static extern IntPtr BNGetValidPluginCommandsForHighLevelILFunction( + + // BNBinaryView* view + IntPtr view , + + // BNHighLevelILFunction* func + IntPtr func , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetValidPluginCommandsForHighLevelILInstruction.cs b/Function/BNGetValidPluginCommandsForHighLevelILInstruction.cs new file mode 100644 index 0000000..961e98e --- /dev/null +++ b/Function/BNGetValidPluginCommandsForHighLevelILInstruction.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNPluginCommand* BNGetValidPluginCommandsForHighLevelILInstruction(BNBinaryView* view, BNHighLevelILFunction* func, uint64_t instr, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetValidPluginCommandsForHighLevelILInstruction" + )] + internal static extern IntPtr BNGetValidPluginCommandsForHighLevelILInstruction( + + // BNBinaryView* view + IntPtr view , + + // BNHighLevelILFunction* func + IntPtr func , + + // uint64_t instr + ulong instr , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetValidPluginCommandsForLowLevelILFunction.cs b/Function/BNGetValidPluginCommandsForLowLevelILFunction.cs new file mode 100644 index 0000000..7e56ce5 --- /dev/null +++ b/Function/BNGetValidPluginCommandsForLowLevelILFunction.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNPluginCommand* BNGetValidPluginCommandsForLowLevelILFunction(BNBinaryView* view, BNLowLevelILFunction* func, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetValidPluginCommandsForLowLevelILFunction" + )] + internal static extern IntPtr BNGetValidPluginCommandsForLowLevelILFunction( + + // BNBinaryView* view + IntPtr view , + + // BNLowLevelILFunction* func + IntPtr func , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetValidPluginCommandsForLowLevelILInstruction.cs b/Function/BNGetValidPluginCommandsForLowLevelILInstruction.cs new file mode 100644 index 0000000..c5d0206 --- /dev/null +++ b/Function/BNGetValidPluginCommandsForLowLevelILInstruction.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNPluginCommand* BNGetValidPluginCommandsForLowLevelILInstruction(BNBinaryView* view, BNLowLevelILFunction* func, uint64_t instr, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetValidPluginCommandsForLowLevelILInstruction" + )] + internal static extern IntPtr BNGetValidPluginCommandsForLowLevelILInstruction( + + // BNBinaryView* view + IntPtr view , + + // BNLowLevelILFunction* func + IntPtr func , + + // uint64_t instr + ulong instr , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetValidPluginCommandsForMediumLevelILFunction.cs b/Function/BNGetValidPluginCommandsForMediumLevelILFunction.cs new file mode 100644 index 0000000..01308d0 --- /dev/null +++ b/Function/BNGetValidPluginCommandsForMediumLevelILFunction.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNPluginCommand* BNGetValidPluginCommandsForMediumLevelILFunction(BNBinaryView* view, BNMediumLevelILFunction* func, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetValidPluginCommandsForMediumLevelILFunction" + )] + internal static extern IntPtr BNGetValidPluginCommandsForMediumLevelILFunction( + + // BNBinaryView* view + IntPtr view , + + // BNMediumLevelILFunction* func + IntPtr func , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetValidPluginCommandsForMediumLevelILInstruction.cs b/Function/BNGetValidPluginCommandsForMediumLevelILInstruction.cs new file mode 100644 index 0000000..ee9f7b1 --- /dev/null +++ b/Function/BNGetValidPluginCommandsForMediumLevelILInstruction.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNPluginCommand* BNGetValidPluginCommandsForMediumLevelILInstruction(BNBinaryView* view, BNMediumLevelILFunction* func, uint64_t instr, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetValidPluginCommandsForMediumLevelILInstruction" + )] + internal static extern IntPtr BNGetValidPluginCommandsForMediumLevelILInstruction( + + // BNBinaryView* view + IntPtr view , + + // BNMediumLevelILFunction* func + IntPtr func , + + // uint64_t instr + ulong instr , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetValidPluginCommandsForProject.cs b/Function/BNGetValidPluginCommandsForProject.cs new file mode 100644 index 0000000..3cf5602 --- /dev/null +++ b/Function/BNGetValidPluginCommandsForProject.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNPluginCommand* BNGetValidPluginCommandsForProject(BNProject* project, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetValidPluginCommandsForProject" + )] + internal static extern IntPtr BNGetValidPluginCommandsForProject( + + // BNProject* project + IntPtr project , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetValidPluginCommandsForRange.cs b/Function/BNGetValidPluginCommandsForRange.cs new file mode 100644 index 0000000..6ea2926 --- /dev/null +++ b/Function/BNGetValidPluginCommandsForRange.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNPluginCommand* BNGetValidPluginCommandsForRange(BNBinaryView* view, uint64_t addr, uint64_t len, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetValidPluginCommandsForRange" + )] + internal static extern IntPtr BNGetValidPluginCommandsForRange( + + // BNBinaryView* view + IntPtr view , + + // uint64_t addr + ulong address , + + // uint64_t len + ulong length , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetVariableName.cs b/Function/BNGetVariableName.cs new file mode 100644 index 0000000..6762462 --- /dev/null +++ b/Function/BNGetVariableName.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetVariableName(BNFunction* func, BNVariable* var) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetVariableName" + )] + internal static extern IntPtr BNGetVariableName( + + // BNFunction* func + IntPtr func , + + // BNVariable* _var + IntPtr _var + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetVariableNameOrDefault.cs b/Function/BNGetVariableNameOrDefault.cs new file mode 100644 index 0000000..828f140 --- /dev/null +++ b/Function/BNGetVariableNameOrDefault.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// char* BNGetVariableNameOrDefault(BNFunction* func, BNVariable* var) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetVariableNameOrDefault" + )] + internal static extern IntPtr BNGetVariableNameOrDefault( + + // BNFunction* func + IntPtr func , + + // BNVariable* _var + in BNVariable variable + ); + } +} \ No newline at end of file diff --git a/Function/BNGetVariableType.cs b/Function/BNGetVariableType.cs new file mode 100644 index 0000000..f93751c --- /dev/null +++ b/Function/BNGetVariableType.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeWithConfidence BNGetVariableType(BNFunction* func, BNVariable* var) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetVariableType" + )] + internal static extern BNTypeWithConfidence BNGetVariableType( + + // BNFunction* func + IntPtr func , + + // BNVariable* _var + IntPtr _var + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetVariablesForParameters.cs b/Function/BNGetVariablesForParameters.cs new file mode 100644 index 0000000..3cc6a57 --- /dev/null +++ b/Function/BNGetVariablesForParameters.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNVariable* BNGetVariablesForParameters(BNCallingConvention* cc, BNFunctionParameter* @params, uint64_t paramCount, uint32_t* permittedArgs, uint64_t permittedArgCount, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetVariablesForParameters" + )] + internal static extern IntPtr BNGetVariablesForParameters( + + // BNCallingConvention* cc + IntPtr cc , + + // BNFunctionParameter* _params + IntPtr _params , + + // uint64_t paramCount + ulong paramCount , + + // uint32_t* permittedArgs + IntPtr permittedArgs , + + // uint64_t permittedArgCount + ulong permittedArgCount , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetVariablesForParametersDefaultPermittedArgs.cs b/Function/BNGetVariablesForParametersDefaultPermittedArgs.cs new file mode 100644 index 0000000..086e071 --- /dev/null +++ b/Function/BNGetVariablesForParametersDefaultPermittedArgs.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNVariable* BNGetVariablesForParametersDefaultPermittedArgs(BNCallingConvention* cc, BNFunctionParameter* @params, uint64_t paramCount, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetVariablesForParametersDefaultPermittedArgs" + )] + internal static extern IntPtr BNGetVariablesForParametersDefaultPermittedArgs( + + // BNCallingConvention* cc + IntPtr cc , + + // BNFunctionParameter* _params + IntPtr _params , + + // uint64_t paramCount + ulong paramCount , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetVersionInfo.cs b/Function/BNGetVersionInfo.cs new file mode 100644 index 0000000..a5cbf30 --- /dev/null +++ b/Function/BNGetVersionInfo.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public static partial class Core + { + public static VersionInfo GetVersionInfo() + { + return VersionInfo.FromNative( + NativeMethods.BNGetVersionInfo() + ); + } + } + + internal static partial class NativeMethods + { + /// + /// BNVersionInfo BNGetVersionInfo() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetVersionInfo" + )] + internal static extern BNVersionInfo BNGetVersionInfo(); + } +} \ No newline at end of file diff --git a/Function/BNGetVersionString.cs b/Function/BNGetVersionString.cs new file mode 100644 index 0000000..cf05005 --- /dev/null +++ b/Function/BNGetVersionString.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public static partial class Core + { + public static string GetVersionString() + { + return UnsafeUtils.TakeAnsiString( + NativeMethods.BNGetVersionString() + ); + } + } + + internal static partial class NativeMethods + { + /// + /// char* BNGetVersionString() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetVersionString" + )] + internal static extern IntPtr BNGetVersionString(); + } +} \ No newline at end of file diff --git a/Function/BNGetVerticalFlowGraphNodeMargin.cs b/Function/BNGetVerticalFlowGraphNodeMargin.cs new file mode 100644 index 0000000..616a71a --- /dev/null +++ b/Function/BNGetVerticalFlowGraphNodeMargin.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// int32_t BNGetVerticalFlowGraphNodeMargin(BNFlowGraph* graph) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetVerticalFlowGraphNodeMargin" + )] + internal static extern int BNGetVerticalFlowGraphNodeMargin( + + // BNFlowGraph* graph + IntPtr graph + ); + } +} \ No newline at end of file diff --git a/Function/BNGetViewAddressSize.cs b/Function/BNGetViewAddressSize.cs new file mode 100644 index 0000000..dab69e7 --- /dev/null +++ b/Function/BNGetViewAddressSize.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetViewAddressSize(BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetViewAddressSize" + )] + internal static extern ulong BNGetViewAddressSize( + + // BNBinaryView* view + IntPtr view + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetViewForFlowGraph.cs b/Function/BNGetViewForFlowGraph.cs new file mode 100644 index 0000000..a1dcf5c --- /dev/null +++ b/Function/BNGetViewForFlowGraph.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBinaryView* BNGetViewForFlowGraph(BNFlowGraph* graph) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetViewForFlowGraph" + )] + internal static extern IntPtr BNGetViewForFlowGraph( + + // BNFlowGraph* graph + IntPtr graph + ); + } +} \ No newline at end of file diff --git a/Function/BNGetViewLength.cs b/Function/BNGetViewLength.cs new file mode 100644 index 0000000..ec3fae4 --- /dev/null +++ b/Function/BNGetViewLength.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetViewLength(BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetViewLength" + )] + internal static extern ulong BNGetViewLength( + + // BNBinaryView* view + IntPtr view + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetViewType.cs b/Function/BNGetViewType.cs new file mode 100644 index 0000000..916c7a6 --- /dev/null +++ b/Function/BNGetViewType.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetViewType(BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetViewType" + )] + internal static extern IntPtr BNGetViewType( + + // BNBinaryView* view + IntPtr view + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetVirtualPath.cs b/Function/BNGetVirtualPath.cs new file mode 100644 index 0000000..50fdbc9 --- /dev/null +++ b/Function/BNGetVirtualPath.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// char* BNGetVirtualPath(BNFileMetadata* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetVirtualPath" + )] + internal static extern IntPtr BNGetVirtualPath( + + // BNFileMetadata* file + IntPtr file + ); + } +} \ No newline at end of file diff --git a/Function/BNGetVisibleSymbols.cs b/Function/BNGetVisibleSymbols.cs new file mode 100644 index 0000000..948102d --- /dev/null +++ b/Function/BNGetVisibleSymbols.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNSymbol** BNGetVisibleSymbols(BNBinaryView* view, uint64_t* count, BNNameSpace* nameSpace) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetVisibleSymbols" + )] + internal static extern IntPtr BNGetVisibleSymbols( + + // BNBinaryView* view + IntPtr view , + + // uint64_t* count + IntPtr count , + + // BNNameSpace* _nameSpace + IntPtr _nameSpace + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetWebsocketProviderByName.cs b/Function/BNGetWebsocketProviderByName.cs new file mode 100644 index 0000000..e06eb3c --- /dev/null +++ b/Function/BNGetWebsocketProviderByName.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNWebsocketProvider* BNGetWebsocketProviderByName(const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetWebsocketProviderByName" + )] + internal static extern IntPtr BNGetWebsocketProviderByName( + + // const char* name + string name + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetWebsocketProviderList.cs b/Function/BNGetWebsocketProviderList.cs new file mode 100644 index 0000000..650c654 --- /dev/null +++ b/Function/BNGetWebsocketProviderList.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNWebsocketProvider** BNGetWebsocketProviderList(uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetWebsocketProviderList" + )] + internal static extern IntPtr BNGetWebsocketProviderList( + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetWebsocketProviderName.cs b/Function/BNGetWebsocketProviderName.cs new file mode 100644 index 0000000..8612525 --- /dev/null +++ b/Function/BNGetWebsocketProviderName.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetWebsocketProviderName(BNWebsocketProvider* provider) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetWebsocketProviderName" + )] + internal static extern IntPtr BNGetWebsocketProviderName( + + // BNWebsocketProvider* provider + IntPtr provider + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetWorkerThreadCount.cs b/Function/BNGetWorkerThreadCount.cs new file mode 100644 index 0000000..64e1dd6 --- /dev/null +++ b/Function/BNGetWorkerThreadCount.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetWorkerThreadCount() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetWorkerThreadCount" + )] + internal static extern ulong BNGetWorkerThreadCount( + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetWorkflowForBinaryView.cs b/Function/BNGetWorkflowForBinaryView.cs new file mode 100644 index 0000000..7ad3b6c --- /dev/null +++ b/Function/BNGetWorkflowForBinaryView.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNWorkflow* BNGetWorkflowForBinaryView(BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetWorkflowForBinaryView" + )] + internal static extern IntPtr BNGetWorkflowForBinaryView( + + // BNBinaryView* view + IntPtr view + ); + } +} \ No newline at end of file diff --git a/Function/BNGetWorkflowForFunction.cs b/Function/BNGetWorkflowForFunction.cs new file mode 100644 index 0000000..029df0d --- /dev/null +++ b/Function/BNGetWorkflowForFunction.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNWorkflow* BNGetWorkflowForFunction(BNFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetWorkflowForFunction" + )] + internal static extern IntPtr BNGetWorkflowForFunction( + + // BNFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNGetWorkflowGraphForBinaryView.cs b/Function/BNGetWorkflowGraphForBinaryView.cs new file mode 100644 index 0000000..901ae4f --- /dev/null +++ b/Function/BNGetWorkflowGraphForBinaryView.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFlowGraph* BNGetWorkflowGraphForBinaryView(BNBinaryView* view, const char* name, bool sequential) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetWorkflowGraphForBinaryView" + )] + internal static extern IntPtr BNGetWorkflowGraphForBinaryView( + + // BNBinaryView* view + IntPtr view , + + // const char* name + string name , + + // bool sequential + bool sequential + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetWorkflowGraphForFunction.cs b/Function/BNGetWorkflowGraphForFunction.cs new file mode 100644 index 0000000..c38fb6f --- /dev/null +++ b/Function/BNGetWorkflowGraphForFunction.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFlowGraph* BNGetWorkflowGraphForFunction(BNFunction* func, const char* name, bool sequential) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetWorkflowGraphForFunction" + )] + internal static extern IntPtr BNGetWorkflowGraphForFunction( + + // BNFunction* func + IntPtr func , + + // const char* name + string name , + + // bool sequential + bool sequential + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetWorkflowList.cs b/Function/BNGetWorkflowList.cs new file mode 100644 index 0000000..2406018 --- /dev/null +++ b/Function/BNGetWorkflowList.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNWorkflow** BNGetWorkflowList(uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetWorkflowList" + )] + internal static extern IntPtr BNGetWorkflowList( + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNGetWorkflowName.cs b/Function/BNGetWorkflowName.cs new file mode 100644 index 0000000..2914fbe --- /dev/null +++ b/Function/BNGetWorkflowName.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNGetWorkflowName(BNWorkflow* workflow) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNGetWorkflowName" + )] + internal static extern IntPtr BNGetWorkflowName( + + // BNWorkflow* workflow + IntPtr workflow + + ); + } +} \ No newline at end of file diff --git a/Function/BNGetWriterPosition.cs b/Function/BNGetWriterPosition.cs new file mode 100644 index 0000000..0ae7406 --- /dev/null +++ b/Function/BNGetWriterPosition.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNGetWriterPosition(BNBinaryWriter* stream) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNGetWriterPosition" + )] + internal static extern ulong BNGetWriterPosition( + + // BNBinaryWriter* stream + IntPtr stream + ); + } +} \ No newline at end of file diff --git a/Function/BNHasDataVariables.cs b/Function/BNHasDataVariables.cs new file mode 100644 index 0000000..ea0449c --- /dev/null +++ b/Function/BNHasDataVariables.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNHasDataVariables(BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNHasDataVariables" + )] + internal static extern bool BNHasDataVariables( + + // BNBinaryView* view + IntPtr view + ); + } +} \ No newline at end of file diff --git a/Function/BNHasFunctions.cs b/Function/BNHasFunctions.cs new file mode 100644 index 0000000..a92fdc2 --- /dev/null +++ b/Function/BNHasFunctions.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNHasFunctions(BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNHasFunctions" + )] + internal static extern bool BNHasFunctions( + + // BNBinaryView* view + IntPtr view + ); + } +} \ No newline at end of file diff --git a/Function/BNHasGuidedSourceBlocks.cs b/Function/BNHasGuidedSourceBlocks.cs new file mode 100644 index 0000000..d292b08 --- /dev/null +++ b/Function/BNHasGuidedSourceBlocks.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNHasGuidedSourceBlocks(BNFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNHasGuidedSourceBlocks" + )] + internal static extern bool BNHasGuidedSourceBlocks( + + // BNFunction* func + IntPtr func + + ); + } +} \ No newline at end of file diff --git a/Function/BNHasInitialAnalysis.cs b/Function/BNHasInitialAnalysis.cs new file mode 100644 index 0000000..2663ab4 --- /dev/null +++ b/Function/BNHasInitialAnalysis.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNHasInitialAnalysis(BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNHasInitialAnalysis" + )] + internal static extern bool BNHasInitialAnalysis( + + // BNBinaryView* view + IntPtr view + ); + } +} \ No newline at end of file diff --git a/Function/BNHasSymbols.cs b/Function/BNHasSymbols.cs new file mode 100644 index 0000000..7afaa67 --- /dev/null +++ b/Function/BNHasSymbols.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNHasSymbols(BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNHasSymbols" + )] + internal static extern bool BNHasSymbols( + + // BNBinaryView* view + IntPtr view + ); + } +} \ No newline at end of file diff --git a/Function/BNHasUnresolvedIndirectBranches.cs b/Function/BNHasUnresolvedIndirectBranches.cs new file mode 100644 index 0000000..13eee71 --- /dev/null +++ b/Function/BNHasUnresolvedIndirectBranches.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNHasUnresolvedIndirectBranches(BNFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNHasUnresolvedIndirectBranches" + )] + internal static extern bool BNHasUnresolvedIndirectBranches( + + // BNFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNHighLevelILAddExpr.cs b/Function/BNHighLevelILAddExpr.cs new file mode 100644 index 0000000..21605a9 --- /dev/null +++ b/Function/BNHighLevelILAddExpr.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNHighLevelILAddExpr(BNHighLevelILFunction* func, BNHighLevelILOperation operation, uint64_t size, uint64_t a, uint64_t b, uint64_t c, uint64_t d, uint64_t e) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNHighLevelILAddExpr" + )] + internal static extern HighLevelILExpressionIndex BNHighLevelILAddExpr( + + // BNHighLevelILFunction* func + IntPtr func , + + // BNHighLevelILOperation operation + HighLevelILOperation operation , + + // uint64_t size + ulong size , + + // uint64_t a + ulong a , + + // uint64_t b + ulong b , + + // uint64_t c + ulong c , + + // uint64_t d + ulong d , + + // uint64_t e + ulong e + ); + } +} \ No newline at end of file diff --git a/Function/BNHighLevelILAddExprWithLocation.cs b/Function/BNHighLevelILAddExprWithLocation.cs new file mode 100644 index 0000000..27e54ab --- /dev/null +++ b/Function/BNHighLevelILAddExprWithLocation.cs @@ -0,0 +1,51 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNHighLevelILAddExprWithLocation(BNHighLevelILFunction* func, BNHighLevelILOperation operation, uint64_t addr, uint32_t sourceOperand, uint64_t size, uint64_t a, uint64_t b, uint64_t c, uint64_t d, uint64_t e) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNHighLevelILAddExprWithLocation" + )] + internal static extern HighLevelILExpressionIndex BNHighLevelILAddExprWithLocation( + + // BNHighLevelILFunction* func + IntPtr func , + + // BNHighLevelILOperation operation + HighLevelILOperation operation , + + // uint64_t addr + ulong addr , + + // uint32_t sourceOperand + uint sourceOperand , + + // uint64_t size + ulong size , + + // uint64_t a + ulong a , + + // uint64_t b + ulong b , + + // uint64_t c + ulong c , + + // uint64_t d + ulong d , + + // uint64_t e + ulong e + ); + } +} \ No newline at end of file diff --git a/Function/BNHighLevelILAddOperandList.cs b/Function/BNHighLevelILAddOperandList.cs new file mode 100644 index 0000000..684d1b8 --- /dev/null +++ b/Function/BNHighLevelILAddOperandList.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNHighLevelILAddOperandList(BNHighLevelILFunction* func, uint64_t* operands, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNHighLevelILAddOperandList" + )] + internal static extern HighLevelILExpressionIndex BNHighLevelILAddOperandList( + + // BNHighLevelILFunction* func + IntPtr func , + + // uint64_t* operands + ulong[] operands , + + // uint64_t count + ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNHighLevelILExprEqual.cs b/Function/BNHighLevelILExprEqual.cs new file mode 100644 index 0000000..174ba91 --- /dev/null +++ b/Function/BNHighLevelILExprEqual.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNHighLevelILExprEqual(BNHighLevelILFunction* leftFunc, uint64_t leftExpr, BNHighLevelILFunction* rightFunc, uint64_t rightExpr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNHighLevelILExprEqual" + )] + internal static extern bool BNHighLevelILExprEqual( + + // BNHighLevelILFunction* leftFunc + IntPtr leftFunc , + + // uint64_t leftExpr + ulong leftExpr , + + // BNHighLevelILFunction* rightFunc + IntPtr rightFunc , + + // uint64_t rightExpr + ulong rightExpr + + ); + } +} \ No newline at end of file diff --git a/Function/BNHighLevelILExprLessThan.cs b/Function/BNHighLevelILExprLessThan.cs new file mode 100644 index 0000000..41f0299 --- /dev/null +++ b/Function/BNHighLevelILExprLessThan.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNHighLevelILExprLessThan(BNHighLevelILFunction* leftFunc, uint64_t leftExpr, BNHighLevelILFunction* rightFunc, uint64_t rightExpr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNHighLevelILExprLessThan" + )] + internal static extern bool BNHighLevelILExprLessThan( + + // BNHighLevelILFunction* leftFunc + IntPtr leftFunc , + + // uint64_t leftExpr + ulong leftExpr , + + // BNHighLevelILFunction* rightFunc + IntPtr rightFunc , + + // uint64_t rightExpr + ulong rightExpr + ); + } +} \ No newline at end of file diff --git a/Function/BNHighLevelILFreeOperandList.cs b/Function/BNHighLevelILFreeOperandList.cs new file mode 100644 index 0000000..49633f5 --- /dev/null +++ b/Function/BNHighLevelILFreeOperandList.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNHighLevelILFreeOperandList(uint64_t* operands) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNHighLevelILFreeOperandList" + )] + internal static extern void BNHighLevelILFreeOperandList( + + // uint64_t* operands + IntPtr operands + + ); + } +} \ No newline at end of file diff --git a/Function/BNHighLevelILGetCurrentAddress.cs b/Function/BNHighLevelILGetCurrentAddress.cs new file mode 100644 index 0000000..8836272 --- /dev/null +++ b/Function/BNHighLevelILGetCurrentAddress.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNHighLevelILGetCurrentAddress(BNHighLevelILFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNHighLevelILGetCurrentAddress" + )] + internal static extern ulong BNHighLevelILGetCurrentAddress( + + // BNHighLevelILFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNHighLevelILGetOperandList.cs b/Function/BNHighLevelILGetOperandList.cs new file mode 100644 index 0000000..dfc1c37 --- /dev/null +++ b/Function/BNHighLevelILGetOperandList.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t* BNHighLevelILGetOperandList(BNHighLevelILFunction* func, uint64_t expr, uint64_t operand, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNHighLevelILGetOperandList" + )] + internal static extern IntPtr BNHighLevelILGetOperandList( + + // BNHighLevelILFunction* func + IntPtr func , + + // uint64_t expr + HighLevelILExpressionIndex expr , + + // uint64_t operand + ulong operand , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNHighLevelILHasSideEffects.cs b/Function/BNHighLevelILHasSideEffects.cs new file mode 100644 index 0000000..7459cd7 --- /dev/null +++ b/Function/BNHighLevelILHasSideEffects.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNHighLevelILHasSideEffects(BNHighLevelILFunction* func, uint64_t exprIndex) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNHighLevelILHasSideEffects" + )] + internal static extern bool BNHighLevelILHasSideEffects( + + // BNHighLevelILFunction* func + IntPtr func , + + // uint64_t exprIndex + HighLevelILExpressionIndex exprIndex + ); + } +} \ No newline at end of file diff --git a/Function/BNHighLevelILSetCurrentAddress.cs b/Function/BNHighLevelILSetCurrentAddress.cs new file mode 100644 index 0000000..4ba93d5 --- /dev/null +++ b/Function/BNHighLevelILSetCurrentAddress.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNHighLevelILSetCurrentAddress(BNHighLevelILFunction* func, BNArchitecture* arch, uint64_t addr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNHighLevelILSetCurrentAddress" + )] + internal static extern void BNHighLevelILSetCurrentAddress( + + // BNHighLevelILFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t addr + ulong addr + ); + } +} \ No newline at end of file diff --git a/Function/BNHighLevelILTokenEmitterAppend.cs b/Function/BNHighLevelILTokenEmitterAppend.cs new file mode 100644 index 0000000..848d281 --- /dev/null +++ b/Function/BNHighLevelILTokenEmitterAppend.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNHighLevelILTokenEmitterAppend(BNHighLevelILTokenEmitter* emitter, BNInstructionTextToken* token) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNHighLevelILTokenEmitterAppend" + )] + internal static extern void BNHighLevelILTokenEmitterAppend( + + // BNHighLevelILTokenEmitter* emitter + IntPtr emitter , + + // BNInstructionTextToken* token + in BNInstructionTextToken token + ); + } +} \ No newline at end of file diff --git a/Function/BNHighLevelILTokenEmitterAppendCloseBrace.cs b/Function/BNHighLevelILTokenEmitterAppendCloseBrace.cs new file mode 100644 index 0000000..35b32fc --- /dev/null +++ b/Function/BNHighLevelILTokenEmitterAppendCloseBrace.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNHighLevelILTokenEmitterAppendCloseBrace(BNHighLevelILTokenEmitter* emitter) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNHighLevelILTokenEmitterAppendCloseBrace" + )] + internal static extern void BNHighLevelILTokenEmitterAppendCloseBrace( + + // BNHighLevelILTokenEmitter* emitter + IntPtr emitter + ); + } +} \ No newline at end of file diff --git a/Function/BNHighLevelILTokenEmitterAppendCloseBracket.cs b/Function/BNHighLevelILTokenEmitterAppendCloseBracket.cs new file mode 100644 index 0000000..18b5760 --- /dev/null +++ b/Function/BNHighLevelILTokenEmitterAppendCloseBracket.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNHighLevelILTokenEmitterAppendCloseBracket(BNHighLevelILTokenEmitter* emitter) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNHighLevelILTokenEmitterAppendCloseBracket" + )] + internal static extern void BNHighLevelILTokenEmitterAppendCloseBracket( + + // BNHighLevelILTokenEmitter* emitter + IntPtr emitter + ); + } +} \ No newline at end of file diff --git a/Function/BNHighLevelILTokenEmitterAppendCloseParen.cs b/Function/BNHighLevelILTokenEmitterAppendCloseParen.cs new file mode 100644 index 0000000..82960a5 --- /dev/null +++ b/Function/BNHighLevelILTokenEmitterAppendCloseParen.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNHighLevelILTokenEmitterAppendCloseParen(BNHighLevelILTokenEmitter* emitter) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNHighLevelILTokenEmitterAppendCloseParen" + )] + internal static extern void BNHighLevelILTokenEmitterAppendCloseParen( + + // BNHighLevelILTokenEmitter* emitter + IntPtr emitter + + ); + } +} \ No newline at end of file diff --git a/Function/BNHighLevelILTokenEmitterAppendOpenBrace.cs b/Function/BNHighLevelILTokenEmitterAppendOpenBrace.cs new file mode 100644 index 0000000..6f45e38 --- /dev/null +++ b/Function/BNHighLevelILTokenEmitterAppendOpenBrace.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNHighLevelILTokenEmitterAppendOpenBrace(BNHighLevelILTokenEmitter* emitter) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNHighLevelILTokenEmitterAppendOpenBrace" + )] + internal static extern void BNHighLevelILTokenEmitterAppendOpenBrace( + + // BNHighLevelILTokenEmitter* emitter + IntPtr emitter + ); + } +} \ No newline at end of file diff --git a/Function/BNHighLevelILTokenEmitterAppendOpenBracket.cs b/Function/BNHighLevelILTokenEmitterAppendOpenBracket.cs new file mode 100644 index 0000000..8e02dfa --- /dev/null +++ b/Function/BNHighLevelILTokenEmitterAppendOpenBracket.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNHighLevelILTokenEmitterAppendOpenBracket(BNHighLevelILTokenEmitter* emitter) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNHighLevelILTokenEmitterAppendOpenBracket" + )] + internal static extern void BNHighLevelILTokenEmitterAppendOpenBracket( + + // BNHighLevelILTokenEmitter* emitter + IntPtr emitter + ); + } +} \ No newline at end of file diff --git a/Function/BNHighLevelILTokenEmitterAppendOpenParen.cs b/Function/BNHighLevelILTokenEmitterAppendOpenParen.cs new file mode 100644 index 0000000..9417905 --- /dev/null +++ b/Function/BNHighLevelILTokenEmitterAppendOpenParen.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNHighLevelILTokenEmitterAppendOpenParen(BNHighLevelILTokenEmitter* emitter) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNHighLevelILTokenEmitterAppendOpenParen" + )] + internal static extern void BNHighLevelILTokenEmitterAppendOpenParen( + + // BNHighLevelILTokenEmitter* emitter + IntPtr emitter + ); + } +} \ No newline at end of file diff --git a/Function/BNHighLevelILTokenEmitterAppendSemicolon.cs b/Function/BNHighLevelILTokenEmitterAppendSemicolon.cs new file mode 100644 index 0000000..02f158e --- /dev/null +++ b/Function/BNHighLevelILTokenEmitterAppendSemicolon.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNHighLevelILTokenEmitterAppendSemicolon(BNHighLevelILTokenEmitter* emitter) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNHighLevelILTokenEmitterAppendSemicolon" + )] + internal static extern void BNHighLevelILTokenEmitterAppendSemicolon( + + // BNHighLevelILTokenEmitter* emitter + IntPtr emitter + ); + } +} \ No newline at end of file diff --git a/Function/BNHighLevelILTokenEmitterBeginForceZeroConfidence.cs b/Function/BNHighLevelILTokenEmitterBeginForceZeroConfidence.cs new file mode 100644 index 0000000..e6186b4 --- /dev/null +++ b/Function/BNHighLevelILTokenEmitterBeginForceZeroConfidence.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNHighLevelILTokenEmitterBeginForceZeroConfidence(BNHighLevelILTokenEmitter* emitter) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNHighLevelILTokenEmitterBeginForceZeroConfidence" + )] + internal static extern void BNHighLevelILTokenEmitterBeginForceZeroConfidence( + + // BNHighLevelILTokenEmitter* emitter + IntPtr emitter + ); + } +} \ No newline at end of file diff --git a/Function/BNHighLevelILTokenEmitterBeginScope.cs b/Function/BNHighLevelILTokenEmitterBeginScope.cs new file mode 100644 index 0000000..01ad8b8 --- /dev/null +++ b/Function/BNHighLevelILTokenEmitterBeginScope.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNHighLevelILTokenEmitterBeginScope(BNHighLevelILTokenEmitter* emitter, BNScopeType type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNHighLevelILTokenEmitterBeginScope" + )] + internal static extern void BNHighLevelILTokenEmitterBeginScope( + + // BNHighLevelILTokenEmitter* emitter + IntPtr emitter , + + // BNScopeType type + ScopeType type + ); + } +} \ No newline at end of file diff --git a/Function/BNHighLevelILTokenEmitterDecreaseIndent.cs b/Function/BNHighLevelILTokenEmitterDecreaseIndent.cs new file mode 100644 index 0000000..af5dac0 --- /dev/null +++ b/Function/BNHighLevelILTokenEmitterDecreaseIndent.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNHighLevelILTokenEmitterDecreaseIndent(BNHighLevelILTokenEmitter* emitter) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNHighLevelILTokenEmitterDecreaseIndent" + )] + internal static extern void BNHighLevelILTokenEmitterDecreaseIndent( + + // BNHighLevelILTokenEmitter* emitter + IntPtr emitter + ); + } +} \ No newline at end of file diff --git a/Function/BNHighLevelILTokenEmitterEndForceZeroConfidence.cs b/Function/BNHighLevelILTokenEmitterEndForceZeroConfidence.cs new file mode 100644 index 0000000..19076ca --- /dev/null +++ b/Function/BNHighLevelILTokenEmitterEndForceZeroConfidence.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNHighLevelILTokenEmitterEndForceZeroConfidence(BNHighLevelILTokenEmitter* emitter) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNHighLevelILTokenEmitterEndForceZeroConfidence" + )] + internal static extern void BNHighLevelILTokenEmitterEndForceZeroConfidence( + + // BNHighLevelILTokenEmitter* emitter + IntPtr emitter + ); + } +} \ No newline at end of file diff --git a/Function/BNHighLevelILTokenEmitterEndScope.cs b/Function/BNHighLevelILTokenEmitterEndScope.cs new file mode 100644 index 0000000..139abaf --- /dev/null +++ b/Function/BNHighLevelILTokenEmitterEndScope.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNHighLevelILTokenEmitterEndScope(BNHighLevelILTokenEmitter* emitter, BNScopeType type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNHighLevelILTokenEmitterEndScope" + )] + internal static extern void BNHighLevelILTokenEmitterEndScope( + + // BNHighLevelILTokenEmitter* emitter + IntPtr emitter , + + // BNScopeType type + ScopeType type + ); + } +} \ No newline at end of file diff --git a/Function/BNHighLevelILTokenEmitterFinalize.cs b/Function/BNHighLevelILTokenEmitterFinalize.cs new file mode 100644 index 0000000..120fb6b --- /dev/null +++ b/Function/BNHighLevelILTokenEmitterFinalize.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNHighLevelILTokenEmitterFinalize(BNHighLevelILTokenEmitter* emitter) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNHighLevelILTokenEmitterFinalize" + )] + internal static extern void BNHighLevelILTokenEmitterFinalize( + + // BNHighLevelILTokenEmitter* emitter + IntPtr emitter + + ); + } +} \ No newline at end of file diff --git a/Function/BNHighLevelILTokenEmitterFinalizeScope.cs b/Function/BNHighLevelILTokenEmitterFinalizeScope.cs new file mode 100644 index 0000000..792681a --- /dev/null +++ b/Function/BNHighLevelILTokenEmitterFinalizeScope.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNHighLevelILTokenEmitterFinalizeScope(BNHighLevelILTokenEmitter* emitter) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNHighLevelILTokenEmitterFinalizeScope" + )] + internal static extern void BNHighLevelILTokenEmitterFinalizeScope( + + // BNHighLevelILTokenEmitter* emitter + IntPtr emitter + ); + } +} \ No newline at end of file diff --git a/Function/BNHighLevelILTokenEmitterGetBraceRequirement.cs b/Function/BNHighLevelILTokenEmitterGetBraceRequirement.cs new file mode 100644 index 0000000..6b9124b --- /dev/null +++ b/Function/BNHighLevelILTokenEmitterGetBraceRequirement.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBraceRequirement BNHighLevelILTokenEmitterGetBraceRequirement(BNHighLevelILTokenEmitter* emitter) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNHighLevelILTokenEmitterGetBraceRequirement" + )] + internal static extern BraceRequirement BNHighLevelILTokenEmitterGetBraceRequirement( + + // BNHighLevelILTokenEmitter* emitter + IntPtr emitter + ); + } +} \ No newline at end of file diff --git a/Function/BNHighLevelILTokenEmitterGetCurrentTokens.cs b/Function/BNHighLevelILTokenEmitterGetCurrentTokens.cs new file mode 100644 index 0000000..0564260 --- /dev/null +++ b/Function/BNHighLevelILTokenEmitterGetCurrentTokens.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNInstructionTextToken* BNHighLevelILTokenEmitterGetCurrentTokens(BNHighLevelILTokenEmitter* emitter, uint64_t* tokenCount) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNHighLevelILTokenEmitterGetCurrentTokens" + )] + internal static extern IntPtr BNHighLevelILTokenEmitterGetCurrentTokens( + + // BNHighLevelILTokenEmitter* emitter + IntPtr emitter , + + // uint64_t* tokenCount + IntPtr tokenCount + + ); + } +} \ No newline at end of file diff --git a/Function/BNHighLevelILTokenEmitterGetDefaultBracesOnSameLine.cs b/Function/BNHighLevelILTokenEmitterGetDefaultBracesOnSameLine.cs new file mode 100644 index 0000000..c8177f1 --- /dev/null +++ b/Function/BNHighLevelILTokenEmitterGetDefaultBracesOnSameLine.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNHighLevelILTokenEmitterGetDefaultBracesOnSameLine(BNHighLevelILTokenEmitter* emitter) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNHighLevelILTokenEmitterGetDefaultBracesOnSameLine" + )] + internal static extern bool BNHighLevelILTokenEmitterGetDefaultBracesOnSameLine( + + // BNHighLevelILTokenEmitter* emitter + IntPtr emitter + + ); + } +} \ No newline at end of file diff --git a/Function/BNHighLevelILTokenEmitterGetLines.cs b/Function/BNHighLevelILTokenEmitterGetLines.cs new file mode 100644 index 0000000..156e4cf --- /dev/null +++ b/Function/BNHighLevelILTokenEmitterGetLines.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDisassemblyTextLine* BNHighLevelILTokenEmitterGetLines(BNHighLevelILTokenEmitter* emitter, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNHighLevelILTokenEmitterGetLines" + )] + internal static extern IntPtr BNHighLevelILTokenEmitterGetLines( + + // BNHighLevelILTokenEmitter* emitter + IntPtr emitter , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNHighLevelILTokenEmitterGetMaxTernarySimplficationTokens.cs b/Function/BNHighLevelILTokenEmitterGetMaxTernarySimplficationTokens.cs new file mode 100644 index 0000000..e22e36e --- /dev/null +++ b/Function/BNHighLevelILTokenEmitterGetMaxTernarySimplficationTokens.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNHighLevelILTokenEmitterGetMaxTernarySimplficationTokens(BNHighLevelILTokenEmitter* emitter) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNHighLevelILTokenEmitterGetMaxTernarySimplficationTokens" + )] + internal static extern ulong BNHighLevelILTokenEmitterGetMaxTernarySimplficationTokens( + + // BNHighLevelILTokenEmitter* emitter + IntPtr emitter + + ); + } +} \ No newline at end of file diff --git a/Function/BNHighLevelILTokenEmitterHasBracesAroundSwitchCases.cs b/Function/BNHighLevelILTokenEmitterHasBracesAroundSwitchCases.cs new file mode 100644 index 0000000..88d56bd --- /dev/null +++ b/Function/BNHighLevelILTokenEmitterHasBracesAroundSwitchCases.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNHighLevelILTokenEmitterHasBracesAroundSwitchCases(BNHighLevelILTokenEmitter* emitter) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNHighLevelILTokenEmitterHasBracesAroundSwitchCases" + )] + internal static extern bool BNHighLevelILTokenEmitterHasBracesAroundSwitchCases( + + // BNHighLevelILTokenEmitter* emitter + IntPtr emitter + + ); + } +} \ No newline at end of file diff --git a/Function/BNHighLevelILTokenEmitterHasCollapsableRegions.cs b/Function/BNHighLevelILTokenEmitterHasCollapsableRegions.cs new file mode 100644 index 0000000..040f40f --- /dev/null +++ b/Function/BNHighLevelILTokenEmitterHasCollapsableRegions.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNHighLevelILTokenEmitterHasCollapsableRegions(BNHighLevelILTokenEmitter* emitter) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNHighLevelILTokenEmitterHasCollapsableRegions" + )] + internal static extern bool BNHighLevelILTokenEmitterHasCollapsableRegions( + + // BNHighLevelILTokenEmitter* emitter + IntPtr emitter + ); + } +} \ No newline at end of file diff --git a/Function/BNHighLevelILTokenEmitterIncreaseIndent.cs b/Function/BNHighLevelILTokenEmitterIncreaseIndent.cs new file mode 100644 index 0000000..836c0d3 --- /dev/null +++ b/Function/BNHighLevelILTokenEmitterIncreaseIndent.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNHighLevelILTokenEmitterIncreaseIndent(BNHighLevelILTokenEmitter* emitter) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNHighLevelILTokenEmitterIncreaseIndent" + )] + internal static extern void BNHighLevelILTokenEmitterIncreaseIndent( + + // BNHighLevelILTokenEmitter* emitter + IntPtr emitter + ); + } +} \ No newline at end of file diff --git a/Function/BNHighLevelILTokenEmitterInitLine.cs b/Function/BNHighLevelILTokenEmitterInitLine.cs new file mode 100644 index 0000000..c9baa0b --- /dev/null +++ b/Function/BNHighLevelILTokenEmitterInitLine.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNHighLevelILTokenEmitterInitLine(BNHighLevelILTokenEmitter* emitter) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNHighLevelILTokenEmitterInitLine" + )] + internal static extern void BNHighLevelILTokenEmitterInitLine( + + // BNHighLevelILTokenEmitter* emitter + IntPtr emitter + ); + } +} \ No newline at end of file diff --git a/Function/BNHighLevelILTokenEmitterIsSimpleScopeAllowed.cs b/Function/BNHighLevelILTokenEmitterIsSimpleScopeAllowed.cs new file mode 100644 index 0000000..a1b2a41 --- /dev/null +++ b/Function/BNHighLevelILTokenEmitterIsSimpleScopeAllowed.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNHighLevelILTokenEmitterIsSimpleScopeAllowed(BNHighLevelILTokenEmitter* emitter) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNHighLevelILTokenEmitterIsSimpleScopeAllowed" + )] + internal static extern bool BNHighLevelILTokenEmitterIsSimpleScopeAllowed( + + // BNHighLevelILTokenEmitter* emitter + IntPtr emitter + + ); + } +} \ No newline at end of file diff --git a/Function/BNHighLevelILTokenEmitterNewLine.cs b/Function/BNHighLevelILTokenEmitterNewLine.cs new file mode 100644 index 0000000..e0c4c65 --- /dev/null +++ b/Function/BNHighLevelILTokenEmitterNewLine.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNHighLevelILTokenEmitterNewLine(BNHighLevelILTokenEmitter* emitter) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNHighLevelILTokenEmitterNewLine" + )] + internal static extern void BNHighLevelILTokenEmitterNewLine( + + // BNHighLevelILTokenEmitter* emitter + IntPtr emitter + ); + } +} \ No newline at end of file diff --git a/Function/BNHighLevelILTokenEmitterNoIndentForThisLine.cs b/Function/BNHighLevelILTokenEmitterNoIndentForThisLine.cs new file mode 100644 index 0000000..877dab8 --- /dev/null +++ b/Function/BNHighLevelILTokenEmitterNoIndentForThisLine.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNHighLevelILTokenEmitterNoIndentForThisLine(BNHighLevelILTokenEmitter* emitter) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNHighLevelILTokenEmitterNoIndentForThisLine" + )] + internal static extern void BNHighLevelILTokenEmitterNoIndentForThisLine( + + // BNHighLevelILTokenEmitter* emitter + IntPtr emitter + ); + } +} \ No newline at end of file diff --git a/Function/BNHighLevelILTokenEmitterRestoreCurrentExpr.cs b/Function/BNHighLevelILTokenEmitterRestoreCurrentExpr.cs new file mode 100644 index 0000000..0f66ede --- /dev/null +++ b/Function/BNHighLevelILTokenEmitterRestoreCurrentExpr.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNHighLevelILTokenEmitterRestoreCurrentExpr(BNHighLevelILTokenEmitter* emitter, BNTokenEmitterExpr expr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNHighLevelILTokenEmitterRestoreCurrentExpr" + )] + internal static extern void BNHighLevelILTokenEmitterRestoreCurrentExpr( + + // BNHighLevelILTokenEmitter* emitter + IntPtr emitter , + + // BNTokenEmitterExpr expr + in BNTokenEmitterExpr expr + ); + } +} \ No newline at end of file diff --git a/Function/BNHighLevelILTokenEmitterScopeContinuation.cs b/Function/BNHighLevelILTokenEmitterScopeContinuation.cs new file mode 100644 index 0000000..a6f1983 --- /dev/null +++ b/Function/BNHighLevelILTokenEmitterScopeContinuation.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNHighLevelILTokenEmitterScopeContinuation(BNHighLevelILTokenEmitter* emitter, bool forceSameLine) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNHighLevelILTokenEmitterScopeContinuation" + )] + internal static extern void BNHighLevelILTokenEmitterScopeContinuation( + + // BNHighLevelILTokenEmitter* emitter + IntPtr emitter , + + // bool forceSameLine + bool forceSameLine + ); + } +} \ No newline at end of file diff --git a/Function/BNHighLevelILTokenEmitterScopeSeparator.cs b/Function/BNHighLevelILTokenEmitterScopeSeparator.cs new file mode 100644 index 0000000..7990a8d --- /dev/null +++ b/Function/BNHighLevelILTokenEmitterScopeSeparator.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNHighLevelILTokenEmitterScopeSeparator(BNHighLevelILTokenEmitter* emitter) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNHighLevelILTokenEmitterScopeSeparator" + )] + internal static extern void BNHighLevelILTokenEmitterScopeSeparator( + + // BNHighLevelILTokenEmitter* emitter + IntPtr emitter + ); + } +} \ No newline at end of file diff --git a/Function/BNHighLevelILTokenEmitterSetBraceRequirement.cs b/Function/BNHighLevelILTokenEmitterSetBraceRequirement.cs new file mode 100644 index 0000000..2cfc897 --- /dev/null +++ b/Function/BNHighLevelILTokenEmitterSetBraceRequirement.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNHighLevelILTokenEmitterSetBraceRequirement(BNHighLevelILTokenEmitter* emitter, BNBraceRequirement required) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNHighLevelILTokenEmitterSetBraceRequirement" + )] + internal static extern void BNHighLevelILTokenEmitterSetBraceRequirement( + + // BNHighLevelILTokenEmitter* emitter + IntPtr emitter , + + // BNBraceRequirement _required + BraceRequirement _required + + ); + } +} \ No newline at end of file diff --git a/Function/BNHighLevelILTokenEmitterSetBracesAroundSwitchCases.cs b/Function/BNHighLevelILTokenEmitterSetBracesAroundSwitchCases.cs new file mode 100644 index 0000000..05387b9 --- /dev/null +++ b/Function/BNHighLevelILTokenEmitterSetBracesAroundSwitchCases.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNHighLevelILTokenEmitterSetBracesAroundSwitchCases(BNHighLevelILTokenEmitter* emitter, bool braces) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNHighLevelILTokenEmitterSetBracesAroundSwitchCases" + )] + internal static extern void BNHighLevelILTokenEmitterSetBracesAroundSwitchCases( + + // BNHighLevelILTokenEmitter* emitter + IntPtr emitter , + + // bool braces + bool braces + + ); + } +} \ No newline at end of file diff --git a/Function/BNHighLevelILTokenEmitterSetCurrentExpr.cs b/Function/BNHighLevelILTokenEmitterSetCurrentExpr.cs new file mode 100644 index 0000000..dc41db9 --- /dev/null +++ b/Function/BNHighLevelILTokenEmitterSetCurrentExpr.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTokenEmitterExpr BNHighLevelILTokenEmitterSetCurrentExpr(BNHighLevelILTokenEmitter* emitter, BNTokenEmitterExpr expr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNHighLevelILTokenEmitterSetCurrentExpr" + )] + internal static extern BNTokenEmitterExpr BNHighLevelILTokenEmitterSetCurrentExpr( + + // BNHighLevelILTokenEmitter* emitter + IntPtr emitter , + + // BNTokenEmitterExpr expr + in BNTokenEmitterExpr expr + ); + } +} \ No newline at end of file diff --git a/Function/BNHighLevelILTokenEmitterSetCurrentTokens.cs b/Function/BNHighLevelILTokenEmitterSetCurrentTokens.cs new file mode 100644 index 0000000..ff2bcb2 --- /dev/null +++ b/Function/BNHighLevelILTokenEmitterSetCurrentTokens.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNHighLevelILTokenEmitterSetCurrentTokens(BNHighLevelILTokenEmitter* emitter, BNInstructionTextToken* tokens, uint64_t tokenCount) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNHighLevelILTokenEmitterSetCurrentTokens" + )] + internal static extern void BNHighLevelILTokenEmitterSetCurrentTokens( + + // BNHighLevelILTokenEmitter* emitter + IntPtr emitter , + + // BNInstructionTextToken* tokens + IntPtr tokens , + + // uint64_t tokenCount + ulong tokenCount + + ); + } +} \ No newline at end of file diff --git a/Function/BNHighLevelILTokenEmitterSetDefaultBracesOnSameLine.cs b/Function/BNHighLevelILTokenEmitterSetDefaultBracesOnSameLine.cs new file mode 100644 index 0000000..9bf7a8d --- /dev/null +++ b/Function/BNHighLevelILTokenEmitterSetDefaultBracesOnSameLine.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNHighLevelILTokenEmitterSetDefaultBracesOnSameLine(BNHighLevelILTokenEmitter* emitter, bool sameLine) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNHighLevelILTokenEmitterSetDefaultBracesOnSameLine" + )] + internal static extern void BNHighLevelILTokenEmitterSetDefaultBracesOnSameLine( + + // BNHighLevelILTokenEmitter* emitter + IntPtr emitter , + + // bool sameLine + bool sameLine + + ); + } +} \ No newline at end of file diff --git a/Function/BNHighLevelILTokenEmitterSetHasCollapsableRegions.cs b/Function/BNHighLevelILTokenEmitterSetHasCollapsableRegions.cs new file mode 100644 index 0000000..ec81ea0 --- /dev/null +++ b/Function/BNHighLevelILTokenEmitterSetHasCollapsableRegions.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNHighLevelILTokenEmitterSetHasCollapsableRegions(BNHighLevelILTokenEmitter* emitter, bool state) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNHighLevelILTokenEmitterSetHasCollapsableRegions" + )] + internal static extern void BNHighLevelILTokenEmitterSetHasCollapsableRegions( + + // BNHighLevelILTokenEmitter* emitter + IntPtr emitter , + + // bool state + bool state + ); + } +} \ No newline at end of file diff --git a/Function/BNHighLevelILTokenEmitterSetSimpleScopeAllowed.cs b/Function/BNHighLevelILTokenEmitterSetSimpleScopeAllowed.cs new file mode 100644 index 0000000..0a56c59 --- /dev/null +++ b/Function/BNHighLevelILTokenEmitterSetSimpleScopeAllowed.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNHighLevelILTokenEmitterSetSimpleScopeAllowed(BNHighLevelILTokenEmitter* emitter, bool allowed) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNHighLevelILTokenEmitterSetSimpleScopeAllowed" + )] + internal static extern void BNHighLevelILTokenEmitterSetSimpleScopeAllowed( + + // BNHighLevelILTokenEmitter* emitter + IntPtr emitter , + + // bool allowed + bool allowed + + ); + } +} \ No newline at end of file diff --git a/Function/BNHighLevelILTokenPrependCollapseBlankIndicator.cs b/Function/BNHighLevelILTokenPrependCollapseBlankIndicator.cs new file mode 100644 index 0000000..19f8ec7 --- /dev/null +++ b/Function/BNHighLevelILTokenPrependCollapseBlankIndicator.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNHighLevelILTokenPrependCollapseBlankIndicator(BNHighLevelILTokenEmitter* emitter) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNHighLevelILTokenPrependCollapseBlankIndicator" + )] + internal static extern void BNHighLevelILTokenPrependCollapseBlankIndicator( + + // BNHighLevelILTokenEmitter* emitter + IntPtr emitter + ); + } +} \ No newline at end of file diff --git a/Function/BNHighLevelILTokenPrependCollapseIndicator.cs b/Function/BNHighLevelILTokenPrependCollapseIndicator.cs new file mode 100644 index 0000000..119b543 --- /dev/null +++ b/Function/BNHighLevelILTokenPrependCollapseIndicator.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNHighLevelILTokenPrependCollapseIndicator(BNHighLevelILTokenEmitter* emitter, BNInstructionTextTokenContext context, uint64_t hash) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNHighLevelILTokenPrependCollapseIndicator" + )] + internal static extern void BNHighLevelILTokenPrependCollapseIndicator( + + // BNHighLevelILTokenEmitter* emitter + IntPtr emitter , + + // BNInstructionTextTokenContext context + InstructionTextTokenContext context , + + // uint64_t hash + ulong hash + ); + } +} \ No newline at end of file diff --git a/Function/BNImportedFunctionFromImportAddressSymbol.cs b/Function/BNImportedFunctionFromImportAddressSymbol.cs new file mode 100644 index 0000000..84da969 --- /dev/null +++ b/Function/BNImportedFunctionFromImportAddressSymbol.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNSymbol* BNImportedFunctionFromImportAddressSymbol(BNSymbol* sym, uint64_t addr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNImportedFunctionFromImportAddressSymbol" + )] + internal static extern IntPtr BNImportedFunctionFromImportAddressSymbol( + + // BNSymbol* sym + IntPtr sym , + + // uint64_t addr + ulong addr + + ); + } +} \ No newline at end of file diff --git a/Function/BNInitCorePlugins.cs b/Function/BNInitCorePlugins.cs new file mode 100644 index 0000000..ddffcb8 --- /dev/null +++ b/Function/BNInitCorePlugins.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNInitCorePlugins() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNInitCorePlugins" + )] + internal static extern bool BNInitCorePlugins( + + ); + } +} \ No newline at end of file diff --git a/Function/BNInitDownloadInstance.cs b/Function/BNInitDownloadInstance.cs new file mode 100644 index 0000000..c5f004d --- /dev/null +++ b/Function/BNInitDownloadInstance.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDownloadInstance* BNInitDownloadInstance(BNDownloadProvider* provider, BNDownloadInstanceCallbacks* callbacks) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNInitDownloadInstance" + )] + internal static extern IntPtr BNInitDownloadInstance( + + // BNDownloadProvider* provider + IntPtr provider , + + // BNDownloadInstanceCallbacks* callbacks + IntPtr callbacks + + ); + } +} \ No newline at end of file diff --git a/Function/BNInitPlugins.cs b/Function/BNInitPlugins.cs new file mode 100644 index 0000000..3f632df --- /dev/null +++ b/Function/BNInitPlugins.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public static partial class Core + { + public static bool InitPlugins(bool allowUserPlugins ) + { + return NativeMethods.BNInitPlugins(allowUserPlugins); + } + } + + internal static partial class NativeMethods + { + /// + /// bool BNInitPlugins(bool allowUserPlugins) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNInitPlugins" + )] + public static extern bool BNInitPlugins( + + // bool allowUserPlugins + bool allowUserPlugins + ); + } +} \ No newline at end of file diff --git a/Function/BNInitRepoPlugins.cs b/Function/BNInitRepoPlugins.cs new file mode 100644 index 0000000..4d23b0b --- /dev/null +++ b/Function/BNInitRepoPlugins.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNInitRepoPlugins() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNInitRepoPlugins" + )] + internal static extern void BNInitRepoPlugins( + + ); + } +} \ No newline at end of file diff --git a/Function/BNInitScriptingInstance.cs b/Function/BNInitScriptingInstance.cs new file mode 100644 index 0000000..e9db7ba --- /dev/null +++ b/Function/BNInitScriptingInstance.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNScriptingInstance* BNInitScriptingInstance(BNScriptingProvider* provider, BNScriptingInstanceCallbacks* callbacks) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNInitScriptingInstance" + )] + internal static extern IntPtr BNInitScriptingInstance( + + // BNScriptingProvider* provider + IntPtr provider , + + // BNScriptingInstanceCallbacks* callbacks + IntPtr callbacks + + ); + } +} \ No newline at end of file diff --git a/Function/BNInitUserPlugins.cs b/Function/BNInitUserPlugins.cs new file mode 100644 index 0000000..75ba638 --- /dev/null +++ b/Function/BNInitUserPlugins.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNInitUserPlugins() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNInitUserPlugins" + )] + internal static extern void BNInitUserPlugins( + + ); + } +} \ No newline at end of file diff --git a/Function/BNInitWebsocketClient.cs b/Function/BNInitWebsocketClient.cs new file mode 100644 index 0000000..a174570 --- /dev/null +++ b/Function/BNInitWebsocketClient.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNWebsocketClient* BNInitWebsocketClient(BNWebsocketProvider* provider, BNWebsocketClientCallbacks* callbacks) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNInitWebsocketClient" + )] + internal static extern IntPtr BNInitWebsocketClient( + + // BNWebsocketProvider* provider + IntPtr provider , + + // BNWebsocketClientCallbacks* callbacks + IntPtr callbacks + + ); + } +} \ No newline at end of file diff --git a/Function/BNInitializeEnterpriseServer.cs b/Function/BNInitializeEnterpriseServer.cs new file mode 100644 index 0000000..4395917 --- /dev/null +++ b/Function/BNInitializeEnterpriseServer.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNInitializeEnterpriseServer() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNInitializeEnterpriseServer" + )] + internal static extern bool BNInitializeEnterpriseServer( + + ); + } +} \ No newline at end of file diff --git a/Function/BNInsertViewBuffer.cs b/Function/BNInsertViewBuffer.cs new file mode 100644 index 0000000..92c60ea --- /dev/null +++ b/Function/BNInsertViewBuffer.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNInsertViewBuffer(BNBinaryView* view, uint64_t offset, BNDataBuffer* data) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNInsertViewBuffer" + )] + internal static extern ulong BNInsertViewBuffer( + + // BNBinaryView* view + IntPtr view , + + // uint64_t offset + ulong offset , + + // BNDataBuffer* data + IntPtr data + ); + } +} \ No newline at end of file diff --git a/Function/BNInsertViewData.cs b/Function/BNInsertViewData.cs new file mode 100644 index 0000000..b92e496 --- /dev/null +++ b/Function/BNInsertViewData.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNInsertViewData(BNBinaryView* view, uint64_t offset, void* data, uint64_t len) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNInsertViewData" + )] + internal static extern ulong BNInsertViewData( + + // BNBinaryView* view + IntPtr view , + + // uint64_t offset + ulong offset , + + // void* data + byte[] data , + + // uint64_t len + ulong len + ); + } +} \ No newline at end of file diff --git a/Function/BNInstallPendingUpdate.cs b/Function/BNInstallPendingUpdate.cs new file mode 100644 index 0000000..1f018bd --- /dev/null +++ b/Function/BNInstallPendingUpdate.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNInstallPendingUpdate(const char** errors) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNInstallPendingUpdate" + )] + internal static extern void BNInstallPendingUpdate( + + // const char** errors + string[] errors + + ); + } +} \ No newline at end of file diff --git a/Function/BNInstallScriptingProviderModules.cs b/Function/BNInstallScriptingProviderModules.cs new file mode 100644 index 0000000..df0c355 --- /dev/null +++ b/Function/BNInstallScriptingProviderModules.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNInstallScriptingProviderModules(BNScriptingProvider* provider, const char* modules) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNInstallScriptingProviderModules" + )] + internal static extern bool BNInstallScriptingProviderModules( + + // BNScriptingProvider* provider + IntPtr provider , + + // const char* modules + string modules + + ); + } +} \ No newline at end of file diff --git a/Function/BNInvertBranch.cs b/Function/BNInvertBranch.cs new file mode 100644 index 0000000..9a06f5a --- /dev/null +++ b/Function/BNInvertBranch.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNInvertBranch(BNBinaryView* view, BNArchitecture* arch, uint64_t addr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNInvertBranch" + )] + internal static extern bool BNInvertBranch( + + // BNBinaryView* view + IntPtr view , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t addr + ulong addr + ); + } +} \ No newline at end of file diff --git a/Function/BNIsAlwaysBranchPatchAvailable.cs b/Function/BNIsAlwaysBranchPatchAvailable.cs new file mode 100644 index 0000000..95050d2 --- /dev/null +++ b/Function/BNIsAlwaysBranchPatchAvailable.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsAlwaysBranchPatchAvailable(BNBinaryView* view, BNArchitecture* arch, uint64_t addr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNIsAlwaysBranchPatchAvailable" + )] + internal static extern bool BNIsAlwaysBranchPatchAvailable( + + // BNBinaryView* view + IntPtr view , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t addr + ulong addr + ); + } +} \ No newline at end of file diff --git a/Function/BNIsAnalysisChanged.cs b/Function/BNIsAnalysisChanged.cs new file mode 100644 index 0000000..fd82e5c --- /dev/null +++ b/Function/BNIsAnalysisChanged.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsAnalysisChanged(BNFileMetadata* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNIsAnalysisChanged" + )] + internal static extern bool BNIsAnalysisChanged( + + // BNFileMetadata* file + IntPtr file + ); + } +} \ No newline at end of file diff --git a/Function/BNIsAnalysisTypeAutoDefined.cs b/Function/BNIsAnalysisTypeAutoDefined.cs new file mode 100644 index 0000000..a27fcec --- /dev/null +++ b/Function/BNIsAnalysisTypeAutoDefined.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsAnalysisTypeAutoDefined(BNBinaryView* view, BNQualifiedName* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNIsAnalysisTypeAutoDefined" + )] + internal static extern bool BNIsAnalysisTypeAutoDefined( + + // BNBinaryView* view + IntPtr view , + + // BNQualifiedName* name + in BNQualifiedName name + ); + } +} \ No newline at end of file diff --git a/Function/BNIsApplyingDebugInfo.cs b/Function/BNIsApplyingDebugInfo.cs new file mode 100644 index 0000000..3bd175b --- /dev/null +++ b/Function/BNIsApplyingDebugInfo.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsApplyingDebugInfo(BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNIsApplyingDebugInfo" + )] + internal static extern bool BNIsApplyingDebugInfo( + + // BNBinaryView* view + IntPtr view + + ); + } +} \ No newline at end of file diff --git a/Function/BNIsArchitectureAlwaysBranchPatchAvailable.cs b/Function/BNIsArchitectureAlwaysBranchPatchAvailable.cs new file mode 100644 index 0000000..b40969d --- /dev/null +++ b/Function/BNIsArchitectureAlwaysBranchPatchAvailable.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsArchitectureAlwaysBranchPatchAvailable(BNArchitecture* arch, uint8_t* data, uint64_t addr, uint64_t len) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNIsArchitectureAlwaysBranchPatchAvailable" + )] + internal static extern bool BNIsArchitectureAlwaysBranchPatchAvailable( + + // BNArchitecture* arch + IntPtr arch , + + // uint8_t* data + byte[] data , + + // uint64_t addr + ulong addr , + + // uint64_t len + ulong len + ); + } +} \ No newline at end of file diff --git a/Function/BNIsArchitectureGlobalRegister.cs b/Function/BNIsArchitectureGlobalRegister.cs new file mode 100644 index 0000000..892ca41 --- /dev/null +++ b/Function/BNIsArchitectureGlobalRegister.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsArchitectureGlobalRegister(BNArchitecture* arch, uint32_t reg) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNIsArchitectureGlobalRegister" + )] + internal static extern bool BNIsArchitectureGlobalRegister( + + // BNArchitecture* arch + IntPtr arch , + + // uint32_t reg + RegisterIndex reg + ); + } +} \ No newline at end of file diff --git a/Function/BNIsArchitectureInvertBranchPatchAvailable.cs b/Function/BNIsArchitectureInvertBranchPatchAvailable.cs new file mode 100644 index 0000000..5fcbfbd --- /dev/null +++ b/Function/BNIsArchitectureInvertBranchPatchAvailable.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsArchitectureInvertBranchPatchAvailable(BNArchitecture* arch, uint8_t* data, uint64_t addr, uint64_t len) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNIsArchitectureInvertBranchPatchAvailable" + )] + internal static extern bool BNIsArchitectureInvertBranchPatchAvailable( + + // BNArchitecture* arch + IntPtr arch , + + // uint8_t* data + byte[] data , + + // uint64_t addr + ulong addr , + + // uint64_t len + ulong len + ); + } +} \ No newline at end of file diff --git a/Function/BNIsArchitectureNeverBranchPatchAvailable.cs b/Function/BNIsArchitectureNeverBranchPatchAvailable.cs new file mode 100644 index 0000000..140c97c --- /dev/null +++ b/Function/BNIsArchitectureNeverBranchPatchAvailable.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsArchitectureNeverBranchPatchAvailable(BNArchitecture* arch, uint8_t* data, uint64_t addr, uint64_t len) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNIsArchitectureNeverBranchPatchAvailable" + )] + internal static extern bool BNIsArchitectureNeverBranchPatchAvailable( + + // BNArchitecture* arch + IntPtr arch , + + // uint8_t* data + byte[] data , + + // uint64_t addr + ulong addr , + + // uint64_t len + ulong len + ); + } +} \ No newline at end of file diff --git a/Function/BNIsArchitectureSkipAndReturnValuePatchAvailable.cs b/Function/BNIsArchitectureSkipAndReturnValuePatchAvailable.cs new file mode 100644 index 0000000..0e4446e --- /dev/null +++ b/Function/BNIsArchitectureSkipAndReturnValuePatchAvailable.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsArchitectureSkipAndReturnValuePatchAvailable(BNArchitecture* arch, uint8_t* data, uint64_t addr, uint64_t len) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNIsArchitectureSkipAndReturnValuePatchAvailable" + )] + internal static extern bool BNIsArchitectureSkipAndReturnValuePatchAvailable( + + // BNArchitecture* arch + IntPtr arch , + + // uint8_t* data + byte[] data , + + // uint64_t addr + ulong addr , + + // uint64_t len + ulong len + ); + } +} \ No newline at end of file diff --git a/Function/BNIsArchitectureSkipAndReturnZeroPatchAvailable.cs b/Function/BNIsArchitectureSkipAndReturnZeroPatchAvailable.cs new file mode 100644 index 0000000..4e48747 --- /dev/null +++ b/Function/BNIsArchitectureSkipAndReturnZeroPatchAvailable.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsArchitectureSkipAndReturnZeroPatchAvailable(BNArchitecture* arch, uint8_t* data, uint64_t addr, uint64_t len) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNIsArchitectureSkipAndReturnZeroPatchAvailable" + )] + internal static extern bool BNIsArchitectureSkipAndReturnZeroPatchAvailable( + + // BNArchitecture* arch + IntPtr arch , + + // uint8_t* data + byte[] data , + + // uint64_t addr + ulong addr , + + // uint64_t len + ulong len + ); + } +} \ No newline at end of file diff --git a/Function/BNIsArchitectureSystemRegister.cs b/Function/BNIsArchitectureSystemRegister.cs new file mode 100644 index 0000000..bbebe2f --- /dev/null +++ b/Function/BNIsArchitectureSystemRegister.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsArchitectureSystemRegister(BNArchitecture* arch, uint32_t reg) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNIsArchitectureSystemRegister" + )] + internal static extern bool BNIsArchitectureSystemRegister( + + // BNArchitecture* arch + IntPtr arch , + + // uint32_t reg + RegisterIndex reg + ); + } +} \ No newline at end of file diff --git a/Function/BNIsBackedByDatabase.cs b/Function/BNIsBackedByDatabase.cs new file mode 100644 index 0000000..950f831 --- /dev/null +++ b/Function/BNIsBackedByDatabase.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsBackedByDatabase(BNFileMetadata* file, const char* binaryViewType) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNIsBackedByDatabase" + )] + internal static extern bool BNIsBackedByDatabase( + + // BNFileMetadata* file + IntPtr file , + + // const char* binaryViewType + string binaryViewType + ); + } +} \ No newline at end of file diff --git a/Function/BNIsBackgroundTaskCancelled.cs b/Function/BNIsBackgroundTaskCancelled.cs new file mode 100644 index 0000000..99e1493 --- /dev/null +++ b/Function/BNIsBackgroundTaskCancelled.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsBackgroundTaskCancelled(BNBackgroundTask* task) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNIsBackgroundTaskCancelled" + )] + internal static extern bool BNIsBackgroundTaskCancelled( + + // BNBackgroundTask* task + IntPtr task + ); + } +} \ No newline at end of file diff --git a/Function/BNIsBackgroundTaskFinished.cs b/Function/BNIsBackgroundTaskFinished.cs new file mode 100644 index 0000000..176de57 --- /dev/null +++ b/Function/BNIsBackgroundTaskFinished.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsBackgroundTaskFinished(BNBackgroundTask* task) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNIsBackgroundTaskFinished" + )] + internal static extern bool BNIsBackgroundTaskFinished( + + // BNBackgroundTask* task + IntPtr task + ); + } +} \ No newline at end of file diff --git a/Function/BNIsBaseAddressDetectionAborted.cs b/Function/BNIsBaseAddressDetectionAborted.cs new file mode 100644 index 0000000..330e731 --- /dev/null +++ b/Function/BNIsBaseAddressDetectionAborted.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsBaseAddressDetectionAborted(BNBaseAddressDetection* bad) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNIsBaseAddressDetectionAborted" + )] + internal static extern bool BNIsBaseAddressDetectionAborted( + + // BNBaseAddressDetection* bad + IntPtr bad + + ); + } +} \ No newline at end of file diff --git a/Function/BNIsBinaryViewTypeDeprecated.cs b/Function/BNIsBinaryViewTypeDeprecated.cs new file mode 100644 index 0000000..88157a2 --- /dev/null +++ b/Function/BNIsBinaryViewTypeDeprecated.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsBinaryViewTypeDeprecated(BNBinaryViewType* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNIsBinaryViewTypeDeprecated" + )] + internal static extern bool BNIsBinaryViewTypeDeprecated( + + // BNBinaryViewType* type + IntPtr type + + ); + } +} \ No newline at end of file diff --git a/Function/BNIsBinaryViewTypeForceLoadable.cs b/Function/BNIsBinaryViewTypeForceLoadable.cs new file mode 100644 index 0000000..8c4e673 --- /dev/null +++ b/Function/BNIsBinaryViewTypeForceLoadable.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsBinaryViewTypeForceLoadable(BNBinaryViewType* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNIsBinaryViewTypeForceLoadable" + )] + internal static extern bool BNIsBinaryViewTypeForceLoadable( + + // BNBinaryViewType* type + IntPtr type + + ); + } +} \ No newline at end of file diff --git a/Function/BNIsBinaryViewTypeValidForData.cs b/Function/BNIsBinaryViewTypeValidForData.cs new file mode 100644 index 0000000..c83eeb6 --- /dev/null +++ b/Function/BNIsBinaryViewTypeValidForData.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsBinaryViewTypeValidForData(BNBinaryViewType* type, BNBinaryView* data) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNIsBinaryViewTypeValidForData" + )] + internal static extern bool BNIsBinaryViewTypeValidForData( + + // BNBinaryViewType* type + IntPtr type , + + // BNBinaryView* data + IntPtr data + + ); + } +} \ No newline at end of file diff --git a/Function/BNIsCallInstruction.cs b/Function/BNIsCallInstruction.cs new file mode 100644 index 0000000..cfbd648 --- /dev/null +++ b/Function/BNIsCallInstruction.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsCallInstruction(BNFunction* func, BNArchitecture* arch, uint64_t addr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNIsCallInstruction" + )] + internal static extern bool BNIsCallInstruction( + + // BNFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t addr + ulong addr + + ); + } +} \ No newline at end of file diff --git a/Function/BNIsConditionInverted.cs b/Function/BNIsConditionInverted.cs new file mode 100644 index 0000000..e7c59c9 --- /dev/null +++ b/Function/BNIsConditionInverted.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsConditionInverted(BNFunction* func, uint64_t addr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNIsConditionInverted" + )] + internal static extern bool BNIsConditionInverted( + + // BNFunction* func + IntPtr func , + + // uint64_t addr + ulong addr + + ); + } +} \ No newline at end of file diff --git a/Function/BNIsDatabase.cs b/Function/BNIsDatabase.cs new file mode 100644 index 0000000..ad71e92 --- /dev/null +++ b/Function/BNIsDatabase.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public static partial class Core + { + public static bool IsDatabase(string filename) + { + return NativeMethods.BNIsDatabase(filename); + } + } + + internal static partial class NativeMethods + { + /// + /// bool BNIsDatabase(const char* filename) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNIsDatabase" + )] + public static extern bool BNIsDatabase( + + // const char* filename + string filename + ); + } +} \ No newline at end of file diff --git a/Function/BNIsDatabaseFromData.cs b/Function/BNIsDatabaseFromData.cs new file mode 100644 index 0000000..14c234e --- /dev/null +++ b/Function/BNIsDatabaseFromData.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsDatabaseFromData(void* data, uint64_t len) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNIsDatabaseFromData" + )] + internal static extern bool BNIsDatabaseFromData( + + // void* data + IntPtr data , + + // uint64_t len + ulong len + + ); + } +} \ No newline at end of file diff --git a/Function/BNIsDebugInfoParserValidForView.cs b/Function/BNIsDebugInfoParserValidForView.cs new file mode 100644 index 0000000..72c35be --- /dev/null +++ b/Function/BNIsDebugInfoParserValidForView.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsDebugInfoParserValidForView(BNDebugInfoParser* parser, BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNIsDebugInfoParserValidForView" + )] + internal static extern bool BNIsDebugInfoParserValidForView( + + // BNDebugInfoParser* parser + IntPtr parser , + + // BNBinaryView* view + IntPtr view + + ); + } +} \ No newline at end of file diff --git a/Function/BNIsDemanglerMangledName.cs b/Function/BNIsDemanglerMangledName.cs new file mode 100644 index 0000000..0490c83 --- /dev/null +++ b/Function/BNIsDemanglerMangledName.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsDemanglerMangledName(BNDemangler* demangler, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNIsDemanglerMangledName" + )] + internal static extern bool BNIsDemanglerMangledName( + + // BNDemangler* demangler + IntPtr demangler , + + // const char* name + string name + + ); + } +} \ No newline at end of file diff --git a/Function/BNIsDisassemblySettingsOptionSet.cs b/Function/BNIsDisassemblySettingsOptionSet.cs new file mode 100644 index 0000000..fea4ba4 --- /dev/null +++ b/Function/BNIsDisassemblySettingsOptionSet.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsDisassemblySettingsOptionSet(BNDisassemblySettings* settings, BNDisassemblyOption option) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNIsDisassemblySettingsOptionSet" + )] + internal static extern bool BNIsDisassemblySettingsOptionSet( + + // BNDisassemblySettings* settings + IntPtr settings , + + // BNDisassemblyOption option + DisassemblyOption option + ); + } +} \ No newline at end of file diff --git a/Function/BNIsEligibleForHeuristics.cs b/Function/BNIsEligibleForHeuristics.cs new file mode 100644 index 0000000..301b35d --- /dev/null +++ b/Function/BNIsEligibleForHeuristics.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsEligibleForHeuristics(BNCallingConvention* cc) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNIsEligibleForHeuristics" + )] + internal static extern bool BNIsEligibleForHeuristics( + + // BNCallingConvention* cc + IntPtr cc + + ); + } +} \ No newline at end of file diff --git a/Function/BNIsEndOfFile.cs b/Function/BNIsEndOfFile.cs new file mode 100644 index 0000000..4987a78 --- /dev/null +++ b/Function/BNIsEndOfFile.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsEndOfFile(BNBinaryReader* stream) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNIsEndOfFile" + )] + internal static extern bool BNIsEndOfFile( + + // BNBinaryReader* stream + IntPtr stream + ); + } +} \ No newline at end of file diff --git a/Function/BNIsEnterpriseServerAuthenticated.cs b/Function/BNIsEnterpriseServerAuthenticated.cs new file mode 100644 index 0000000..dc53e82 --- /dev/null +++ b/Function/BNIsEnterpriseServerAuthenticated.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsEnterpriseServerAuthenticated() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNIsEnterpriseServerAuthenticated" + )] + internal static extern bool BNIsEnterpriseServerAuthenticated( + + ); + } +} \ No newline at end of file diff --git a/Function/BNIsEnterpriseServerConnected.cs b/Function/BNIsEnterpriseServerConnected.cs new file mode 100644 index 0000000..31761ed --- /dev/null +++ b/Function/BNIsEnterpriseServerConnected.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsEnterpriseServerConnected() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNIsEnterpriseServerConnected" + )] + internal static extern bool BNIsEnterpriseServerConnected( + + ); + } +} \ No newline at end of file diff --git a/Function/BNIsEnterpriseServerFloatingLicense.cs b/Function/BNIsEnterpriseServerFloatingLicense.cs new file mode 100644 index 0000000..0648930 --- /dev/null +++ b/Function/BNIsEnterpriseServerFloatingLicense.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsEnterpriseServerFloatingLicense() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNIsEnterpriseServerFloatingLicense" + )] + internal static extern bool BNIsEnterpriseServerFloatingLicense( + + ); + } +} \ No newline at end of file diff --git a/Function/BNIsEnterpriseServerInitialized.cs b/Function/BNIsEnterpriseServerInitialized.cs new file mode 100644 index 0000000..2dd02ed --- /dev/null +++ b/Function/BNIsEnterpriseServerInitialized.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsEnterpriseServerInitialized() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNIsEnterpriseServerInitialized" + )] + internal static extern bool BNIsEnterpriseServerInitialized( + + ); + } +} \ No newline at end of file diff --git a/Function/BNIsEnterpriseServerLicenseStillActivated.cs b/Function/BNIsEnterpriseServerLicenseStillActivated.cs new file mode 100644 index 0000000..0ba009a --- /dev/null +++ b/Function/BNIsEnterpriseServerLicenseStillActivated.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsEnterpriseServerLicenseStillActivated() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNIsEnterpriseServerLicenseStillActivated" + )] + internal static extern bool BNIsEnterpriseServerLicenseStillActivated( + + ); + } +} \ No newline at end of file diff --git a/Function/BNIsExecutableView.cs b/Function/BNIsExecutableView.cs new file mode 100644 index 0000000..8dd7721 --- /dev/null +++ b/Function/BNIsExecutableView.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsExecutableView(BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNIsExecutableView" + )] + internal static extern bool BNIsExecutableView( + + // BNBinaryView* view + IntPtr view + + ); + } +} \ No newline at end of file diff --git a/Function/BNIsFileModified.cs b/Function/BNIsFileModified.cs new file mode 100644 index 0000000..5ac20d1 --- /dev/null +++ b/Function/BNIsFileModified.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsFileModified(BNFileMetadata* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNIsFileModified" + )] + internal static extern bool BNIsFileModified( + + // BNFileMetadata* file + IntPtr file + ); + } +} \ No newline at end of file diff --git a/Function/BNIsFlowGraphLayoutComplete.cs b/Function/BNIsFlowGraphLayoutComplete.cs new file mode 100644 index 0000000..fc8de27 --- /dev/null +++ b/Function/BNIsFlowGraphLayoutComplete.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsFlowGraphLayoutComplete(BNFlowGraph* graph) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNIsFlowGraphLayoutComplete" + )] + internal static extern bool BNIsFlowGraphLayoutComplete( + + // BNFlowGraph* graph + IntPtr graph + ); + } +} \ No newline at end of file diff --git a/Function/BNIsFlowGraphLayoutRequestComplete.cs b/Function/BNIsFlowGraphLayoutRequestComplete.cs new file mode 100644 index 0000000..678a183 --- /dev/null +++ b/Function/BNIsFlowGraphLayoutRequestComplete.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsFlowGraphLayoutRequestComplete(BNFlowGraphLayoutRequest* layout) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNIsFlowGraphLayoutRequestComplete" + )] + internal static extern bool BNIsFlowGraphLayoutRequestComplete( + + // BNFlowGraphLayoutRequest* layout + IntPtr layout + ); + } +} \ No newline at end of file diff --git a/Function/BNIsFlowGraphOptionSet.cs b/Function/BNIsFlowGraphOptionSet.cs new file mode 100644 index 0000000..7c31bdf --- /dev/null +++ b/Function/BNIsFlowGraphOptionSet.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsFlowGraphOptionSet(BNFlowGraph* graph, BNFlowGraphOption option) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNIsFlowGraphOptionSet" + )] + internal static extern bool BNIsFlowGraphOptionSet( + + // BNFlowGraph* graph + IntPtr graph , + + // BNFlowGraphOption option + FlowGraphOption option + ); + } +} \ No newline at end of file diff --git a/Function/BNIsFunctionAnalysisSkipped.cs b/Function/BNIsFunctionAnalysisSkipped.cs new file mode 100644 index 0000000..0af59c3 --- /dev/null +++ b/Function/BNIsFunctionAnalysisSkipped.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsFunctionAnalysisSkipped(BNFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNIsFunctionAnalysisSkipped" + )] + internal static extern bool BNIsFunctionAnalysisSkipped( + + // BNFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNIsFunctionInlinedDuringAnalysis.cs b/Function/BNIsFunctionInlinedDuringAnalysis.cs new file mode 100644 index 0000000..a71a600 --- /dev/null +++ b/Function/BNIsFunctionInlinedDuringAnalysis.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBoolWithConfidence BNIsFunctionInlinedDuringAnalysis(BNFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNIsFunctionInlinedDuringAnalysis" + )] + internal static extern BNBoolWithConfidence BNIsFunctionInlinedDuringAnalysis( + + // BNFunction* func + IntPtr func + + ); + } +} \ No newline at end of file diff --git a/Function/BNIsFunctionPure.cs b/Function/BNIsFunctionPure.cs new file mode 100644 index 0000000..23bd71f --- /dev/null +++ b/Function/BNIsFunctionPure.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBoolWithConfidence BNIsFunctionPure(BNFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNIsFunctionPure" + )] + internal static extern BNBoolWithConfidence BNIsFunctionPure( + + // BNFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNIsFunctionTooLarge.cs b/Function/BNIsFunctionTooLarge.cs new file mode 100644 index 0000000..181f931 --- /dev/null +++ b/Function/BNIsFunctionTooLarge.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsFunctionTooLarge(BNFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNIsFunctionTooLarge" + )] + internal static extern bool BNIsFunctionTooLarge( + + // BNFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNIsFunctionUpdateNeeded.cs b/Function/BNIsFunctionUpdateNeeded.cs new file mode 100644 index 0000000..31a6ba2 --- /dev/null +++ b/Function/BNIsFunctionUpdateNeeded.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsFunctionUpdateNeeded(BNFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNIsFunctionUpdateNeeded" + )] + internal static extern bool BNIsFunctionUpdateNeeded( + + // BNFunction* func + IntPtr func + + ); + } +} \ No newline at end of file diff --git a/Function/BNIsGNU3MangledString.cs b/Function/BNIsGNU3MangledString.cs new file mode 100644 index 0000000..fe1d328 --- /dev/null +++ b/Function/BNIsGNU3MangledString.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsGNU3MangledString(const char* mangledName) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNIsGNU3MangledString" + )] + internal static extern bool BNIsGNU3MangledString( + + // const char* mangledName + string mangledName + + ); + } +} \ No newline at end of file diff --git a/Function/BNIsGuidedSourceBlock.cs b/Function/BNIsGuidedSourceBlock.cs new file mode 100644 index 0000000..d818a10 --- /dev/null +++ b/Function/BNIsGuidedSourceBlock.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsGuidedSourceBlock(BNFunction* func, BNArchitecture* arch, uint64_t addr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNIsGuidedSourceBlock" + )] + internal static extern bool BNIsGuidedSourceBlock( + + // BNFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t addr + ulong addr + + ); + } +} \ No newline at end of file diff --git a/Function/BNIsHighLevelILBasicBlock.cs b/Function/BNIsHighLevelILBasicBlock.cs new file mode 100644 index 0000000..0bc5014 --- /dev/null +++ b/Function/BNIsHighLevelILBasicBlock.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsHighLevelILBasicBlock(BNBasicBlock* block) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNIsHighLevelILBasicBlock" + )] + internal static extern bool BNIsHighLevelILBasicBlock( + + // BNBasicBlock* block + IntPtr block + ); + } +} \ No newline at end of file diff --git a/Function/BNIsHighLevelILFlowGraph.cs b/Function/BNIsHighLevelILFlowGraph.cs new file mode 100644 index 0000000..5021b3d --- /dev/null +++ b/Function/BNIsHighLevelILFlowGraph.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsHighLevelILFlowGraph(BNFlowGraph* graph) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNIsHighLevelILFlowGraph" + )] + internal static extern bool BNIsHighLevelILFlowGraph( + + // BNFlowGraph* graph + IntPtr graph + ); + } +} \ No newline at end of file diff --git a/Function/BNIsHighLevelILSSAVarLive.cs b/Function/BNIsHighLevelILSSAVarLive.cs new file mode 100644 index 0000000..ab1bdb7 --- /dev/null +++ b/Function/BNIsHighLevelILSSAVarLive.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsHighLevelILSSAVarLive(BNHighLevelILFunction* func, BNVariable* var, uint64_t version) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNIsHighLevelILSSAVarLive" + )] + internal static extern bool BNIsHighLevelILSSAVarLive( + + // BNHighLevelILFunction* func + IntPtr func , + + // BNVariable* _var + in BNVariable _var , + + // uint64_t version + ulong version + ); + } +} \ No newline at end of file diff --git a/Function/BNIsHighLevelILSSAVarLiveAt.cs b/Function/BNIsHighLevelILSSAVarLiveAt.cs new file mode 100644 index 0000000..f5bfb3f --- /dev/null +++ b/Function/BNIsHighLevelILSSAVarLiveAt.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsHighLevelILSSAVarLiveAt(BNHighLevelILFunction* func, BNVariable* var, uint64_t version, uint64_t instr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNIsHighLevelILSSAVarLiveAt" + )] + internal static extern bool BNIsHighLevelILSSAVarLiveAt( + + // BNHighLevelILFunction* func + IntPtr func , + + // BNVariable* _var + in BNVariable _var , + + // uint64_t version + ulong version , + + // uint64_t instr + HighLevelILInstructionIndex instr + ); + } +} \ No newline at end of file diff --git a/Function/BNIsHighLevelILVarLiveAt.cs b/Function/BNIsHighLevelILVarLiveAt.cs new file mode 100644 index 0000000..41bd37b --- /dev/null +++ b/Function/BNIsHighLevelILVarLiveAt.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsHighLevelILVarLiveAt(BNHighLevelILFunction* func, BNVariable* var, uint64_t instr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNIsHighLevelILVarLiveAt" + )] + internal static extern bool BNIsHighLevelILVarLiveAt( + + // BNHighLevelILFunction* func + IntPtr func , + + // BNVariable* _var + in BNVariable _var , + + // uint64_t instr + HighLevelILInstructionIndex instr + ); + } +} \ No newline at end of file diff --git a/Function/BNIsILBasicBlock.cs b/Function/BNIsILBasicBlock.cs new file mode 100644 index 0000000..4b13bbf --- /dev/null +++ b/Function/BNIsILBasicBlock.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsILBasicBlock(BNBasicBlock* block) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNIsILBasicBlock" + )] + internal static extern bool BNIsILBasicBlock( + + // BNBasicBlock* block + IntPtr block + ); + } +} \ No newline at end of file diff --git a/Function/BNIsILDisassemblyTextRenderer.cs b/Function/BNIsILDisassemblyTextRenderer.cs new file mode 100644 index 0000000..a1021e7 --- /dev/null +++ b/Function/BNIsILDisassemblyTextRenderer.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsILDisassemblyTextRenderer(BNDisassemblyTextRenderer* renderer) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNIsILDisassemblyTextRenderer" + )] + internal static extern bool BNIsILDisassemblyTextRenderer( + + // BNDisassemblyTextRenderer* renderer + IntPtr renderer + + ); + } +} \ No newline at end of file diff --git a/Function/BNIsILFlowGraph.cs b/Function/BNIsILFlowGraph.cs new file mode 100644 index 0000000..5dc14bf --- /dev/null +++ b/Function/BNIsILFlowGraph.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsILFlowGraph(BNFlowGraph* graph) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNIsILFlowGraph" + )] + internal static extern bool BNIsILFlowGraph( + + // BNFlowGraph* graph + IntPtr graph + ); + } +} \ No newline at end of file diff --git a/Function/BNIsIntegerToken.cs b/Function/BNIsIntegerToken.cs new file mode 100644 index 0000000..4c72814 --- /dev/null +++ b/Function/BNIsIntegerToken.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsIntegerToken(BNInstructionTextTokenType type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNIsIntegerToken" + )] + internal static extern bool BNIsIntegerToken( + + // BNInstructionTextTokenType type + InstructionTextTokenType type + + ); + } +} \ No newline at end of file diff --git a/Function/BNIsInvertBranchPatchAvailable.cs b/Function/BNIsInvertBranchPatchAvailable.cs new file mode 100644 index 0000000..f84ad0f --- /dev/null +++ b/Function/BNIsInvertBranchPatchAvailable.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsInvertBranchPatchAvailable(BNBinaryView* view, BNArchitecture* arch, uint64_t addr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNIsInvertBranchPatchAvailable" + )] + internal static extern bool BNIsInvertBranchPatchAvailable( + + // BNBinaryView* view + IntPtr view , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t addr + ulong addr + ); + } +} \ No newline at end of file diff --git a/Function/BNIsKeyValueStoreEmpty.cs b/Function/BNIsKeyValueStoreEmpty.cs new file mode 100644 index 0000000..301d30b --- /dev/null +++ b/Function/BNIsKeyValueStoreEmpty.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsKeyValueStoreEmpty(BNKeyValueStore* store) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNIsKeyValueStoreEmpty" + )] + internal static extern bool BNIsKeyValueStoreEmpty( + + // BNKeyValueStore* store + IntPtr store + ); + } +} \ No newline at end of file diff --git a/Function/BNIsLanguageRepresentationFunctionTypeValid.cs b/Function/BNIsLanguageRepresentationFunctionTypeValid.cs new file mode 100644 index 0000000..f055658 --- /dev/null +++ b/Function/BNIsLanguageRepresentationFunctionTypeValid.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsLanguageRepresentationFunctionTypeValid(BNLanguageRepresentationFunctionType* type, BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNIsLanguageRepresentationFunctionTypeValid" + )] + internal static extern bool BNIsLanguageRepresentationFunctionTypeValid( + + // BNLanguageRepresentationFunctionType* type + IntPtr type , + + // BNBinaryView* view + IntPtr view + ); + } +} \ No newline at end of file diff --git a/Function/BNIsLicenseValidated.cs b/Function/BNIsLicenseValidated.cs new file mode 100644 index 0000000..97fe8c6 --- /dev/null +++ b/Function/BNIsLicenseValidated.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public static partial class Core + { + public static bool IsLicenseValidated() + { + return NativeMethods.BNIsLicenseValidated(); + } + } + + internal static partial class NativeMethods + { + /// + /// bool BNIsLicenseValidated() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNIsLicenseValidated" + )] + public static extern bool BNIsLicenseValidated(); + } +} \ No newline at end of file diff --git a/Function/BNIsLinearViewCursorAfterEnd.cs b/Function/BNIsLinearViewCursorAfterEnd.cs new file mode 100644 index 0000000..f2c8e93 --- /dev/null +++ b/Function/BNIsLinearViewCursorAfterEnd.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsLinearViewCursorAfterEnd(BNLinearViewCursor* cursor) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNIsLinearViewCursorAfterEnd" + )] + internal static extern bool BNIsLinearViewCursorAfterEnd( + + // BNLinearViewCursor* cursor + IntPtr cursor + ); + } +} \ No newline at end of file diff --git a/Function/BNIsLinearViewCursorBeforeBegin.cs b/Function/BNIsLinearViewCursorBeforeBegin.cs new file mode 100644 index 0000000..ba6b6f8 --- /dev/null +++ b/Function/BNIsLinearViewCursorBeforeBegin.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsLinearViewCursorBeforeBegin(BNLinearViewCursor* cursor) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNIsLinearViewCursorBeforeBegin" + )] + internal static extern bool BNIsLinearViewCursorBeforeBegin( + + // BNLinearViewCursor* cursor + IntPtr cursor + ); + } +} \ No newline at end of file diff --git a/Function/BNIsLowLevelILBasicBlock.cs b/Function/BNIsLowLevelILBasicBlock.cs new file mode 100644 index 0000000..6f20147 --- /dev/null +++ b/Function/BNIsLowLevelILBasicBlock.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsLowLevelILBasicBlock(BNBasicBlock* block) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNIsLowLevelILBasicBlock" + )] + internal static extern bool BNIsLowLevelILBasicBlock( + + // BNBasicBlock* block + IntPtr block + ); + } +} \ No newline at end of file diff --git a/Function/BNIsLowLevelILFlowGraph.cs b/Function/BNIsLowLevelILFlowGraph.cs new file mode 100644 index 0000000..da917d2 --- /dev/null +++ b/Function/BNIsLowLevelILFlowGraph.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsLowLevelILFlowGraph(BNFlowGraph* graph) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNIsLowLevelILFlowGraph" + )] + internal static extern bool BNIsLowLevelILFlowGraph( + + // BNFlowGraph* graph + IntPtr graph + ); + } +} \ No newline at end of file diff --git a/Function/BNIsMainThread.cs b/Function/BNIsMainThread.cs new file mode 100644 index 0000000..1d3c5e1 --- /dev/null +++ b/Function/BNIsMainThread.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsMainThread() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNIsMainThread" + )] + internal static extern bool BNIsMainThread( + + ); + } +} \ No newline at end of file diff --git a/Function/BNIsMainThreadActionDone.cs b/Function/BNIsMainThreadActionDone.cs new file mode 100644 index 0000000..a23ef04 --- /dev/null +++ b/Function/BNIsMainThreadActionDone.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsMainThreadActionDone(BNMainThreadAction* action) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNIsMainThreadActionDone" + )] + internal static extern bool BNIsMainThreadActionDone( + + // BNMainThreadAction* action + IntPtr action + + ); + } +} \ No newline at end of file diff --git a/Function/BNIsMediumLevelILBasicBlock.cs b/Function/BNIsMediumLevelILBasicBlock.cs new file mode 100644 index 0000000..db7521b --- /dev/null +++ b/Function/BNIsMediumLevelILBasicBlock.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsMediumLevelILBasicBlock(BNBasicBlock* block) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNIsMediumLevelILBasicBlock" + )] + internal static extern bool BNIsMediumLevelILBasicBlock( + + // BNBasicBlock* block + IntPtr block + ); + } +} \ No newline at end of file diff --git a/Function/BNIsMediumLevelILFlowGraph.cs b/Function/BNIsMediumLevelILFlowGraph.cs new file mode 100644 index 0000000..ef6f14a --- /dev/null +++ b/Function/BNIsMediumLevelILFlowGraph.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsMediumLevelILFlowGraph(BNFlowGraph* graph) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNIsMediumLevelILFlowGraph" + )] + internal static extern bool BNIsMediumLevelILFlowGraph( + + // BNFlowGraph* graph + IntPtr graph + ); + } +} \ No newline at end of file diff --git a/Function/BNIsMediumLevelILSSAVarLive.cs b/Function/BNIsMediumLevelILSSAVarLive.cs new file mode 100644 index 0000000..ea1065f --- /dev/null +++ b/Function/BNIsMediumLevelILSSAVarLive.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsMediumLevelILSSAVarLive(BNMediumLevelILFunction* func, BNVariable* var, uint64_t version) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNIsMediumLevelILSSAVarLive" + )] + internal static extern bool BNIsMediumLevelILSSAVarLive( + + // BNMediumLevelILFunction* func + IntPtr func , + + // BNVariable* _var + in BNVariable variable , + + // uint64_t version + ulong version + ); + } +} \ No newline at end of file diff --git a/Function/BNIsMediumLevelILSSAVarLiveAt.cs b/Function/BNIsMediumLevelILSSAVarLiveAt.cs new file mode 100644 index 0000000..eacae44 --- /dev/null +++ b/Function/BNIsMediumLevelILSSAVarLiveAt.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsMediumLevelILSSAVarLiveAt(BNMediumLevelILFunction* func, BNVariable* var, uint64_t version, uint64_t instr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNIsMediumLevelILSSAVarLiveAt" + )] + internal static extern bool BNIsMediumLevelILSSAVarLiveAt( + + // BNMediumLevelILFunction* func + IntPtr func , + + // BNVariable* _var + in BNVariable variable , + + // uint64_t version + ulong version , + + // uint64_t instr + MediumLevelILInstructionIndex instr + ); + } +} \ No newline at end of file diff --git a/Function/BNIsMediumLevelILVarLiveAt.cs b/Function/BNIsMediumLevelILVarLiveAt.cs new file mode 100644 index 0000000..153cdc5 --- /dev/null +++ b/Function/BNIsMediumLevelILVarLiveAt.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsMediumLevelILVarLiveAt(BNMediumLevelILFunction* func, BNVariable* var, uint64_t instr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNIsMediumLevelILVarLiveAt" + )] + internal static extern bool BNIsMediumLevelILVarLiveAt( + + // BNMediumLevelILFunction* func + IntPtr func , + + // BNVariable* _var + in BNVariable variable , + + // uint64_t instr + MediumLevelILInstructionIndex instr + ); + } +} \ No newline at end of file diff --git a/Function/BNIsMemoryMapActivated.cs b/Function/BNIsMemoryMapActivated.cs new file mode 100644 index 0000000..73c2aaf --- /dev/null +++ b/Function/BNIsMemoryMapActivated.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsMemoryMapActivated(BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNIsMemoryMapActivated" + )] + internal static extern bool BNIsMemoryMapActivated( + + // BNBinaryView* view + IntPtr view + ); + } +} \ No newline at end of file diff --git a/Function/BNIsMemoryRegionEnabled.cs b/Function/BNIsMemoryRegionEnabled.cs new file mode 100644 index 0000000..77d4326 --- /dev/null +++ b/Function/BNIsMemoryRegionEnabled.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsMemoryRegionEnabled(BNBinaryView* view, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNIsMemoryRegionEnabled" + )] + internal static extern bool BNIsMemoryRegionEnabled( + + // BNBinaryView* view + IntPtr view , + + // const char* name + string name + ); + } +} \ No newline at end of file diff --git a/Function/BNIsMemoryRegionLocal.cs b/Function/BNIsMemoryRegionLocal.cs new file mode 100644 index 0000000..2b8e29d --- /dev/null +++ b/Function/BNIsMemoryRegionLocal.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsMemoryRegionLocal(BNBinaryView* view, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNIsMemoryRegionLocal" + )] + internal static extern bool BNIsMemoryRegionLocal( + + // BNBinaryView* view + IntPtr view , + + // const char* name + string name + + ); + } +} \ No newline at end of file diff --git a/Function/BNIsMemoryRegionRebaseable.cs b/Function/BNIsMemoryRegionRebaseable.cs new file mode 100644 index 0000000..25a1bd5 --- /dev/null +++ b/Function/BNIsMemoryRegionRebaseable.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsMemoryRegionRebaseable(BNBinaryView* view, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNIsMemoryRegionRebaseable" + )] + internal static extern bool BNIsMemoryRegionRebaseable( + + // BNBinaryView* view + IntPtr view , + + // const char* name + string name + ); + } +} \ No newline at end of file diff --git a/Function/BNIsNeverBranchPatchAvailable.cs b/Function/BNIsNeverBranchPatchAvailable.cs new file mode 100644 index 0000000..6fff003 --- /dev/null +++ b/Function/BNIsNeverBranchPatchAvailable.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsNeverBranchPatchAvailable(BNBinaryView* view, BNArchitecture* arch, uint64_t addr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNIsNeverBranchPatchAvailable" + )] + internal static extern bool BNIsNeverBranchPatchAvailable( + + // BNBinaryView* view + IntPtr view , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t addr + ulong addr + ); + } +} \ No newline at end of file diff --git a/Function/BNIsNodeValidForFlowGraph.cs b/Function/BNIsNodeValidForFlowGraph.cs new file mode 100644 index 0000000..9597a69 --- /dev/null +++ b/Function/BNIsNodeValidForFlowGraph.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsNodeValidForFlowGraph(BNFlowGraph* graph, BNFlowGraphNode* node) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNIsNodeValidForFlowGraph" + )] + internal static extern bool BNIsNodeValidForFlowGraph( + + // BNFlowGraph* graph + IntPtr graph , + + // BNFlowGraphNode* node + IntPtr node + ); + } +} \ No newline at end of file diff --git a/Function/BNIsOffsetBackedByFile.cs b/Function/BNIsOffsetBackedByFile.cs new file mode 100644 index 0000000..b9a7ee5 --- /dev/null +++ b/Function/BNIsOffsetBackedByFile.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsOffsetBackedByFile(BNBinaryView* view, uint64_t offset) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNIsOffsetBackedByFile" + )] + internal static extern bool BNIsOffsetBackedByFile( + + // BNBinaryView* view + IntPtr view , + + // uint64_t offset + ulong offset + ); + } +} \ No newline at end of file diff --git a/Function/BNIsOffsetCodeSemantics.cs b/Function/BNIsOffsetCodeSemantics.cs new file mode 100644 index 0000000..35fdd13 --- /dev/null +++ b/Function/BNIsOffsetCodeSemantics.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsOffsetCodeSemantics(BNBinaryView* view, uint64_t offset) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNIsOffsetCodeSemantics" + )] + internal static extern bool BNIsOffsetCodeSemantics( + + // BNBinaryView* view + IntPtr view , + + // uint64_t offset + ulong offset + ); + } +} \ No newline at end of file diff --git a/Function/BNIsOffsetExecutable.cs b/Function/BNIsOffsetExecutable.cs new file mode 100644 index 0000000..4c5199d --- /dev/null +++ b/Function/BNIsOffsetExecutable.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsOffsetExecutable(BNBinaryView* view, uint64_t offset) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNIsOffsetExecutable" + )] + internal static extern bool BNIsOffsetExecutable( + + // BNBinaryView* view + IntPtr view , + + // uint64_t offset + ulong offset + ); + } +} \ No newline at end of file diff --git a/Function/BNIsOffsetExternSemantics.cs b/Function/BNIsOffsetExternSemantics.cs new file mode 100644 index 0000000..d08cb22 --- /dev/null +++ b/Function/BNIsOffsetExternSemantics.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsOffsetExternSemantics(BNBinaryView* view, uint64_t offset) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNIsOffsetExternSemantics" + )] + internal static extern bool BNIsOffsetExternSemantics( + + // BNBinaryView* view + IntPtr view , + + // uint64_t offset + ulong offset + ); + } +} \ No newline at end of file diff --git a/Function/BNIsOffsetReadable.cs b/Function/BNIsOffsetReadable.cs new file mode 100644 index 0000000..a8e55b4 --- /dev/null +++ b/Function/BNIsOffsetReadable.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsOffsetReadable(BNBinaryView* view, uint64_t offset) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNIsOffsetReadable" + )] + internal static extern bool BNIsOffsetReadable( + + // BNBinaryView* view + IntPtr view , + + // uint64_t offset + ulong offset + ); + } +} \ No newline at end of file diff --git a/Function/BNIsOffsetWritable.cs b/Function/BNIsOffsetWritable.cs new file mode 100644 index 0000000..0c63787 --- /dev/null +++ b/Function/BNIsOffsetWritable.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsOffsetWritable(BNBinaryView* view, uint64_t offset) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNIsOffsetWritable" + )] + internal static extern bool BNIsOffsetWritable( + + // BNBinaryView* view + IntPtr view , + + // uint64_t offset + ulong offset + ); + } +} \ No newline at end of file diff --git a/Function/BNIsOffsetWritableSemantics.cs b/Function/BNIsOffsetWritableSemantics.cs new file mode 100644 index 0000000..64a9f03 --- /dev/null +++ b/Function/BNIsOffsetWritableSemantics.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsOffsetWritableSemantics(BNBinaryView* view, uint64_t offset) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNIsOffsetWritableSemantics" + )] + internal static extern bool BNIsOffsetWritableSemantics( + + // BNBinaryView* view + IntPtr view , + + // uint64_t offset + ulong offset + ); + } +} \ No newline at end of file diff --git a/Function/BNIsPathDirectory.cs b/Function/BNIsPathDirectory.cs new file mode 100644 index 0000000..74379d9 --- /dev/null +++ b/Function/BNIsPathDirectory.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsPathDirectory(const char* path) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNIsPathDirectory" + )] + internal static extern bool BNIsPathDirectory( + + // const char* path + string path + + ); + } +} \ No newline at end of file diff --git a/Function/BNIsPathRegularFile.cs b/Function/BNIsPathRegularFile.cs new file mode 100644 index 0000000..1bcfae0 --- /dev/null +++ b/Function/BNIsPathRegularFile.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsPathRegularFile(const char* path) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNIsPathRegularFile" + )] + internal static extern bool BNIsPathRegularFile( + + // const char* path + string path + + ); + } +} \ No newline at end of file diff --git a/Function/BNIsPluginsEnabled.cs b/Function/BNIsPluginsEnabled.cs new file mode 100644 index 0000000..f2ad67a --- /dev/null +++ b/Function/BNIsPluginsEnabled.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public static partial class Core + { + public static bool IsPluginsEnabled() + { + return NativeMethods.BNIsPluginsEnabled(); + } + } + + internal static partial class NativeMethods + { + /// + /// bool BNIsPluginsEnabled() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNIsPluginsEnabled" + )] + public static extern bool BNIsPluginsEnabled(); + } +} \ No newline at end of file diff --git a/Function/BNIsRelocatable.cs b/Function/BNIsRelocatable.cs new file mode 100644 index 0000000..db7c28a --- /dev/null +++ b/Function/BNIsRelocatable.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsRelocatable(BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNIsRelocatable" + )] + internal static extern bool BNIsRelocatable( + + // BNBinaryView* view + IntPtr view + + ); + } +} \ No newline at end of file diff --git a/Function/BNIsSaveSettingsOptionSet.cs b/Function/BNIsSaveSettingsOptionSet.cs new file mode 100644 index 0000000..5451cd7 --- /dev/null +++ b/Function/BNIsSaveSettingsOptionSet.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsSaveSettingsOptionSet(BNSaveSettings* settings, BNSaveOption option) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNIsSaveSettingsOptionSet" + )] + internal static extern bool BNIsSaveSettingsOptionSet( + + // BNSaveSettings* settings + IntPtr settings , + + // BNSaveOption option + SaveOption option + ); + } +} \ No newline at end of file diff --git a/Function/BNIsShutdownRequested.cs b/Function/BNIsShutdownRequested.cs new file mode 100644 index 0000000..a109abe --- /dev/null +++ b/Function/BNIsShutdownRequested.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public static partial class Core + { + public static bool IsShutdownRequested() + { + return NativeMethods.BNIsShutdownRequested(); + } + } + + internal static partial class NativeMethods + { + /// + /// bool BNIsShutdownRequested() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNIsShutdownRequested" + )] + public static extern bool BNIsShutdownRequested(); + } +} \ No newline at end of file diff --git a/Function/BNIsSkipAndReturnValuePatchAvailable.cs b/Function/BNIsSkipAndReturnValuePatchAvailable.cs new file mode 100644 index 0000000..713926d --- /dev/null +++ b/Function/BNIsSkipAndReturnValuePatchAvailable.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsSkipAndReturnValuePatchAvailable(BNBinaryView* view, BNArchitecture* arch, uint64_t addr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNIsSkipAndReturnValuePatchAvailable" + )] + internal static extern bool BNIsSkipAndReturnValuePatchAvailable( + + // BNBinaryView* view + IntPtr view , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t addr + ulong addr + ); + } +} \ No newline at end of file diff --git a/Function/BNIsSkipAndReturnZeroPatchAvailable.cs b/Function/BNIsSkipAndReturnZeroPatchAvailable.cs new file mode 100644 index 0000000..225d0b3 --- /dev/null +++ b/Function/BNIsSkipAndReturnZeroPatchAvailable.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsSkipAndReturnZeroPatchAvailable(BNBinaryView* view, BNArchitecture* arch, uint64_t addr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNIsSkipAndReturnZeroPatchAvailable" + )] + internal static extern bool BNIsSkipAndReturnZeroPatchAvailable( + + // BNBinaryView* view + IntPtr view , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t addr + ulong addr + ); + } +} \ No newline at end of file diff --git a/Function/BNIsSnapshotAutoSave.cs b/Function/BNIsSnapshotAutoSave.cs new file mode 100644 index 0000000..b2c9337 --- /dev/null +++ b/Function/BNIsSnapshotAutoSave.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsSnapshotAutoSave(BNSnapshot* snapshot) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNIsSnapshotAutoSave" + )] + internal static extern bool BNIsSnapshotAutoSave( + + // BNSnapshot* snapshot + IntPtr snapshot + + ); + } +} \ No newline at end of file diff --git a/Function/BNIsSnapshotDataAppliedWithoutError.cs b/Function/BNIsSnapshotDataAppliedWithoutError.cs new file mode 100644 index 0000000..34ed76a --- /dev/null +++ b/Function/BNIsSnapshotDataAppliedWithoutError.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsSnapshotDataAppliedWithoutError(BNFileMetadata* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNIsSnapshotDataAppliedWithoutError" + )] + internal static extern bool BNIsSnapshotDataAppliedWithoutError( + + // BNFileMetadata* view + IntPtr view + ); + } +} \ No newline at end of file diff --git a/Function/BNIsStackAdjustedOnReturn.cs b/Function/BNIsStackAdjustedOnReturn.cs new file mode 100644 index 0000000..e3858fc --- /dev/null +++ b/Function/BNIsStackAdjustedOnReturn.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsStackAdjustedOnReturn(BNCallingConvention* cc) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNIsStackAdjustedOnReturn" + )] + internal static extern bool BNIsStackAdjustedOnReturn( + + // BNCallingConvention* cc + IntPtr cc + + ); + } +} \ No newline at end of file diff --git a/Function/BNIsStackReservedForArgumentRegisters.cs b/Function/BNIsStackReservedForArgumentRegisters.cs new file mode 100644 index 0000000..360e4b1 --- /dev/null +++ b/Function/BNIsStackReservedForArgumentRegisters.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsStackReservedForArgumentRegisters(BNCallingConvention* cc) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNIsStackReservedForArgumentRegisters" + )] + internal static extern bool BNIsStackReservedForArgumentRegisters( + + // BNCallingConvention* cc + IntPtr cc + + ); + } +} \ No newline at end of file diff --git a/Function/BNIsStructureBuilderPacked.cs b/Function/BNIsStructureBuilderPacked.cs new file mode 100644 index 0000000..3e18ed2 --- /dev/null +++ b/Function/BNIsStructureBuilderPacked.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsStructureBuilderPacked(BNStructureBuilder* s) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNIsStructureBuilderPacked" + )] + internal static extern bool BNIsStructureBuilderPacked( + + // BNStructureBuilder* s + IntPtr s + ); + } +} \ No newline at end of file diff --git a/Function/BNIsStructureBuilderUnion.cs b/Function/BNIsStructureBuilderUnion.cs new file mode 100644 index 0000000..a9a4703 --- /dev/null +++ b/Function/BNIsStructureBuilderUnion.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsStructureBuilderUnion(BNStructureBuilder* s) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNIsStructureBuilderUnion" + )] + internal static extern bool BNIsStructureBuilderUnion( + + // BNStructureBuilder* s + IntPtr s + ); + } +} \ No newline at end of file diff --git a/Function/BNIsStructurePacked.cs b/Function/BNIsStructurePacked.cs new file mode 100644 index 0000000..32249a7 --- /dev/null +++ b/Function/BNIsStructurePacked.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsStructurePacked(BNStructure* s) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNIsStructurePacked" + )] + internal static extern bool BNIsStructurePacked( + + // BNStructure* s + IntPtr s + ); + } +} \ No newline at end of file diff --git a/Function/BNIsStructureUnion.cs b/Function/BNIsStructureUnion.cs new file mode 100644 index 0000000..0ba84ff --- /dev/null +++ b/Function/BNIsStructureUnion.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsStructureUnion(BNStructure* s) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNIsStructureUnion" + )] + internal static extern bool BNIsStructureUnion( + + // BNStructure* s + IntPtr s + ); + } +} \ No newline at end of file diff --git a/Function/BNIsSymbolAutoDefined.cs b/Function/BNIsSymbolAutoDefined.cs new file mode 100644 index 0000000..5277078 --- /dev/null +++ b/Function/BNIsSymbolAutoDefined.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsSymbolAutoDefined(BNSymbol* sym) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNIsSymbolAutoDefined" + )] + internal static extern bool BNIsSymbolAutoDefined( + + // BNSymbol* sym + IntPtr sym + ); + } +} \ No newline at end of file diff --git a/Function/BNIsTypeArchive.cs b/Function/BNIsTypeArchive.cs new file mode 100644 index 0000000..a4da6ce --- /dev/null +++ b/Function/BNIsTypeArchive.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsTypeArchive(const char* path) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNIsTypeArchive" + )] + internal static extern bool BNIsTypeArchive( + + // const char* path + string path + + ); + } +} \ No newline at end of file diff --git a/Function/BNIsTypeBuilderConst.cs b/Function/BNIsTypeBuilderConst.cs new file mode 100644 index 0000000..68d7c07 --- /dev/null +++ b/Function/BNIsTypeBuilderConst.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBoolWithConfidence BNIsTypeBuilderConst(BNTypeBuilder* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNIsTypeBuilderConst" + )] + internal static extern BNBoolWithConfidence BNIsTypeBuilderConst( + + // BNTypeBuilder* type + IntPtr type + ); + } +} \ No newline at end of file diff --git a/Function/BNIsTypeBuilderFloatingPoint.cs b/Function/BNIsTypeBuilderFloatingPoint.cs new file mode 100644 index 0000000..97674f9 --- /dev/null +++ b/Function/BNIsTypeBuilderFloatingPoint.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsTypeBuilderFloatingPoint(BNTypeBuilder* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNIsTypeBuilderFloatingPoint" + )] + internal static extern bool BNIsTypeBuilderFloatingPoint( + + // BNTypeBuilder* type + IntPtr type + + ); + } +} \ No newline at end of file diff --git a/Function/BNIsTypeBuilderPure.cs b/Function/BNIsTypeBuilderPure.cs new file mode 100644 index 0000000..5dd14a9 --- /dev/null +++ b/Function/BNIsTypeBuilderPure.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBoolWithConfidence BNIsTypeBuilderPure(BNTypeBuilder* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNIsTypeBuilderPure" + )] + internal static extern BNBoolWithConfidence BNIsTypeBuilderPure( + + // BNTypeBuilder* type + IntPtr type + ); + } +} \ No newline at end of file diff --git a/Function/BNIsTypeBuilderSigned.cs b/Function/BNIsTypeBuilderSigned.cs new file mode 100644 index 0000000..5a749b9 --- /dev/null +++ b/Function/BNIsTypeBuilderSigned.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBoolWithConfidence BNIsTypeBuilderSigned(BNTypeBuilder* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNIsTypeBuilderSigned" + )] + internal static extern BNBoolWithConfidence BNIsTypeBuilderSigned( + + // BNTypeBuilder* type + IntPtr type + + ); + } +} \ No newline at end of file diff --git a/Function/BNIsTypeBuilderVolatile.cs b/Function/BNIsTypeBuilderVolatile.cs new file mode 100644 index 0000000..83e3cf1 --- /dev/null +++ b/Function/BNIsTypeBuilderVolatile.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBoolWithConfidence BNIsTypeBuilderVolatile(BNTypeBuilder* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNIsTypeBuilderVolatile" + )] + internal static extern BNBoolWithConfidence BNIsTypeBuilderVolatile( + + // BNTypeBuilder* type + IntPtr type + + ); + } +} \ No newline at end of file diff --git a/Function/BNIsTypeConst.cs b/Function/BNIsTypeConst.cs new file mode 100644 index 0000000..926f334 --- /dev/null +++ b/Function/BNIsTypeConst.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBoolWithConfidence BNIsTypeConst(BNType* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNIsTypeConst" + )] + internal static extern BNBoolWithConfidence BNIsTypeConst( + + // BNType* type + IntPtr type + ); + } +} \ No newline at end of file diff --git a/Function/BNIsTypeFloatingPoint.cs b/Function/BNIsTypeFloatingPoint.cs new file mode 100644 index 0000000..2f7f7dd --- /dev/null +++ b/Function/BNIsTypeFloatingPoint.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsTypeFloatingPoint(BNType* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNIsTypeFloatingPoint" + )] + internal static extern bool BNIsTypeFloatingPoint( + + // BNType* type + IntPtr type + + ); + } +} \ No newline at end of file diff --git a/Function/BNIsTypePure.cs b/Function/BNIsTypePure.cs new file mode 100644 index 0000000..7cd6b85 --- /dev/null +++ b/Function/BNIsTypePure.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBoolWithConfidence BNIsTypePure(BNType* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNIsTypePure" + )] + internal static extern BNBoolWithConfidence BNIsTypePure( + + // BNType* type + IntPtr type + + ); + } +} \ No newline at end of file diff --git a/Function/BNIsTypeSigned.cs b/Function/BNIsTypeSigned.cs new file mode 100644 index 0000000..7bbec9b --- /dev/null +++ b/Function/BNIsTypeSigned.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBoolWithConfidence BNIsTypeSigned(BNType* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNIsTypeSigned" + )] + internal static extern BNBoolWithConfidence BNIsTypeSigned( + + // BNType* type + IntPtr type + ); + } +} \ No newline at end of file diff --git a/Function/BNIsTypeVolatile.cs b/Function/BNIsTypeVolatile.cs new file mode 100644 index 0000000..d9c4d20 --- /dev/null +++ b/Function/BNIsTypeVolatile.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBoolWithConfidence BNIsTypeVolatile(BNType* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNIsTypeVolatile" + )] + internal static extern BNBoolWithConfidence BNIsTypeVolatile( + + // BNType* type + IntPtr type + ); + } +} \ No newline at end of file diff --git a/Function/BNIsUIEnabled.cs b/Function/BNIsUIEnabled.cs new file mode 100644 index 0000000..e6a3af2 --- /dev/null +++ b/Function/BNIsUIEnabled.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + + public static partial class Core + { + public static bool IsUIEnabled() + { + return NativeMethods.BNIsUIEnabled(); + } + } + + internal static partial class NativeMethods + { + /// + /// bool BNIsUIEnabled() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNIsUIEnabled" + )] + public static extern bool BNIsUIEnabled(); + } +} \ No newline at end of file diff --git a/Function/BNIsUpdateInstallationPending.cs b/Function/BNIsUpdateInstallationPending.cs new file mode 100644 index 0000000..cd023c6 --- /dev/null +++ b/Function/BNIsUpdateInstallationPending.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsUpdateInstallationPending() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNIsUpdateInstallationPending" + )] + internal static extern bool BNIsUpdateInstallationPending( + + ); + } +} \ No newline at end of file diff --git a/Function/BNIsValidForData.cs b/Function/BNIsValidForData.cs new file mode 100644 index 0000000..de9f186 --- /dev/null +++ b/Function/BNIsValidForData.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsValidForData(void* ctxt, BNBinaryView* view, uint64_t addr, BNType* type, BNTypeContext* typeCtx, uint64_t ctxCount) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNIsValidForData" + )] + internal static extern bool BNIsValidForData( + + // void* ctxt + IntPtr ctxt , + + // BNBinaryView* view + IntPtr view , + + // uint64_t addr + ulong addr , + + // BNType* type + IntPtr type , + + // BNTypeContext* typeCtx + IntPtr typeCtx , + + // uint64_t ctxCount + ulong ctxCount + + ); + } +} \ No newline at end of file diff --git a/Function/BNIsValidOffset.cs b/Function/BNIsValidOffset.cs new file mode 100644 index 0000000..2a0acf9 --- /dev/null +++ b/Function/BNIsValidOffset.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsValidOffset(BNBinaryView* view, uint64_t offset) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNIsValidOffset" + )] + internal static extern bool BNIsValidOffset( + + // BNBinaryView* view + IntPtr view , + + // uint64_t offset + ulong offset + ); + } +} \ No newline at end of file diff --git a/Function/BNIsVariableUserDefined.cs b/Function/BNIsVariableUserDefined.cs new file mode 100644 index 0000000..10dd091 --- /dev/null +++ b/Function/BNIsVariableUserDefined.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsVariableUserDefined(BNFunction* func, BNVariable* var) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNIsVariableUserDefined" + )] + internal static extern bool BNIsVariableUserDefined( + + // BNFunction* func + IntPtr func , + + // BNVariable* _var + IntPtr _var + + ); + } +} \ No newline at end of file diff --git a/Function/BNIsViewModified.cs b/Function/BNIsViewModified.cs new file mode 100644 index 0000000..2ce3b00 --- /dev/null +++ b/Function/BNIsViewModified.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNIsViewModified(BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNIsViewModified" + )] + internal static extern bool BNIsViewModified( + + // BNBinaryView* view + IntPtr view + ); + } +} \ No newline at end of file diff --git a/Function/BNKeyValueStoreHasValue.cs b/Function/BNKeyValueStoreHasValue.cs new file mode 100644 index 0000000..c8de4e4 --- /dev/null +++ b/Function/BNKeyValueStoreHasValue.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNKeyValueStoreHasValue(BNKeyValueStore* store, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNKeyValueStoreHasValue" + )] + internal static extern bool BNKeyValueStoreHasValue( + + // BNKeyValueStore* store + IntPtr store , + + // const char* name + string name + ); + } +} \ No newline at end of file diff --git a/Function/BNLinearViewCursorNext.cs b/Function/BNLinearViewCursorNext.cs new file mode 100644 index 0000000..8bef925 --- /dev/null +++ b/Function/BNLinearViewCursorNext.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNLinearViewCursorNext(BNLinearViewCursor* cursor) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNLinearViewCursorNext" + )] + internal static extern bool BNLinearViewCursorNext( + + // BNLinearViewCursor* cursor + IntPtr cursor + ); + } +} \ No newline at end of file diff --git a/Function/BNLinearViewCursorPrevious.cs b/Function/BNLinearViewCursorPrevious.cs new file mode 100644 index 0000000..4b11af1 --- /dev/null +++ b/Function/BNLinearViewCursorPrevious.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNLinearViewCursorPrevious(BNLinearViewCursor* cursor) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNLinearViewCursorPrevious" + )] + internal static extern bool BNLinearViewCursorPrevious( + + // BNLinearViewCursor* cursor + IntPtr cursor + ); + } +} \ No newline at end of file diff --git a/Function/BNLlvmServicesAssemble.cs b/Function/BNLlvmServicesAssemble.cs new file mode 100644 index 0000000..d64b9a4 --- /dev/null +++ b/Function/BNLlvmServicesAssemble.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// int32_t BNLlvmServicesAssemble(const char* src, int32_t dialect, const char* triplet, int32_t codeModel, int32_t relocMode, const char** outBytes, int32_t* outBytesLen, const char** err, int32_t* errLen) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNLlvmServicesAssemble" + )] + internal static extern int BNLlvmServicesAssemble( + + // const char* src + string src , + + // int32_t dialect + int dialect , + + // const char* triplet + string triplet , + + // int32_t codeModel + int codeModel , + + // int32_t relocMode + int relocMode , + + // const char** outBytes + string[] outBytes , + + // int32_t* outBytesLen + IntPtr outBytesLen , + + // const char** err + string[] err , + + // int32_t* errLen + IntPtr errLen + + ); + } +} \ No newline at end of file diff --git a/Function/BNLlvmServicesAssembleFree.cs b/Function/BNLlvmServicesAssembleFree.cs new file mode 100644 index 0000000..4b1d291 --- /dev/null +++ b/Function/BNLlvmServicesAssembleFree.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNLlvmServicesAssembleFree(const char* outBytes, const char* err) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNLlvmServicesAssembleFree" + )] + internal static extern void BNLlvmServicesAssembleFree( + + // const char* outBytes + string outBytes , + + // const char* err + string err + + ); + } +} \ No newline at end of file diff --git a/Function/BNLlvmServicesDisasmInstruction.cs b/Function/BNLlvmServicesDisasmInstruction.cs new file mode 100644 index 0000000..e00cfd4 --- /dev/null +++ b/Function/BNLlvmServicesDisasmInstruction.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// int32_t BNLlvmServicesDisasmInstruction(const char* triplet, uint8_t* src, int32_t srcLen, uint64_t addr, const char* result, uint64_t resultMaxSize) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNLlvmServicesDisasmInstruction" + )] + internal static extern int BNLlvmServicesDisasmInstruction( + + // const char* triplet + string triplet , + + // uint8_t* src + IntPtr src , + + // int32_t srcLen + int srcLen , + + // uint64_t addr + ulong addr , + + // const char* result + string result , + + // uint64_t resultMaxSize + ulong resultMaxSize + + ); + } +} \ No newline at end of file diff --git a/Function/BNLlvmServicesInit.cs b/Function/BNLlvmServicesInit.cs new file mode 100644 index 0000000..eb1594d --- /dev/null +++ b/Function/BNLlvmServicesInit.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNLlvmServicesInit() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNLlvmServicesInit" + )] + internal static extern void BNLlvmServicesInit( + + ); + } +} \ No newline at end of file diff --git a/Function/BNLoadBinaryView.cs b/Function/BNLoadBinaryView.cs new file mode 100644 index 0000000..45dddbb --- /dev/null +++ b/Function/BNLoadBinaryView.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBinaryView* BNLoadBinaryView(BNBinaryView* view, bool updateAnalysis, const char* options, void** progress, void* progressContext) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNLoadBinaryView" + )] + internal static extern IntPtr BNLoadBinaryView( + + // BNBinaryView* view + IntPtr view , + + // bool updateAnalysis + bool updateAnalysis , + + // const char* options + string options , + + // void* progress + IntPtr progress , + + // void* progressContext + IntPtr progressContext + ); + } +} \ No newline at end of file diff --git a/Function/BNLoadFilename.cs b/Function/BNLoadFilename.cs new file mode 100644 index 0000000..38648e4 --- /dev/null +++ b/Function/BNLoadFilename.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBinaryView* BNLoadFilename(const char* filename, bool updateAnalysis, const char* options, void** progress, void* progressContext) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNLoadFilename" + )] + internal static extern IntPtr BNLoadFilename( + + // const char* filename + string filename , + + // bool updateAnalysis + bool updateAnalysis , + + // const char* options + string options , + + // void** progress + IntPtr progress , + + // void* progressContext + IntPtr progressContext + ); + } +} \ No newline at end of file diff --git a/Function/BNLoadProjectFile.cs b/Function/BNLoadProjectFile.cs new file mode 100644 index 0000000..d2ef6f5 --- /dev/null +++ b/Function/BNLoadProjectFile.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBinaryView* BNLoadProjectFile(BNProjectFile* projectFile, bool updateAnalysis, const char* options, void** progress, void* progressContext) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNLoadProjectFile" + )] + internal static extern IntPtr BNLoadProjectFile( + + // BNProjectFile* projectFile + IntPtr projectFile , + + // bool updateAnalysis + bool updateAnalysis , + + // const char* options + string options , + + // void** progress + IntPtr progress , + + // void* progressContext + IntPtr progressContext + + ); + } +} \ No newline at end of file diff --git a/Function/BNLoadScriptingProviderModule.cs b/Function/BNLoadScriptingProviderModule.cs new file mode 100644 index 0000000..b68f586 --- /dev/null +++ b/Function/BNLoadScriptingProviderModule.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNLoadScriptingProviderModule(BNScriptingProvider* provider, const char* repository, const char* module, bool force) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNLoadScriptingProviderModule" + )] + internal static extern bool BNLoadScriptingProviderModule( + + // BNScriptingProvider* provider + IntPtr provider , + + // const char* repository + string repository , + + // const char* module + string module , + + // bool force + bool force + + ); + } +} \ No newline at end of file diff --git a/Function/BNLoadSettingsFile.cs b/Function/BNLoadSettingsFile.cs new file mode 100644 index 0000000..99ae125 --- /dev/null +++ b/Function/BNLoadSettingsFile.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNLoadSettingsFile(BNSettings* settings, const char* fileName, BNSettingsScope scope, BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNLoadSettingsFile" + )] + internal static extern bool BNLoadSettingsFile( + + // BNSettings* settings + IntPtr settings , + + // const char* fileName + string fileName , + + // BNSettingsScope scope + SettingsScope scope , + + // BNBinaryView* view + IntPtr view + ); + } +} \ No newline at end of file diff --git a/Function/BNLoadTypeLibraryFromFile.cs b/Function/BNLoadTypeLibraryFromFile.cs new file mode 100644 index 0000000..a06c968 --- /dev/null +++ b/Function/BNLoadTypeLibraryFromFile.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeLibrary* BNLoadTypeLibraryFromFile(const char* path) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNLoadTypeLibraryFromFile" + )] + internal static extern IntPtr BNLoadTypeLibraryFromFile( + + // const char* path + string path + ); + } +} \ No newline at end of file diff --git a/Function/BNLogAlertWithStackTrace.cs b/Function/BNLogAlertWithStackTrace.cs new file mode 100644 index 0000000..1cf7d4b --- /dev/null +++ b/Function/BNLogAlertWithStackTrace.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNLogAlertWithStackTrace(const char* stackTrace, const char* fmt) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNLogAlertWithStackTrace" + )] + internal static extern void BNLogAlertWithStackTrace( + + // const char* stackTrace + string stackTrace , + + // const char* fmt + string fmt + + ); + } +} \ No newline at end of file diff --git a/Function/BNLogCreateLogger.cs b/Function/BNLogCreateLogger.cs new file mode 100644 index 0000000..5b79adf --- /dev/null +++ b/Function/BNLogCreateLogger.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLogger* BNLogCreateLogger(const char* loggerName, uint64_t sessionId) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNLogCreateLogger" + )] + internal static extern IntPtr BNLogCreateLogger( + + // const char* loggerName + string loggerName , + + // uint64_t sessionId + ulong sessionId + ); + } +} \ No newline at end of file diff --git a/Function/BNLogGetLogger.cs b/Function/BNLogGetLogger.cs new file mode 100644 index 0000000..2762cb1 --- /dev/null +++ b/Function/BNLogGetLogger.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLogger* BNLogGetLogger(const char* loggerName, uint64_t sessionId) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNLogGetLogger" + )] + internal static extern IntPtr BNLogGetLogger( + + // const char* loggerName + string loggerName , + + // uint64_t sessionId + ulong sessionId + ); + } +} \ No newline at end of file diff --git a/Function/BNLogGetLoggerNames.cs b/Function/BNLogGetLoggerNames.cs new file mode 100644 index 0000000..1777426 --- /dev/null +++ b/Function/BNLogGetLoggerNames.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// char** BNLogGetLoggerNames(uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNLogGetLoggerNames" + )] + internal static extern IntPtr BNLogGetLoggerNames( + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNLogString.cs b/Function/BNLogString.cs new file mode 100644 index 0000000..f8b92d6 --- /dev/null +++ b/Function/BNLogString.cs @@ -0,0 +1,92 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Threading; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public static partial class Core + { + public static void LogString( + LogLevel level , + string text, + string logger_name = "" , + ulong session = 0 + ) + { + BinaryNinja.NativeMethods.BNLogString( + session , + level , + logger_name , + (ulong)Thread.CurrentThread.ManagedThreadId , + text + ); + } + + public static void LogDebug(string format , params object[] args) + { + string text = string.Format(format, args); + + LogString( LogLevel.DebugLog , text ); + } + + public static void LogInfo(string format , params object[] args) + { + string text = string.Format(format, args); + + LogString( LogLevel.InfoLog , text ); + } + + public static void LogWarn(string format , params object[] args) + { + string text = string.Format(format, args); + + LogString( LogLevel.WarningLog , text ); + } + + public static void LogError(string format , params object[] args) + { + string text = string.Format(format, args); + + LogString( LogLevel.ErrorLog , text ); + } + + public static void LogAlert(string format , params object[] args) + { + string text = string.Format(format, args); + + LogString( LogLevel.AlertLog , text ); + } + } + + internal static partial class NativeMethods + { + /// + /// void BNLogString(uint64_t session, BNLogLevel level, const char* logger_name, uint64_t tid, const char* str) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNLogString" + )] + public static extern void BNLogString( + + // uint64_t session + ulong session , + + // BNLogLevel level + LogLevel level , + + // const char* logger_name + string logger_name , + + // uint64_t tid + ulong tid , + + // const char* str + string str + ); + } +} \ No newline at end of file diff --git a/Function/BNLogStringWithStackTrace.cs b/Function/BNLogStringWithStackTrace.cs new file mode 100644 index 0000000..ef3cac9 --- /dev/null +++ b/Function/BNLogStringWithStackTrace.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNLogStringWithStackTrace(uint64_t session, BNLogLevel level, const char* logger_name, uint64_t tid, const char* stackTrace, const char* str) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNLogStringWithStackTrace" + )] + internal static extern void BNLogStringWithStackTrace( + + // uint64_t session + ulong session , + + // BNLogLevel level + LogLevel level , + + // const char* logger_name + string logger_name , + + // uint64_t tid + ulong tid , + + // const char* stackTrace + string stackTrace , + + // const char* str + string str + + ); + } +} \ No newline at end of file diff --git a/Function/BNLogToFile.cs b/Function/BNLogToFile.cs new file mode 100644 index 0000000..80d0c71 --- /dev/null +++ b/Function/BNLogToFile.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNLogToFile(BNLogLevel minimumLevel, const char* path, bool append) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNLogToFile" + )] + public static extern bool BNLogToFile( + + // BNLogLevel minimumLevel + LogLevel minimumLevel , + + // const char* path + string path , + + // bool append + bool append + ); + } +} \ No newline at end of file diff --git a/Function/BNLogToStderr.cs b/Function/BNLogToStderr.cs new file mode 100644 index 0000000..d0d91dc --- /dev/null +++ b/Function/BNLogToStderr.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNLogToStderr(BNLogLevel minimumLevel) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNLogToStderr" + )] + public static extern void BNLogToStderr( + + // BNLogLevel minimumLevel + LogLevel minimumLevel + ); + } +} \ No newline at end of file diff --git a/Function/BNLogToStdout.cs b/Function/BNLogToStdout.cs new file mode 100644 index 0000000..db080a7 --- /dev/null +++ b/Function/BNLogToStdout.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNLogToStdout(BNLogLevel minimumLevel) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNLogToStdout" + )] + public static extern void BNLogToStdout( + + // BNLogLevel minimumLevel + LogLevel minimumLevel + ); + } +} \ No newline at end of file diff --git a/Function/BNLoggerDedent.cs b/Function/BNLoggerDedent.cs new file mode 100644 index 0000000..de0f65e --- /dev/null +++ b/Function/BNLoggerDedent.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNLoggerDedent(BNLogger* logger) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNLoggerDedent" + )] + internal static extern void BNLoggerDedent( + + // BNLogger* logger + IntPtr logger + ); + } +} \ No newline at end of file diff --git a/Function/BNLoggerGetName.cs b/Function/BNLoggerGetName.cs new file mode 100644 index 0000000..304560a --- /dev/null +++ b/Function/BNLoggerGetName.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// char* BNLoggerGetName(BNLogger* logger) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNLoggerGetName" + )] + internal static extern IntPtr BNLoggerGetName( + + // BNLogger* logger + IntPtr logger + ); + } +} \ No newline at end of file diff --git a/Function/BNLoggerGetSessionId.cs b/Function/BNLoggerGetSessionId.cs new file mode 100644 index 0000000..85c4fdb --- /dev/null +++ b/Function/BNLoggerGetSessionId.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNLoggerGetSessionId(BNLogger* logger) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNLoggerGetSessionId" + )] + internal static extern ulong BNLoggerGetSessionId( + + // BNLogger* logger + IntPtr logger + ); + } +} \ No newline at end of file diff --git a/Function/BNLoggerIndent.cs b/Function/BNLoggerIndent.cs new file mode 100644 index 0000000..ae7b380 --- /dev/null +++ b/Function/BNLoggerIndent.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNLoggerIndent(BNLogger* logger) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNLoggerIndent" + )] + internal static extern void BNLoggerIndent( + + // BNLogger* logger + IntPtr logger + ); + } +} \ No newline at end of file diff --git a/Function/BNLoggerLogString.cs b/Function/BNLoggerLogString.cs new file mode 100644 index 0000000..7be3967 --- /dev/null +++ b/Function/BNLoggerLogString.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNLoggerLogString(BNLogger* logger, BNLogLevel level, const char* msg) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNLoggerLogString" + )] + internal static extern void BNLoggerLogString( + + // BNLogger* logger + IntPtr logger , + + // BNLogLevel level + LogLevel level , + + // const char* msg + string msg + ); + } +} \ No newline at end of file diff --git a/Function/BNLoggerLogStringWithStackTrace.cs b/Function/BNLoggerLogStringWithStackTrace.cs new file mode 100644 index 0000000..1c87a2c --- /dev/null +++ b/Function/BNLoggerLogStringWithStackTrace.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNLoggerLogStringWithStackTrace(BNLogger* logger, BNLogLevel level, const char* stackTrace, const char* msg) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNLoggerLogStringWithStackTrace" + )] + internal static extern void BNLoggerLogStringWithStackTrace( + + // BNLogger* logger + IntPtr logger , + + // BNLogLevel level + LogLevel level , + + // const char* stackTrace + string stackTrace , + + // const char* msg + string msg + + ); + } +} \ No newline at end of file diff --git a/Function/BNLoggerResetIndent.cs b/Function/BNLoggerResetIndent.cs new file mode 100644 index 0000000..8f11733 --- /dev/null +++ b/Function/BNLoggerResetIndent.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNLoggerResetIndent(BNLogger* logger) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNLoggerResetIndent" + )] + internal static extern void BNLoggerResetIndent( + + // BNLogger* logger + IntPtr logger + ); + } +} \ No newline at end of file diff --git a/Function/BNLookupImportedTypePlatform.cs b/Function/BNLookupImportedTypePlatform.cs new file mode 100644 index 0000000..4810551 --- /dev/null +++ b/Function/BNLookupImportedTypePlatform.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNLookupImportedTypePlatform(BNBinaryView* view, BNQualifiedName* typeName, BNPlatform** platform, BNQualifiedName* resultName) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNLookupImportedTypePlatform" + )] + internal static extern bool BNLookupImportedTypePlatform( + + // BNBinaryView* view + IntPtr view , + + // BNQualifiedName* typeName + in BNQualifiedName typeName , + + // BNPlatform** platform + out IntPtr platform , + + // BNQualifiedName* resultName + out BNQualifiedName resultName + ); + } +} \ No newline at end of file diff --git a/Function/BNLookupTypeArchiveById.cs b/Function/BNLookupTypeArchiveById.cs new file mode 100644 index 0000000..1bb47c1 --- /dev/null +++ b/Function/BNLookupTypeArchiveById.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeArchive* BNLookupTypeArchiveById(const char* id) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNLookupTypeArchiveById" + )] + internal static extern IntPtr BNLookupTypeArchiveById( + + // const char* id + string id + + ); + } +} \ No newline at end of file diff --git a/Function/BNLookupTypeLibraryByGuid.cs b/Function/BNLookupTypeLibraryByGuid.cs new file mode 100644 index 0000000..f265a53 --- /dev/null +++ b/Function/BNLookupTypeLibraryByGuid.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeLibrary* BNLookupTypeLibraryByGuid(BNArchitecture* arch, const char* guid) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNLookupTypeLibraryByGuid" + )] + internal static extern IntPtr BNLookupTypeLibraryByGuid( + + // BNArchitecture* arch + IntPtr arch , + + // const char* guid + string guid + ); + } +} \ No newline at end of file diff --git a/Function/BNLookupTypeLibraryByName.cs b/Function/BNLookupTypeLibraryByName.cs new file mode 100644 index 0000000..cc92997 --- /dev/null +++ b/Function/BNLookupTypeLibraryByName.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeLibrary* BNLookupTypeLibraryByName(BNArchitecture* arch, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNLookupTypeLibraryByName" + )] + internal static extern IntPtr BNLookupTypeLibraryByName( + + // BNArchitecture* arch + IntPtr arch , + + // const char* name + string name + ); + } +} \ No newline at end of file diff --git a/Function/BNLowLevelILAddExpr.cs b/Function/BNLowLevelILAddExpr.cs new file mode 100644 index 0000000..292db1c --- /dev/null +++ b/Function/BNLowLevelILAddExpr.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNLowLevelILAddExpr(BNLowLevelILFunction* func, BNLowLevelILOperation operation, uint64_t size, uint32_t flags, uint64_t a, uint64_t b, uint64_t c, uint64_t d) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNLowLevelILAddExpr" + )] + internal static extern LowLevelILExpressionIndex BNLowLevelILAddExpr( + + // BNLowLevelILFunction* func + IntPtr func , + + // BNLowLevelILOperation operation + LowLevelILOperation operation , + + // uint64_t size + ulong size , + + // uint32_t flags + uint flags , + + // uint64_t a + ulong a , + + // uint64_t b + ulong b , + + // uint64_t c + ulong c , + + // uint64_t d + ulong d + ); + } +} \ No newline at end of file diff --git a/Function/BNLowLevelILAddExprWithLocation.cs b/Function/BNLowLevelILAddExprWithLocation.cs new file mode 100644 index 0000000..b366a5c --- /dev/null +++ b/Function/BNLowLevelILAddExprWithLocation.cs @@ -0,0 +1,51 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNLowLevelILAddExprWithLocation(BNLowLevelILFunction* func, uint64_t addr, uint32_t sourceOperand, BNLowLevelILOperation operation, uint64_t size, uint32_t flags, uint64_t a, uint64_t b, uint64_t c, uint64_t d) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNLowLevelILAddExprWithLocation" + )] + internal static extern LowLevelILExpressionIndex BNLowLevelILAddExprWithLocation( + + // BNLowLevelILFunction* func + IntPtr func , + + // uint64_t addr + ulong addr , + + // uint32_t sourceOperand + OperandIndex sourceOperand , + + // BNLowLevelILOperation operation + LowLevelILOperation operation , + + // uint64_t size + ulong size , + + // uint32_t flags + uint flags , + + // uint64_t a + ulong a , + + // uint64_t b + ulong b , + + // uint64_t c + ulong c , + + // uint64_t d + ulong d + ); + } +} \ No newline at end of file diff --git a/Function/BNLowLevelILAddInstruction.cs b/Function/BNLowLevelILAddInstruction.cs new file mode 100644 index 0000000..b1646fc --- /dev/null +++ b/Function/BNLowLevelILAddInstruction.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNLowLevelILAddInstruction(BNLowLevelILFunction* func, uint64_t expr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNLowLevelILAddInstruction" + )] + internal static extern LowLevelILInstructionIndex BNLowLevelILAddInstruction( + + // BNLowLevelILFunction* func + IntPtr func , + + // uint64_t expr + LowLevelILExpressionIndex expr + ); + } +} \ No newline at end of file diff --git a/Function/BNLowLevelILAddLabelMap.cs b/Function/BNLowLevelILAddLabelMap.cs new file mode 100644 index 0000000..3d6e47b --- /dev/null +++ b/Function/BNLowLevelILAddLabelMap.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNLowLevelILAddLabelMap(BNLowLevelILFunction* func, uint64_t* values, BNLowLevelILLabel** labels, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNLowLevelILAddLabelMap" + )] + internal static extern LowLevelILExpressionIndex BNLowLevelILAddLabelMap( + + // BNLowLevelILFunction* func + IntPtr func , + + // uint64_t* values + ulong[] values , + + // BNLowLevelILLabel** labels + BNLowLevelILLabel[] labels , + + // uint64_t count + ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNLowLevelILAddOperandList.cs b/Function/BNLowLevelILAddOperandList.cs new file mode 100644 index 0000000..b03e63e --- /dev/null +++ b/Function/BNLowLevelILAddOperandList.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNLowLevelILAddOperandList(BNLowLevelILFunction* func, uint64_t* operands, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNLowLevelILAddOperandList" + )] + internal static extern LowLevelILExpressionIndex BNLowLevelILAddOperandList( + + // BNLowLevelILFunction* func + IntPtr func , + + // uint64_t* operands + ulong[] operands , + + // uint64_t count + ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNLowLevelILClearIndirectBranches.cs b/Function/BNLowLevelILClearIndirectBranches.cs new file mode 100644 index 0000000..37a6c58 --- /dev/null +++ b/Function/BNLowLevelILClearIndirectBranches.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNLowLevelILClearIndirectBranches(BNLowLevelILFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNLowLevelILClearIndirectBranches" + )] + internal static extern void BNLowLevelILClearIndirectBranches( + + // BNLowLevelILFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNLowLevelILFreeOperandList.cs b/Function/BNLowLevelILFreeOperandList.cs new file mode 100644 index 0000000..67db0ec --- /dev/null +++ b/Function/BNLowLevelILFreeOperandList.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNLowLevelILFreeOperandList(uint64_t* operands) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNLowLevelILFreeOperandList" + )] + internal static extern void BNLowLevelILFreeOperandList( + + // uint64_t* operands + IntPtr operands + + ); + } +} \ No newline at end of file diff --git a/Function/BNLowLevelILGetCurrentAddress.cs b/Function/BNLowLevelILGetCurrentAddress.cs new file mode 100644 index 0000000..94d37be --- /dev/null +++ b/Function/BNLowLevelILGetCurrentAddress.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNLowLevelILGetCurrentAddress(BNLowLevelILFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNLowLevelILGetCurrentAddress" + )] + internal static extern ulong BNLowLevelILGetCurrentAddress( + + // BNLowLevelILFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNLowLevelILGetExitsForInstruction.cs b/Function/BNLowLevelILGetExitsForInstruction.cs new file mode 100644 index 0000000..b1ff532 --- /dev/null +++ b/Function/BNLowLevelILGetExitsForInstruction.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t* BNLowLevelILGetExitsForInstruction(BNLowLevelILFunction* func, uint64_t instr, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNLowLevelILGetExitsForInstruction" + )] + internal static extern IntPtr BNLowLevelILGetExitsForInstruction( + + // BNLowLevelILFunction* func + IntPtr func , + + // uint64_t instr + LowLevelILInstructionIndex instr , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNLowLevelILGetInstructionStart.cs b/Function/BNLowLevelILGetInstructionStart.cs new file mode 100644 index 0000000..5651425 --- /dev/null +++ b/Function/BNLowLevelILGetInstructionStart.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNLowLevelILGetInstructionStart(BNLowLevelILFunction* func, BNArchitecture* arch, uint64_t addr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNLowLevelILGetInstructionStart" + )] + internal static extern LowLevelILInstructionIndex BNLowLevelILGetInstructionStart( + + // BNLowLevelILFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t addr + ulong addr + ); + } +} \ No newline at end of file diff --git a/Function/BNLowLevelILGetInstructionsAt.cs b/Function/BNLowLevelILGetInstructionsAt.cs new file mode 100644 index 0000000..dd9b167 --- /dev/null +++ b/Function/BNLowLevelILGetInstructionsAt.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t* BNLowLevelILGetInstructionsAt(BNLowLevelILFunction* func, BNArchitecture* arch, uint64_t addr, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNLowLevelILGetInstructionsAt" + )] + internal static extern IntPtr BNLowLevelILGetInstructionsAt( + + // BNLowLevelILFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t addr + ulong addr , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNLowLevelILGetOperandList.cs b/Function/BNLowLevelILGetOperandList.cs new file mode 100644 index 0000000..a381aa9 --- /dev/null +++ b/Function/BNLowLevelILGetOperandList.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t* BNLowLevelILGetOperandList(BNLowLevelILFunction* func, uint64_t expr, uint64_t operand, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNLowLevelILGetOperandList" + )] + internal static extern IntPtr BNLowLevelILGetOperandList( + + // BNLowLevelILFunction* func + IntPtr func , + + // uint64_t expr + LowLevelILExpressionIndex expr , + + // uint64_t operand + ulong operand , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNLowLevelILGoto.cs b/Function/BNLowLevelILGoto.cs new file mode 100644 index 0000000..473666f --- /dev/null +++ b/Function/BNLowLevelILGoto.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNLowLevelILGoto(BNLowLevelILFunction* func, BNLowLevelILLabel* label) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNLowLevelILGoto" + )] + internal static extern LowLevelILExpressionIndex BNLowLevelILGoto( + + // BNLowLevelILFunction* func + IntPtr func , + + // BNLowLevelILLabel* label + in BNLowLevelILLabel label + ); + } +} \ No newline at end of file diff --git a/Function/BNLowLevelILGotoWithLocation.cs b/Function/BNLowLevelILGotoWithLocation.cs new file mode 100644 index 0000000..17db1f2 --- /dev/null +++ b/Function/BNLowLevelILGotoWithLocation.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNLowLevelILGotoWithLocation(BNLowLevelILFunction* func, BNLowLevelILLabel* label, uint64_t addr, uint32_t sourceOperand) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNLowLevelILGotoWithLocation" + )] + internal static extern LowLevelILExpressionIndex BNLowLevelILGotoWithLocation( + + // BNLowLevelILFunction* func + IntPtr func , + + // BNLowLevelILLabel* label + in BNLowLevelILLabel label , + + // uint64_t addr + ulong addr , + + // uint32_t sourceOperand + uint sourceOperand + ); + } +} \ No newline at end of file diff --git a/Function/BNLowLevelILIf.cs b/Function/BNLowLevelILIf.cs new file mode 100644 index 0000000..88af9c7 --- /dev/null +++ b/Function/BNLowLevelILIf.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNLowLevelILIf(BNLowLevelILFunction* func, uint64_t op, BNLowLevelILLabel* t, BNLowLevelILLabel* f) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNLowLevelILIf" + )] + internal static extern LowLevelILExpressionIndex BNLowLevelILIf( + + // BNLowLevelILFunction* func + IntPtr func , + + // uint64_t op + LowLevelILExpressionIndex op , + + // BNLowLevelILLabel* t + in BNLowLevelILLabel t , + + // BNLowLevelILLabel* f + in BNLowLevelILLabel f + ); + } +} \ No newline at end of file diff --git a/Function/BNLowLevelILIfWithLocation.cs b/Function/BNLowLevelILIfWithLocation.cs new file mode 100644 index 0000000..0a494cb --- /dev/null +++ b/Function/BNLowLevelILIfWithLocation.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNLowLevelILIfWithLocation(BNLowLevelILFunction* func, uint64_t op, BNLowLevelILLabel* t, BNLowLevelILLabel* f, uint64_t addr, uint32_t sourceOperand) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNLowLevelILIfWithLocation" + )] + internal static extern LowLevelILExpressionIndex BNLowLevelILIfWithLocation( + + // BNLowLevelILFunction* func + IntPtr func , + + // uint64_t op + LowLevelILExpressionIndex op , + + // BNLowLevelILLabel* t + in BNLowLevelILLabel t , + + // BNLowLevelILLabel* f + in BNLowLevelILLabel f , + + // uint64_t addr + ulong addr , + + // uint32_t sourceOperand + uint sourceOperand + ); + } +} \ No newline at end of file diff --git a/Function/BNLowLevelILInitLabel.cs b/Function/BNLowLevelILInitLabel.cs new file mode 100644 index 0000000..e96f0cc --- /dev/null +++ b/Function/BNLowLevelILInitLabel.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNLowLevelILInitLabel(BNLowLevelILLabel* label) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNLowLevelILInitLabel" + )] + internal static extern void BNLowLevelILInitLabel( + + // BNLowLevelILLabel* label + ref BNLowLevelILLabel label + ); + } +} \ No newline at end of file diff --git a/Function/BNLowLevelILMarkLabel.cs b/Function/BNLowLevelILMarkLabel.cs new file mode 100644 index 0000000..a891f01 --- /dev/null +++ b/Function/BNLowLevelILMarkLabel.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNLowLevelILMarkLabel(BNLowLevelILFunction* func, BNLowLevelILLabel* label) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNLowLevelILMarkLabel" + )] + internal static extern void BNLowLevelILMarkLabel( + + // BNLowLevelILFunction* func + IntPtr func , + + // BNLowLevelILLabel* label + in BNLowLevelILLabel label + ); + } +} \ No newline at end of file diff --git a/Function/BNLowLevelILSetCurrentAddress.cs b/Function/BNLowLevelILSetCurrentAddress.cs new file mode 100644 index 0000000..8e0f6dc --- /dev/null +++ b/Function/BNLowLevelILSetCurrentAddress.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNLowLevelILSetCurrentAddress(BNLowLevelILFunction* func, BNArchitecture* arch, uint64_t addr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNLowLevelILSetCurrentAddress" + )] + internal static extern void BNLowLevelILSetCurrentAddress( + + // BNLowLevelILFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t addr + ulong addr + ); + } +} \ No newline at end of file diff --git a/Function/BNLowLevelILSetCurrentSourceBlock.cs b/Function/BNLowLevelILSetCurrentSourceBlock.cs new file mode 100644 index 0000000..2a69abd --- /dev/null +++ b/Function/BNLowLevelILSetCurrentSourceBlock.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNLowLevelILSetCurrentSourceBlock(BNLowLevelILFunction* func, BNBasicBlock* source) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNLowLevelILSetCurrentSourceBlock" + )] + internal static extern void BNLowLevelILSetCurrentSourceBlock( + + // BNLowLevelILFunction* func + IntPtr func , + + // BNBasicBlock* source + IntPtr source + ); + } +} \ No newline at end of file diff --git a/Function/BNLowLevelILSetExprSourceOperand.cs b/Function/BNLowLevelILSetExprSourceOperand.cs new file mode 100644 index 0000000..cf7b386 --- /dev/null +++ b/Function/BNLowLevelILSetExprSourceOperand.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNLowLevelILSetExprSourceOperand(BNLowLevelILFunction* func, uint64_t expr, uint32_t operand) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNLowLevelILSetExprSourceOperand" + )] + internal static extern void BNLowLevelILSetExprSourceOperand( + + // BNLowLevelILFunction* func + IntPtr func , + + // uint64_t expr + LowLevelILExpressionIndex expr , + + // uint32_t operand + uint operand + ); + } +} \ No newline at end of file diff --git a/Function/BNLowLevelILSetIndirectBranches.cs b/Function/BNLowLevelILSetIndirectBranches.cs new file mode 100644 index 0000000..9ddf56a --- /dev/null +++ b/Function/BNLowLevelILSetIndirectBranches.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNLowLevelILSetIndirectBranches(BNLowLevelILFunction* func, BNArchitectureAndAddress* branches, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNLowLevelILSetIndirectBranches" + )] + internal static extern void BNLowLevelILSetIndirectBranches( + + // BNLowLevelILFunction* func + IntPtr func , + + // BNArchitectureAndAddress* branches + BNArchitectureAndAddress[] branches , + + // uint64_t count + ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNLzma2Decompress.cs b/Function/BNLzma2Decompress.cs new file mode 100644 index 0000000..a8b2e3b --- /dev/null +++ b/Function/BNLzma2Decompress.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDataBuffer* BNLzma2Decompress(BNDataBuffer* buf) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNLzma2Decompress" + )] + internal static extern IntPtr BNLzma2Decompress( + + // BNDataBuffer* buf + IntPtr buf + + ); + } +} \ No newline at end of file diff --git a/Function/BNLzmaDecompress.cs b/Function/BNLzmaDecompress.cs new file mode 100644 index 0000000..63b39db --- /dev/null +++ b/Function/BNLzmaDecompress.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDataBuffer* BNLzmaDecompress(BNDataBuffer* buf) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNLzmaDecompress" + )] + internal static extern IntPtr BNLzmaDecompress( + + // BNDataBuffer* buf + IntPtr buf + + ); + } +} \ No newline at end of file diff --git a/Function/BNMarkBasicBlockAsRecentlyUsed.cs b/Function/BNMarkBasicBlockAsRecentlyUsed.cs new file mode 100644 index 0000000..b41f3ea --- /dev/null +++ b/Function/BNMarkBasicBlockAsRecentlyUsed.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNMarkBasicBlockAsRecentlyUsed(BNBasicBlock* block) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNMarkBasicBlockAsRecentlyUsed" + )] + internal static extern void BNMarkBasicBlockAsRecentlyUsed( + + // BNBasicBlock* block + IntPtr block + + ); + } +} \ No newline at end of file diff --git a/Function/BNMarkCallerUpdatesRequired.cs b/Function/BNMarkCallerUpdatesRequired.cs new file mode 100644 index 0000000..353cbea --- /dev/null +++ b/Function/BNMarkCallerUpdatesRequired.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNMarkCallerUpdatesRequired(BNFunction* func, BNFunctionUpdateType type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNMarkCallerUpdatesRequired" + )] + internal static extern void BNMarkCallerUpdatesRequired( + + // BNFunction* func + IntPtr func , + + // BNFunctionUpdateType type + FunctionUpdateType type + + ); + } +} \ No newline at end of file diff --git a/Function/BNMarkFileModified.cs b/Function/BNMarkFileModified.cs new file mode 100644 index 0000000..1dc527f --- /dev/null +++ b/Function/BNMarkFileModified.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNMarkFileModified(BNFileMetadata* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNMarkFileModified" + )] + internal static extern void BNMarkFileModified( + + // BNFileMetadata* file + IntPtr file + ); + } +} \ No newline at end of file diff --git a/Function/BNMarkFileSaved.cs b/Function/BNMarkFileSaved.cs new file mode 100644 index 0000000..70a5d77 --- /dev/null +++ b/Function/BNMarkFileSaved.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNMarkFileSaved(BNFileMetadata* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNMarkFileSaved" + )] + internal static extern void BNMarkFileSaved( + + // BNFileMetadata* file + IntPtr file + ); + } +} \ No newline at end of file diff --git a/Function/BNMarkFunctionAsRecentlyUsed.cs b/Function/BNMarkFunctionAsRecentlyUsed.cs new file mode 100644 index 0000000..7f5f7cf --- /dev/null +++ b/Function/BNMarkFunctionAsRecentlyUsed.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNMarkFunctionAsRecentlyUsed(BNFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNMarkFunctionAsRecentlyUsed" + )] + internal static extern void BNMarkFunctionAsRecentlyUsed( + + // BNFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNMarkMediumLevelILInstructionForRemoval.cs b/Function/BNMarkMediumLevelILInstructionForRemoval.cs new file mode 100644 index 0000000..8acbccc --- /dev/null +++ b/Function/BNMarkMediumLevelILInstructionForRemoval.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNMarkMediumLevelILInstructionForRemoval(BNMediumLevelILFunction* func, uint64_t instr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNMarkMediumLevelILInstructionForRemoval" + )] + internal static extern void BNMarkMediumLevelILInstructionForRemoval( + + // BNMediumLevelILFunction* func + IntPtr func , + + // uint64_t instr + ulong instr + + ); + } +} \ No newline at end of file diff --git a/Function/BNMarkUpdatesRequired.cs b/Function/BNMarkUpdatesRequired.cs new file mode 100644 index 0000000..68b49b8 --- /dev/null +++ b/Function/BNMarkUpdatesRequired.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNMarkUpdatesRequired(BNFunction* func, BNFunctionUpdateType type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNMarkUpdatesRequired" + )] + internal static extern void BNMarkUpdatesRequired( + + // BNFunction* func + IntPtr func , + + // BNFunctionUpdateType type + FunctionUpdateType type + + ); + } +} \ No newline at end of file diff --git a/Function/BNMarkdownToHTML.cs b/Function/BNMarkdownToHTML.cs new file mode 100644 index 0000000..06a0da7 --- /dev/null +++ b/Function/BNMarkdownToHTML.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public static partial class Core + { + public static string MarkdownToHTML(string contents) + { + return UnsafeUtils.TakeUtf8String( + NativeMethods.BNMarkdownToHTML(contents) + ); + } + } + + internal static partial class NativeMethods + { + /// + /// char* BNMarkdownToHTML(const char* contents) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNMarkdownToHTML" + )] + internal static extern IntPtr BNMarkdownToHTML( + + // const char* contents + string contents + ); + } +} \ No newline at end of file diff --git a/Function/BNMaskToSize.cs b/Function/BNMaskToSize.cs new file mode 100644 index 0000000..08c0d27 --- /dev/null +++ b/Function/BNMaskToSize.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// int64_t BNMaskToSize(int64_t value, uint64_t size) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNMaskToSize" + )] + internal static extern long BNMaskToSize( + + // int64_t _value + long _value , + + // uint64_t size + ulong size + ); + } +} \ No newline at end of file diff --git a/Function/BNMediumLevelILAddExpr.cs b/Function/BNMediumLevelILAddExpr.cs new file mode 100644 index 0000000..0c850bb --- /dev/null +++ b/Function/BNMediumLevelILAddExpr.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNMediumLevelILAddExpr(BNMediumLevelILFunction* func, BNMediumLevelILOperation operation, uint64_t size, uint64_t a, uint64_t b, uint64_t c, uint64_t d, uint64_t e) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNMediumLevelILAddExpr" + )] + internal static extern MediumLevelILExpressionIndex BNMediumLevelILAddExpr( + + // BNMediumLevelILFunction* func + IntPtr func , + + // BNMediumLevelILOperation operation + MediumLevelILOperation operation , + + // uint64_t size + ulong size , + + // uint64_t a + ulong a , + + // uint64_t b + ulong b , + + // uint64_t c + ulong c , + + // uint64_t d + ulong d , + + // uint64_t e + ulong e + ); + } +} \ No newline at end of file diff --git a/Function/BNMediumLevelILAddExprWithLocation.cs b/Function/BNMediumLevelILAddExprWithLocation.cs new file mode 100644 index 0000000..793bcfe --- /dev/null +++ b/Function/BNMediumLevelILAddExprWithLocation.cs @@ -0,0 +1,51 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNMediumLevelILAddExprWithLocation(BNMediumLevelILFunction* func, BNMediumLevelILOperation operation, uint64_t addr, uint32_t sourceOperand, uint64_t size, uint64_t a, uint64_t b, uint64_t c, uint64_t d, uint64_t e) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNMediumLevelILAddExprWithLocation" + )] + internal static extern MediumLevelILExpressionIndex BNMediumLevelILAddExprWithLocation( + + // BNMediumLevelILFunction* func + IntPtr func , + + // BNMediumLevelILOperation operation + MediumLevelILOperation operation , + + // uint64_t addr + ulong address , + + // uint32_t sourceOperand + OperandIndex sourceOperand , + + // uint64_t size + ulong size , + + // uint64_t a + ulong a , + + // uint64_t b + ulong b , + + // uint64_t c + ulong c , + + // uint64_t d + ulong d , + + // uint64_t e + ulong e + ); + } +} \ No newline at end of file diff --git a/Function/BNMediumLevelILAddInstruction.cs b/Function/BNMediumLevelILAddInstruction.cs new file mode 100644 index 0000000..eb3899f --- /dev/null +++ b/Function/BNMediumLevelILAddInstruction.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNMediumLevelILAddInstruction(BNMediumLevelILFunction* func, uint64_t expr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNMediumLevelILAddInstruction" + )] + internal static extern MediumLevelILInstructionIndex BNMediumLevelILAddInstruction( + + // BNMediumLevelILFunction* func + IntPtr func , + + // uint64_t expr + MediumLevelILExpressionIndex expr + ); + } +} \ No newline at end of file diff --git a/Function/BNMediumLevelILAddLabelMap.cs b/Function/BNMediumLevelILAddLabelMap.cs new file mode 100644 index 0000000..ce525e5 --- /dev/null +++ b/Function/BNMediumLevelILAddLabelMap.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNMediumLevelILAddLabelMap(BNMediumLevelILFunction* func, uint64_t* values, BNMediumLevelILLabel** labels, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNMediumLevelILAddLabelMap" + )] + internal static extern MediumLevelILExpressionIndex BNMediumLevelILAddLabelMap( + + // BNMediumLevelILFunction* func + IntPtr func , + + // uint64_t* values + ulong[] values , + + // BNMediumLevelILLabel** labels + BNMediumLevelILLabel[] labels , + + // uint64_t count + ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNMediumLevelILAddOperandList.cs b/Function/BNMediumLevelILAddOperandList.cs new file mode 100644 index 0000000..e198248 --- /dev/null +++ b/Function/BNMediumLevelILAddOperandList.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNMediumLevelILAddOperandList(BNMediumLevelILFunction* func, uint64_t* operands, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNMediumLevelILAddOperandList" + )] + internal static extern MediumLevelILExpressionIndex BNMediumLevelILAddOperandList( + + // BNMediumLevelILFunction* func + IntPtr func , + + // uint64_t* operands + ulong[] operands , + + // uint64_t count + ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNMediumLevelILFreeOperandList.cs b/Function/BNMediumLevelILFreeOperandList.cs new file mode 100644 index 0000000..3cd8fce --- /dev/null +++ b/Function/BNMediumLevelILFreeOperandList.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNMediumLevelILFreeOperandList(uint64_t* operands) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNMediumLevelILFreeOperandList" + )] + internal static extern void BNMediumLevelILFreeOperandList( + + // uint64_t* operands + IntPtr operands + ); + } +} \ No newline at end of file diff --git a/Function/BNMediumLevelILGetCurrentAddress.cs b/Function/BNMediumLevelILGetCurrentAddress.cs new file mode 100644 index 0000000..dd42990 --- /dev/null +++ b/Function/BNMediumLevelILGetCurrentAddress.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNMediumLevelILGetCurrentAddress(BNMediumLevelILFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNMediumLevelILGetCurrentAddress" + )] + internal static extern ulong BNMediumLevelILGetCurrentAddress( + + // BNMediumLevelILFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNMediumLevelILGetInstructionStart.cs b/Function/BNMediumLevelILGetInstructionStart.cs new file mode 100644 index 0000000..4eda8c1 --- /dev/null +++ b/Function/BNMediumLevelILGetInstructionStart.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNMediumLevelILGetInstructionStart(BNMediumLevelILFunction* func, BNArchitecture* arch, uint64_t addr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNMediumLevelILGetInstructionStart" + )] + internal static extern MediumLevelILInstructionIndex BNMediumLevelILGetInstructionStart( + + // BNMediumLevelILFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t addr + ulong addr + ); + } +} \ No newline at end of file diff --git a/Function/BNMediumLevelILGetOperandList.cs b/Function/BNMediumLevelILGetOperandList.cs new file mode 100644 index 0000000..44ddc8e --- /dev/null +++ b/Function/BNMediumLevelILGetOperandList.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t* BNMediumLevelILGetOperandList(BNMediumLevelILFunction* func, uint64_t expr, uint64_t operand, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNMediumLevelILGetOperandList" + )] + internal static extern IntPtr BNMediumLevelILGetOperandList( + + // BNMediumLevelILFunction* func + IntPtr func , + + // uint64_t expr + MediumLevelILExpressionIndex expr , + + // uint64_t operand + ulong operand , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNMediumLevelILGoto.cs b/Function/BNMediumLevelILGoto.cs new file mode 100644 index 0000000..2d34c2c --- /dev/null +++ b/Function/BNMediumLevelILGoto.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNMediumLevelILGoto(BNMediumLevelILFunction* func, BNMediumLevelILLabel* label) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNMediumLevelILGoto" + )] + internal static extern MediumLevelILExpressionIndex BNMediumLevelILGoto( + + // BNMediumLevelILFunction* func + IntPtr func , + + // BNMediumLevelILLabel* label + in BNMediumLevelILLabel label + ); + } +} \ No newline at end of file diff --git a/Function/BNMediumLevelILGotoWithLocation.cs b/Function/BNMediumLevelILGotoWithLocation.cs new file mode 100644 index 0000000..b7e1740 --- /dev/null +++ b/Function/BNMediumLevelILGotoWithLocation.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNMediumLevelILGotoWithLocation(BNMediumLevelILFunction* func, BNMediumLevelILLabel* label, uint64_t addr, uint32_t sourceOperand) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNMediumLevelILGotoWithLocation" + )] + internal static extern MediumLevelILExpressionIndex BNMediumLevelILGotoWithLocation( + + // BNMediumLevelILFunction* func + IntPtr function , + + // BNMediumLevelILLabel* label + in BNMediumLevelILLabel label , + + // uint64_t addr + ulong address , + + // uint32_t sourceOperand + OperandIndex sourceOperand + ); + } +} \ No newline at end of file diff --git a/Function/BNMediumLevelILIf.cs b/Function/BNMediumLevelILIf.cs new file mode 100644 index 0000000..9c3ba6b --- /dev/null +++ b/Function/BNMediumLevelILIf.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNMediumLevelILIf(BNMediumLevelILFunction* func, uint64_t op, BNMediumLevelILLabel* t, BNMediumLevelILLabel* f) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNMediumLevelILIf" + )] + internal static extern MediumLevelILExpressionIndex BNMediumLevelILIf( + + // BNMediumLevelILFunction* func + IntPtr func , + + // uint64_t op + MediumLevelILExpressionIndex op , + + // BNMediumLevelILLabel* t + in BNMediumLevelILLabel t , + + // BNMediumLevelILLabel* f + in BNMediumLevelILLabel f + ); + } +} \ No newline at end of file diff --git a/Function/BNMediumLevelILIfWithLocation.cs b/Function/BNMediumLevelILIfWithLocation.cs new file mode 100644 index 0000000..6d90103 --- /dev/null +++ b/Function/BNMediumLevelILIfWithLocation.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNMediumLevelILIfWithLocation(BNMediumLevelILFunction* func, uint64_t op, BNMediumLevelILLabel* t, BNMediumLevelILLabel* f, uint64_t addr, uint32_t sourceOperand) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNMediumLevelILIfWithLocation" + )] + internal static extern MediumLevelILExpressionIndex BNMediumLevelILIfWithLocation( + + // BNMediumLevelILFunction* func + IntPtr func , + + // uint64_t op + MediumLevelILExpressionIndex op , + + // BNMediumLevelILLabel* t + in BNMediumLevelILLabel t , + + // BNMediumLevelILLabel* f + in BNMediumLevelILLabel f , + + // uint64_t addr + ulong address , + + // uint32_t sourceOperand + uint sourceOperand + ); + } +} \ No newline at end of file diff --git a/Function/BNMediumLevelILInitLabel.cs b/Function/BNMediumLevelILInitLabel.cs new file mode 100644 index 0000000..f76951e --- /dev/null +++ b/Function/BNMediumLevelILInitLabel.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNMediumLevelILInitLabel(BNMediumLevelILLabel* label) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNMediumLevelILInitLabel" + )] + internal static extern void BNMediumLevelILInitLabel( + + // BNMediumLevelILLabel* label + ref BNMediumLevelILLabel label + ); + } +} \ No newline at end of file diff --git a/Function/BNMediumLevelILMarkLabel.cs b/Function/BNMediumLevelILMarkLabel.cs new file mode 100644 index 0000000..af1b3fb --- /dev/null +++ b/Function/BNMediumLevelILMarkLabel.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNMediumLevelILMarkLabel(BNMediumLevelILFunction* func, BNMediumLevelILLabel* label) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNMediumLevelILMarkLabel" + )] + internal static extern void BNMediumLevelILMarkLabel( + + // BNMediumLevelILFunction* func + IntPtr func , + + // BNMediumLevelILLabel* label + in BNMediumLevelILLabel label + ); + } +} \ No newline at end of file diff --git a/Function/BNMediumLevelILSetCurrentAddress.cs b/Function/BNMediumLevelILSetCurrentAddress.cs new file mode 100644 index 0000000..df3b999 --- /dev/null +++ b/Function/BNMediumLevelILSetCurrentAddress.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNMediumLevelILSetCurrentAddress(BNMediumLevelILFunction* func, BNArchitecture* arch, uint64_t addr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNMediumLevelILSetCurrentAddress" + )] + internal static extern void BNMediumLevelILSetCurrentAddress( + + // BNMediumLevelILFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t addr + ulong addr + ); + } +} \ No newline at end of file diff --git a/Function/BNMergeVariables.cs b/Function/BNMergeVariables.cs new file mode 100644 index 0000000..465e2fa --- /dev/null +++ b/Function/BNMergeVariables.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNMergeVariables(BNFunction* func, BNVariable* target, BNVariable* sources, uint64_t sourceCount) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNMergeVariables" + )] + internal static extern void BNMergeVariables( + + // BNFunction* func + IntPtr func , + + // BNVariable* target + IntPtr target , + + // BNVariable* sources + IntPtr sources , + + // uint64_t sourceCount + ulong sourceCount + + ); + } +} \ No newline at end of file diff --git a/Function/BNMetadataArrayAppend.cs b/Function/BNMetadataArrayAppend.cs new file mode 100644 index 0000000..1079b2c --- /dev/null +++ b/Function/BNMetadataArrayAppend.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNMetadataArrayAppend(BNMetadata* data, BNMetadata* md) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNMetadataArrayAppend" + )] + internal static extern bool BNMetadataArrayAppend( + + // BNMetadata* data + IntPtr data , + + // BNMetadata* md + IntPtr md + ); + } +} \ No newline at end of file diff --git a/Function/BNMetadataGetArray.cs b/Function/BNMetadataGetArray.cs new file mode 100644 index 0000000..1c819ff --- /dev/null +++ b/Function/BNMetadataGetArray.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNMetadata** BNMetadataGetArray(BNMetadata* data, uint64_t* size) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNMetadataGetArray" + )] + internal static extern IntPtr BNMetadataGetArray( + + // BNMetadata* data + IntPtr data , + + // uint64_t* size + out ulong size + ); + } +} \ No newline at end of file diff --git a/Function/BNMetadataGetBoolean.cs b/Function/BNMetadataGetBoolean.cs new file mode 100644 index 0000000..cbb4433 --- /dev/null +++ b/Function/BNMetadataGetBoolean.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNMetadataGetBoolean(BNMetadata* data) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNMetadataGetBoolean" + )] + internal static extern bool BNMetadataGetBoolean( + + // BNMetadata* data + IntPtr data + + ); + } +} \ No newline at end of file diff --git a/Function/BNMetadataGetBooleanList.cs b/Function/BNMetadataGetBooleanList.cs new file mode 100644 index 0000000..ebc0be0 --- /dev/null +++ b/Function/BNMetadataGetBooleanList.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool* BNMetadataGetBooleanList(BNMetadata* data, uint64_t* param2) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNMetadataGetBooleanList" + )] + internal static extern IntPtr BNMetadataGetBooleanList( + + // BNMetadata* data + IntPtr data , + + // uint64_t* param2 + out ulong param2 + ); + } +} \ No newline at end of file diff --git a/Function/BNMetadataGetDouble.cs b/Function/BNMetadataGetDouble.cs new file mode 100644 index 0000000..80e2fdd --- /dev/null +++ b/Function/BNMetadataGetDouble.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// double BNMetadataGetDouble(BNMetadata* data) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNMetadataGetDouble" + )] + internal static extern double BNMetadataGetDouble( + + // BNMetadata* data + IntPtr data + ); + } +} \ No newline at end of file diff --git a/Function/BNMetadataGetDoubleList.cs b/Function/BNMetadataGetDoubleList.cs new file mode 100644 index 0000000..785e9c7 --- /dev/null +++ b/Function/BNMetadataGetDoubleList.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// double* BNMetadataGetDoubleList(BNMetadata* data, uint64_t* param2) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNMetadataGetDoubleList" + )] + internal static extern IntPtr BNMetadataGetDoubleList( + + // BNMetadata* data + IntPtr data , + + // uint64_t* param2 + out ulong param2 + ); + } +} \ No newline at end of file diff --git a/Function/BNMetadataGetForIndex.cs b/Function/BNMetadataGetForIndex.cs new file mode 100644 index 0000000..97d758d --- /dev/null +++ b/Function/BNMetadataGetForIndex.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNMetadata* BNMetadataGetForIndex(BNMetadata* data, uint64_t index) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNMetadataGetForIndex" + )] + internal static extern IntPtr BNMetadataGetForIndex( + + // BNMetadata* data + IntPtr data , + + // uint64_t index + ulong index + ); + } +} \ No newline at end of file diff --git a/Function/BNMetadataGetForKey.cs b/Function/BNMetadataGetForKey.cs new file mode 100644 index 0000000..0ce06ff --- /dev/null +++ b/Function/BNMetadataGetForKey.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNMetadata* BNMetadataGetForKey(BNMetadata* data, const char* key) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNMetadataGetForKey" + )] + internal static extern IntPtr BNMetadataGetForKey( + + // BNMetadata* data + IntPtr data , + + // const char* key + string key + ); + } +} \ No newline at end of file diff --git a/Function/BNMetadataGetJsonString.cs b/Function/BNMetadataGetJsonString.cs new file mode 100644 index 0000000..6fc0940 --- /dev/null +++ b/Function/BNMetadataGetJsonString.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNMetadataGetJsonString(BNMetadata* data) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNMetadataGetJsonString" + )] + internal static extern IntPtr BNMetadataGetJsonString( + + // BNMetadata* data + IntPtr data + + ); + } +} \ No newline at end of file diff --git a/Function/BNMetadataGetRaw.cs b/Function/BNMetadataGetRaw.cs new file mode 100644 index 0000000..b4c9542 --- /dev/null +++ b/Function/BNMetadataGetRaw.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint8_t* BNMetadataGetRaw(BNMetadata* data, uint64_t* size) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNMetadataGetRaw" + )] + internal static extern IntPtr BNMetadataGetRaw( + + // BNMetadata* data + IntPtr data , + + // uint64_t* size + out ulong size + ); + } +} \ No newline at end of file diff --git a/Function/BNMetadataGetSignedInteger.cs b/Function/BNMetadataGetSignedInteger.cs new file mode 100644 index 0000000..6a76704 --- /dev/null +++ b/Function/BNMetadataGetSignedInteger.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// int64_t BNMetadataGetSignedInteger(BNMetadata* data) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNMetadataGetSignedInteger" + )] + internal static extern long BNMetadataGetSignedInteger( + + // BNMetadata* data + IntPtr data + ); + } +} \ No newline at end of file diff --git a/Function/BNMetadataGetSignedIntegerList.cs b/Function/BNMetadataGetSignedIntegerList.cs new file mode 100644 index 0000000..0cf7ff9 --- /dev/null +++ b/Function/BNMetadataGetSignedIntegerList.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// int64_t* BNMetadataGetSignedIntegerList(BNMetadata* data, uint64_t* param2) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNMetadataGetSignedIntegerList" + )] + internal static extern IntPtr BNMetadataGetSignedIntegerList( + + // BNMetadata* data + IntPtr data , + + // uint64_t* param2 + out ulong param2 + ); + } +} \ No newline at end of file diff --git a/Function/BNMetadataGetString.cs b/Function/BNMetadataGetString.cs new file mode 100644 index 0000000..b030552 --- /dev/null +++ b/Function/BNMetadataGetString.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// char* BNMetadataGetString(BNMetadata* data) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNMetadataGetString" + )] + internal static extern IntPtr BNMetadataGetString( + + // BNMetadata* data + IntPtr data + ); + } +} \ No newline at end of file diff --git a/Function/BNMetadataGetStringList.cs b/Function/BNMetadataGetStringList.cs new file mode 100644 index 0000000..9d50652 --- /dev/null +++ b/Function/BNMetadataGetStringList.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// char** BNMetadataGetStringList(BNMetadata* data, uint64_t* param2) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNMetadataGetStringList" + )] + internal static extern IntPtr BNMetadataGetStringList( + + // BNMetadata* data + IntPtr data , + + // uint64_t* param2 + out ulong param2 + ); + } +} \ No newline at end of file diff --git a/Function/BNMetadataGetType.cs b/Function/BNMetadataGetType.cs new file mode 100644 index 0000000..f473392 --- /dev/null +++ b/Function/BNMetadataGetType.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNMetadataType BNMetadataGetType(BNMetadata* data) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNMetadataGetType" + )] + internal static extern MetadataType BNMetadataGetType( + + // BNMetadata* data + IntPtr data + + ); + } +} \ No newline at end of file diff --git a/Function/BNMetadataGetUnsignedInteger.cs b/Function/BNMetadataGetUnsignedInteger.cs new file mode 100644 index 0000000..4ebf393 --- /dev/null +++ b/Function/BNMetadataGetUnsignedInteger.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNMetadataGetUnsignedInteger(BNMetadata* data) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNMetadataGetUnsignedInteger" + )] + internal static extern ulong BNMetadataGetUnsignedInteger( + + // BNMetadata* data + IntPtr data + ); + } +} \ No newline at end of file diff --git a/Function/BNMetadataGetUnsignedIntegerList.cs b/Function/BNMetadataGetUnsignedIntegerList.cs new file mode 100644 index 0000000..37c8c0e --- /dev/null +++ b/Function/BNMetadataGetUnsignedIntegerList.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t* BNMetadataGetUnsignedIntegerList(BNMetadata* data, uint64_t* param2) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNMetadataGetUnsignedIntegerList" + )] + internal static extern IntPtr BNMetadataGetUnsignedIntegerList( + + // BNMetadata* data + IntPtr data , + + // uint64_t* param2 + out ulong param2 + ); + } +} \ No newline at end of file diff --git a/Function/BNMetadataGetValueStore.cs b/Function/BNMetadataGetValueStore.cs new file mode 100644 index 0000000..1e0c8b4 --- /dev/null +++ b/Function/BNMetadataGetValueStore.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNMetadataValueStore* BNMetadataGetValueStore(BNMetadata* data) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNMetadataGetValueStore" + )] + internal static extern IntPtr BNMetadataGetValueStore( + + // BNMetadata* data + IntPtr data + ); + } +} \ No newline at end of file diff --git a/Function/BNMetadataIsArray.cs b/Function/BNMetadataIsArray.cs new file mode 100644 index 0000000..4ff7596 --- /dev/null +++ b/Function/BNMetadataIsArray.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNMetadataIsArray(BNMetadata* data) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNMetadataIsArray" + )] + internal static extern bool BNMetadataIsArray( + + // BNMetadata* data + IntPtr data + ); + } +} \ No newline at end of file diff --git a/Function/BNMetadataIsBoolean.cs b/Function/BNMetadataIsBoolean.cs new file mode 100644 index 0000000..f25bda2 --- /dev/null +++ b/Function/BNMetadataIsBoolean.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNMetadataIsBoolean(BNMetadata* data) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNMetadataIsBoolean" + )] + internal static extern bool BNMetadataIsBoolean( + + // BNMetadata* data + IntPtr data + ); + } +} \ No newline at end of file diff --git a/Function/BNMetadataIsBooleanList.cs b/Function/BNMetadataIsBooleanList.cs new file mode 100644 index 0000000..3f34139 --- /dev/null +++ b/Function/BNMetadataIsBooleanList.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNMetadataIsBooleanList(BNMetadata* data) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNMetadataIsBooleanList" + )] + internal static extern bool BNMetadataIsBooleanList( + + // BNMetadata* data + IntPtr data + ); + } +} \ No newline at end of file diff --git a/Function/BNMetadataIsDouble.cs b/Function/BNMetadataIsDouble.cs new file mode 100644 index 0000000..2d93f4b --- /dev/null +++ b/Function/BNMetadataIsDouble.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNMetadataIsDouble(BNMetadata* data) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNMetadataIsDouble" + )] + internal static extern bool BNMetadataIsDouble( + + // BNMetadata* data + IntPtr data + ); + } +} \ No newline at end of file diff --git a/Function/BNMetadataIsDoubleList.cs b/Function/BNMetadataIsDoubleList.cs new file mode 100644 index 0000000..b5f71e0 --- /dev/null +++ b/Function/BNMetadataIsDoubleList.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNMetadataIsDoubleList(BNMetadata* data) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNMetadataIsDoubleList" + )] + internal static extern bool BNMetadataIsDoubleList( + + // BNMetadata* data + IntPtr data + ); + } +} \ No newline at end of file diff --git a/Function/BNMetadataIsEqual.cs b/Function/BNMetadataIsEqual.cs new file mode 100644 index 0000000..fa3e82c --- /dev/null +++ b/Function/BNMetadataIsEqual.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNMetadataIsEqual(BNMetadata* lhs, BNMetadata* rhs) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNMetadataIsEqual" + )] + internal static extern bool BNMetadataIsEqual( + + // BNMetadata* lhs + IntPtr lhs , + + // BNMetadata* rhs + IntPtr rhs + ); + } +} \ No newline at end of file diff --git a/Function/BNMetadataIsKeyValueStore.cs b/Function/BNMetadataIsKeyValueStore.cs new file mode 100644 index 0000000..bb8a75c --- /dev/null +++ b/Function/BNMetadataIsKeyValueStore.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNMetadataIsKeyValueStore(BNMetadata* data) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNMetadataIsKeyValueStore" + )] + internal static extern bool BNMetadataIsKeyValueStore( + + // BNMetadata* data + IntPtr data + ); + } +} \ No newline at end of file diff --git a/Function/BNMetadataIsRaw.cs b/Function/BNMetadataIsRaw.cs new file mode 100644 index 0000000..9428f7b --- /dev/null +++ b/Function/BNMetadataIsRaw.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNMetadataIsRaw(BNMetadata* data) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNMetadataIsRaw" + )] + internal static extern bool BNMetadataIsRaw( + + // BNMetadata* data + IntPtr data + ); + } +} \ No newline at end of file diff --git a/Function/BNMetadataIsSignedInteger.cs b/Function/BNMetadataIsSignedInteger.cs new file mode 100644 index 0000000..568ab69 --- /dev/null +++ b/Function/BNMetadataIsSignedInteger.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNMetadataIsSignedInteger(BNMetadata* data) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNMetadataIsSignedInteger" + )] + internal static extern bool BNMetadataIsSignedInteger( + + // BNMetadata* data + IntPtr data + ); + } +} \ No newline at end of file diff --git a/Function/BNMetadataIsSignedIntegerList.cs b/Function/BNMetadataIsSignedIntegerList.cs new file mode 100644 index 0000000..24cb4da --- /dev/null +++ b/Function/BNMetadataIsSignedIntegerList.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNMetadataIsSignedIntegerList(BNMetadata* data) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNMetadataIsSignedIntegerList" + )] + internal static extern bool BNMetadataIsSignedIntegerList( + + // BNMetadata* data + IntPtr data + ); + } +} \ No newline at end of file diff --git a/Function/BNMetadataIsString.cs b/Function/BNMetadataIsString.cs new file mode 100644 index 0000000..3e2d81d --- /dev/null +++ b/Function/BNMetadataIsString.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNMetadataIsString(BNMetadata* data) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNMetadataIsString" + )] + internal static extern bool BNMetadataIsString( + + // BNMetadata* data + IntPtr data + ); + } +} \ No newline at end of file diff --git a/Function/BNMetadataIsStringList.cs b/Function/BNMetadataIsStringList.cs new file mode 100644 index 0000000..d4ef4af --- /dev/null +++ b/Function/BNMetadataIsStringList.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNMetadataIsStringList(BNMetadata* data) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNMetadataIsStringList" + )] + internal static extern bool BNMetadataIsStringList( + + // BNMetadata* data + IntPtr data + ); + } +} \ No newline at end of file diff --git a/Function/BNMetadataIsUnsignedInteger.cs b/Function/BNMetadataIsUnsignedInteger.cs new file mode 100644 index 0000000..d26e2a1 --- /dev/null +++ b/Function/BNMetadataIsUnsignedInteger.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNMetadataIsUnsignedInteger(BNMetadata* data) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNMetadataIsUnsignedInteger" + )] + internal static extern bool BNMetadataIsUnsignedInteger( + + // BNMetadata* data + IntPtr data + ); + } +} \ No newline at end of file diff --git a/Function/BNMetadataIsUnsignedIntegerList.cs b/Function/BNMetadataIsUnsignedIntegerList.cs new file mode 100644 index 0000000..a764020 --- /dev/null +++ b/Function/BNMetadataIsUnsignedIntegerList.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNMetadataIsUnsignedIntegerList(BNMetadata* data) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNMetadataIsUnsignedIntegerList" + )] + internal static extern bool BNMetadataIsUnsignedIntegerList( + + // BNMetadata* data + IntPtr data + ); + } +} \ No newline at end of file diff --git a/Function/BNMetadataRemoveIndex.cs b/Function/BNMetadataRemoveIndex.cs new file mode 100644 index 0000000..433708e --- /dev/null +++ b/Function/BNMetadataRemoveIndex.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNMetadataRemoveIndex(BNMetadata* data, uint64_t index) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNMetadataRemoveIndex" + )] + internal static extern void BNMetadataRemoveIndex( + + // BNMetadata* data + IntPtr data , + + // uint64_t index + ulong index + ); + } +} \ No newline at end of file diff --git a/Function/BNMetadataRemoveKey.cs b/Function/BNMetadataRemoveKey.cs new file mode 100644 index 0000000..78e05e9 --- /dev/null +++ b/Function/BNMetadataRemoveKey.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNMetadataRemoveKey(BNMetadata* data, const char* key) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNMetadataRemoveKey" + )] + internal static extern void BNMetadataRemoveKey( + + // BNMetadata* data + IntPtr data , + + // const char* key + string key + ); + } +} \ No newline at end of file diff --git a/Function/BNMetadataSetValueForKey.cs b/Function/BNMetadataSetValueForKey.cs new file mode 100644 index 0000000..94a5a57 --- /dev/null +++ b/Function/BNMetadataSetValueForKey.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNMetadataSetValueForKey(BNMetadata* data, const char* key, BNMetadata* md) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNMetadataSetValueForKey" + )] + internal static extern bool BNMetadataSetValueForKey( + + // BNMetadata* data + IntPtr data , + + // const char* key + string key , + + // BNMetadata* md + IntPtr md + + ); + } +} \ No newline at end of file diff --git a/Function/BNMetadataSize.cs b/Function/BNMetadataSize.cs new file mode 100644 index 0000000..250a788 --- /dev/null +++ b/Function/BNMetadataSize.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNMetadataSize(BNMetadata* data) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNMetadataSize" + )] + internal static extern ulong BNMetadataSize( + + // BNMetadata* data + IntPtr data + ); + } +} \ No newline at end of file diff --git a/Function/BNNavigate.cs b/Function/BNNavigate.cs new file mode 100644 index 0000000..b3e41d1 --- /dev/null +++ b/Function/BNNavigate.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNNavigate(BNFileMetadata* file, const char* view, uint64_t offset) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNavigate" + )] + internal static extern bool BNNavigate( + + // BNFileMetadata* file + IntPtr file , + + // const char* view + string view , + + // uint64_t offset + ulong offset + ); + } +} \ No newline at end of file diff --git a/Function/BNNewActivityReference.cs b/Function/BNNewActivityReference.cs new file mode 100644 index 0000000..63462a5 --- /dev/null +++ b/Function/BNNewActivityReference.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNActivity* BNNewActivityReference(BNActivity* activity) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNNewActivityReference" + )] + internal static extern IntPtr BNNewActivityReference( + + // BNActivity* activity + IntPtr activity + ); + } +} \ No newline at end of file diff --git a/Function/BNNewAnalysisCompletionEventReference.cs b/Function/BNNewAnalysisCompletionEventReference.cs new file mode 100644 index 0000000..1e231fe --- /dev/null +++ b/Function/BNNewAnalysisCompletionEventReference.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNAnalysisCompletionEvent* BNNewAnalysisCompletionEventReference(BNAnalysisCompletionEvent* @event) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNNewAnalysisCompletionEventReference" + )] + internal static extern IntPtr BNNewAnalysisCompletionEventReference( + + // BNAnalysisCompletionEvent* _event + IntPtr _event + ); + } +} \ No newline at end of file diff --git a/Function/BNNewAnalysisContextReference.cs b/Function/BNNewAnalysisContextReference.cs new file mode 100644 index 0000000..9ba16ea --- /dev/null +++ b/Function/BNNewAnalysisContextReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNAnalysisContext* BNNewAnalysisContextReference(BNAnalysisContext* analysisContext) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewAnalysisContextReference" + )] + internal static extern IntPtr BNNewAnalysisContextReference( + + // BNAnalysisContext* analysisContext + IntPtr analysisContext + + ); + } +} \ No newline at end of file diff --git a/Function/BNNewAnalysisMergeConflictReference.cs b/Function/BNNewAnalysisMergeConflictReference.cs new file mode 100644 index 0000000..cb16ba0 --- /dev/null +++ b/Function/BNNewAnalysisMergeConflictReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNAnalysisMergeConflict* BNNewAnalysisMergeConflictReference(BNAnalysisMergeConflict* conflict) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewAnalysisMergeConflictReference" + )] + internal static extern IntPtr BNNewAnalysisMergeConflictReference( + + // BNAnalysisMergeConflict* conflict + IntPtr conflict + + ); + } +} \ No newline at end of file diff --git a/Function/BNNewBackgroundTaskReference.cs b/Function/BNNewBackgroundTaskReference.cs new file mode 100644 index 0000000..15ecdd7 --- /dev/null +++ b/Function/BNNewBackgroundTaskReference.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBackgroundTask* BNNewBackgroundTaskReference(BNBackgroundTask* task) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNNewBackgroundTaskReference" + )] + internal static extern IntPtr BNNewBackgroundTaskReference( + + // BNBackgroundTask* task + IntPtr task + ); + } +} \ No newline at end of file diff --git a/Function/BNNewBasicBlockReference.cs b/Function/BNNewBasicBlockReference.cs new file mode 100644 index 0000000..d655901 --- /dev/null +++ b/Function/BNNewBasicBlockReference.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBasicBlock* BNNewBasicBlockReference(BNBasicBlock* block) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNNewBasicBlockReference" + )] + internal static extern IntPtr BNNewBasicBlockReference( + + // BNBasicBlock* block + IntPtr block + ); + } +} \ No newline at end of file diff --git a/Function/BNNewCallingConventionReference.cs b/Function/BNNewCallingConventionReference.cs new file mode 100644 index 0000000..609c6be --- /dev/null +++ b/Function/BNNewCallingConventionReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNCallingConvention* BNNewCallingConventionReference(BNCallingConvention* cc) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewCallingConventionReference" + )] + internal static extern IntPtr BNNewCallingConventionReference( + + // BNCallingConvention* cc + IntPtr cc + + ); + } +} \ No newline at end of file diff --git a/Function/BNNewCollaborationChangesetReference.cs b/Function/BNNewCollaborationChangesetReference.cs new file mode 100644 index 0000000..1b772b0 --- /dev/null +++ b/Function/BNNewCollaborationChangesetReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNCollaborationChangeset* BNNewCollaborationChangesetReference(BNCollaborationChangeset* changeset) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewCollaborationChangesetReference" + )] + internal static extern IntPtr BNNewCollaborationChangesetReference( + + // BNCollaborationChangeset* changeset + IntPtr changeset + + ); + } +} \ No newline at end of file diff --git a/Function/BNNewCollaborationGroupReference.cs b/Function/BNNewCollaborationGroupReference.cs new file mode 100644 index 0000000..eb63b1b --- /dev/null +++ b/Function/BNNewCollaborationGroupReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNCollaborationGroup* BNNewCollaborationGroupReference(BNCollaborationGroup* group) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewCollaborationGroupReference" + )] + internal static extern IntPtr BNNewCollaborationGroupReference( + + // BNCollaborationGroup* _group + IntPtr _group + + ); + } +} \ No newline at end of file diff --git a/Function/BNNewCollaborationPermissionReference.cs b/Function/BNNewCollaborationPermissionReference.cs new file mode 100644 index 0000000..1b934f5 --- /dev/null +++ b/Function/BNNewCollaborationPermissionReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNCollaborationPermission* BNNewCollaborationPermissionReference(BNCollaborationPermission* permission) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewCollaborationPermissionReference" + )] + internal static extern IntPtr BNNewCollaborationPermissionReference( + + // BNCollaborationPermission* permission + IntPtr permission + + ); + } +} \ No newline at end of file diff --git a/Function/BNNewCollaborationSnapshotReference.cs b/Function/BNNewCollaborationSnapshotReference.cs new file mode 100644 index 0000000..be77976 --- /dev/null +++ b/Function/BNNewCollaborationSnapshotReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNCollaborationSnapshot* BNNewCollaborationSnapshotReference(BNCollaborationSnapshot* snapshot) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewCollaborationSnapshotReference" + )] + internal static extern IntPtr BNNewCollaborationSnapshotReference( + + // BNCollaborationSnapshot* snapshot + IntPtr snapshot + + ); + } +} \ No newline at end of file diff --git a/Function/BNNewCollaborationUndoEntryReference.cs b/Function/BNNewCollaborationUndoEntryReference.cs new file mode 100644 index 0000000..5756d67 --- /dev/null +++ b/Function/BNNewCollaborationUndoEntryReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNCollaborationUndoEntry* BNNewCollaborationUndoEntryReference(BNCollaborationUndoEntry* entry) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewCollaborationUndoEntryReference" + )] + internal static extern IntPtr BNNewCollaborationUndoEntryReference( + + // BNCollaborationUndoEntry* entry + IntPtr entry + + ); + } +} \ No newline at end of file diff --git a/Function/BNNewCollaborationUserReference.cs b/Function/BNNewCollaborationUserReference.cs new file mode 100644 index 0000000..a496591 --- /dev/null +++ b/Function/BNNewCollaborationUserReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNCollaborationUser* BNNewCollaborationUserReference(BNCollaborationUser* user) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewCollaborationUserReference" + )] + internal static extern IntPtr BNNewCollaborationUserReference( + + // BNCollaborationUser* user + IntPtr user + + ); + } +} \ No newline at end of file diff --git a/Function/BNNewComponentReference.cs b/Function/BNNewComponentReference.cs new file mode 100644 index 0000000..fd25276 --- /dev/null +++ b/Function/BNNewComponentReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNComponent* BNNewComponentReference(BNComponent* component) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewComponentReference" + )] + internal static extern IntPtr BNNewComponentReference( + + // BNComponent* component + IntPtr component + + ); + } +} \ No newline at end of file diff --git a/Function/BNNewDataRendererReference.cs b/Function/BNNewDataRendererReference.cs new file mode 100644 index 0000000..0d4eea3 --- /dev/null +++ b/Function/BNNewDataRendererReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDataRenderer* BNNewDataRendererReference(BNDataRenderer* renderer) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewDataRendererReference" + )] + internal static extern IntPtr BNNewDataRendererReference( + + // BNDataRenderer* renderer + IntPtr renderer + + ); + } +} \ No newline at end of file diff --git a/Function/BNNewDatabaseReference.cs b/Function/BNNewDatabaseReference.cs new file mode 100644 index 0000000..d68b5f0 --- /dev/null +++ b/Function/BNNewDatabaseReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDatabase* BNNewDatabaseReference(BNDatabase* database) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewDatabaseReference" + )] + internal static extern IntPtr BNNewDatabaseReference( + + // BNDatabase* database + IntPtr database + + ); + } +} \ No newline at end of file diff --git a/Function/BNNewDebugInfoParserReference.cs b/Function/BNNewDebugInfoParserReference.cs new file mode 100644 index 0000000..68449db --- /dev/null +++ b/Function/BNNewDebugInfoParserReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDebugInfoParser* BNNewDebugInfoParserReference(BNDebugInfoParser* parser) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewDebugInfoParserReference" + )] + internal static extern IntPtr BNNewDebugInfoParserReference( + + // BNDebugInfoParser* parser + IntPtr parser + + ); + } +} \ No newline at end of file diff --git a/Function/BNNewDebugInfoReference.cs b/Function/BNNewDebugInfoReference.cs new file mode 100644 index 0000000..744b8ed --- /dev/null +++ b/Function/BNNewDebugInfoReference.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDebugInfo* BNNewDebugInfoReference(BNDebugInfo* debugInfo) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNNewDebugInfoReference" + )] + internal static extern IntPtr BNNewDebugInfoReference( + + // BNDebugInfo* debugInfo + IntPtr debugInfo + ); + } +} \ No newline at end of file diff --git a/Function/BNNewDisassemblySettingsReference.cs b/Function/BNNewDisassemblySettingsReference.cs new file mode 100644 index 0000000..6e28630 --- /dev/null +++ b/Function/BNNewDisassemblySettingsReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDisassemblySettings* BNNewDisassemblySettingsReference(BNDisassemblySettings* settings) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewDisassemblySettingsReference" + )] + internal static extern IntPtr BNNewDisassemblySettingsReference( + + // BNDisassemblySettings* settings + IntPtr settings + + ); + } +} \ No newline at end of file diff --git a/Function/BNNewDisassemblyTextRendererReference.cs b/Function/BNNewDisassemblyTextRendererReference.cs new file mode 100644 index 0000000..3dee198 --- /dev/null +++ b/Function/BNNewDisassemblyTextRendererReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDisassemblyTextRenderer* BNNewDisassemblyTextRendererReference(BNDisassemblyTextRenderer* renderer) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewDisassemblyTextRendererReference" + )] + internal static extern IntPtr BNNewDisassemblyTextRendererReference( + + // BNDisassemblyTextRenderer* renderer + IntPtr renderer + + ); + } +} \ No newline at end of file diff --git a/Function/BNNewDownloadInstanceReference.cs b/Function/BNNewDownloadInstanceReference.cs new file mode 100644 index 0000000..44200fe --- /dev/null +++ b/Function/BNNewDownloadInstanceReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDownloadInstance* BNNewDownloadInstanceReference(BNDownloadInstance* instance) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewDownloadInstanceReference" + )] + internal static extern IntPtr BNNewDownloadInstanceReference( + + // BNDownloadInstance* instance + IntPtr instance + + ); + } +} \ No newline at end of file diff --git a/Function/BNNewEnumerationReference.cs b/Function/BNNewEnumerationReference.cs new file mode 100644 index 0000000..fa4a9ce --- /dev/null +++ b/Function/BNNewEnumerationReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNEnumeration* BNNewEnumerationReference(BNEnumeration* e) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewEnumerationReference" + )] + internal static extern IntPtr BNNewEnumerationReference( + + // BNEnumeration* e + IntPtr e + + ); + } +} \ No newline at end of file diff --git a/Function/BNNewExternalLibraryReference.cs b/Function/BNNewExternalLibraryReference.cs new file mode 100644 index 0000000..488e61d --- /dev/null +++ b/Function/BNNewExternalLibraryReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNExternalLibrary* BNNewExternalLibraryReference(BNExternalLibrary* lib) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewExternalLibraryReference" + )] + internal static extern IntPtr BNNewExternalLibraryReference( + + // BNExternalLibrary* lib + IntPtr lib + + ); + } +} \ No newline at end of file diff --git a/Function/BNNewExternalLocationReference.cs b/Function/BNNewExternalLocationReference.cs new file mode 100644 index 0000000..e53e59b --- /dev/null +++ b/Function/BNNewExternalLocationReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNExternalLocation* BNNewExternalLocationReference(BNExternalLocation* loc) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewExternalLocationReference" + )] + internal static extern IntPtr BNNewExternalLocationReference( + + // BNExternalLocation* loc + IntPtr loc + + ); + } +} \ No newline at end of file diff --git a/Function/BNNewFieldResolutionInfoReference.cs b/Function/BNNewFieldResolutionInfoReference.cs new file mode 100644 index 0000000..a3e987c --- /dev/null +++ b/Function/BNNewFieldResolutionInfoReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFieldResolutionInfo* BNNewFieldResolutionInfoReference(BNFieldResolutionInfo* info) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewFieldResolutionInfoReference" + )] + internal static extern IntPtr BNNewFieldResolutionInfoReference( + + // BNFieldResolutionInfo* info + IntPtr info + + ); + } +} \ No newline at end of file diff --git a/Function/BNNewFileReference.cs b/Function/BNNewFileReference.cs new file mode 100644 index 0000000..76d852f --- /dev/null +++ b/Function/BNNewFileReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFileMetadata* BNNewFileReference(BNFileMetadata* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewFileReference" + )] + internal static extern IntPtr BNNewFileReference( + + // BNFileMetadata* file + IntPtr file + + ); + } +} \ No newline at end of file diff --git a/Function/BNNewFirmwareNinjaReferenceNodeReference.cs b/Function/BNNewFirmwareNinjaReferenceNodeReference.cs new file mode 100644 index 0000000..971e4c5 --- /dev/null +++ b/Function/BNNewFirmwareNinjaReferenceNodeReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFirmwareNinjaReferenceNode* BNNewFirmwareNinjaReferenceNodeReference(BNFirmwareNinjaReferenceNode* node) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewFirmwareNinjaReferenceNodeReference" + )] + internal static extern IntPtr BNNewFirmwareNinjaReferenceNodeReference( + + // BNFirmwareNinjaReferenceNode* node + IntPtr node + + ); + } +} \ No newline at end of file diff --git a/Function/BNNewFirmwareNinjaRelationshipReference.cs b/Function/BNNewFirmwareNinjaRelationshipReference.cs new file mode 100644 index 0000000..732bded --- /dev/null +++ b/Function/BNNewFirmwareNinjaRelationshipReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFirmwareNinjaRelationship* BNNewFirmwareNinjaRelationshipReference(BNFirmwareNinjaRelationship* rel) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewFirmwareNinjaRelationshipReference" + )] + internal static extern IntPtr BNNewFirmwareNinjaRelationshipReference( + + // BNFirmwareNinjaRelationship* rel + IntPtr rel + + ); + } +} \ No newline at end of file diff --git a/Function/BNNewFlowGraphLayoutRequestReference.cs b/Function/BNNewFlowGraphLayoutRequestReference.cs new file mode 100644 index 0000000..6d28f6b --- /dev/null +++ b/Function/BNNewFlowGraphLayoutRequestReference.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFlowGraphLayoutRequest* BNNewFlowGraphLayoutRequestReference(BNFlowGraphLayoutRequest* layout) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNNewFlowGraphLayoutRequestReference" + )] + internal static extern IntPtr BNNewFlowGraphLayoutRequestReference( + + // BNFlowGraphLayoutRequest* layout + IntPtr layout + ); + } +} \ No newline at end of file diff --git a/Function/BNNewFlowGraphNodeReference.cs b/Function/BNNewFlowGraphNodeReference.cs new file mode 100644 index 0000000..c1f9575 --- /dev/null +++ b/Function/BNNewFlowGraphNodeReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFlowGraphNode* BNNewFlowGraphNodeReference(BNFlowGraphNode* node) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewFlowGraphNodeReference" + )] + internal static extern IntPtr BNNewFlowGraphNodeReference( + + // BNFlowGraphNode* node + IntPtr node + + ); + } +} \ No newline at end of file diff --git a/Function/BNNewFlowGraphReference.cs b/Function/BNNewFlowGraphReference.cs new file mode 100644 index 0000000..640db29 --- /dev/null +++ b/Function/BNNewFlowGraphReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFlowGraph* BNNewFlowGraphReference(BNFlowGraph* graph) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewFlowGraphReference" + )] + internal static extern IntPtr BNNewFlowGraphReference( + + // BNFlowGraph* graph + IntPtr graph + + ); + } +} \ No newline at end of file diff --git a/Function/BNNewFunctionReference.cs b/Function/BNNewFunctionReference.cs new file mode 100644 index 0000000..1d81db2 --- /dev/null +++ b/Function/BNNewFunctionReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFunction* BNNewFunctionReference(BNFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewFunctionReference" + )] + internal static extern IntPtr BNNewFunctionReference( + + // BNFunction* func + IntPtr func + + ); + } +} \ No newline at end of file diff --git a/Function/BNNewHighLevelILFunctionReference.cs b/Function/BNNewHighLevelILFunctionReference.cs new file mode 100644 index 0000000..85e93eb --- /dev/null +++ b/Function/BNNewHighLevelILFunctionReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNHighLevelILFunction* BNNewHighLevelILFunctionReference(BNHighLevelILFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewHighLevelILFunctionReference" + )] + internal static extern IntPtr BNNewHighLevelILFunctionReference( + + // BNHighLevelILFunction* func + IntPtr func + + ); + } +} \ No newline at end of file diff --git a/Function/BNNewHighLevelILTokenEmitterReference.cs b/Function/BNNewHighLevelILTokenEmitterReference.cs new file mode 100644 index 0000000..3604e57 --- /dev/null +++ b/Function/BNNewHighLevelILTokenEmitterReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNHighLevelILTokenEmitter* BNNewHighLevelILTokenEmitterReference(BNHighLevelILTokenEmitter* emitter) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewHighLevelILTokenEmitterReference" + )] + internal static extern IntPtr BNNewHighLevelILTokenEmitterReference( + + // BNHighLevelILTokenEmitter* emitter + IntPtr emitter + + ); + } +} \ No newline at end of file diff --git a/Function/BNNewKeyValueStoreReference.cs b/Function/BNNewKeyValueStoreReference.cs new file mode 100644 index 0000000..fff2e8a --- /dev/null +++ b/Function/BNNewKeyValueStoreReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNKeyValueStore* BNNewKeyValueStoreReference(BNKeyValueStore* store) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewKeyValueStoreReference" + )] + internal static extern IntPtr BNNewKeyValueStoreReference( + + // BNKeyValueStore* store + IntPtr store + + ); + } +} \ No newline at end of file diff --git a/Function/BNNewLanguageRepresentationFunctionReference.cs b/Function/BNNewLanguageRepresentationFunctionReference.cs new file mode 100644 index 0000000..b6d2d23 --- /dev/null +++ b/Function/BNNewLanguageRepresentationFunctionReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLanguageRepresentationFunction* BNNewLanguageRepresentationFunctionReference(BNLanguageRepresentationFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewLanguageRepresentationFunctionReference" + )] + internal static extern IntPtr BNNewLanguageRepresentationFunctionReference( + + // BNLanguageRepresentationFunction* func + IntPtr func + + ); + } +} \ No newline at end of file diff --git a/Function/BNNewLinearViewCursorReference.cs b/Function/BNNewLinearViewCursorReference.cs new file mode 100644 index 0000000..7c395b9 --- /dev/null +++ b/Function/BNNewLinearViewCursorReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLinearViewCursor* BNNewLinearViewCursorReference(BNLinearViewCursor* cursor) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewLinearViewCursorReference" + )] + internal static extern IntPtr BNNewLinearViewCursorReference( + + // BNLinearViewCursor* cursor + IntPtr cursor + + ); + } +} \ No newline at end of file diff --git a/Function/BNNewLinearViewObjectReference.cs b/Function/BNNewLinearViewObjectReference.cs new file mode 100644 index 0000000..eb643f3 --- /dev/null +++ b/Function/BNNewLinearViewObjectReference.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLinearViewObject* BNNewLinearViewObjectReference(BNLinearViewObject* obj) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNNewLinearViewObjectReference" + )] + internal static extern IntPtr BNNewLinearViewObjectReference( + + // BNLinearViewObject* obj + IntPtr obj + ); + } +} \ No newline at end of file diff --git a/Function/BNNewLoggerReference.cs b/Function/BNNewLoggerReference.cs new file mode 100644 index 0000000..3691f2a --- /dev/null +++ b/Function/BNNewLoggerReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLogger* BNNewLoggerReference(BNLogger* logger) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewLoggerReference" + )] + internal static extern IntPtr BNNewLoggerReference( + + // BNLogger* logger + IntPtr logger + + ); + } +} \ No newline at end of file diff --git a/Function/BNNewLowLevelILFunctionReference.cs b/Function/BNNewLowLevelILFunctionReference.cs new file mode 100644 index 0000000..500c83d --- /dev/null +++ b/Function/BNNewLowLevelILFunctionReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLowLevelILFunction* BNNewLowLevelILFunctionReference(BNLowLevelILFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewLowLevelILFunctionReference" + )] + internal static extern IntPtr BNNewLowLevelILFunctionReference( + + // BNLowLevelILFunction* func + IntPtr func + + ); + } +} \ No newline at end of file diff --git a/Function/BNNewMainThreadActionReference.cs b/Function/BNNewMainThreadActionReference.cs new file mode 100644 index 0000000..ac896c7 --- /dev/null +++ b/Function/BNNewMainThreadActionReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNMainThreadAction* BNNewMainThreadActionReference(BNMainThreadAction* action) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewMainThreadActionReference" + )] + internal static extern IntPtr BNNewMainThreadActionReference( + + // BNMainThreadAction* action + IntPtr action + + ); + } +} \ No newline at end of file diff --git a/Function/BNNewMediumLevelILFunctionReference.cs b/Function/BNNewMediumLevelILFunctionReference.cs new file mode 100644 index 0000000..a6c761a --- /dev/null +++ b/Function/BNNewMediumLevelILFunctionReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNMediumLevelILFunction* BNNewMediumLevelILFunctionReference(BNMediumLevelILFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewMediumLevelILFunctionReference" + )] + internal static extern IntPtr BNNewMediumLevelILFunctionReference( + + // BNMediumLevelILFunction* func + IntPtr func + + ); + } +} \ No newline at end of file diff --git a/Function/BNNewMetadataReference.cs b/Function/BNNewMetadataReference.cs new file mode 100644 index 0000000..5e41548 --- /dev/null +++ b/Function/BNNewMetadataReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNMetadata* BNNewMetadataReference(BNMetadata* data) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewMetadataReference" + )] + internal static extern IntPtr BNNewMetadataReference( + + // BNMetadata* data + IntPtr data + + ); + } +} \ No newline at end of file diff --git a/Function/BNNewNamedTypeReference.cs b/Function/BNNewNamedTypeReference.cs new file mode 100644 index 0000000..9b6f0c5 --- /dev/null +++ b/Function/BNNewNamedTypeReference.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNNamedTypeReference* BNNewNamedTypeReference(BNNamedTypeReference* nt) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNNewNamedTypeReference" + )] + internal static extern IntPtr BNNewNamedTypeReference( + + // BNNamedTypeReference* nt + IntPtr nt + ); + } +} \ No newline at end of file diff --git a/Function/BNNewPlatformReference.cs b/Function/BNNewPlatformReference.cs new file mode 100644 index 0000000..ce74315 --- /dev/null +++ b/Function/BNNewPlatformReference.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNPlatform* BNNewPlatformReference(BNPlatform* platform) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNNewPlatformReference" + )] + internal static extern IntPtr BNNewPlatformReference( + + // BNPlatform* platform + IntPtr platform + ); + } +} \ No newline at end of file diff --git a/Function/BNNewPluginReference.cs b/Function/BNNewPluginReference.cs new file mode 100644 index 0000000..e31bc81 --- /dev/null +++ b/Function/BNNewPluginReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRepoPlugin* BNNewPluginReference(BNRepoPlugin* r) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewPluginReference" + )] + internal static extern IntPtr BNNewPluginReference( + + // BNRepoPlugin* r + IntPtr r + + ); + } +} \ No newline at end of file diff --git a/Function/BNNewProjectFileReference.cs b/Function/BNNewProjectFileReference.cs new file mode 100644 index 0000000..a6e7fd3 --- /dev/null +++ b/Function/BNNewProjectFileReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNProjectFile* BNNewProjectFileReference(BNProjectFile* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewProjectFileReference" + )] + internal static extern IntPtr BNNewProjectFileReference( + + // BNProjectFile* file + IntPtr file + + ); + } +} \ No newline at end of file diff --git a/Function/BNNewProjectFolderReference.cs b/Function/BNNewProjectFolderReference.cs new file mode 100644 index 0000000..b4f7a6f --- /dev/null +++ b/Function/BNNewProjectFolderReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNProjectFolder* BNNewProjectFolderReference(BNProjectFolder* folder) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewProjectFolderReference" + )] + internal static extern IntPtr BNNewProjectFolderReference( + + // BNProjectFolder* folder + IntPtr folder + + ); + } +} \ No newline at end of file diff --git a/Function/BNNewProjectReference.cs b/Function/BNNewProjectReference.cs new file mode 100644 index 0000000..9287486 --- /dev/null +++ b/Function/BNNewProjectReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNProject* BNNewProjectReference(BNProject* project) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewProjectReference" + )] + internal static extern IntPtr BNNewProjectReference( + + // BNProject* project + IntPtr project + + ); + } +} \ No newline at end of file diff --git a/Function/BNNewRelocationHandlerReference.cs b/Function/BNNewRelocationHandlerReference.cs new file mode 100644 index 0000000..acffe1b --- /dev/null +++ b/Function/BNNewRelocationHandlerReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRelocationHandler* BNNewRelocationHandlerReference(BNRelocationHandler* handler) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewRelocationHandlerReference" + )] + internal static extern IntPtr BNNewRelocationHandlerReference( + + // BNRelocationHandler* handler + IntPtr handler + + ); + } +} \ No newline at end of file diff --git a/Function/BNNewRelocationReference.cs b/Function/BNNewRelocationReference.cs new file mode 100644 index 0000000..96a831d --- /dev/null +++ b/Function/BNNewRelocationReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRelocation* BNNewRelocationReference(BNRelocation* reloc) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewRelocationReference" + )] + internal static extern IntPtr BNNewRelocationReference( + + // BNRelocation* reloc + IntPtr reloc + + ); + } +} \ No newline at end of file diff --git a/Function/BNNewRemoteFileReference.cs b/Function/BNNewRemoteFileReference.cs new file mode 100644 index 0000000..516d862 --- /dev/null +++ b/Function/BNNewRemoteFileReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRemoteFile* BNNewRemoteFileReference(BNRemoteFile* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewRemoteFileReference" + )] + internal static extern IntPtr BNNewRemoteFileReference( + + // BNRemoteFile* file + IntPtr file + + ); + } +} \ No newline at end of file diff --git a/Function/BNNewRemoteFolderReference.cs b/Function/BNNewRemoteFolderReference.cs new file mode 100644 index 0000000..5d15416 --- /dev/null +++ b/Function/BNNewRemoteFolderReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRemoteFolder* BNNewRemoteFolderReference(BNRemoteFolder* folder) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewRemoteFolderReference" + )] + internal static extern IntPtr BNNewRemoteFolderReference( + + // BNRemoteFolder* folder + IntPtr folder + + ); + } +} \ No newline at end of file diff --git a/Function/BNNewRemoteProjectReference.cs b/Function/BNNewRemoteProjectReference.cs new file mode 100644 index 0000000..bd7a5b4 --- /dev/null +++ b/Function/BNNewRemoteProjectReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRemoteProject* BNNewRemoteProjectReference(BNRemoteProject* project) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewRemoteProjectReference" + )] + internal static extern IntPtr BNNewRemoteProjectReference( + + // BNRemoteProject* project + IntPtr project + + ); + } +} \ No newline at end of file diff --git a/Function/BNNewRemoteReference.cs b/Function/BNNewRemoteReference.cs new file mode 100644 index 0000000..979c9e2 --- /dev/null +++ b/Function/BNNewRemoteReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRemote* BNNewRemoteReference(BNRemote* remote) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewRemoteReference" + )] + internal static extern IntPtr BNNewRemoteReference( + + // BNRemote* remote + IntPtr remote + + ); + } +} \ No newline at end of file diff --git a/Function/BNNewReportCollectionReference.cs b/Function/BNNewReportCollectionReference.cs new file mode 100644 index 0000000..637e525 --- /dev/null +++ b/Function/BNNewReportCollectionReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNReportCollection* BNNewReportCollectionReference(BNReportCollection* reports) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewReportCollectionReference" + )] + internal static extern IntPtr BNNewReportCollectionReference( + + // BNReportCollection* reports + IntPtr reports + + ); + } +} \ No newline at end of file diff --git a/Function/BNNewRepositoryManagerReference.cs b/Function/BNNewRepositoryManagerReference.cs new file mode 100644 index 0000000..1091a9b --- /dev/null +++ b/Function/BNNewRepositoryManagerReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRepositoryManager* BNNewRepositoryManagerReference(BNRepositoryManager* r) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewRepositoryManagerReference" + )] + internal static extern IntPtr BNNewRepositoryManagerReference( + + // BNRepositoryManager* r + IntPtr r + + ); + } +} \ No newline at end of file diff --git a/Function/BNNewRepositoryReference.cs b/Function/BNNewRepositoryReference.cs new file mode 100644 index 0000000..66cecbd --- /dev/null +++ b/Function/BNNewRepositoryReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRepository* BNNewRepositoryReference(BNRepository* r) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewRepositoryReference" + )] + internal static extern IntPtr BNNewRepositoryReference( + + // BNRepository* r + IntPtr r + + ); + } +} \ No newline at end of file diff --git a/Function/BNNewSaveSettingsReference.cs b/Function/BNNewSaveSettingsReference.cs new file mode 100644 index 0000000..25071f7 --- /dev/null +++ b/Function/BNNewSaveSettingsReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNSaveSettings* BNNewSaveSettingsReference(BNSaveSettings* settings) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewSaveSettingsReference" + )] + internal static extern IntPtr BNNewSaveSettingsReference( + + // BNSaveSettings* settings + IntPtr settings + + ); + } +} \ No newline at end of file diff --git a/Function/BNNewScriptingInstanceReference.cs b/Function/BNNewScriptingInstanceReference.cs new file mode 100644 index 0000000..6745465 --- /dev/null +++ b/Function/BNNewScriptingInstanceReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNScriptingInstance* BNNewScriptingInstanceReference(BNScriptingInstance* instance) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewScriptingInstanceReference" + )] + internal static extern IntPtr BNNewScriptingInstanceReference( + + // BNScriptingInstance* instance + IntPtr instance + + ); + } +} \ No newline at end of file diff --git a/Function/BNNewSectionReference.cs b/Function/BNNewSectionReference.cs new file mode 100644 index 0000000..5654504 --- /dev/null +++ b/Function/BNNewSectionReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNSection* BNNewSectionReference(BNSection* section) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewSectionReference" + )] + internal static extern IntPtr BNNewSectionReference( + + // BNSection* section + IntPtr section + + ); + } +} \ No newline at end of file diff --git a/Function/BNNewSegmentReference.cs b/Function/BNNewSegmentReference.cs new file mode 100644 index 0000000..746be2e --- /dev/null +++ b/Function/BNNewSegmentReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNSegment* BNNewSegmentReference(BNSegment* seg) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewSegmentReference" + )] + internal static extern IntPtr BNNewSegmentReference( + + // BNSegment* seg + IntPtr seg + + ); + } +} \ No newline at end of file diff --git a/Function/BNNewSettingsReference.cs b/Function/BNNewSettingsReference.cs new file mode 100644 index 0000000..d788d3e --- /dev/null +++ b/Function/BNNewSettingsReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNSettings* BNNewSettingsReference(BNSettings* settings) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewSettingsReference" + )] + internal static extern IntPtr BNNewSettingsReference( + + // BNSettings* settings + IntPtr settings + + ); + } +} \ No newline at end of file diff --git a/Function/BNNewSnapshotReference.cs b/Function/BNNewSnapshotReference.cs new file mode 100644 index 0000000..027fe04 --- /dev/null +++ b/Function/BNNewSnapshotReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNSnapshot* BNNewSnapshotReference(BNSnapshot* snapshot) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewSnapshotReference" + )] + internal static extern IntPtr BNNewSnapshotReference( + + // BNSnapshot* snapshot + IntPtr snapshot + + ); + } +} \ No newline at end of file diff --git a/Function/BNNewStructureReference.cs b/Function/BNNewStructureReference.cs new file mode 100644 index 0000000..99ab435 --- /dev/null +++ b/Function/BNNewStructureReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNStructure* BNNewStructureReference(BNStructure* s) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewStructureReference" + )] + internal static extern IntPtr BNNewStructureReference( + + // BNStructure* s + IntPtr s + + ); + } +} \ No newline at end of file diff --git a/Function/BNNewSymbolReference.cs b/Function/BNNewSymbolReference.cs new file mode 100644 index 0000000..179931e --- /dev/null +++ b/Function/BNNewSymbolReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNSymbol* BNNewSymbolReference(BNSymbol* sym) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewSymbolReference" + )] + internal static extern IntPtr BNNewSymbolReference( + + // BNSymbol* sym + IntPtr sym + + ); + } +} \ No newline at end of file diff --git a/Function/BNNewTagReference.cs b/Function/BNNewTagReference.cs new file mode 100644 index 0000000..0ac5dfe --- /dev/null +++ b/Function/BNNewTagReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTag* BNNewTagReference(BNTag* tag) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewTagReference" + )] + internal static extern IntPtr BNNewTagReference( + + // BNTag* tag + IntPtr tag + + ); + } +} \ No newline at end of file diff --git a/Function/BNNewTagTypeReference.cs b/Function/BNNewTagTypeReference.cs new file mode 100644 index 0000000..0561b98 --- /dev/null +++ b/Function/BNNewTagTypeReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTagType* BNNewTagTypeReference(BNTagType* tagType) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewTagTypeReference" + )] + internal static extern IntPtr BNNewTagTypeReference( + + // BNTagType* tagType + IntPtr tagType + + ); + } +} \ No newline at end of file diff --git a/Function/BNNewTemporaryFileReference.cs b/Function/BNNewTemporaryFileReference.cs new file mode 100644 index 0000000..887a995 --- /dev/null +++ b/Function/BNNewTemporaryFileReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTemporaryFile* BNNewTemporaryFileReference(BNTemporaryFile* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewTemporaryFileReference" + )] + internal static extern IntPtr BNNewTemporaryFileReference( + + // BNTemporaryFile* file + IntPtr file + + ); + } +} \ No newline at end of file diff --git a/Function/BNNewTransformContextReference.cs b/Function/BNNewTransformContextReference.cs new file mode 100644 index 0000000..09b5fd1 --- /dev/null +++ b/Function/BNNewTransformContextReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTransformContext* BNNewTransformContextReference(BNTransformContext* context) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewTransformContextReference" + )] + internal static extern IntPtr BNNewTransformContextReference( + + // BNTransformContext* context + IntPtr context + + ); + } +} \ No newline at end of file diff --git a/Function/BNNewTransformSessionReference.cs b/Function/BNNewTransformSessionReference.cs new file mode 100644 index 0000000..0ce9013 --- /dev/null +++ b/Function/BNNewTransformSessionReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTransformSession* BNNewTransformSessionReference(BNTransformSession* session) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewTransformSessionReference" + )] + internal static extern IntPtr BNNewTransformSessionReference( + + // BNTransformSession* session + IntPtr session + + ); + } +} \ No newline at end of file diff --git a/Function/BNNewTypeArchiveMergeConflictReference.cs b/Function/BNNewTypeArchiveMergeConflictReference.cs new file mode 100644 index 0000000..a16c776 --- /dev/null +++ b/Function/BNNewTypeArchiveMergeConflictReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeArchiveMergeConflict* BNNewTypeArchiveMergeConflictReference(BNTypeArchiveMergeConflict* conflict) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewTypeArchiveMergeConflictReference" + )] + internal static extern IntPtr BNNewTypeArchiveMergeConflictReference( + + // BNTypeArchiveMergeConflict* conflict + IntPtr conflict + + ); + } +} \ No newline at end of file diff --git a/Function/BNNewTypeArchiveReference.cs b/Function/BNNewTypeArchiveReference.cs new file mode 100644 index 0000000..251989c --- /dev/null +++ b/Function/BNNewTypeArchiveReference.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeArchive* BNNewTypeArchiveReference(BNTypeArchive* archive) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewTypeArchiveReference" + )] + internal static extern IntPtr BNNewTypeArchiveReference( + + // BNTypeArchive* archive + IntPtr archive + ); + } +} \ No newline at end of file diff --git a/Function/BNNewTypeLibrary.cs b/Function/BNNewTypeLibrary.cs new file mode 100644 index 0000000..af12143 --- /dev/null +++ b/Function/BNNewTypeLibrary.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeLibrary* BNNewTypeLibrary(BNArchitecture* arch, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewTypeLibrary" + )] + internal static extern IntPtr BNNewTypeLibrary( + + // BNArchitecture* arch + IntPtr arch , + + // const char* name + string name + ); + } +} \ No newline at end of file diff --git a/Function/BNNewTypeLibraryReference.cs b/Function/BNNewTypeLibraryReference.cs new file mode 100644 index 0000000..8326881 --- /dev/null +++ b/Function/BNNewTypeLibraryReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeLibrary* BNNewTypeLibraryReference(BNTypeLibrary* lib) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewTypeLibraryReference" + )] + internal static extern IntPtr BNNewTypeLibraryReference( + + // BNTypeLibrary* lib + IntPtr lib + + ); + } +} \ No newline at end of file diff --git a/Function/BNNewTypeReference.cs b/Function/BNNewTypeReference.cs new file mode 100644 index 0000000..b5d3951 --- /dev/null +++ b/Function/BNNewTypeReference.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNType* BNNewTypeReference(BNType* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNNewTypeReference" + )] + internal static extern IntPtr BNNewTypeReference( + + // BNType* type + IntPtr type + ); + } +} \ No newline at end of file diff --git a/Function/BNNewUndoActionReference.cs b/Function/BNNewUndoActionReference.cs new file mode 100644 index 0000000..5f57dfc --- /dev/null +++ b/Function/BNNewUndoActionReference.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNUndoAction* BNNewUndoActionReference(BNUndoAction* action) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNNewUndoActionReference" + )] + internal static extern IntPtr BNNewUndoActionReference( + + // BNUndoAction* action + IntPtr action + ); + } +} \ No newline at end of file diff --git a/Function/BNNewUndoEntryReference.cs b/Function/BNNewUndoEntryReference.cs new file mode 100644 index 0000000..53b817d --- /dev/null +++ b/Function/BNNewUndoEntryReference.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNUndoEntry* BNNewUndoEntryReference(BNUndoEntry* entry) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNNewUndoEntryReference" + )] + internal static extern IntPtr BNNewUndoEntryReference( + + // BNUndoEntry* entry + IntPtr entry + ); + } +} \ No newline at end of file diff --git a/Function/BNNewUserReference.cs b/Function/BNNewUserReference.cs new file mode 100644 index 0000000..b4b431d --- /dev/null +++ b/Function/BNNewUserReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNUser* BNNewUserReference(BNUser* user) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewUserReference" + )] + internal static extern IntPtr BNNewUserReference( + + // BNUser* user + IntPtr user + + ); + } +} \ No newline at end of file diff --git a/Function/BNNewViewReference.cs b/Function/BNNewViewReference.cs new file mode 100644 index 0000000..20048f5 --- /dev/null +++ b/Function/BNNewViewReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBinaryView* BNNewViewReference(BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewViewReference" + )] + internal static extern IntPtr BNNewViewReference( + + // BNBinaryView* view + IntPtr view + + ); + } +} \ No newline at end of file diff --git a/Function/BNNewWebsocketClientReference.cs b/Function/BNNewWebsocketClientReference.cs new file mode 100644 index 0000000..2e1bde5 --- /dev/null +++ b/Function/BNNewWebsocketClientReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNWebsocketClient* BNNewWebsocketClientReference(BNWebsocketClient* client) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewWebsocketClientReference" + )] + internal static extern IntPtr BNNewWebsocketClientReference( + + // BNWebsocketClient* client + IntPtr client + + ); + } +} \ No newline at end of file diff --git a/Function/BNNewWorkflowReference.cs b/Function/BNNewWorkflowReference.cs new file mode 100644 index 0000000..0709585 --- /dev/null +++ b/Function/BNNewWorkflowReference.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNWorkflow* BNNewWorkflowReference(BNWorkflow* workflow) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNewWorkflowReference" + )] + internal static extern IntPtr BNNewWorkflowReference( + + // BNWorkflow* workflow + IntPtr workflow + + ); + } +} \ No newline at end of file diff --git a/Function/BNNotifyDataInserted.cs b/Function/BNNotifyDataInserted.cs new file mode 100644 index 0000000..dbfa706 --- /dev/null +++ b/Function/BNNotifyDataInserted.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNNotifyDataInserted(BNBinaryView* view, uint64_t offset, uint64_t len) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNNotifyDataInserted" + )] + internal static extern void BNNotifyDataInserted( + + // BNBinaryView* view + IntPtr view , + + // uint64_t offset + ulong offset , + + // uint64_t len + ulong len + ); + } +} \ No newline at end of file diff --git a/Function/BNNotifyDataRemoved.cs b/Function/BNNotifyDataRemoved.cs new file mode 100644 index 0000000..784f208 --- /dev/null +++ b/Function/BNNotifyDataRemoved.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNNotifyDataRemoved(BNBinaryView* view, uint64_t offset, uint64_t len) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNNotifyDataRemoved" + )] + internal static extern void BNNotifyDataRemoved( + + // BNBinaryView* view + IntPtr view , + + // uint64_t offset + ulong offset , + + // uint64_t len + ulong len + ); + } +} \ No newline at end of file diff --git a/Function/BNNotifyDataWritten.cs b/Function/BNNotifyDataWritten.cs new file mode 100644 index 0000000..a6c3759 --- /dev/null +++ b/Function/BNNotifyDataWritten.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNNotifyDataWritten(BNBinaryView* view, uint64_t offset, uint64_t len) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNNotifyDataWritten" + )] + internal static extern void BNNotifyDataWritten( + + // BNBinaryView* view + IntPtr view , + + // uint64_t offset + ulong offset , + + // uint64_t len + ulong len + ); + } +} \ No newline at end of file diff --git a/Function/BNNotifyErrorForScriptingInstance.cs b/Function/BNNotifyErrorForScriptingInstance.cs new file mode 100644 index 0000000..cd425ee --- /dev/null +++ b/Function/BNNotifyErrorForScriptingInstance.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNNotifyErrorForScriptingInstance(BNScriptingInstance* instance, const char* text) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNotifyErrorForScriptingInstance" + )] + internal static extern void BNNotifyErrorForScriptingInstance( + + // BNScriptingInstance* instance + IntPtr instance , + + // const char* text + string text + + ); + } +} \ No newline at end of file diff --git a/Function/BNNotifyInputReadyStateForScriptingInstance.cs b/Function/BNNotifyInputReadyStateForScriptingInstance.cs new file mode 100644 index 0000000..fcf7ec5 --- /dev/null +++ b/Function/BNNotifyInputReadyStateForScriptingInstance.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNNotifyInputReadyStateForScriptingInstance(BNScriptingInstance* instance, BNScriptingProviderInputReadyState state) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNotifyInputReadyStateForScriptingInstance" + )] + internal static extern void BNNotifyInputReadyStateForScriptingInstance( + + // BNScriptingInstance* instance + IntPtr instance , + + // BNScriptingProviderInputReadyState state + ScriptingProviderInputReadyState state + + ); + } +} \ No newline at end of file diff --git a/Function/BNNotifyOutputForScriptingInstance.cs b/Function/BNNotifyOutputForScriptingInstance.cs new file mode 100644 index 0000000..1176559 --- /dev/null +++ b/Function/BNNotifyOutputForScriptingInstance.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNNotifyOutputForScriptingInstance(BNScriptingInstance* instance, const char* text) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNotifyOutputForScriptingInstance" + )] + internal static extern void BNNotifyOutputForScriptingInstance( + + // BNScriptingInstance* instance + IntPtr instance , + + // const char* text + string text + + ); + } +} \ No newline at end of file diff --git a/Function/BNNotifyProgressForDownloadInstance.cs b/Function/BNNotifyProgressForDownloadInstance.cs new file mode 100644 index 0000000..98da245 --- /dev/null +++ b/Function/BNNotifyProgressForDownloadInstance.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNNotifyProgressForDownloadInstance(BNDownloadInstance* instance, uint64_t progress, uint64_t total) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNotifyProgressForDownloadInstance" + )] + internal static extern bool BNNotifyProgressForDownloadInstance( + + // BNDownloadInstance* instance + IntPtr instance , + + // uint64_t progress + ulong progress , + + // uint64_t total + ulong total + + ); + } +} \ No newline at end of file diff --git a/Function/BNNotifyWarningForScriptingInstance.cs b/Function/BNNotifyWarningForScriptingInstance.cs new file mode 100644 index 0000000..5c81647 --- /dev/null +++ b/Function/BNNotifyWarningForScriptingInstance.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNNotifyWarningForScriptingInstance(BNScriptingInstance* instance, const char* text) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNotifyWarningForScriptingInstance" + )] + internal static extern void BNNotifyWarningForScriptingInstance( + + // BNScriptingInstance* instance + IntPtr instance , + + // const char* text + string text + + ); + } +} \ No newline at end of file diff --git a/Function/BNNotifyWebsocketClientConnect.cs b/Function/BNNotifyWebsocketClientConnect.cs new file mode 100644 index 0000000..99741da --- /dev/null +++ b/Function/BNNotifyWebsocketClientConnect.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNNotifyWebsocketClientConnect(BNWebsocketClient* client) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNotifyWebsocketClientConnect" + )] + internal static extern bool BNNotifyWebsocketClientConnect( + + // BNWebsocketClient* client + IntPtr client + + ); + } +} \ No newline at end of file diff --git a/Function/BNNotifyWebsocketClientDisconnect.cs b/Function/BNNotifyWebsocketClientDisconnect.cs new file mode 100644 index 0000000..5a55ad9 --- /dev/null +++ b/Function/BNNotifyWebsocketClientDisconnect.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNNotifyWebsocketClientDisconnect(BNWebsocketClient* client) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNotifyWebsocketClientDisconnect" + )] + internal static extern void BNNotifyWebsocketClientDisconnect( + + // BNWebsocketClient* client + IntPtr client + + ); + } +} \ No newline at end of file diff --git a/Function/BNNotifyWebsocketClientError.cs b/Function/BNNotifyWebsocketClientError.cs new file mode 100644 index 0000000..8d9cfeb --- /dev/null +++ b/Function/BNNotifyWebsocketClientError.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNNotifyWebsocketClientError(BNWebsocketClient* client, const char* msg) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNotifyWebsocketClientError" + )] + internal static extern void BNNotifyWebsocketClientError( + + // BNWebsocketClient* client + IntPtr client , + + // const char* msg + string msg + + ); + } +} \ No newline at end of file diff --git a/Function/BNNotifyWebsocketClientReadData.cs b/Function/BNNotifyWebsocketClientReadData.cs new file mode 100644 index 0000000..ec49edb --- /dev/null +++ b/Function/BNNotifyWebsocketClientReadData.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNNotifyWebsocketClientReadData(BNWebsocketClient* client, uint8_t* data, uint64_t len) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNNotifyWebsocketClientReadData" + )] + internal static extern bool BNNotifyWebsocketClientReadData( + + // BNWebsocketClient* client + IntPtr client , + + // uint8_t* data + IntPtr data , + + // uint64_t len + ulong len + + ); + } +} \ No newline at end of file diff --git a/Function/BNOpenDatabaseForConfiguration.cs b/Function/BNOpenDatabaseForConfiguration.cs new file mode 100644 index 0000000..c54459f --- /dev/null +++ b/Function/BNOpenDatabaseForConfiguration.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBinaryView* BNOpenDatabaseForConfiguration(BNFileMetadata* file, const char* path) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNOpenDatabaseForConfiguration" + )] + internal static extern IntPtr BNOpenDatabaseForConfiguration( + + // BNFileMetadata* file + IntPtr file , + + // const char* path + string path + ); + } +} \ No newline at end of file diff --git a/Function/BNOpenExistingDatabase.cs b/Function/BNOpenExistingDatabase.cs new file mode 100644 index 0000000..28bd8e5 --- /dev/null +++ b/Function/BNOpenExistingDatabase.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBinaryView* BNOpenExistingDatabase(BNFileMetadata* file, const char* path) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNOpenExistingDatabase" + )] + internal static extern IntPtr BNOpenExistingDatabase( + + // BNFileMetadata* file + IntPtr file , + + // const char* path + string path + ); + } +} \ No newline at end of file diff --git a/Function/BNOpenExistingDatabaseWithProgress.cs b/Function/BNOpenExistingDatabaseWithProgress.cs new file mode 100644 index 0000000..e90af3b --- /dev/null +++ b/Function/BNOpenExistingDatabaseWithProgress.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBinaryView* BNOpenExistingDatabaseWithProgress(BNFileMetadata* file, const char* path, void* ctxt, void** progress) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNOpenExistingDatabaseWithProgress" + )] + internal static extern IntPtr BNOpenExistingDatabaseWithProgress( + + // BNFileMetadata* file + IntPtr file , + + // const char* path + string path , + + // void* ctxt + IntPtr ctxt , + + // void* progress + IntPtr progress + ); + } +} \ No newline at end of file diff --git a/Function/BNOpenProject.cs b/Function/BNOpenProject.cs new file mode 100644 index 0000000..b128c7c --- /dev/null +++ b/Function/BNOpenProject.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNProject* BNOpenProject(const char* path) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNOpenProject" + )] + internal static extern IntPtr BNOpenProject( + + // const char* path + string path + + ); + } +} \ No newline at end of file diff --git a/Function/BNOpenTypeArchive.cs b/Function/BNOpenTypeArchive.cs new file mode 100644 index 0000000..f8fdb3c --- /dev/null +++ b/Function/BNOpenTypeArchive.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeArchive* BNOpenTypeArchive(const char* path) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNOpenTypeArchive" + )] + internal static extern IntPtr BNOpenTypeArchive( + + // const char* path + string path + + ); + } +} \ No newline at end of file diff --git a/Function/BNOpenUrl.cs b/Function/BNOpenUrl.cs new file mode 100644 index 0000000..40fba8f --- /dev/null +++ b/Function/BNOpenUrl.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public static partial class Core + { + public static bool OpenUrl(string url) + { + return NativeMethods.BNOpenUrl(url); + } + } + + internal static partial class NativeMethods + { + /// + /// bool BNOpenUrl(const char* url) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNOpenUrl" + )] + internal static extern bool BNOpenUrl( + + // const char* url + string url + ); + } +} \ No newline at end of file diff --git a/Function/BNParseBinaryViewOfType.cs b/Function/BNParseBinaryViewOfType.cs new file mode 100644 index 0000000..f7c7bb5 --- /dev/null +++ b/Function/BNParseBinaryViewOfType.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBinaryView* BNParseBinaryViewOfType(BNBinaryViewType* type, BNBinaryView* data) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNParseBinaryViewOfType" + )] + internal static extern IntPtr BNParseBinaryViewOfType( + + // BNBinaryViewType* type + IntPtr type , + + // BNBinaryView* data + IntPtr data + + ); + } +} \ No newline at end of file diff --git a/Function/BNParseDebugInfo.cs b/Function/BNParseDebugInfo.cs new file mode 100644 index 0000000..b159df9 --- /dev/null +++ b/Function/BNParseDebugInfo.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDebugInfo* BNParseDebugInfo(BNDebugInfoParser* parser, BNBinaryView* view, BNBinaryView* debugFile, BNDebugInfo* existingDebugInfo, void** progress, void* progressCtxt) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNParseDebugInfo" + )] + internal static extern IntPtr BNParseDebugInfo( + + // BNDebugInfoParser* parser + IntPtr parser , + + // BNBinaryView* view + IntPtr view , + + // BNBinaryView* debugFile + IntPtr debugFile , + + // BNDebugInfo* existingDebugInfo + IntPtr existingDebugInfo , + + // void** progress + IntPtr progress , + + // void* progressCtxt + IntPtr progressCtxt + + ); + } +} \ No newline at end of file diff --git a/Function/BNParseExpression.cs b/Function/BNParseExpression.cs new file mode 100644 index 0000000..19075b3 --- /dev/null +++ b/Function/BNParseExpression.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNParseExpression(BNBinaryView* view, const char* expression, uint64_t* offset, uint64_t here, const char** errorString) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNParseExpression" + )] + internal static extern bool BNParseExpression( + + // BNBinaryView* view + IntPtr view , + + // const char* expression + string expression , + + // uint64_t* offset + out ulong offset , + + // uint64_t here + ulong here , + + // const char** errorString + out IntPtr errorString + ); + } +} \ No newline at end of file diff --git a/Function/BNParsePossibleValueSet.cs b/Function/BNParsePossibleValueSet.cs new file mode 100644 index 0000000..a67c163 --- /dev/null +++ b/Function/BNParsePossibleValueSet.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNParsePossibleValueSet(BNBinaryView* view, const char* valueText, BNRegisterValueType state, BNPossibleValueSet* result, uint64_t here, const char** errors) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNParsePossibleValueSet" + )] + internal static extern bool BNParsePossibleValueSet( + + // BNBinaryView* view + IntPtr view , + + // const char* valueText + string valueText , + + // BNRegisterValueType state + RegisterValueType state , + + // BNPossibleValueSet* result + out BNPossibleValueSet result , + + // uint64_t here + ulong here , + + // const char** errors + out IntPtr errors + ); + } +} \ No newline at end of file diff --git a/Function/BNParseTextFormat.cs b/Function/BNParseTextFormat.cs new file mode 100644 index 0000000..feba8b8 --- /dev/null +++ b/Function/BNParseTextFormat.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBinaryView* BNParseTextFormat(const char* filename) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNParseTextFormat" + )] + internal static extern IntPtr BNParseTextFormat( + + // const char* filename + string filename + + ); + } +} \ No newline at end of file diff --git a/Function/BNParseTypeParserOptionsText.cs b/Function/BNParseTypeParserOptionsText.cs new file mode 100644 index 0000000..d2b3424 --- /dev/null +++ b/Function/BNParseTypeParserOptionsText.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char** BNParseTypeParserOptionsText(const char* optionsText, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNParseTypeParserOptionsText" + )] + internal static extern IntPtr BNParseTypeParserOptionsText( + + // const char* optionsText + string optionsText , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNParseTypeString.cs b/Function/BNParseTypeString.cs new file mode 100644 index 0000000..5254bb2 --- /dev/null +++ b/Function/BNParseTypeString.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNParseTypeString(BNBinaryView* view, const char* text, BNQualifiedNameAndType* result, const char** errors, BNQualifiedNameList* typesAllowRedefinition, bool importDepencencies) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNParseTypeString" + )] + internal static extern bool BNParseTypeString( + + // BNBinaryView* view + IntPtr view , + + // const char* text + string text , + + // BNQualifiedNameAndType* result + out BNQualifiedNameAndType result , + + // char** errors + out IntPtr errors , + + // BNQualifiedNameList* typesAllowRedefinition + in BNQualifiedNameList typesAllowRedefinition , + + // bool importDepencencies + bool importDepencencies + ); + } +} \ No newline at end of file diff --git a/Function/BNParseTypesFromSource.cs b/Function/BNParseTypesFromSource.cs new file mode 100644 index 0000000..11ddb08 --- /dev/null +++ b/Function/BNParseTypesFromSource.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNParseTypesFromSource(BNPlatform* platform, const char* source, const char* fileName, BNTypeParserResult* result, const char** errors, const char** includeDirs, uint64_t includeDirCount, const char* autoTypeSource) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNParseTypesFromSource" + )] + internal static extern bool BNParseTypesFromSource( + + // BNPlatform* platform + IntPtr platform , + + // const char* source + string source , + + // const char* fileName + string fileName , + + // BNTypeParserResult* result + IntPtr result , + + // const char** errors + string[] errors , + + // const char** includeDirs + string[] includeDirs , + + // uint64_t includeDirCount + ulong includeDirCount , + + // const char* autoTypeSource + string autoTypeSource + + ); + } +} \ No newline at end of file diff --git a/Function/BNParseTypesFromSourceFile.cs b/Function/BNParseTypesFromSourceFile.cs new file mode 100644 index 0000000..5e54d04 --- /dev/null +++ b/Function/BNParseTypesFromSourceFile.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNParseTypesFromSourceFile(BNPlatform* platform, const char* fileName, BNTypeParserResult* result, const char** errors, const char** includeDirs, uint64_t includeDirCount, const char* autoTypeSource) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNParseTypesFromSourceFile" + )] + internal static extern bool BNParseTypesFromSourceFile( + + // BNPlatform* platform + IntPtr platform , + + // const char* fileName + string fileName , + + // BNTypeParserResult* result + IntPtr result , + + // const char** errors + string[] errors , + + // const char** includeDirs + string[] includeDirs , + + // uint64_t includeDirCount + ulong includeDirCount , + + // const char* autoTypeSource + string autoTypeSource + + ); + } +} \ No newline at end of file diff --git a/Function/BNParseTypesString.cs b/Function/BNParseTypesString.cs new file mode 100644 index 0000000..295cd52 --- /dev/null +++ b/Function/BNParseTypesString.cs @@ -0,0 +1,52 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNParseTypesString(BNBinaryView* view, const char* text, const char** options, uint64_t optionCount, const char** includeDirs, uint64_t includeDirCount, BNTypeParserResult* result, const char** errors, BNQualifiedNameList* typesAllowRedefinition, bool importDepencencies) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNParseTypesString" + )] + internal static extern bool BNParseTypesString( + + // BNBinaryView* view + IntPtr view , + + // const char* text + string text , + + // const char** options + string[] options , + + // uint64_t optionCount + ulong optionCount , + + // const char** includeDirs + string[] includeDirs , + + // uint64_t includeDirCount + ulong includeDirCount , + + // BNTypeParserResult* result + out BNTypeParserResult result , + + // char** errors + out IntPtr errors , + + // BNQualifiedNameList* typesAllowRedefinition + in BNQualifiedNameList typesAllowRedefinition , + + // bool importDepencencies + bool importDepencencies + ); + } +} \ No newline at end of file diff --git a/Function/BNParseVersionString.cs b/Function/BNParseVersionString.cs new file mode 100644 index 0000000..f7e448c --- /dev/null +++ b/Function/BNParseVersionString.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNParseVersionString(BNVersionInfo @return, const char* v) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNParseVersionString" + )] + internal static extern void BNParseVersionString( + + // BNVersionInfo _return + VersionInfo _return , + + // const char* v + string v + + ); + } +} \ No newline at end of file diff --git a/Function/BNPathExists.cs b/Function/BNPathExists.cs new file mode 100644 index 0000000..6631ff0 --- /dev/null +++ b/Function/BNPathExists.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNPathExists(const char* path) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNPathExists" + )] + internal static extern bool BNPathExists( + + // const char* path + string path + + ); + } +} \ No newline at end of file diff --git a/Function/BNPerformCustomRequest.cs b/Function/BNPerformCustomRequest.cs new file mode 100644 index 0000000..d72d772 --- /dev/null +++ b/Function/BNPerformCustomRequest.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// int32_t BNPerformCustomRequest(BNDownloadInstance* instance, const char* method, const char* url, uint64_t headerCount, const char** headerKeys, const char** headerValues, BNDownloadInstanceResponse** response, BNDownloadInstanceInputOutputCallbacks* callbacks) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNPerformCustomRequest" + )] + internal static extern int BNPerformCustomRequest( + + // BNDownloadInstance* instance + IntPtr instance , + + // const char* method + string method , + + // const char* url + string url , + + // uint64_t headerCount + ulong headerCount , + + // const char** headerKeys + string[] headerKeys , + + // const char** headerValues + string[] headerValues , + + // BNDownloadInstanceResponse** response + IntPtr response , + + // BNDownloadInstanceInputOutputCallbacks* callbacks + IntPtr callbacks + + ); + } +} \ No newline at end of file diff --git a/Function/BNPerformDownloadRequest.cs b/Function/BNPerformDownloadRequest.cs new file mode 100644 index 0000000..32126d5 --- /dev/null +++ b/Function/BNPerformDownloadRequest.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// int32_t BNPerformDownloadRequest(BNDownloadInstance* instance, const char* url, BNDownloadInstanceOutputCallbacks* callbacks) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNPerformDownloadRequest" + )] + internal static extern int BNPerformDownloadRequest( + + // BNDownloadInstance* instance + IntPtr instance , + + // const char* url + string url , + + // BNDownloadInstanceOutputCallbacks* callbacks + IntPtr callbacks + + ); + } +} \ No newline at end of file diff --git a/Function/BNPerformSearch.cs b/Function/BNPerformSearch.cs new file mode 100644 index 0000000..2334a8f --- /dev/null +++ b/Function/BNPerformSearch.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNPerformSearch(const char* query, uint8_t* buffer, uint64_t size, void** callback, void* context) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNPerformSearch" + )] + internal static extern bool BNPerformSearch( + + // const char* query + string query , + + // uint8_t* buffer + IntPtr buffer , + + // uint64_t size + ulong size , + + // void** callback + IntPtr callback , + + // void* context + IntPtr context + ); + } +} \ No newline at end of file diff --git a/Function/BNPlatformAdjustTypeParserInput.cs b/Function/BNPlatformAdjustTypeParserInput.cs new file mode 100644 index 0000000..c50f23e --- /dev/null +++ b/Function/BNPlatformAdjustTypeParserInput.cs @@ -0,0 +1,59 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNPlatformAdjustTypeParserInput(BNPlatform* platform, BNTypeParser* parser, const char** argumentsIn, uint64_t argumentsLenIn, const char** sourceFileNamesIn, const char** sourceFileValuesIn, uint64_t sourceFilesLenIn, const char*** argumentsOut, uint64_t* argumentsLenOut, const char*** sourceFileNamesOut, const char*** sourceFileValuesOut, uint64_t* sourceFilesLenOut) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNPlatformAdjustTypeParserInput" + )] + internal static extern void BNPlatformAdjustTypeParserInput( + + // BNPlatform* platform + IntPtr platform , + + // BNTypeParser* parser + IntPtr parser , + + // const char** argumentsIn + string[] argumentsIn , + + // uint64_t argumentsLenIn + ulong argumentsLenIn , + + // const char** sourceFileNamesIn + string[] sourceFileNamesIn , + + // const char** sourceFileValuesIn + string[] sourceFileValuesIn , + + // uint64_t sourceFilesLenIn + ulong sourceFilesLenIn , + + // const char*** argumentsOut + IntPtr argumentsOut , + + // uint64_t* argumentsLenOut + IntPtr argumentsLenOut , + + // const char*** sourceFileNamesOut + IntPtr sourceFileNamesOut , + + // const char*** sourceFileValuesOut + IntPtr sourceFileValuesOut , + + // uint64_t* sourceFilesLenOut + IntPtr sourceFilesLenOut + + ); + } +} \ No newline at end of file diff --git a/Function/BNPluginAreDependenciesBeingInstalled.cs b/Function/BNPluginAreDependenciesBeingInstalled.cs new file mode 100644 index 0000000..a85477c --- /dev/null +++ b/Function/BNPluginAreDependenciesBeingInstalled.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNPluginAreDependenciesBeingInstalled(BNRepoPlugin* p) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNPluginAreDependenciesBeingInstalled" + )] + internal static extern bool BNPluginAreDependenciesBeingInstalled( + + // BNRepoPlugin* p + IntPtr p + + ); + } +} \ No newline at end of file diff --git a/Function/BNPluginDisable.cs b/Function/BNPluginDisable.cs new file mode 100644 index 0000000..cfcda40 --- /dev/null +++ b/Function/BNPluginDisable.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNPluginDisable(BNRepoPlugin* p) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNPluginDisable" + )] + internal static extern bool BNPluginDisable( + + // BNRepoPlugin* p + IntPtr p + + ); + } +} \ No newline at end of file diff --git a/Function/BNPluginEnable.cs b/Function/BNPluginEnable.cs new file mode 100644 index 0000000..892b01d --- /dev/null +++ b/Function/BNPluginEnable.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNPluginEnable(BNRepoPlugin* p, bool force) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNPluginEnable" + )] + internal static extern bool BNPluginEnable( + + // BNRepoPlugin* p + IntPtr p , + + // bool force + bool force + + ); + } +} \ No newline at end of file diff --git a/Function/BNPluginGetApis.cs b/Function/BNPluginGetApis.cs new file mode 100644 index 0000000..e710f0e --- /dev/null +++ b/Function/BNPluginGetApis.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char** BNPluginGetApis(BNRepoPlugin* p, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNPluginGetApis" + )] + internal static extern IntPtr BNPluginGetApis( + + // BNRepoPlugin* p + IntPtr p , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNPluginGetAuthor.cs b/Function/BNPluginGetAuthor.cs new file mode 100644 index 0000000..a6da467 --- /dev/null +++ b/Function/BNPluginGetAuthor.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNPluginGetAuthor(BNRepoPlugin* p) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNPluginGetAuthor" + )] + internal static extern IntPtr BNPluginGetAuthor( + + // BNRepoPlugin* p + IntPtr p + + ); + } +} \ No newline at end of file diff --git a/Function/BNPluginGetAuthorUrl.cs b/Function/BNPluginGetAuthorUrl.cs new file mode 100644 index 0000000..dea6c36 --- /dev/null +++ b/Function/BNPluginGetAuthorUrl.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNPluginGetAuthorUrl(BNRepoPlugin* p) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNPluginGetAuthorUrl" + )] + internal static extern IntPtr BNPluginGetAuthorUrl( + + // BNRepoPlugin* p + IntPtr p + + ); + } +} \ No newline at end of file diff --git a/Function/BNPluginGetCommit.cs b/Function/BNPluginGetCommit.cs new file mode 100644 index 0000000..2240022 --- /dev/null +++ b/Function/BNPluginGetCommit.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNPluginGetCommit(BNRepoPlugin* p) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNPluginGetCommit" + )] + internal static extern IntPtr BNPluginGetCommit( + + // BNRepoPlugin* p + IntPtr p + + ); + } +} \ No newline at end of file diff --git a/Function/BNPluginGetDependencies.cs b/Function/BNPluginGetDependencies.cs new file mode 100644 index 0000000..7e1188a --- /dev/null +++ b/Function/BNPluginGetDependencies.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNPluginGetDependencies(BNRepoPlugin* p) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNPluginGetDependencies" + )] + internal static extern IntPtr BNPluginGetDependencies( + + // BNRepoPlugin* p + IntPtr p + + ); + } +} \ No newline at end of file diff --git a/Function/BNPluginGetDescription.cs b/Function/BNPluginGetDescription.cs new file mode 100644 index 0000000..681d302 --- /dev/null +++ b/Function/BNPluginGetDescription.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNPluginGetDescription(BNRepoPlugin* p) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNPluginGetDescription" + )] + internal static extern IntPtr BNPluginGetDescription( + + // BNRepoPlugin* p + IntPtr p + + ); + } +} \ No newline at end of file diff --git a/Function/BNPluginGetLastUpdate.cs b/Function/BNPluginGetLastUpdate.cs new file mode 100644 index 0000000..d8fd5d4 --- /dev/null +++ b/Function/BNPluginGetLastUpdate.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNPluginGetLastUpdate(BNRepoPlugin* p) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNPluginGetLastUpdate" + )] + internal static extern ulong BNPluginGetLastUpdate( + + // BNRepoPlugin* p + IntPtr p + + ); + } +} \ No newline at end of file diff --git a/Function/BNPluginGetLicenseText.cs b/Function/BNPluginGetLicenseText.cs new file mode 100644 index 0000000..e3e8c8f --- /dev/null +++ b/Function/BNPluginGetLicenseText.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNPluginGetLicenseText(BNRepoPlugin* p) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNPluginGetLicenseText" + )] + internal static extern IntPtr BNPluginGetLicenseText( + + // BNRepoPlugin* p + IntPtr p + + ); + } +} \ No newline at end of file diff --git a/Function/BNPluginGetLongdescription.cs b/Function/BNPluginGetLongdescription.cs new file mode 100644 index 0000000..a9dd69f --- /dev/null +++ b/Function/BNPluginGetLongdescription.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNPluginGetLongdescription(BNRepoPlugin* p) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNPluginGetLongdescription" + )] + internal static extern IntPtr BNPluginGetLongdescription( + + // BNRepoPlugin* p + IntPtr p + + ); + } +} \ No newline at end of file diff --git a/Function/BNPluginGetMaximumVersionInfo.cs b/Function/BNPluginGetMaximumVersionInfo.cs new file mode 100644 index 0000000..89a2be7 --- /dev/null +++ b/Function/BNPluginGetMaximumVersionInfo.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNVersionInfo BNPluginGetMaximumVersionInfo(BNRepoPlugin* p) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNPluginGetMaximumVersionInfo" + )] + internal static extern BNVersionInfo BNPluginGetMaximumVersionInfo( + + // BNRepoPlugin* p + IntPtr p + + ); + } +} \ No newline at end of file diff --git a/Function/BNPluginGetMinimumVersionInfo.cs b/Function/BNPluginGetMinimumVersionInfo.cs new file mode 100644 index 0000000..4dfb253 --- /dev/null +++ b/Function/BNPluginGetMinimumVersionInfo.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNVersionInfo BNPluginGetMinimumVersionInfo(BNRepoPlugin* p) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNPluginGetMinimumVersionInfo" + )] + internal static extern BNVersionInfo BNPluginGetMinimumVersionInfo( + + // BNRepoPlugin* p + IntPtr p + + ); + } +} \ No newline at end of file diff --git a/Function/BNPluginGetName.cs b/Function/BNPluginGetName.cs new file mode 100644 index 0000000..fd92ce8 --- /dev/null +++ b/Function/BNPluginGetName.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNPluginGetName(BNRepoPlugin* p) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNPluginGetName" + )] + internal static extern IntPtr BNPluginGetName( + + // BNRepoPlugin* p + IntPtr p + + ); + } +} \ No newline at end of file diff --git a/Function/BNPluginGetPackageUrl.cs b/Function/BNPluginGetPackageUrl.cs new file mode 100644 index 0000000..bb4343a --- /dev/null +++ b/Function/BNPluginGetPackageUrl.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNPluginGetPackageUrl(BNRepoPlugin* p) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNPluginGetPackageUrl" + )] + internal static extern IntPtr BNPluginGetPackageUrl( + + // BNRepoPlugin* p + IntPtr p + + ); + } +} \ No newline at end of file diff --git a/Function/BNPluginGetPath.cs b/Function/BNPluginGetPath.cs new file mode 100644 index 0000000..7d5a3de --- /dev/null +++ b/Function/BNPluginGetPath.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNPluginGetPath(BNRepoPlugin* p) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNPluginGetPath" + )] + internal static extern IntPtr BNPluginGetPath( + + // BNRepoPlugin* p + IntPtr p + + ); + } +} \ No newline at end of file diff --git a/Function/BNPluginGetPlatforms.cs b/Function/BNPluginGetPlatforms.cs new file mode 100644 index 0000000..6c9c227 --- /dev/null +++ b/Function/BNPluginGetPlatforms.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char** BNPluginGetPlatforms(BNRepoPlugin* p, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNPluginGetPlatforms" + )] + internal static extern IntPtr BNPluginGetPlatforms( + + // BNRepoPlugin* p + IntPtr p , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNPluginGetPluginStatus.cs b/Function/BNPluginGetPluginStatus.cs new file mode 100644 index 0000000..3b8a756 --- /dev/null +++ b/Function/BNPluginGetPluginStatus.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNPluginStatus BNPluginGetPluginStatus(BNRepoPlugin* p) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNPluginGetPluginStatus" + )] + internal static extern PluginStatus BNPluginGetPluginStatus( + + // BNRepoPlugin* p + IntPtr p + + ); + } +} \ No newline at end of file diff --git a/Function/BNPluginGetPluginTypes.cs b/Function/BNPluginGetPluginTypes.cs new file mode 100644 index 0000000..477fa2c --- /dev/null +++ b/Function/BNPluginGetPluginTypes.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNPluginType* BNPluginGetPluginTypes(BNRepoPlugin* p, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNPluginGetPluginTypes" + )] + internal static extern IntPtr BNPluginGetPluginTypes( + + // BNRepoPlugin* p + IntPtr p , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNPluginGetProjectData.cs b/Function/BNPluginGetProjectData.cs new file mode 100644 index 0000000..46baf2d --- /dev/null +++ b/Function/BNPluginGetProjectData.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNPluginGetProjectData(BNRepoPlugin* p) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNPluginGetProjectData" + )] + internal static extern IntPtr BNPluginGetProjectData( + + // BNRepoPlugin* p + IntPtr p + + ); + } +} \ No newline at end of file diff --git a/Function/BNPluginGetProjectUrl.cs b/Function/BNPluginGetProjectUrl.cs new file mode 100644 index 0000000..6a07d23 --- /dev/null +++ b/Function/BNPluginGetProjectUrl.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNPluginGetProjectUrl(BNRepoPlugin* p) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNPluginGetProjectUrl" + )] + internal static extern IntPtr BNPluginGetProjectUrl( + + // BNRepoPlugin* p + IntPtr p + + ); + } +} \ No newline at end of file diff --git a/Function/BNPluginGetRepository.cs b/Function/BNPluginGetRepository.cs new file mode 100644 index 0000000..2cc9776 --- /dev/null +++ b/Function/BNPluginGetRepository.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNPluginGetRepository(BNRepoPlugin* p) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNPluginGetRepository" + )] + internal static extern IntPtr BNPluginGetRepository( + + // BNRepoPlugin* p + IntPtr p + + ); + } +} \ No newline at end of file diff --git a/Function/BNPluginGetSubdir.cs b/Function/BNPluginGetSubdir.cs new file mode 100644 index 0000000..7c8c89e --- /dev/null +++ b/Function/BNPluginGetSubdir.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNPluginGetSubdir(BNRepoPlugin* p) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNPluginGetSubdir" + )] + internal static extern IntPtr BNPluginGetSubdir( + + // BNRepoPlugin* p + IntPtr p + + ); + } +} \ No newline at end of file diff --git a/Function/BNPluginGetVersion.cs b/Function/BNPluginGetVersion.cs new file mode 100644 index 0000000..e818f70 --- /dev/null +++ b/Function/BNPluginGetVersion.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNPluginGetVersion(BNRepoPlugin* p) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNPluginGetVersion" + )] + internal static extern IntPtr BNPluginGetVersion( + + // BNRepoPlugin* p + IntPtr p + + ); + } +} \ No newline at end of file diff --git a/Function/BNPluginGetViewOnly.cs b/Function/BNPluginGetViewOnly.cs new file mode 100644 index 0000000..114bf1d --- /dev/null +++ b/Function/BNPluginGetViewOnly.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNPluginGetViewOnly(BNRepoPlugin* p) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNPluginGetViewOnly" + )] + internal static extern bool BNPluginGetViewOnly( + + // BNRepoPlugin* p + IntPtr p + + ); + } +} \ No newline at end of file diff --git a/Function/BNPluginInstall.cs b/Function/BNPluginInstall.cs new file mode 100644 index 0000000..12c9653 --- /dev/null +++ b/Function/BNPluginInstall.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNPluginInstall(BNRepoPlugin* p) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNPluginInstall" + )] + internal static extern bool BNPluginInstall( + + // BNRepoPlugin* p + IntPtr p + + ); + } +} \ No newline at end of file diff --git a/Function/BNPluginInstallDependencies.cs b/Function/BNPluginInstallDependencies.cs new file mode 100644 index 0000000..ecb053c --- /dev/null +++ b/Function/BNPluginInstallDependencies.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNPluginInstallDependencies(BNRepoPlugin* p) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNPluginInstallDependencies" + )] + internal static extern bool BNPluginInstallDependencies( + + // BNRepoPlugin* p + IntPtr p + + ); + } +} \ No newline at end of file diff --git a/Function/BNPluginIsBeingDeleted.cs b/Function/BNPluginIsBeingDeleted.cs new file mode 100644 index 0000000..e8be830 --- /dev/null +++ b/Function/BNPluginIsBeingDeleted.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNPluginIsBeingDeleted(BNRepoPlugin* p) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNPluginIsBeingDeleted" + )] + internal static extern bool BNPluginIsBeingDeleted( + + // BNRepoPlugin* p + IntPtr p + + ); + } +} \ No newline at end of file diff --git a/Function/BNPluginIsBeingUpdated.cs b/Function/BNPluginIsBeingUpdated.cs new file mode 100644 index 0000000..5a9aea7 --- /dev/null +++ b/Function/BNPluginIsBeingUpdated.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNPluginIsBeingUpdated(BNRepoPlugin* p) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNPluginIsBeingUpdated" + )] + internal static extern bool BNPluginIsBeingUpdated( + + // BNRepoPlugin* p + IntPtr p + + ); + } +} \ No newline at end of file diff --git a/Function/BNPluginIsDeletePending.cs b/Function/BNPluginIsDeletePending.cs new file mode 100644 index 0000000..b18cf5e --- /dev/null +++ b/Function/BNPluginIsDeletePending.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNPluginIsDeletePending(BNRepoPlugin* p) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNPluginIsDeletePending" + )] + internal static extern bool BNPluginIsDeletePending( + + // BNRepoPlugin* p + IntPtr p + + ); + } +} \ No newline at end of file diff --git a/Function/BNPluginIsDisablePending.cs b/Function/BNPluginIsDisablePending.cs new file mode 100644 index 0000000..734e6fb --- /dev/null +++ b/Function/BNPluginIsDisablePending.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNPluginIsDisablePending(BNRepoPlugin* p) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNPluginIsDisablePending" + )] + internal static extern bool BNPluginIsDisablePending( + + // BNRepoPlugin* p + IntPtr p + + ); + } +} \ No newline at end of file diff --git a/Function/BNPluginIsEnabled.cs b/Function/BNPluginIsEnabled.cs new file mode 100644 index 0000000..d5a7eca --- /dev/null +++ b/Function/BNPluginIsEnabled.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNPluginIsEnabled(BNRepoPlugin* p) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNPluginIsEnabled" + )] + internal static extern bool BNPluginIsEnabled( + + // BNRepoPlugin* p + IntPtr p + + ); + } +} \ No newline at end of file diff --git a/Function/BNPluginIsInstalled.cs b/Function/BNPluginIsInstalled.cs new file mode 100644 index 0000000..5aab537 --- /dev/null +++ b/Function/BNPluginIsInstalled.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNPluginIsInstalled(BNRepoPlugin* p) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNPluginIsInstalled" + )] + internal static extern bool BNPluginIsInstalled( + + // BNRepoPlugin* p + IntPtr p + + ); + } +} \ No newline at end of file diff --git a/Function/BNPluginIsRunning.cs b/Function/BNPluginIsRunning.cs new file mode 100644 index 0000000..28a3971 --- /dev/null +++ b/Function/BNPluginIsRunning.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNPluginIsRunning(BNRepoPlugin* p) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNPluginIsRunning" + )] + internal static extern bool BNPluginIsRunning( + + // BNRepoPlugin* p + IntPtr p + + ); + } +} \ No newline at end of file diff --git a/Function/BNPluginIsUpdateAvailable.cs b/Function/BNPluginIsUpdateAvailable.cs new file mode 100644 index 0000000..5380b09 --- /dev/null +++ b/Function/BNPluginIsUpdateAvailable.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNPluginIsUpdateAvailable(BNRepoPlugin* p) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNPluginIsUpdateAvailable" + )] + internal static extern bool BNPluginIsUpdateAvailable( + + // BNRepoPlugin* p + IntPtr p + + ); + } +} \ No newline at end of file diff --git a/Function/BNPluginIsUpdatePending.cs b/Function/BNPluginIsUpdatePending.cs new file mode 100644 index 0000000..927d2c0 --- /dev/null +++ b/Function/BNPluginIsUpdatePending.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNPluginIsUpdatePending(BNRepoPlugin* p) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNPluginIsUpdatePending" + )] + internal static extern bool BNPluginIsUpdatePending( + + // BNRepoPlugin* p + IntPtr p + + ); + } +} \ No newline at end of file diff --git a/Function/BNPluginUninstall.cs b/Function/BNPluginUninstall.cs new file mode 100644 index 0000000..64af1ad --- /dev/null +++ b/Function/BNPluginUninstall.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNPluginUninstall(BNRepoPlugin* p) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNPluginUninstall" + )] + internal static extern bool BNPluginUninstall( + + // BNRepoPlugin* p + IntPtr p + + ); + } +} \ No newline at end of file diff --git a/Function/BNPluginUpdate.cs b/Function/BNPluginUpdate.cs new file mode 100644 index 0000000..db03726 --- /dev/null +++ b/Function/BNPluginUpdate.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNPluginUpdate(BNRepoPlugin* p) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNPluginUpdate" + )] + internal static extern bool BNPluginUpdate( + + // BNRepoPlugin* p + IntPtr p + + ); + } +} \ No newline at end of file diff --git a/Function/BNPostProcessDisassemblyTextRendererLines.cs b/Function/BNPostProcessDisassemblyTextRendererLines.cs new file mode 100644 index 0000000..936738b --- /dev/null +++ b/Function/BNPostProcessDisassemblyTextRendererLines.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDisassemblyTextLine* BNPostProcessDisassemblyTextRendererLines(BNDisassemblyTextRenderer* renderer, uint64_t addr, uint64_t len, BNDisassemblyTextLine* inLines, uint64_t inCount, uint64_t* outCount, const char* indentSpaces) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNPostProcessDisassemblyTextRendererLines" + )] + internal static extern IntPtr BNPostProcessDisassemblyTextRendererLines( + + // BNDisassemblyTextRenderer* renderer + IntPtr renderer , + + // uint64_t addr + ulong addr , + + // uint64_t len + ulong len , + + // BNDisassemblyTextLine* inLines + IntPtr inLines , + + // uint64_t inCount + ulong inCount , + + // uint64_t* outCount + IntPtr outCount , + + // const char* indentSpaces + string indentSpaces + + ); + } +} \ No newline at end of file diff --git a/Function/BNPostWorkflowRequestForBinaryView.cs b/Function/BNPostWorkflowRequestForBinaryView.cs new file mode 100644 index 0000000..1c1d6f9 --- /dev/null +++ b/Function/BNPostWorkflowRequestForBinaryView.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNPostWorkflowRequestForBinaryView(BNBinaryView* view, const char* request) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNPostWorkflowRequestForBinaryView" + )] + internal static extern IntPtr BNPostWorkflowRequestForBinaryView( + + // BNBinaryView* view + IntPtr view , + + // const char* request + string request + + ); + } +} \ No newline at end of file diff --git a/Function/BNPostWorkflowRequestForFunction.cs b/Function/BNPostWorkflowRequestForFunction.cs new file mode 100644 index 0000000..c9b1e2c --- /dev/null +++ b/Function/BNPostWorkflowRequestForFunction.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNPostWorkflowRequestForFunction(BNFunction* func, const char* request) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNPostWorkflowRequestForFunction" + )] + internal static extern IntPtr BNPostWorkflowRequestForFunction( + + // BNFunction* func + IntPtr func , + + // const char* request + string request + + ); + } +} \ No newline at end of file diff --git a/Function/BNPrepareToCopyLowLevelILBasicBlock.cs b/Function/BNPrepareToCopyLowLevelILBasicBlock.cs new file mode 100644 index 0000000..3774757 --- /dev/null +++ b/Function/BNPrepareToCopyLowLevelILBasicBlock.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNPrepareToCopyLowLevelILBasicBlock(BNLowLevelILFunction* func, BNBasicBlock* block) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNPrepareToCopyLowLevelILBasicBlock" + )] + internal static extern void BNPrepareToCopyLowLevelILBasicBlock( + + // BNLowLevelILFunction* func + IntPtr func , + + // BNBasicBlock* block + IntPtr block + ); + } +} \ No newline at end of file diff --git a/Function/BNPrepareToCopyLowLevelILFunction.cs b/Function/BNPrepareToCopyLowLevelILFunction.cs new file mode 100644 index 0000000..2855939 --- /dev/null +++ b/Function/BNPrepareToCopyLowLevelILFunction.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNPrepareToCopyLowLevelILFunction(BNLowLevelILFunction* func, BNLowLevelILFunction* src) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNPrepareToCopyLowLevelILFunction" + )] + internal static extern void BNPrepareToCopyLowLevelILFunction( + + // BNLowLevelILFunction* func + IntPtr func , + + // BNLowLevelILFunction* src + IntPtr src + ); + } +} \ No newline at end of file diff --git a/Function/BNPrepareToCopyMediumLevelILBasicBlock.cs b/Function/BNPrepareToCopyMediumLevelILBasicBlock.cs new file mode 100644 index 0000000..dfcf540 --- /dev/null +++ b/Function/BNPrepareToCopyMediumLevelILBasicBlock.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNPrepareToCopyMediumLevelILBasicBlock(BNMediumLevelILFunction* func, BNBasicBlock* block) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNPrepareToCopyMediumLevelILBasicBlock" + )] + internal static extern void BNPrepareToCopyMediumLevelILBasicBlock( + + // BNMediumLevelILFunction* func + IntPtr func , + + // BNBasicBlock* block + IntPtr block + ); + } +} \ No newline at end of file diff --git a/Function/BNPrepareToCopyMediumLevelILFunction.cs b/Function/BNPrepareToCopyMediumLevelILFunction.cs new file mode 100644 index 0000000..8810a5f --- /dev/null +++ b/Function/BNPrepareToCopyMediumLevelILFunction.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNPrepareToCopyMediumLevelILFunction(BNMediumLevelILFunction* func, BNMediumLevelILFunction* src) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNPrepareToCopyMediumLevelILFunction" + )] + internal static extern void BNPrepareToCopyMediumLevelILFunction( + + // BNMediumLevelILFunction* func + IntPtr func , + + // BNMediumLevelILFunction* src + IntPtr src + ); + } +} \ No newline at end of file diff --git a/Function/BNPreprocessSource.cs b/Function/BNPreprocessSource.cs new file mode 100644 index 0000000..4fa9af2 --- /dev/null +++ b/Function/BNPreprocessSource.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNPreprocessSource(const char* source, const char* fileName, const char** output, const char** errors, const char** includeDirs, uint64_t includeDirCount) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNPreprocessSource" + )] + internal static extern bool BNPreprocessSource( + + // const char* source + string source , + + // const char* fileName + string fileName , + + // const char** output + string[] output , + + // const char** errors + string[] errors , + + // const char** includeDirs + string[] includeDirs , + + // uint64_t includeDirCount + ulong includeDirCount + + ); + } +} \ No newline at end of file diff --git a/Function/BNProcessSymbolQueue.cs b/Function/BNProcessSymbolQueue.cs new file mode 100644 index 0000000..7fa7f4e --- /dev/null +++ b/Function/BNProcessSymbolQueue.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNProcessSymbolQueue(BNSymbolQueue* queue) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNProcessSymbolQueue" + )] + internal static extern void BNProcessSymbolQueue( + + // BNSymbolQueue* queue + IntPtr queue + + ); + } +} \ No newline at end of file diff --git a/Function/BNProjectBeginBulkOperation.cs b/Function/BNProjectBeginBulkOperation.cs new file mode 100644 index 0000000..15e5047 --- /dev/null +++ b/Function/BNProjectBeginBulkOperation.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNProjectBeginBulkOperation(BNProject* project) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNProjectBeginBulkOperation" + )] + internal static extern bool BNProjectBeginBulkOperation( + + // BNProject* project + IntPtr project + + ); + } +} \ No newline at end of file diff --git a/Function/BNProjectClose.cs b/Function/BNProjectClose.cs new file mode 100644 index 0000000..7032818 --- /dev/null +++ b/Function/BNProjectClose.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNProjectClose(BNProject* project) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNProjectClose" + )] + internal static extern bool BNProjectClose( + + // BNProject* project + IntPtr project + + ); + } +} \ No newline at end of file diff --git a/Function/BNProjectCreateFile.cs b/Function/BNProjectCreateFile.cs new file mode 100644 index 0000000..1580cbd --- /dev/null +++ b/Function/BNProjectCreateFile.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNProjectFile* BNProjectCreateFile(BNProject* project, uint8_t* contents, uint64_t contentsSize, BNProjectFolder* folder, const char* name, const char* description, void* ctxt, void** progress) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNProjectCreateFile" + )] + internal static extern IntPtr BNProjectCreateFile( + + // BNProject* project + IntPtr project , + + // uint8_t* contents + IntPtr contents , + + // uint64_t contentsSize + ulong contentsSize , + + // BNProjectFolder* folder + IntPtr folder , + + // const char* name + string name , + + // const char* description + string description , + + // void* ctxt + IntPtr ctxt , + + // void** progress + IntPtr progress + + ); + } +} \ No newline at end of file diff --git a/Function/BNProjectCreateFileFromPath.cs b/Function/BNProjectCreateFileFromPath.cs new file mode 100644 index 0000000..e002483 --- /dev/null +++ b/Function/BNProjectCreateFileFromPath.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNProjectFile* BNProjectCreateFileFromPath(BNProject* project, const char* path, BNProjectFolder* folder, const char* name, const char* description, void* ctxt, void** progress) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNProjectCreateFileFromPath" + )] + internal static extern IntPtr BNProjectCreateFileFromPath( + + // BNProject* project + IntPtr project , + + // const char* path + string path , + + // BNProjectFolder* folder + IntPtr folder , + + // const char* name + string name , + + // const char* description + string description , + + // void* ctxt + IntPtr ctxt , + + // void** progress + IntPtr progress + + ); + } +} \ No newline at end of file diff --git a/Function/BNProjectCreateFileFromPathUnsafe.cs b/Function/BNProjectCreateFileFromPathUnsafe.cs new file mode 100644 index 0000000..e36c4b2 --- /dev/null +++ b/Function/BNProjectCreateFileFromPathUnsafe.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNProjectFile* BNProjectCreateFileFromPathUnsafe(BNProject* project, const char* path, BNProjectFolder* folder, const char* name, const char* description, const char* id, int64_t creationTimestamp, void* ctxt, void** progress) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNProjectCreateFileFromPathUnsafe" + )] + internal static extern IntPtr BNProjectCreateFileFromPathUnsafe( + + // BNProject* project + IntPtr project , + + // const char* path + string path , + + // BNProjectFolder* folder + IntPtr folder , + + // const char* name + string name , + + // const char* description + string description , + + // const char* id + string id , + + // int64_t creationTimestamp + long creationTimestamp , + + // void* ctxt + IntPtr ctxt , + + // void** progress + IntPtr progress + + ); + } +} \ No newline at end of file diff --git a/Function/BNProjectCreateFileUnsafe.cs b/Function/BNProjectCreateFileUnsafe.cs new file mode 100644 index 0000000..fccafd6 --- /dev/null +++ b/Function/BNProjectCreateFileUnsafe.cs @@ -0,0 +1,53 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNProjectFile* BNProjectCreateFileUnsafe(BNProject* project, uint8_t* contents, uint64_t contentsSize, BNProjectFolder* folder, const char* name, const char* description, const char* id, int64_t creationTimestamp, void* ctxt, void** progress) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNProjectCreateFileUnsafe" + )] + internal static extern IntPtr BNProjectCreateFileUnsafe( + + // BNProject* project + IntPtr project , + + // uint8_t* contents + IntPtr contents , + + // uint64_t contentsSize + ulong contentsSize , + + // BNProjectFolder* folder + IntPtr folder , + + // const char* name + string name , + + // const char* description + string description , + + // const char* id + string id , + + // int64_t creationTimestamp + long creationTimestamp , + + // void* ctxt + IntPtr ctxt , + + // void** progress + IntPtr progress + + ); + } +} \ No newline at end of file diff --git a/Function/BNProjectCreateFolder.cs b/Function/BNProjectCreateFolder.cs new file mode 100644 index 0000000..264e847 --- /dev/null +++ b/Function/BNProjectCreateFolder.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNProjectFolder* BNProjectCreateFolder(BNProject* project, BNProjectFolder* parent, const char* name, const char* description) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNProjectCreateFolder" + )] + internal static extern IntPtr BNProjectCreateFolder( + + // BNProject* project + IntPtr project , + + // BNProjectFolder* parent + IntPtr parent , + + // const char* name + string name , + + // const char* description + string description + + ); + } +} \ No newline at end of file diff --git a/Function/BNProjectCreateFolderFromPath.cs b/Function/BNProjectCreateFolderFromPath.cs new file mode 100644 index 0000000..0c245f5 --- /dev/null +++ b/Function/BNProjectCreateFolderFromPath.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNProjectFolder* BNProjectCreateFolderFromPath(BNProject* project, const char* path, BNProjectFolder* parent, const char* description, void* ctxt, void** progress) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNProjectCreateFolderFromPath" + )] + internal static extern IntPtr BNProjectCreateFolderFromPath( + + // BNProject* project + IntPtr project , + + // const char* path + string path , + + // BNProjectFolder* parent + IntPtr parent , + + // const char* description + string description , + + // void* ctxt + IntPtr ctxt , + + // void** progress + IntPtr progress + + ); + } +} \ No newline at end of file diff --git a/Function/BNProjectCreateFolderUnsafe.cs b/Function/BNProjectCreateFolderUnsafe.cs new file mode 100644 index 0000000..09a90bb --- /dev/null +++ b/Function/BNProjectCreateFolderUnsafe.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNProjectFolder* BNProjectCreateFolderUnsafe(BNProject* project, BNProjectFolder* parent, const char* name, const char* description, const char* id) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNProjectCreateFolderUnsafe" + )] + internal static extern IntPtr BNProjectCreateFolderUnsafe( + + // BNProject* project + IntPtr project , + + // BNProjectFolder* parent + IntPtr parent , + + // const char* name + string name , + + // const char* description + string description , + + // const char* id + string id + + ); + } +} \ No newline at end of file diff --git a/Function/BNProjectDeleteFile.cs b/Function/BNProjectDeleteFile.cs new file mode 100644 index 0000000..6a4312a --- /dev/null +++ b/Function/BNProjectDeleteFile.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNProjectDeleteFile(BNProject* project, BNProjectFile* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNProjectDeleteFile" + )] + internal static extern bool BNProjectDeleteFile( + + // BNProject* project + IntPtr project , + + // BNProjectFile* file + IntPtr file + + ); + } +} \ No newline at end of file diff --git a/Function/BNProjectDeleteFolder.cs b/Function/BNProjectDeleteFolder.cs new file mode 100644 index 0000000..ed676cf --- /dev/null +++ b/Function/BNProjectDeleteFolder.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNProjectDeleteFolder(BNProject* project, BNProjectFolder* folder, void* ctxt, void** progress) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNProjectDeleteFolder" + )] + internal static extern bool BNProjectDeleteFolder( + + // BNProject* project + IntPtr project , + + // BNProjectFolder* folder + IntPtr folder , + + // void* ctxt + IntPtr ctxt , + + // void** progress + IntPtr progress + + ); + } +} \ No newline at end of file diff --git a/Function/BNProjectEndBulkOperation.cs b/Function/BNProjectEndBulkOperation.cs new file mode 100644 index 0000000..7a74d2f --- /dev/null +++ b/Function/BNProjectEndBulkOperation.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNProjectEndBulkOperation(BNProject* project) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNProjectEndBulkOperation" + )] + internal static extern bool BNProjectEndBulkOperation( + + // BNProject* project + IntPtr project + + ); + } +} \ No newline at end of file diff --git a/Function/BNProjectFileExistsOnDisk.cs b/Function/BNProjectFileExistsOnDisk.cs new file mode 100644 index 0000000..6414ec1 --- /dev/null +++ b/Function/BNProjectFileExistsOnDisk.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNProjectFileExistsOnDisk(BNProjectFile* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNProjectFileExistsOnDisk" + )] + internal static extern bool BNProjectFileExistsOnDisk( + + // BNProjectFile* file + IntPtr file + + ); + } +} \ No newline at end of file diff --git a/Function/BNProjectFileExport.cs b/Function/BNProjectFileExport.cs new file mode 100644 index 0000000..a09c169 --- /dev/null +++ b/Function/BNProjectFileExport.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNProjectFileExport(BNProjectFile* file, const char* destination) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNProjectFileExport" + )] + internal static extern bool BNProjectFileExport( + + // BNProjectFile* file + IntPtr file , + + // const char* destination + string destination + + ); + } +} \ No newline at end of file diff --git a/Function/BNProjectFileGetCreationTimestamp.cs b/Function/BNProjectFileGetCreationTimestamp.cs new file mode 100644 index 0000000..c898dc5 --- /dev/null +++ b/Function/BNProjectFileGetCreationTimestamp.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// int64_t BNProjectFileGetCreationTimestamp(BNProjectFile* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNProjectFileGetCreationTimestamp" + )] + internal static extern long BNProjectFileGetCreationTimestamp( + + // BNProjectFile* file + IntPtr file + + ); + } +} \ No newline at end of file diff --git a/Function/BNProjectFileGetDescription.cs b/Function/BNProjectFileGetDescription.cs new file mode 100644 index 0000000..7a3c4bf --- /dev/null +++ b/Function/BNProjectFileGetDescription.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNProjectFileGetDescription(BNProjectFile* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNProjectFileGetDescription" + )] + internal static extern IntPtr BNProjectFileGetDescription( + + // BNProjectFile* file + IntPtr file + + ); + } +} \ No newline at end of file diff --git a/Function/BNProjectFileGetFolder.cs b/Function/BNProjectFileGetFolder.cs new file mode 100644 index 0000000..79fba5a --- /dev/null +++ b/Function/BNProjectFileGetFolder.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNProjectFolder* BNProjectFileGetFolder(BNProjectFile* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNProjectFileGetFolder" + )] + internal static extern IntPtr BNProjectFileGetFolder( + + // BNProjectFile* file + IntPtr file + + ); + } +} \ No newline at end of file diff --git a/Function/BNProjectFileGetId.cs b/Function/BNProjectFileGetId.cs new file mode 100644 index 0000000..d8a43a3 --- /dev/null +++ b/Function/BNProjectFileGetId.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNProjectFileGetId(BNProjectFile* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNProjectFileGetId" + )] + internal static extern IntPtr BNProjectFileGetId( + + // BNProjectFile* file + IntPtr file + + ); + } +} \ No newline at end of file diff --git a/Function/BNProjectFileGetName.cs b/Function/BNProjectFileGetName.cs new file mode 100644 index 0000000..ad60243 --- /dev/null +++ b/Function/BNProjectFileGetName.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNProjectFileGetName(BNProjectFile* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNProjectFileGetName" + )] + internal static extern IntPtr BNProjectFileGetName( + + // BNProjectFile* file + IntPtr file + + ); + } +} \ No newline at end of file diff --git a/Function/BNProjectFileGetPathInProject.cs b/Function/BNProjectFileGetPathInProject.cs new file mode 100644 index 0000000..fa10b82 --- /dev/null +++ b/Function/BNProjectFileGetPathInProject.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNProjectFileGetPathInProject(BNProjectFile* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNProjectFileGetPathInProject" + )] + internal static extern IntPtr BNProjectFileGetPathInProject( + + // BNProjectFile* file + IntPtr file + + ); + } +} \ No newline at end of file diff --git a/Function/BNProjectFileGetPathOnDisk.cs b/Function/BNProjectFileGetPathOnDisk.cs new file mode 100644 index 0000000..3b386c9 --- /dev/null +++ b/Function/BNProjectFileGetPathOnDisk.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNProjectFileGetPathOnDisk(BNProjectFile* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNProjectFileGetPathOnDisk" + )] + internal static extern IntPtr BNProjectFileGetPathOnDisk( + + // BNProjectFile* file + IntPtr file + + ); + } +} \ No newline at end of file diff --git a/Function/BNProjectFileGetProject.cs b/Function/BNProjectFileGetProject.cs new file mode 100644 index 0000000..c69840d --- /dev/null +++ b/Function/BNProjectFileGetProject.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNProject* BNProjectFileGetProject(BNProjectFile* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNProjectFileGetProject" + )] + internal static extern IntPtr BNProjectFileGetProject( + + // BNProjectFile* file + IntPtr file + + ); + } +} \ No newline at end of file diff --git a/Function/BNProjectFileSetDescription.cs b/Function/BNProjectFileSetDescription.cs new file mode 100644 index 0000000..013089e --- /dev/null +++ b/Function/BNProjectFileSetDescription.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNProjectFileSetDescription(BNProjectFile* file, const char* description) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNProjectFileSetDescription" + )] + internal static extern bool BNProjectFileSetDescription( + + // BNProjectFile* file + IntPtr file , + + // const char* description + string description + + ); + } +} \ No newline at end of file diff --git a/Function/BNProjectFileSetFolder.cs b/Function/BNProjectFileSetFolder.cs new file mode 100644 index 0000000..86614d8 --- /dev/null +++ b/Function/BNProjectFileSetFolder.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNProjectFileSetFolder(BNProjectFile* file, BNProjectFolder* folder) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNProjectFileSetFolder" + )] + internal static extern bool BNProjectFileSetFolder( + + // BNProjectFile* file + IntPtr file , + + // BNProjectFolder* folder + IntPtr folder + + ); + } +} \ No newline at end of file diff --git a/Function/BNProjectFileSetName.cs b/Function/BNProjectFileSetName.cs new file mode 100644 index 0000000..8128781 --- /dev/null +++ b/Function/BNProjectFileSetName.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNProjectFileSetName(BNProjectFile* file, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNProjectFileSetName" + )] + internal static extern bool BNProjectFileSetName( + + // BNProjectFile* file + IntPtr file , + + // const char* name + string name + + ); + } +} \ No newline at end of file diff --git a/Function/BNProjectFolderExport.cs b/Function/BNProjectFolderExport.cs new file mode 100644 index 0000000..3512dc7 --- /dev/null +++ b/Function/BNProjectFolderExport.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNProjectFolderExport(BNProjectFolder* folder, const char* destination, void* ctxt, void** progress) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNProjectFolderExport" + )] + internal static extern bool BNProjectFolderExport( + + // BNProjectFolder* folder + IntPtr folder , + + // const char* destination + string destination , + + // void* ctxt + IntPtr ctxt , + + // void** progress + IntPtr progress + + ); + } +} \ No newline at end of file diff --git a/Function/BNProjectFolderGetDescription.cs b/Function/BNProjectFolderGetDescription.cs new file mode 100644 index 0000000..5c1bc66 --- /dev/null +++ b/Function/BNProjectFolderGetDescription.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNProjectFolderGetDescription(BNProjectFolder* folder) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNProjectFolderGetDescription" + )] + internal static extern IntPtr BNProjectFolderGetDescription( + + // BNProjectFolder* folder + IntPtr folder + + ); + } +} \ No newline at end of file diff --git a/Function/BNProjectFolderGetId.cs b/Function/BNProjectFolderGetId.cs new file mode 100644 index 0000000..e58f889 --- /dev/null +++ b/Function/BNProjectFolderGetId.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNProjectFolderGetId(BNProjectFolder* folder) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNProjectFolderGetId" + )] + internal static extern IntPtr BNProjectFolderGetId( + + // BNProjectFolder* folder + IntPtr folder + + ); + } +} \ No newline at end of file diff --git a/Function/BNProjectFolderGetName.cs b/Function/BNProjectFolderGetName.cs new file mode 100644 index 0000000..e450cb5 --- /dev/null +++ b/Function/BNProjectFolderGetName.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNProjectFolderGetName(BNProjectFolder* folder) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNProjectFolderGetName" + )] + internal static extern IntPtr BNProjectFolderGetName( + + // BNProjectFolder* folder + IntPtr folder + + ); + } +} \ No newline at end of file diff --git a/Function/BNProjectFolderGetParent.cs b/Function/BNProjectFolderGetParent.cs new file mode 100644 index 0000000..9dec246 --- /dev/null +++ b/Function/BNProjectFolderGetParent.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNProjectFolder* BNProjectFolderGetParent(BNProjectFolder* folder) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNProjectFolderGetParent" + )] + internal static extern IntPtr BNProjectFolderGetParent( + + // BNProjectFolder* folder + IntPtr folder + + ); + } +} \ No newline at end of file diff --git a/Function/BNProjectFolderGetProject.cs b/Function/BNProjectFolderGetProject.cs new file mode 100644 index 0000000..4a0ffd0 --- /dev/null +++ b/Function/BNProjectFolderGetProject.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNProject* BNProjectFolderGetProject(BNProjectFolder* folder) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNProjectFolderGetProject" + )] + internal static extern IntPtr BNProjectFolderGetProject( + + // BNProjectFolder* folder + IntPtr folder + + ); + } +} \ No newline at end of file diff --git a/Function/BNProjectFolderSetDescription.cs b/Function/BNProjectFolderSetDescription.cs new file mode 100644 index 0000000..c4ed4fe --- /dev/null +++ b/Function/BNProjectFolderSetDescription.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNProjectFolderSetDescription(BNProjectFolder* folder, const char* description) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNProjectFolderSetDescription" + )] + internal static extern bool BNProjectFolderSetDescription( + + // BNProjectFolder* folder + IntPtr folder , + + // const char* description + string description + + ); + } +} \ No newline at end of file diff --git a/Function/BNProjectFolderSetName.cs b/Function/BNProjectFolderSetName.cs new file mode 100644 index 0000000..6c3d24a --- /dev/null +++ b/Function/BNProjectFolderSetName.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNProjectFolderSetName(BNProjectFolder* folder, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNProjectFolderSetName" + )] + internal static extern bool BNProjectFolderSetName( + + // BNProjectFolder* folder + IntPtr folder , + + // const char* name + string name + + ); + } +} \ No newline at end of file diff --git a/Function/BNProjectFolderSetParent.cs b/Function/BNProjectFolderSetParent.cs new file mode 100644 index 0000000..c4af5d4 --- /dev/null +++ b/Function/BNProjectFolderSetParent.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNProjectFolderSetParent(BNProjectFolder* folder, BNProjectFolder* parent) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNProjectFolderSetParent" + )] + internal static extern bool BNProjectFolderSetParent( + + // BNProjectFolder* folder + IntPtr folder , + + // BNProjectFolder* parent + IntPtr parent + + ); + } +} \ No newline at end of file diff --git a/Function/BNProjectGetDescription.cs b/Function/BNProjectGetDescription.cs new file mode 100644 index 0000000..f7a9028 --- /dev/null +++ b/Function/BNProjectGetDescription.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNProjectGetDescription(BNProject* project) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNProjectGetDescription" + )] + internal static extern IntPtr BNProjectGetDescription( + + // BNProject* project + IntPtr project + + ); + } +} \ No newline at end of file diff --git a/Function/BNProjectGetFileById.cs b/Function/BNProjectGetFileById.cs new file mode 100644 index 0000000..4fe4262 --- /dev/null +++ b/Function/BNProjectGetFileById.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNProjectFile* BNProjectGetFileById(BNProject* project, const char* id) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNProjectGetFileById" + )] + internal static extern IntPtr BNProjectGetFileById( + + // BNProject* project + IntPtr project , + + // const char* id + string id + + ); + } +} \ No newline at end of file diff --git a/Function/BNProjectGetFileByPathOnDisk.cs b/Function/BNProjectGetFileByPathOnDisk.cs new file mode 100644 index 0000000..006591e --- /dev/null +++ b/Function/BNProjectGetFileByPathOnDisk.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNProjectFile* BNProjectGetFileByPathOnDisk(BNProject* project, const char* path) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNProjectGetFileByPathOnDisk" + )] + internal static extern IntPtr BNProjectGetFileByPathOnDisk( + + // BNProject* project + IntPtr project , + + // const char* path + string path + + ); + } +} \ No newline at end of file diff --git a/Function/BNProjectGetFilePathInProject.cs b/Function/BNProjectGetFilePathInProject.cs new file mode 100644 index 0000000..db049a7 --- /dev/null +++ b/Function/BNProjectGetFilePathInProject.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNProjectGetFilePathInProject(BNProject* project, BNProjectFile* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNProjectGetFilePathInProject" + )] + internal static extern IntPtr BNProjectGetFilePathInProject( + + // BNProject* project + IntPtr project , + + // BNProjectFile* file + IntPtr file + + ); + } +} \ No newline at end of file diff --git a/Function/BNProjectGetFiles.cs b/Function/BNProjectGetFiles.cs new file mode 100644 index 0000000..2e119be --- /dev/null +++ b/Function/BNProjectGetFiles.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNProjectFile** BNProjectGetFiles(BNProject* project, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNProjectGetFiles" + )] + internal static extern IntPtr BNProjectGetFiles( + + // BNProject* project + IntPtr project , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNProjectGetFilesByPathInProject.cs b/Function/BNProjectGetFilesByPathInProject.cs new file mode 100644 index 0000000..35ab48a --- /dev/null +++ b/Function/BNProjectGetFilesByPathInProject.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNProjectFile** BNProjectGetFilesByPathInProject(BNProject* project, const char* path, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNProjectGetFilesByPathInProject" + )] + internal static extern IntPtr BNProjectGetFilesByPathInProject( + + // BNProject* project + IntPtr project , + + // const char* path + string path , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNProjectGetFolderById.cs b/Function/BNProjectGetFolderById.cs new file mode 100644 index 0000000..e086ecb --- /dev/null +++ b/Function/BNProjectGetFolderById.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNProjectFolder* BNProjectGetFolderById(BNProject* project, const char* id) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNProjectGetFolderById" + )] + internal static extern IntPtr BNProjectGetFolderById( + + // BNProject* project + IntPtr project , + + // const char* id + string id + + ); + } +} \ No newline at end of file diff --git a/Function/BNProjectGetFolders.cs b/Function/BNProjectGetFolders.cs new file mode 100644 index 0000000..730cc57 --- /dev/null +++ b/Function/BNProjectGetFolders.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNProjectFolder** BNProjectGetFolders(BNProject* project, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNProjectGetFolders" + )] + internal static extern IntPtr BNProjectGetFolders( + + // BNProject* project + IntPtr project , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNProjectGetId.cs b/Function/BNProjectGetId.cs new file mode 100644 index 0000000..9e2722c --- /dev/null +++ b/Function/BNProjectGetId.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNProjectGetId(BNProject* project) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNProjectGetId" + )] + internal static extern IntPtr BNProjectGetId( + + // BNProject* project + IntPtr project + + ); + } +} \ No newline at end of file diff --git a/Function/BNProjectGetName.cs b/Function/BNProjectGetName.cs new file mode 100644 index 0000000..7c93535 --- /dev/null +++ b/Function/BNProjectGetName.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNProjectGetName(BNProject* project) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNProjectGetName" + )] + internal static extern IntPtr BNProjectGetName( + + // BNProject* project + IntPtr project + + ); + } +} \ No newline at end of file diff --git a/Function/BNProjectGetPath.cs b/Function/BNProjectGetPath.cs new file mode 100644 index 0000000..adf2a01 --- /dev/null +++ b/Function/BNProjectGetPath.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNProjectGetPath(BNProject* project) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNProjectGetPath" + )] + internal static extern IntPtr BNProjectGetPath( + + // BNProject* project + IntPtr project + + ); + } +} \ No newline at end of file diff --git a/Function/BNProjectGetRemoteProject.cs b/Function/BNProjectGetRemoteProject.cs new file mode 100644 index 0000000..4460d62 --- /dev/null +++ b/Function/BNProjectGetRemoteProject.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRemoteProject* BNProjectGetRemoteProject(BNProject* project) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNProjectGetRemoteProject" + )] + internal static extern IntPtr BNProjectGetRemoteProject( + + // BNProject* project + IntPtr project + + ); + } +} \ No newline at end of file diff --git a/Function/BNProjectIsOpen.cs b/Function/BNProjectIsOpen.cs new file mode 100644 index 0000000..15b596f --- /dev/null +++ b/Function/BNProjectIsOpen.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNProjectIsOpen(BNProject* project) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNProjectIsOpen" + )] + internal static extern bool BNProjectIsOpen( + + // BNProject* project + IntPtr project + + ); + } +} \ No newline at end of file diff --git a/Function/BNProjectOpen.cs b/Function/BNProjectOpen.cs new file mode 100644 index 0000000..9523136 --- /dev/null +++ b/Function/BNProjectOpen.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNProjectOpen(BNProject* project) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNProjectOpen" + )] + internal static extern bool BNProjectOpen( + + // BNProject* project + IntPtr project + + ); + } +} \ No newline at end of file diff --git a/Function/BNProjectPushFile.cs b/Function/BNProjectPushFile.cs new file mode 100644 index 0000000..7b45577 --- /dev/null +++ b/Function/BNProjectPushFile.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNProjectPushFile(BNProject* project, BNProjectFile* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNProjectPushFile" + )] + internal static extern bool BNProjectPushFile( + + // BNProject* project + IntPtr project , + + // BNProjectFile* file + IntPtr file + + ); + } +} \ No newline at end of file diff --git a/Function/BNProjectPushFolder.cs b/Function/BNProjectPushFolder.cs new file mode 100644 index 0000000..0790a5b --- /dev/null +++ b/Function/BNProjectPushFolder.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNProjectPushFolder(BNProject* project, BNProjectFolder* folder) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNProjectPushFolder" + )] + internal static extern bool BNProjectPushFolder( + + // BNProject* project + IntPtr project , + + // BNProjectFolder* folder + IntPtr folder + + ); + } +} \ No newline at end of file diff --git a/Function/BNProjectQueryMetadata.cs b/Function/BNProjectQueryMetadata.cs new file mode 100644 index 0000000..270f3bc --- /dev/null +++ b/Function/BNProjectQueryMetadata.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNMetadata* BNProjectQueryMetadata(BNProject* project, const char* key) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNProjectQueryMetadata" + )] + internal static extern IntPtr BNProjectQueryMetadata( + + // BNProject* project + IntPtr project , + + // const char* key + string key + + ); + } +} \ No newline at end of file diff --git a/Function/BNProjectRemoveMetadata.cs b/Function/BNProjectRemoveMetadata.cs new file mode 100644 index 0000000..2c85139 --- /dev/null +++ b/Function/BNProjectRemoveMetadata.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNProjectRemoveMetadata(BNProject* project, const char* key) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNProjectRemoveMetadata" + )] + internal static extern bool BNProjectRemoveMetadata( + + // BNProject* project + IntPtr project , + + // const char* key + string key + + ); + } +} \ No newline at end of file diff --git a/Function/BNProjectSetDescription.cs b/Function/BNProjectSetDescription.cs new file mode 100644 index 0000000..c2deecb --- /dev/null +++ b/Function/BNProjectSetDescription.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNProjectSetDescription(BNProject* project, const char* description) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNProjectSetDescription" + )] + internal static extern bool BNProjectSetDescription( + + // BNProject* project + IntPtr project , + + // const char* description + string description + + ); + } +} \ No newline at end of file diff --git a/Function/BNProjectSetName.cs b/Function/BNProjectSetName.cs new file mode 100644 index 0000000..a3a68e6 --- /dev/null +++ b/Function/BNProjectSetName.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNProjectSetName(BNProject* project, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNProjectSetName" + )] + internal static extern bool BNProjectSetName( + + // BNProject* project + IntPtr project , + + // const char* name + string name + + ); + } +} \ No newline at end of file diff --git a/Function/BNProjectStoreMetadata.cs b/Function/BNProjectStoreMetadata.cs new file mode 100644 index 0000000..06c04ba --- /dev/null +++ b/Function/BNProjectStoreMetadata.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNProjectStoreMetadata(BNProject* project, const char* key, BNMetadata* value) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNProjectStoreMetadata" + )] + internal static extern bool BNProjectStoreMetadata( + + // BNProject* project + IntPtr project , + + // const char* key + string key , + + // BNMetadata* _value + IntPtr _value + + ); + } +} \ No newline at end of file diff --git a/Function/BNPromoteDemangler.cs b/Function/BNPromoteDemangler.cs new file mode 100644 index 0000000..a449efb --- /dev/null +++ b/Function/BNPromoteDemangler.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNPromoteDemangler(BNDemangler* demangler) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNPromoteDemangler" + )] + internal static extern void BNPromoteDemangler( + + // BNDemangler* demangler + IntPtr demangler + + ); + } +} \ No newline at end of file diff --git a/Function/BNRangeContainsRelocation.cs b/Function/BNRangeContainsRelocation.cs new file mode 100644 index 0000000..fc0b6fe --- /dev/null +++ b/Function/BNRangeContainsRelocation.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRangeContainsRelocation(BNBinaryView* view, uint64_t addr, uint64_t size) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNRangeContainsRelocation" + )] + internal static extern bool BNRangeContainsRelocation( + + // BNBinaryView* view + IntPtr view , + + // uint64_t addr + ulong addr , + + // uint64_t size + ulong size + ); + } +} \ No newline at end of file diff --git a/Function/BNRead16.cs b/Function/BNRead16.cs new file mode 100644 index 0000000..3e52383 --- /dev/null +++ b/Function/BNRead16.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRead16(BNBinaryReader* stream, uint16_t* result) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNRead16" + )] + internal static extern bool BNRead16( + + // BNBinaryReader* stream + IntPtr stream , + + // uint16_t* result + out ushort result + ); + } +} \ No newline at end of file diff --git a/Function/BNRead32.cs b/Function/BNRead32.cs new file mode 100644 index 0000000..96ab796 --- /dev/null +++ b/Function/BNRead32.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRead32(BNBinaryReader* stream, uint32_t* result) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNRead32" + )] + internal static extern bool BNRead32( + + // BNBinaryReader* stream + IntPtr stream , + + // uint32_t* result + out uint result + ); + } +} \ No newline at end of file diff --git a/Function/BNRead64.cs b/Function/BNRead64.cs new file mode 100644 index 0000000..976b9c8 --- /dev/null +++ b/Function/BNRead64.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRead64(BNBinaryReader* stream, uint64_t* result) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNRead64" + )] + internal static extern bool BNRead64( + + // BNBinaryReader* stream + IntPtr stream , + + // uint64_t* result + out ulong result + ); + } +} \ No newline at end of file diff --git a/Function/BNRead8.cs b/Function/BNRead8.cs new file mode 100644 index 0000000..3b5edc2 --- /dev/null +++ b/Function/BNRead8.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRead8(BNBinaryReader* stream, uint8_t* result) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNRead8" + )] + internal static extern bool BNRead8( + + // BNBinaryReader* stream + IntPtr stream , + + // uint8_t* result + out byte result + ); + } +} \ No newline at end of file diff --git a/Function/BNReadBE16.cs b/Function/BNReadBE16.cs new file mode 100644 index 0000000..2a7f238 --- /dev/null +++ b/Function/BNReadBE16.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNReadBE16(BNBinaryReader* stream, uint16_t* result) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNReadBE16" + )] + internal static extern bool BNReadBE16( + + // BNBinaryReader* stream + IntPtr stream , + + // uint16_t* result + out ushort result + ); + } +} \ No newline at end of file diff --git a/Function/BNReadBE32.cs b/Function/BNReadBE32.cs new file mode 100644 index 0000000..edd51af --- /dev/null +++ b/Function/BNReadBE32.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNReadBE32(BNBinaryReader* stream, uint32_t* result) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNReadBE32" + )] + internal static extern bool BNReadBE32( + + // BNBinaryReader* stream + IntPtr stream , + + // uint32_t* result + out uint result + ); + } +} \ No newline at end of file diff --git a/Function/BNReadBE64.cs b/Function/BNReadBE64.cs new file mode 100644 index 0000000..b4d29c7 --- /dev/null +++ b/Function/BNReadBE64.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNReadBE64(BNBinaryReader* stream, uint64_t* result) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNReadBE64" + )] + internal static extern bool BNReadBE64( + + // BNBinaryReader* stream + IntPtr stream , + + // uint64_t* result + out ulong result + ); + } +} \ No newline at end of file diff --git a/Function/BNReadData.cs b/Function/BNReadData.cs new file mode 100644 index 0000000..1a54ac6 --- /dev/null +++ b/Function/BNReadData.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNReadData(BNBinaryReader* stream, void* dest, uint64_t len) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNReadData" + )] + internal static extern bool BNReadData( + + // BNBinaryReader* stream + IntPtr stream , + + // void* dest + byte[] dest , + + // uint64_t len + ulong len + ); + } +} \ No newline at end of file diff --git a/Function/BNReadDataForDownloadInstance.cs b/Function/BNReadDataForDownloadInstance.cs new file mode 100644 index 0000000..5ee7d3c --- /dev/null +++ b/Function/BNReadDataForDownloadInstance.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// int64_t BNReadDataForDownloadInstance(BNDownloadInstance* instance, uint8_t* data, uint64_t len) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNReadDataForDownloadInstance" + )] + internal static extern long BNReadDataForDownloadInstance( + + // BNDownloadInstance* instance + IntPtr instance , + + // uint8_t* data + IntPtr data , + + // uint64_t len + ulong len + + ); + } +} \ No newline at end of file diff --git a/Function/BNReadDatabaseAnalysisCache.cs b/Function/BNReadDatabaseAnalysisCache.cs new file mode 100644 index 0000000..24f2a06 --- /dev/null +++ b/Function/BNReadDatabaseAnalysisCache.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNKeyValueStore* BNReadDatabaseAnalysisCache(BNDatabase* database) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNReadDatabaseAnalysisCache" + )] + internal static extern IntPtr BNReadDatabaseAnalysisCache( + + // BNDatabase* database + IntPtr database + + ); + } +} \ No newline at end of file diff --git a/Function/BNReadDatabaseGlobal.cs b/Function/BNReadDatabaseGlobal.cs new file mode 100644 index 0000000..fbe93a9 --- /dev/null +++ b/Function/BNReadDatabaseGlobal.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNReadDatabaseGlobal(BNDatabase* database, const char* key) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNReadDatabaseGlobal" + )] + internal static extern IntPtr BNReadDatabaseGlobal( + + // BNDatabase* database + IntPtr database , + + // const char* key + string key + + ); + } +} \ No newline at end of file diff --git a/Function/BNReadDatabaseGlobalData.cs b/Function/BNReadDatabaseGlobalData.cs new file mode 100644 index 0000000..c39a2c1 --- /dev/null +++ b/Function/BNReadDatabaseGlobalData.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDataBuffer* BNReadDatabaseGlobalData(BNDatabase* database, const char* key) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNReadDatabaseGlobalData" + )] + internal static extern IntPtr BNReadDatabaseGlobalData( + + // BNDatabase* database + IntPtr database , + + // const char* key + string key + + ); + } +} \ No newline at end of file diff --git a/Function/BNReadLE16.cs b/Function/BNReadLE16.cs new file mode 100644 index 0000000..b69e27b --- /dev/null +++ b/Function/BNReadLE16.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNReadLE16(BNBinaryReader* stream, uint16_t* result) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNReadLE16" + )] + internal static extern bool BNReadLE16( + + // BNBinaryReader* stream + IntPtr stream , + + // uint16_t* result + out ushort result + ); + } +} \ No newline at end of file diff --git a/Function/BNReadLE32.cs b/Function/BNReadLE32.cs new file mode 100644 index 0000000..1ac0acb --- /dev/null +++ b/Function/BNReadLE32.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNReadLE32(BNBinaryReader* stream, uint32_t* result) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNReadLE32" + )] + internal static extern bool BNReadLE32( + + // BNBinaryReader* stream + IntPtr stream , + + // uint32_t* result + out uint result + ); + } +} \ No newline at end of file diff --git a/Function/BNReadLE64.cs b/Function/BNReadLE64.cs new file mode 100644 index 0000000..819ab3c --- /dev/null +++ b/Function/BNReadLE64.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNReadLE64(BNBinaryReader* stream, uint64_t* result) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNReadLE64" + )] + internal static extern bool BNReadLE64( + + // BNBinaryReader* stream + IntPtr stream , + + // uint64_t* result + out ulong result + ); + } +} \ No newline at end of file diff --git a/Function/BNReadPointer.cs b/Function/BNReadPointer.cs new file mode 100644 index 0000000..5be2c74 --- /dev/null +++ b/Function/BNReadPointer.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNReadPointer(BNBinaryView* view, BNBinaryReader* stream, uint64_t* result) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNReadPointer" + )] + internal static extern bool BNReadPointer( + + // BNBinaryView* view + IntPtr view , + + // BNBinaryReader* stream + IntPtr stream , + + // uint64_t* result + out ulong result + ); + } +} \ No newline at end of file diff --git a/Function/BNReadSnapshotData.cs b/Function/BNReadSnapshotData.cs new file mode 100644 index 0000000..0289029 --- /dev/null +++ b/Function/BNReadSnapshotData.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNKeyValueStore* BNReadSnapshotData(BNSnapshot* snapshot) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNReadSnapshotData" + )] + internal static extern IntPtr BNReadSnapshotData( + + // BNSnapshot* snapshot + IntPtr snapshot + + ); + } +} \ No newline at end of file diff --git a/Function/BNReadSnapshotDataWithProgress.cs b/Function/BNReadSnapshotDataWithProgress.cs new file mode 100644 index 0000000..c323c7f --- /dev/null +++ b/Function/BNReadSnapshotDataWithProgress.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNKeyValueStore* BNReadSnapshotDataWithProgress(BNSnapshot* snapshot, void* ctxt, void** progress) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNReadSnapshotDataWithProgress" + )] + internal static extern IntPtr BNReadSnapshotDataWithProgress( + + // BNSnapshot* snapshot + IntPtr snapshot , + + // void* ctxt + IntPtr ctxt , + + // void** progress + IntPtr progress + + ); + } +} \ No newline at end of file diff --git a/Function/BNReadViewBuffer.cs b/Function/BNReadViewBuffer.cs new file mode 100644 index 0000000..c520828 --- /dev/null +++ b/Function/BNReadViewBuffer.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDataBuffer* BNReadViewBuffer(BNBinaryView* view, uint64_t offset, uint64_t len) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNReadViewBuffer" + )] + internal static extern IntPtr BNReadViewBuffer( + + // BNBinaryView* view + IntPtr view , + + // uint64_t offset + ulong offset , + + // uint64_t len + ulong len + ); + } +} \ No newline at end of file diff --git a/Function/BNReadViewData.cs b/Function/BNReadViewData.cs new file mode 100644 index 0000000..a2d193c --- /dev/null +++ b/Function/BNReadViewData.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNReadViewData(BNBinaryView* view, void* dest, uint64_t offset, uint64_t len) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNReadViewData" + )] + internal static extern ulong BNReadViewData( + + // BNBinaryView* view + IntPtr view , + + // void* dest + byte[] dest , + + // uint64_t offset + ulong offset , + + // uint64_t len + ulong len + ); + } +} \ No newline at end of file diff --git a/Function/BNReanalyzeAllFunctions.cs b/Function/BNReanalyzeAllFunctions.cs new file mode 100644 index 0000000..af987d9 --- /dev/null +++ b/Function/BNReanalyzeAllFunctions.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNReanalyzeAllFunctions(BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNReanalyzeAllFunctions" + )] + internal static extern void BNReanalyzeAllFunctions( + + // BNBinaryView* view + IntPtr view + ); + } +} \ No newline at end of file diff --git a/Function/BNReanalyzeFunction.cs b/Function/BNReanalyzeFunction.cs new file mode 100644 index 0000000..332c951 --- /dev/null +++ b/Function/BNReanalyzeFunction.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNReanalyzeFunction(BNFunction* func, BNFunctionUpdateType type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNReanalyzeFunction" + )] + internal static extern void BNReanalyzeFunction( + + // BNFunction* func + IntPtr func , + + // BNFunctionUpdateType type + FunctionUpdateType type + ); + } +} \ No newline at end of file diff --git a/Function/BNRebase.cs b/Function/BNRebase.cs new file mode 100644 index 0000000..8d26671 --- /dev/null +++ b/Function/BNRebase.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRebase(BNBinaryView* data, uint64_t address) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNRebase" + )] + internal static extern bool BNRebase( + + // BNBinaryView* data + IntPtr data , + + // uint64_t address + ulong address + ); + } +} \ No newline at end of file diff --git a/Function/BNRebaseWithProgress.cs b/Function/BNRebaseWithProgress.cs new file mode 100644 index 0000000..a921888 --- /dev/null +++ b/Function/BNRebaseWithProgress.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRebaseWithProgress(BNBinaryView* data, uint64_t address, void* ctxt, void** progress) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNRebaseWithProgress" + )] + internal static extern bool BNRebaseWithProgress( + + // BNBinaryView* data + IntPtr data , + + // uint64_t address + ulong address , + + // void* ctxt + IntPtr ctxt , + + // void* progress + IntPtr progress + ); + } +} \ No newline at end of file diff --git a/Function/BNRecognizePlatformForViewType.cs b/Function/BNRecognizePlatformForViewType.cs new file mode 100644 index 0000000..a78b25a --- /dev/null +++ b/Function/BNRecognizePlatformForViewType.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNPlatform* BNRecognizePlatformForViewType(BNBinaryViewType* type, uint64_t id, BNEndianness endian, BNBinaryView* view, BNMetadata* metadata) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNRecognizePlatformForViewType" + )] + internal static extern IntPtr BNRecognizePlatformForViewType( + + // BNBinaryViewType* type + IntPtr type , + + // uint64_t id + ulong id , + + // BNEndianness endian + Endianness endian , + + // BNBinaryView* view + IntPtr view , + + // BNMetadata* metadata + IntPtr metadata + ); + } +} \ No newline at end of file diff --git a/Function/BNRedo.cs b/Function/BNRedo.cs new file mode 100644 index 0000000..d53f8de --- /dev/null +++ b/Function/BNRedo.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRedo(BNFileMetadata* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNRedo" + )] + internal static extern bool BNRedo( + + // BNFileMetadata* file + IntPtr file + ); + } +} \ No newline at end of file diff --git a/Function/BNRegisterAnalysisMergeConflictSplitter.cs b/Function/BNRegisterAnalysisMergeConflictSplitter.cs new file mode 100644 index 0000000..f586c07 --- /dev/null +++ b/Function/BNRegisterAnalysisMergeConflictSplitter.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNAnalysisMergeConflictSplitter* BNRegisterAnalysisMergeConflictSplitter(BNAnalysisMergeConflictSplitterCallbacks* callbacks) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRegisterAnalysisMergeConflictSplitter" + )] + internal static extern IntPtr BNRegisterAnalysisMergeConflictSplitter( + + // BNAnalysisMergeConflictSplitterCallbacks* callbacks + IntPtr callbacks + + ); + } +} \ No newline at end of file diff --git a/Function/BNRegisterArchitecture.cs b/Function/BNRegisterArchitecture.cs new file mode 100644 index 0000000..b875728 --- /dev/null +++ b/Function/BNRegisterArchitecture.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNArchitecture* BNRegisterArchitecture(const char* name, BNCustomArchitecture* arch) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRegisterArchitecture" + )] + internal static extern IntPtr BNRegisterArchitecture( + + // const char* name + string name , + + // BNCustomArchitecture* arch + IntPtr arch + ); + } +} \ No newline at end of file diff --git a/Function/BNRegisterArchitectureExtension.cs b/Function/BNRegisterArchitectureExtension.cs new file mode 100644 index 0000000..4662e31 --- /dev/null +++ b/Function/BNRegisterArchitectureExtension.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNArchitecture* BNRegisterArchitectureExtension(const char* name, BNArchitecture* @base, BNCustomArchitecture* arch) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRegisterArchitectureExtension" + )] + internal static extern IntPtr BNRegisterArchitectureExtension( + + // const char* name + string name , + + // BNArchitecture* _base + IntPtr _base , + + // BNCustomArchitecture* arch + IntPtr arch + + ); + } +} \ No newline at end of file diff --git a/Function/BNRegisterArchitectureForViewType.cs b/Function/BNRegisterArchitectureForViewType.cs new file mode 100644 index 0000000..37b9bf4 --- /dev/null +++ b/Function/BNRegisterArchitectureForViewType.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRegisterArchitectureForViewType(BNBinaryViewType* type, uint32_t id, BNEndianness endian, BNArchitecture* arch) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNRegisterArchitectureForViewType" + )] + internal static extern void BNRegisterArchitectureForViewType( + + // BNBinaryViewType* type + IntPtr type , + + // uint32_t id + uint id , + + // BNEndianness endian + Endianness endian , + + // BNArchitecture* arch + IntPtr arch + ); + } +} \ No newline at end of file diff --git a/Function/BNRegisterArchitectureFunctionRecognizer.cs b/Function/BNRegisterArchitectureFunctionRecognizer.cs new file mode 100644 index 0000000..fab4eef --- /dev/null +++ b/Function/BNRegisterArchitectureFunctionRecognizer.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRegisterArchitectureFunctionRecognizer(BNArchitecture* arch, BNFunctionRecognizer* rec) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRegisterArchitectureFunctionRecognizer" + )] + internal static extern void BNRegisterArchitectureFunctionRecognizer( + + // BNArchitecture* arch + IntPtr arch , + + // BNFunctionRecognizer* rec + IntPtr rec + + ); + } +} \ No newline at end of file diff --git a/Function/BNRegisterArchitectureHook.cs b/Function/BNRegisterArchitectureHook.cs new file mode 100644 index 0000000..ed153a7 --- /dev/null +++ b/Function/BNRegisterArchitectureHook.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNArchitecture* BNRegisterArchitectureHook(BNArchitecture* @base, BNCustomArchitecture* arch) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRegisterArchitectureHook" + )] + internal static extern IntPtr BNRegisterArchitectureHook( + + // BNArchitecture* _base + IntPtr _base , + + // BNCustomArchitecture* arch + IntPtr arch + + ); + } +} \ No newline at end of file diff --git a/Function/BNRegisterBinaryViewEvent.cs b/Function/BNRegisterBinaryViewEvent.cs new file mode 100644 index 0000000..7dae8c2 --- /dev/null +++ b/Function/BNRegisterBinaryViewEvent.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public static partial class Core + { + public static void RegisterBinaryViewEvent( BinaryViewEventType type ,Action callback) + { + Action adapter = (ctx , view) => + { + callback( BinaryView.MustBorrowHandle(view)); + }; + + NativeMethods.BNRegisterBinaryViewEvent( + type, + Marshal.GetFunctionPointerForDelegate>(adapter), + IntPtr.Zero + ); + } + } + + internal static partial class NativeMethods + { + /// + /// void BNRegisterBinaryViewEvent(BNBinaryViewEventType type, void** callback, void* ctx) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRegisterBinaryViewEvent" + )] + internal static extern void BNRegisterBinaryViewEvent( + + // BNBinaryViewEventType type + BinaryViewEventType type , + + // void** callback + IntPtr callback , + + // void* ctx + IntPtr ctx + ); + } +} \ No newline at end of file diff --git a/Function/BNRegisterBinaryViewType.cs b/Function/BNRegisterBinaryViewType.cs new file mode 100644 index 0000000..a3e7bd6 --- /dev/null +++ b/Function/BNRegisterBinaryViewType.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBinaryViewType* BNRegisterBinaryViewType(const char* name, const char* longName, BNCustomBinaryViewType* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRegisterBinaryViewType" + )] + internal static extern IntPtr BNRegisterBinaryViewType( + + // const char* name + string name , + + // const char* longName + string longName , + + // BNCustomBinaryViewType* type + IntPtr type + ); + } +} \ No newline at end of file diff --git a/Function/BNRegisterCallingConvention.cs b/Function/BNRegisterCallingConvention.cs new file mode 100644 index 0000000..dddb874 --- /dev/null +++ b/Function/BNRegisterCallingConvention.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRegisterCallingConvention(BNArchitecture* arch, BNCallingConvention* cc) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRegisterCallingConvention" + )] + internal static extern void BNRegisterCallingConvention( + + // BNArchitecture* arch + IntPtr arch , + + // BNCallingConvention* cc + IntPtr cc + + ); + } +} \ No newline at end of file diff --git a/Function/BNRegisterDataNotification.cs b/Function/BNRegisterDataNotification.cs new file mode 100644 index 0000000..264d325 --- /dev/null +++ b/Function/BNRegisterDataNotification.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRegisterDataNotification(BNBinaryView* view, BNBinaryDataNotification* notify) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRegisterDataNotification" + )] + internal static extern void BNRegisterDataNotification( + + // BNBinaryView* view + IntPtr view , + + // BNBinaryDataNotification* notify + IntPtr notify + + ); + } +} \ No newline at end of file diff --git a/Function/BNRegisterDebugInfoParser.cs b/Function/BNRegisterDebugInfoParser.cs new file mode 100644 index 0000000..a2e2b57 --- /dev/null +++ b/Function/BNRegisterDebugInfoParser.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDebugInfoParser* BNRegisterDebugInfoParser(const char* name, void** isValid, void** parseInfo, void* context) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRegisterDebugInfoParser" + )] + internal static extern IntPtr BNRegisterDebugInfoParser( + + // const char* name + string name , + + // void** isValid + IntPtr isValid , + + // void** parseInfo + IntPtr parseInfo , + + // void* context + IntPtr context + + ); + } +} \ No newline at end of file diff --git a/Function/BNRegisterDefaultPlatformForViewType.cs b/Function/BNRegisterDefaultPlatformForViewType.cs new file mode 100644 index 0000000..ef6b749 --- /dev/null +++ b/Function/BNRegisterDefaultPlatformForViewType.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRegisterDefaultPlatformForViewType(BNBinaryViewType* type, BNArchitecture* arch, BNPlatform* platform) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNRegisterDefaultPlatformForViewType" + )] + internal static extern void BNRegisterDefaultPlatformForViewType( + + // BNBinaryViewType* type + IntPtr type , + + // BNArchitecture* arch + IntPtr arch , + + // BNPlatform* platform + IntPtr platform + ); + } +} \ No newline at end of file diff --git a/Function/BNRegisterDemangler.cs b/Function/BNRegisterDemangler.cs new file mode 100644 index 0000000..decd686 --- /dev/null +++ b/Function/BNRegisterDemangler.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDemangler* BNRegisterDemangler(const char* name, BNDemanglerCallbacks* callbacks) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRegisterDemangler" + )] + internal static extern IntPtr BNRegisterDemangler( + + // const char* name + string name , + + // BNDemanglerCallbacks* callbacks + IntPtr callbacks + + ); + } +} \ No newline at end of file diff --git a/Function/BNRegisterDownloadProvider.cs b/Function/BNRegisterDownloadProvider.cs new file mode 100644 index 0000000..874bfe0 --- /dev/null +++ b/Function/BNRegisterDownloadProvider.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDownloadProvider* BNRegisterDownloadProvider(const char* name, BNDownloadProviderCallbacks* callbacks) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRegisterDownloadProvider" + )] + internal static extern IntPtr BNRegisterDownloadProvider( + + // const char* name + string name , + + // BNDownloadProviderCallbacks* callbacks + IntPtr callbacks + + ); + } +} \ No newline at end of file diff --git a/Function/BNRegisterEnterpriseServerNotification.cs b/Function/BNRegisterEnterpriseServerNotification.cs new file mode 100644 index 0000000..fc832ef --- /dev/null +++ b/Function/BNRegisterEnterpriseServerNotification.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRegisterEnterpriseServerNotification(BNEnterpriseServerCallbacks* notify) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRegisterEnterpriseServerNotification" + )] + internal static extern void BNRegisterEnterpriseServerNotification( + + // BNEnterpriseServerCallbacks* notify + IntPtr notify + + ); + } +} \ No newline at end of file diff --git a/Function/BNRegisterFlowGraphLayout.cs b/Function/BNRegisterFlowGraphLayout.cs new file mode 100644 index 0000000..45838cb --- /dev/null +++ b/Function/BNRegisterFlowGraphLayout.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFlowGraphLayout* BNRegisterFlowGraphLayout(const char* name, BNCustomFlowGraphLayout* callbacks) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRegisterFlowGraphLayout" + )] + internal static extern IntPtr BNRegisterFlowGraphLayout( + + // const char* name + string name , + + // BNCustomFlowGraphLayout* callbacks + IntPtr callbacks + + ); + } +} \ No newline at end of file diff --git a/Function/BNRegisterGenericDataRenderer.cs b/Function/BNRegisterGenericDataRenderer.cs new file mode 100644 index 0000000..c1c2a79 --- /dev/null +++ b/Function/BNRegisterGenericDataRenderer.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRegisterGenericDataRenderer(BNDataRendererContainer* container, BNDataRenderer* renderer) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRegisterGenericDataRenderer" + )] + internal static extern void BNRegisterGenericDataRenderer( + + // BNDataRendererContainer* container + IntPtr container , + + // BNDataRenderer* renderer + IntPtr renderer + + ); + } +} \ No newline at end of file diff --git a/Function/BNRegisterGlobalFunctionRecognizer.cs b/Function/BNRegisterGlobalFunctionRecognizer.cs new file mode 100644 index 0000000..81afa2d --- /dev/null +++ b/Function/BNRegisterGlobalFunctionRecognizer.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRegisterGlobalFunctionRecognizer(BNFunctionRecognizer* rec) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRegisterGlobalFunctionRecognizer" + )] + internal static extern void BNRegisterGlobalFunctionRecognizer( + + // BNFunctionRecognizer* rec + IntPtr rec + + ); + } +} \ No newline at end of file diff --git a/Function/BNRegisterInteractionHandler.cs b/Function/BNRegisterInteractionHandler.cs new file mode 100644 index 0000000..77ddfb8 --- /dev/null +++ b/Function/BNRegisterInteractionHandler.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRegisterInteractionHandler(BNInteractionHandlerCallbacks* callbacks) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRegisterInteractionHandler" + )] + internal static extern void BNRegisterInteractionHandler( + + // BNInteractionHandlerCallbacks* callbacks + IntPtr callbacks + + ); + } +} \ No newline at end of file diff --git a/Function/BNRegisterLanguageRepresentationFunctionType.cs b/Function/BNRegisterLanguageRepresentationFunctionType.cs new file mode 100644 index 0000000..dd52a08 --- /dev/null +++ b/Function/BNRegisterLanguageRepresentationFunctionType.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLanguageRepresentationFunctionType* BNRegisterLanguageRepresentationFunctionType(const char* name, BNCustomLanguageRepresentationFunctionType* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRegisterLanguageRepresentationFunctionType" + )] + internal static extern IntPtr BNRegisterLanguageRepresentationFunctionType( + + // const char* name + string name , + + // BNCustomLanguageRepresentationFunctionType* type + IntPtr type + + ); + } +} \ No newline at end of file diff --git a/Function/BNRegisterLineFormatter.cs b/Function/BNRegisterLineFormatter.cs new file mode 100644 index 0000000..0cb89e9 --- /dev/null +++ b/Function/BNRegisterLineFormatter.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNLineFormatter* BNRegisterLineFormatter(const char* name, BNCustomLineFormatter* callbacks) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRegisterLineFormatter" + )] + internal static extern IntPtr BNRegisterLineFormatter( + + // const char* name + string name , + + // BNCustomLineFormatter* callbacks + IntPtr callbacks + + ); + } +} \ No newline at end of file diff --git a/Function/BNRegisterLogListener.cs b/Function/BNRegisterLogListener.cs new file mode 100644 index 0000000..2fb1e2e --- /dev/null +++ b/Function/BNRegisterLogListener.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRegisterLogListener(BNLogListener* listener) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNRegisterLogListener" + )] + internal static extern void BNRegisterLogListener( + + // BNLogListener* listener + IntPtr listener + ); + } +} \ No newline at end of file diff --git a/Function/BNRegisterMainThread.cs b/Function/BNRegisterMainThread.cs new file mode 100644 index 0000000..8729694 --- /dev/null +++ b/Function/BNRegisterMainThread.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRegisterMainThread(BNMainThreadCallbacks* callbacks) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRegisterMainThread" + )] + internal static extern void BNRegisterMainThread( + + // BNMainThreadCallbacks* callbacks + IntPtr callbacks + + ); + } +} \ No newline at end of file diff --git a/Function/BNRegisterObjectDestructionCallbacks.cs b/Function/BNRegisterObjectDestructionCallbacks.cs new file mode 100644 index 0000000..a16f2af --- /dev/null +++ b/Function/BNRegisterObjectDestructionCallbacks.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRegisterObjectDestructionCallbacks(BNObjectDestructionCallbacks* callbacks) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRegisterObjectDestructionCallbacks" + )] + internal static extern void BNRegisterObjectDestructionCallbacks( + + // BNObjectDestructionCallbacks* callbacks + IntPtr callbacks + + ); + } +} \ No newline at end of file diff --git a/Function/BNRegisterObjectRefDebugTrace.cs b/Function/BNRegisterObjectRefDebugTrace.cs new file mode 100644 index 0000000..1113a99 --- /dev/null +++ b/Function/BNRegisterObjectRefDebugTrace.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void* BNRegisterObjectRefDebugTrace(const char* typeName) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRegisterObjectRefDebugTrace" + )] + internal static extern IntPtr BNRegisterObjectRefDebugTrace( + + // const char* typeName + string typeName + + ); + } +} \ No newline at end of file diff --git a/Function/BNRegisterPlatform.cs b/Function/BNRegisterPlatform.cs new file mode 100644 index 0000000..638f40c --- /dev/null +++ b/Function/BNRegisterPlatform.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRegisterPlatform(const char* os, BNPlatform* platform) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRegisterPlatform" + )] + internal static extern void BNRegisterPlatform( + + // const char* os + string os , + + // BNPlatform* platform + IntPtr platform + ); + } +} \ No newline at end of file diff --git a/Function/BNRegisterPlatformCallingConvention.cs b/Function/BNRegisterPlatformCallingConvention.cs new file mode 100644 index 0000000..f0db551 --- /dev/null +++ b/Function/BNRegisterPlatformCallingConvention.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRegisterPlatformCallingConvention(BNPlatform* platform, BNCallingConvention* cc) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNRegisterPlatformCallingConvention" + )] + internal static extern void BNRegisterPlatformCallingConvention( + + // BNPlatform* platform + IntPtr platform , + + // BNCallingConvention* cc + IntPtr cc + ); + } +} \ No newline at end of file diff --git a/Function/BNRegisterPlatformCdeclCallingConvention.cs b/Function/BNRegisterPlatformCdeclCallingConvention.cs new file mode 100644 index 0000000..60fdd55 --- /dev/null +++ b/Function/BNRegisterPlatformCdeclCallingConvention.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRegisterPlatformCdeclCallingConvention(BNPlatform* platform, BNCallingConvention* cc) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNRegisterPlatformCdeclCallingConvention" + )] + internal static extern void BNRegisterPlatformCdeclCallingConvention( + + // BNPlatform* platform + IntPtr platform , + + // BNCallingConvention* cc + IntPtr cc + ); + } +} \ No newline at end of file diff --git a/Function/BNRegisterPlatformDefaultCallingConvention.cs b/Function/BNRegisterPlatformDefaultCallingConvention.cs new file mode 100644 index 0000000..ce8d6a2 --- /dev/null +++ b/Function/BNRegisterPlatformDefaultCallingConvention.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRegisterPlatformDefaultCallingConvention(BNPlatform* platform, BNCallingConvention* cc) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNRegisterPlatformDefaultCallingConvention" + )] + internal static extern void BNRegisterPlatformDefaultCallingConvention( + + // BNPlatform* platform + IntPtr platform , + + // BNCallingConvention* cc + IntPtr cc + ); + } +} \ No newline at end of file diff --git a/Function/BNRegisterPlatformFastcallCallingConvention.cs b/Function/BNRegisterPlatformFastcallCallingConvention.cs new file mode 100644 index 0000000..d33c95b --- /dev/null +++ b/Function/BNRegisterPlatformFastcallCallingConvention.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRegisterPlatformFastcallCallingConvention(BNPlatform* platform, BNCallingConvention* cc) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNRegisterPlatformFastcallCallingConvention" + )] + internal static extern void BNRegisterPlatformFastcallCallingConvention( + + // BNPlatform* platform + IntPtr platform , + + // BNCallingConvention* cc + IntPtr cc + ); + } +} \ No newline at end of file diff --git a/Function/BNRegisterPlatformForViewType.cs b/Function/BNRegisterPlatformForViewType.cs new file mode 100644 index 0000000..a22d899 --- /dev/null +++ b/Function/BNRegisterPlatformForViewType.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRegisterPlatformForViewType(BNBinaryViewType* type, uint32_t id, BNArchitecture* arch, BNPlatform* platform) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRegisterPlatformForViewType" + )] + internal static extern void BNRegisterPlatformForViewType( + + // BNBinaryViewType* type + IntPtr type , + + // uint32_t id + uint id , + + // BNArchitecture* arch + IntPtr arch , + + // BNPlatform* platform + IntPtr platform + + ); + } +} \ No newline at end of file diff --git a/Function/BNRegisterPlatformRecognizerForViewType.cs b/Function/BNRegisterPlatformRecognizerForViewType.cs new file mode 100644 index 0000000..a28d88b --- /dev/null +++ b/Function/BNRegisterPlatformRecognizerForViewType.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal delegate IntPtr BNPlatformRecognizeDelegate( + IntPtr ctx, + IntPtr view, + IntPtr metadata + ); + + /// + /// void BNRegisterPlatformRecognizerForViewType(BNBinaryViewType* type, uint64_t id, BNEndianness endian, void** callback, void* ctx) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNRegisterPlatformRecognizerForViewType" + )] + internal static extern void BNRegisterPlatformRecognizerForViewType( + + // BNBinaryViewType* type + IntPtr type , + + // uint64_t id + ulong id , + + // BNEndianness endian + Endianness endian , + + // void* callback + IntPtr callback , + + // void* ctx + IntPtr ctx + ); + } +} \ No newline at end of file diff --git a/Function/BNRegisterPlatformStdcallCallingConvention.cs b/Function/BNRegisterPlatformStdcallCallingConvention.cs new file mode 100644 index 0000000..d1716ec --- /dev/null +++ b/Function/BNRegisterPlatformStdcallCallingConvention.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRegisterPlatformStdcallCallingConvention(BNPlatform* platform, BNCallingConvention* cc) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNRegisterPlatformStdcallCallingConvention" + )] + internal static extern void BNRegisterPlatformStdcallCallingConvention( + + // BNPlatform* platform + IntPtr platform , + + // BNCallingConvention* cc + IntPtr cc + ); + } +} \ No newline at end of file diff --git a/Function/BNRegisterPlatformTypes.cs b/Function/BNRegisterPlatformTypes.cs new file mode 100644 index 0000000..6a80933 --- /dev/null +++ b/Function/BNRegisterPlatformTypes.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRegisterPlatformTypes(BNBinaryView* view, BNPlatform* platform) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNRegisterPlatformTypes" + )] + internal static extern void BNRegisterPlatformTypes( + + // BNBinaryView* view + IntPtr view , + + // BNPlatform* platform + IntPtr platform + ); + } +} \ No newline at end of file diff --git a/Function/BNRegisterPluginCommand.cs b/Function/BNRegisterPluginCommand.cs new file mode 100644 index 0000000..c8fd1d6 --- /dev/null +++ b/Function/BNRegisterPluginCommand.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRegisterPluginCommand(const char* name, const char* description, void** action, void** isValid, void* context) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRegisterPluginCommand" + )] + internal static extern void BNRegisterPluginCommand( + + // const char* name + string name , + + // const char* description + string description , + + // void** action + IntPtr action , + + // void** isValid + IntPtr isValid , + + // void* context + IntPtr context + ); + } +} \ No newline at end of file diff --git a/Function/BNRegisterPluginCommandForAddress.cs b/Function/BNRegisterPluginCommandForAddress.cs new file mode 100644 index 0000000..ba644a5 --- /dev/null +++ b/Function/BNRegisterPluginCommandForAddress.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRegisterPluginCommandForAddress(const char* name, const char* description, void** action, void** isValid, void* context) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRegisterPluginCommandForAddress" + )] + internal static extern void BNRegisterPluginCommandForAddress( + + // const char* name + string name , + + // const char* description + string description , + + // void** action + IntPtr action , + + // void** isValid + IntPtr isValid , + + // void* context + IntPtr context + ); + } +} \ No newline at end of file diff --git a/Function/BNRegisterPluginCommandForFunction.cs b/Function/BNRegisterPluginCommandForFunction.cs new file mode 100644 index 0000000..f1bae22 --- /dev/null +++ b/Function/BNRegisterPluginCommandForFunction.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRegisterPluginCommandForFunction(const char* name, const char* description, void** action, void** isValid, void* context) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRegisterPluginCommandForFunction" + )] + internal static extern void BNRegisterPluginCommandForFunction( + + // const char* name + string name , + + // const char* description + string description , + + // void** action + IntPtr action , + + // void** isValid + IntPtr isValid , + + // void* context + IntPtr context + + ); + } +} \ No newline at end of file diff --git a/Function/BNRegisterPluginCommandForHighLevelILFunction.cs b/Function/BNRegisterPluginCommandForHighLevelILFunction.cs new file mode 100644 index 0000000..0e98e76 --- /dev/null +++ b/Function/BNRegisterPluginCommandForHighLevelILFunction.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRegisterPluginCommandForHighLevelILFunction(const char* name, const char* description, void** action, void** isValid, void* context) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRegisterPluginCommandForHighLevelILFunction" + )] + internal static extern void BNRegisterPluginCommandForHighLevelILFunction( + + // const char* name + string name , + + // const char* description + string description , + + // void** action + IntPtr action , + + // void** isValid + IntPtr isValid , + + // void* context + IntPtr context + + ); + } +} \ No newline at end of file diff --git a/Function/BNRegisterPluginCommandForHighLevelILInstruction.cs b/Function/BNRegisterPluginCommandForHighLevelILInstruction.cs new file mode 100644 index 0000000..468b598 --- /dev/null +++ b/Function/BNRegisterPluginCommandForHighLevelILInstruction.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRegisterPluginCommandForHighLevelILInstruction(const char* name, const char* description, void** action, void** isValid, void* context) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRegisterPluginCommandForHighLevelILInstruction" + )] + internal static extern void BNRegisterPluginCommandForHighLevelILInstruction( + + // const char* name + string name , + + // const char* description + string description , + + // void** action + IntPtr action , + + // void** isValid + IntPtr isValid , + + // void* context + IntPtr context + + ); + } +} \ No newline at end of file diff --git a/Function/BNRegisterPluginCommandForLowLevelILFunction.cs b/Function/BNRegisterPluginCommandForLowLevelILFunction.cs new file mode 100644 index 0000000..f0b9c62 --- /dev/null +++ b/Function/BNRegisterPluginCommandForLowLevelILFunction.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRegisterPluginCommandForLowLevelILFunction(const char* name, const char* description, void** action, void** isValid, void* context) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRegisterPluginCommandForLowLevelILFunction" + )] + internal static extern void BNRegisterPluginCommandForLowLevelILFunction( + + // const char* name + string name , + + // const char* description + string description , + + // void** action + IntPtr action , + + // void** isValid + IntPtr isValid , + + // void* context + IntPtr context + + ); + } +} \ No newline at end of file diff --git a/Function/BNRegisterPluginCommandForLowLevelILInstruction.cs b/Function/BNRegisterPluginCommandForLowLevelILInstruction.cs new file mode 100644 index 0000000..61851cb --- /dev/null +++ b/Function/BNRegisterPluginCommandForLowLevelILInstruction.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRegisterPluginCommandForLowLevelILInstruction(const char* name, const char* description, void** action, void** isValid, void* context) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRegisterPluginCommandForLowLevelILInstruction" + )] + internal static extern void BNRegisterPluginCommandForLowLevelILInstruction( + + // const char* name + string name , + + // const char* description + string description , + + // void** action + IntPtr action , + + // void** isValid + IntPtr isValid , + + // void* context + IntPtr context + + ); + } +} \ No newline at end of file diff --git a/Function/BNRegisterPluginCommandForMediumLevelILFunction.cs b/Function/BNRegisterPluginCommandForMediumLevelILFunction.cs new file mode 100644 index 0000000..48f9e93 --- /dev/null +++ b/Function/BNRegisterPluginCommandForMediumLevelILFunction.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRegisterPluginCommandForMediumLevelILFunction(const char* name, const char* description, void** action, void** isValid, void* context) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRegisterPluginCommandForMediumLevelILFunction" + )] + internal static extern void BNRegisterPluginCommandForMediumLevelILFunction( + + // const char* name + string name , + + // const char* description + string description , + + // void** action + IntPtr action , + + // void** isValid + IntPtr isValid , + + // void* context + IntPtr context + + ); + } +} \ No newline at end of file diff --git a/Function/BNRegisterPluginCommandForMediumLevelILInstruction.cs b/Function/BNRegisterPluginCommandForMediumLevelILInstruction.cs new file mode 100644 index 0000000..592836e --- /dev/null +++ b/Function/BNRegisterPluginCommandForMediumLevelILInstruction.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRegisterPluginCommandForMediumLevelILInstruction(const char* name, const char* description, void** action, void** isValid, void* context) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRegisterPluginCommandForMediumLevelILInstruction" + )] + internal static extern void BNRegisterPluginCommandForMediumLevelILInstruction( + + // const char* name + string name , + + // const char* description + string description , + + // void** action + IntPtr action , + + // void** isValid + IntPtr isValid , + + // void* context + IntPtr context + + ); + } +} \ No newline at end of file diff --git a/Function/BNRegisterPluginCommandForProject.cs b/Function/BNRegisterPluginCommandForProject.cs new file mode 100644 index 0000000..a89a117 --- /dev/null +++ b/Function/BNRegisterPluginCommandForProject.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRegisterPluginCommandForProject(const char* name, const char* description, void** action, void** isValid, void* context) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRegisterPluginCommandForProject" + )] + internal static extern void BNRegisterPluginCommandForProject( + + // const char* name + string name , + + // const char* description + string description , + + // void** action + IntPtr action , + + // void** isValid + IntPtr isValid , + + // void* context + IntPtr context + + ); + } +} \ No newline at end of file diff --git a/Function/BNRegisterPluginCommandForRange.cs b/Function/BNRegisterPluginCommandForRange.cs new file mode 100644 index 0000000..0f32c54 --- /dev/null +++ b/Function/BNRegisterPluginCommandForRange.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRegisterPluginCommandForRange(const char* name, const char* description, void** action, void** isValid, void* context) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRegisterPluginCommandForRange" + )] + internal static extern void BNRegisterPluginCommandForRange( + + // const char* name + string name , + + // const char* description + string description , + + // void** action + IntPtr action , + + // void** isValid + IntPtr isValid , + + // void* context + IntPtr context + + ); + } +} \ No newline at end of file diff --git a/Function/BNRegisterProjectNotification.cs b/Function/BNRegisterProjectNotification.cs new file mode 100644 index 0000000..7b72cf3 --- /dev/null +++ b/Function/BNRegisterProjectNotification.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRegisterProjectNotification(BNProject* project, BNProjectNotification* notify) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRegisterProjectNotification" + )] + internal static extern void BNRegisterProjectNotification( + + // BNProject* project + IntPtr project , + + // BNProjectNotification* notify + IntPtr notify + + ); + } +} \ No newline at end of file diff --git a/Function/BNRegisterRenderLayer.cs b/Function/BNRegisterRenderLayer.cs new file mode 100644 index 0000000..4f4e81e --- /dev/null +++ b/Function/BNRegisterRenderLayer.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRenderLayer* BNRegisterRenderLayer(const char* name, BNRenderLayerCallbacks* callbacks, BNRenderLayerDefaultEnableState enableState) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNRegisterRenderLayer" + )] + internal static extern IntPtr BNRegisterRenderLayer( + + // const char* name + string name , + + // BNRenderLayerCallbacks* callbacks + IntPtr callbacks , + + // BNRenderLayerDefaultEnableState enableState + RenderLayerDefaultEnableState enableState + ); + } +} \ No newline at end of file diff --git a/Function/BNRegisterScriptingInstanceOutputListener.cs b/Function/BNRegisterScriptingInstanceOutputListener.cs new file mode 100644 index 0000000..fd434bd --- /dev/null +++ b/Function/BNRegisterScriptingInstanceOutputListener.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRegisterScriptingInstanceOutputListener(BNScriptingInstance* instance, BNScriptingOutputListener* callbacks) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRegisterScriptingInstanceOutputListener" + )] + internal static extern void BNRegisterScriptingInstanceOutputListener( + + // BNScriptingInstance* instance + IntPtr instance , + + // BNScriptingOutputListener* callbacks + IntPtr callbacks + + ); + } +} \ No newline at end of file diff --git a/Function/BNRegisterScriptingProvider.cs b/Function/BNRegisterScriptingProvider.cs new file mode 100644 index 0000000..0292646 --- /dev/null +++ b/Function/BNRegisterScriptingProvider.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNScriptingProvider* BNRegisterScriptingProvider(const char* name, const char* apiName, BNScriptingProviderCallbacks* callbacks) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRegisterScriptingProvider" + )] + internal static extern IntPtr BNRegisterScriptingProvider( + + // const char* name + string name , + + // const char* apiName + string apiName , + + // BNScriptingProviderCallbacks* callbacks + IntPtr callbacks + + ); + } +} \ No newline at end of file diff --git a/Function/BNRegisterSecretsProvider.cs b/Function/BNRegisterSecretsProvider.cs new file mode 100644 index 0000000..bcfda78 --- /dev/null +++ b/Function/BNRegisterSecretsProvider.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNSecretsProvider* BNRegisterSecretsProvider(const char* name, BNSecretsProviderCallbacks* callbacks) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRegisterSecretsProvider" + )] + internal static extern IntPtr BNRegisterSecretsProvider( + + // const char* name + string name , + + // BNSecretsProviderCallbacks* callbacks + IntPtr callbacks + + ); + } +} \ No newline at end of file diff --git a/Function/BNRegisterTransformType.cs b/Function/BNRegisterTransformType.cs new file mode 100644 index 0000000..6c1d99a --- /dev/null +++ b/Function/BNRegisterTransformType.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTransform* BNRegisterTransformType(BNTransformType type, const char* name, const char* longName, const char* group, BNCustomTransform* xform) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRegisterTransformType" + )] + internal static extern IntPtr BNRegisterTransformType( + + // BNTransformType type + TransformType type , + + // const char* name + string name , + + // const char* longName + string longName , + + // const char* _group + string _group , + + // BNCustomTransform* xform + in BNCustomTransform xform + ); + } +} \ No newline at end of file diff --git a/Function/BNRegisterTransformTypeWithCapabilities.cs b/Function/BNRegisterTransformTypeWithCapabilities.cs new file mode 100644 index 0000000..991643a --- /dev/null +++ b/Function/BNRegisterTransformTypeWithCapabilities.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTransform* BNRegisterTransformTypeWithCapabilities(BNTransformType type, uint32_t capabilities, const char* name, const char* longName, const char* group, BNCustomTransform* xform) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRegisterTransformTypeWithCapabilities" + )] + internal static extern IntPtr BNRegisterTransformTypeWithCapabilities( + + // BNTransformType type + TransformType type , + + // uint32_t capabilities + uint capabilities , + + // const char* name + string name , + + // const char* longName + string longName , + + // const char* _group + string _group , + + // BNCustomTransform* xform + in BNCustomTransform xform + ); + } +} \ No newline at end of file diff --git a/Function/BNRegisterTypeArchiveNotification.cs b/Function/BNRegisterTypeArchiveNotification.cs new file mode 100644 index 0000000..5447b60 --- /dev/null +++ b/Function/BNRegisterTypeArchiveNotification.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRegisterTypeArchiveNotification(BNTypeArchive* archive, BNTypeArchiveNotification* notification) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRegisterTypeArchiveNotification" + )] + internal static extern void BNRegisterTypeArchiveNotification( + + // BNTypeArchive* archive + IntPtr archive , + + // BNTypeArchiveNotification* notification + IntPtr notification + + ); + } +} \ No newline at end of file diff --git a/Function/BNRegisterTypeParser.cs b/Function/BNRegisterTypeParser.cs new file mode 100644 index 0000000..070f1ab --- /dev/null +++ b/Function/BNRegisterTypeParser.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeParser* BNRegisterTypeParser(const char* name, BNTypeParserCallbacks* callbacks) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRegisterTypeParser" + )] + internal static extern IntPtr BNRegisterTypeParser( + + // const char* name + string name , + + // BNTypeParserCallbacks* callbacks + IntPtr callbacks + + ); + } +} \ No newline at end of file diff --git a/Function/BNRegisterTypePrinter.cs b/Function/BNRegisterTypePrinter.cs new file mode 100644 index 0000000..d9f7743 --- /dev/null +++ b/Function/BNRegisterTypePrinter.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypePrinter* BNRegisterTypePrinter(const char* name, BNTypePrinterCallbacks* callbacks) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRegisterTypePrinter" + )] + internal static extern IntPtr BNRegisterTypePrinter( + + // const char* name + string name , + + // BNTypePrinterCallbacks* callbacks + IntPtr callbacks + + ); + } +} \ No newline at end of file diff --git a/Function/BNRegisterTypeSpecificDataRenderer.cs b/Function/BNRegisterTypeSpecificDataRenderer.cs new file mode 100644 index 0000000..03eea83 --- /dev/null +++ b/Function/BNRegisterTypeSpecificDataRenderer.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRegisterTypeSpecificDataRenderer(BNDataRendererContainer* container, BNDataRenderer* renderer) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRegisterTypeSpecificDataRenderer" + )] + internal static extern void BNRegisterTypeSpecificDataRenderer( + + // BNDataRendererContainer* container + IntPtr container , + + // BNDataRenderer* renderer + IntPtr renderer + + ); + } +} \ No newline at end of file diff --git a/Function/BNRegisterWebsocketProvider.cs b/Function/BNRegisterWebsocketProvider.cs new file mode 100644 index 0000000..8db9268 --- /dev/null +++ b/Function/BNRegisterWebsocketProvider.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNWebsocketProvider* BNRegisterWebsocketProvider(const char* name, BNWebsocketProviderCallbacks* callbacks) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRegisterWebsocketProvider" + )] + internal static extern IntPtr BNRegisterWebsocketProvider( + + // const char* name + string name , + + // BNWebsocketProviderCallbacks* callbacks + IntPtr callbacks + + ); + } +} \ No newline at end of file diff --git a/Function/BNRegisterWorkflow.cs b/Function/BNRegisterWorkflow.cs new file mode 100644 index 0000000..fc466cb --- /dev/null +++ b/Function/BNRegisterWorkflow.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRegisterWorkflow(BNWorkflow* workflow, const char* configuration) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRegisterWorkflow" + )] + internal static extern bool BNRegisterWorkflow( + + // BNWorkflow* workflow + IntPtr workflow , + + // const char* configuration + string configuration + ); + } +} \ No newline at end of file diff --git a/Function/BNReleaseAdvancedFunctionAnalysisData.cs b/Function/BNReleaseAdvancedFunctionAnalysisData.cs new file mode 100644 index 0000000..6612805 --- /dev/null +++ b/Function/BNReleaseAdvancedFunctionAnalysisData.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNReleaseAdvancedFunctionAnalysisData(BNFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNReleaseAdvancedFunctionAnalysisData" + )] + internal static extern void BNReleaseAdvancedFunctionAnalysisData( + + // BNFunction* func + IntPtr func + + ); + } +} \ No newline at end of file diff --git a/Function/BNReleaseAdvancedFunctionAnalysisDataMultiple.cs b/Function/BNReleaseAdvancedFunctionAnalysisDataMultiple.cs new file mode 100644 index 0000000..38f36f4 --- /dev/null +++ b/Function/BNReleaseAdvancedFunctionAnalysisDataMultiple.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNReleaseAdvancedFunctionAnalysisDataMultiple(BNFunction* func, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNReleaseAdvancedFunctionAnalysisDataMultiple" + )] + internal static extern void BNReleaseAdvancedFunctionAnalysisDataMultiple( + + // BNFunction* func + IntPtr func , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNReleaseEnterpriseServerLicense.cs b/Function/BNReleaseEnterpriseServerLicense.cs new file mode 100644 index 0000000..c7048bb --- /dev/null +++ b/Function/BNReleaseEnterpriseServerLicense.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNReleaseEnterpriseServerLicense() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNReleaseEnterpriseServerLicense" + )] + internal static extern bool BNReleaseEnterpriseServerLicense( + + ); + } +} \ No newline at end of file diff --git a/Function/BNRelocationGetArchitecture.cs b/Function/BNRelocationGetArchitecture.cs new file mode 100644 index 0000000..adcac4c --- /dev/null +++ b/Function/BNRelocationGetArchitecture.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNArchitecture* BNRelocationGetArchitecture(BNRelocation* reloc) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRelocationGetArchitecture" + )] + internal static extern IntPtr BNRelocationGetArchitecture( + + // BNRelocation* reloc + IntPtr reloc + + ); + } +} \ No newline at end of file diff --git a/Function/BNRelocationGetInfo.cs b/Function/BNRelocationGetInfo.cs new file mode 100644 index 0000000..312475d --- /dev/null +++ b/Function/BNRelocationGetInfo.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRelocationInfo BNRelocationGetInfo(BNRelocation* reloc) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRelocationGetInfo" + )] + internal static extern BNRelocationInfo BNRelocationGetInfo( + + // BNRelocation* reloc + IntPtr reloc + + ); + } +} \ No newline at end of file diff --git a/Function/BNRelocationGetReloc.cs b/Function/BNRelocationGetReloc.cs new file mode 100644 index 0000000..8557d83 --- /dev/null +++ b/Function/BNRelocationGetReloc.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNRelocationGetReloc(BNRelocation* reloc) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRelocationGetReloc" + )] + internal static extern ulong BNRelocationGetReloc( + + // BNRelocation* reloc + IntPtr reloc + + ); + } +} \ No newline at end of file diff --git a/Function/BNRelocationGetSymbol.cs b/Function/BNRelocationGetSymbol.cs new file mode 100644 index 0000000..3a2b95d --- /dev/null +++ b/Function/BNRelocationGetSymbol.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNSymbol* BNRelocationGetSymbol(BNRelocation* reloc) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRelocationGetSymbol" + )] + internal static extern IntPtr BNRelocationGetSymbol( + + // BNRelocation* reloc + IntPtr reloc + + ); + } +} \ No newline at end of file diff --git a/Function/BNRelocationGetTarget.cs b/Function/BNRelocationGetTarget.cs new file mode 100644 index 0000000..d4f630f --- /dev/null +++ b/Function/BNRelocationGetTarget.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNRelocationGetTarget(BNRelocation* reloc) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRelocationGetTarget" + )] + internal static extern ulong BNRelocationGetTarget( + + // BNRelocation* reloc + IntPtr reloc + + ); + } +} \ No newline at end of file diff --git a/Function/BNRelocationHandlerApplyRelocation.cs b/Function/BNRelocationHandlerApplyRelocation.cs new file mode 100644 index 0000000..ad3d15b --- /dev/null +++ b/Function/BNRelocationHandlerApplyRelocation.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRelocationHandlerApplyRelocation(BNRelocationHandler* handler, BNBinaryView* view, BNArchitecture* arch, BNRelocation* reloc, uint8_t* dest, uint64_t len) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRelocationHandlerApplyRelocation" + )] + internal static extern bool BNRelocationHandlerApplyRelocation( + + // BNRelocationHandler* handler + IntPtr handler , + + // BNBinaryView* view + IntPtr view , + + // BNArchitecture* arch + IntPtr arch , + + // BNRelocation* reloc + IntPtr reloc , + + // uint8_t* dest + IntPtr dest , + + // uint64_t len + ulong len + + ); + } +} \ No newline at end of file diff --git a/Function/BNRelocationHandlerDefaultApplyRelocation.cs b/Function/BNRelocationHandlerDefaultApplyRelocation.cs new file mode 100644 index 0000000..10b7dea --- /dev/null +++ b/Function/BNRelocationHandlerDefaultApplyRelocation.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRelocationHandlerDefaultApplyRelocation(BNRelocationHandler* handler, BNBinaryView* view, BNArchitecture* arch, BNRelocation* reloc, uint8_t* dest, uint64_t len) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRelocationHandlerDefaultApplyRelocation" + )] + internal static extern bool BNRelocationHandlerDefaultApplyRelocation( + + // BNRelocationHandler* handler + IntPtr handler , + + // BNBinaryView* view + IntPtr view , + + // BNArchitecture* arch + IntPtr arch , + + // BNRelocation* reloc + IntPtr reloc , + + // uint8_t* dest + IntPtr dest , + + // uint64_t len + ulong len + + ); + } +} \ No newline at end of file diff --git a/Function/BNRelocationHandlerGetOperandForExternalRelocation.cs b/Function/BNRelocationHandlerGetOperandForExternalRelocation.cs new file mode 100644 index 0000000..5b073b0 --- /dev/null +++ b/Function/BNRelocationHandlerGetOperandForExternalRelocation.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNRelocationHandlerGetOperandForExternalRelocation(BNRelocationHandler* handler, uint8_t* data, uint64_t addr, uint64_t length, BNLowLevelILFunction* il, BNRelocation* relocation) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRelocationHandlerGetOperandForExternalRelocation" + )] + internal static extern ulong BNRelocationHandlerGetOperandForExternalRelocation( + + // BNRelocationHandler* handler + IntPtr handler , + + // uint8_t* data + IntPtr data , + + // uint64_t addr + ulong addr , + + // uint64_t length + ulong length , + + // BNLowLevelILFunction* il + IntPtr il , + + // BNRelocation* relocation + IntPtr relocation + + ); + } +} \ No newline at end of file diff --git a/Function/BNRelocationHandlerGetRelocationInfo.cs b/Function/BNRelocationHandlerGetRelocationInfo.cs new file mode 100644 index 0000000..1b8eaa6 --- /dev/null +++ b/Function/BNRelocationHandlerGetRelocationInfo.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRelocationHandlerGetRelocationInfo(BNRelocationHandler* handler, BNBinaryView* data, BNArchitecture* arch, BNRelocationInfo* info, uint64_t infoCount) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRelocationHandlerGetRelocationInfo" + )] + internal static extern bool BNRelocationHandlerGetRelocationInfo( + + // BNRelocationHandler* handler + IntPtr handler , + + // BNBinaryView* data + IntPtr data , + + // BNArchitecture* arch + IntPtr arch , + + // BNRelocationInfo* info + IntPtr info , + + // uint64_t infoCount + ulong infoCount + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteConnect.cs b/Function/BNRemoteConnect.cs new file mode 100644 index 0000000..4244ebd --- /dev/null +++ b/Function/BNRemoteConnect.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRemoteConnect(BNRemote* remote, const char* username, const char* token) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteConnect" + )] + internal static extern bool BNRemoteConnect( + + // BNRemote* remote + IntPtr remote , + + // const char* username + string username , + + // const char* token + string token + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteCreateGroup.cs b/Function/BNRemoteCreateGroup.cs new file mode 100644 index 0000000..9cf8c17 --- /dev/null +++ b/Function/BNRemoteCreateGroup.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNCollaborationGroup* BNRemoteCreateGroup(BNRemote* remote, const char* name, const char** usernames, uint64_t usernameCount) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteCreateGroup" + )] + internal static extern IntPtr BNRemoteCreateGroup( + + // BNRemote* remote + IntPtr remote , + + // const char* name + string name , + + // const char** usernames + string[] usernames , + + // uint64_t usernameCount + ulong usernameCount + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteCreateProject.cs b/Function/BNRemoteCreateProject.cs new file mode 100644 index 0000000..a75b214 --- /dev/null +++ b/Function/BNRemoteCreateProject.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRemoteProject* BNRemoteCreateProject(BNRemote* remote, const char* name, const char* description) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteCreateProject" + )] + internal static extern IntPtr BNRemoteCreateProject( + + // BNRemote* remote + IntPtr remote , + + // const char* name + string name , + + // const char* description + string description + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteCreateUser.cs b/Function/BNRemoteCreateUser.cs new file mode 100644 index 0000000..42c1448 --- /dev/null +++ b/Function/BNRemoteCreateUser.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNCollaborationUser* BNRemoteCreateUser(BNRemote* remote, const char* username, const char* email, bool isActive, const char* password, uint64_t* groupIds, uint64_t groupIdCount, uint64_t* userPermissionIds, uint64_t userPermissionIdCount) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteCreateUser" + )] + internal static extern IntPtr BNRemoteCreateUser( + + // BNRemote* remote + IntPtr remote , + + // const char* username + string username , + + // const char* email + string email , + + // bool isActive + bool isActive , + + // const char* password + string password , + + // uint64_t* groupIds + IntPtr groupIds , + + // uint64_t groupIdCount + ulong groupIdCount , + + // uint64_t* userPermissionIds + IntPtr userPermissionIds , + + // uint64_t userPermissionIdCount + ulong userPermissionIdCount + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteDeleteGroup.cs b/Function/BNRemoteDeleteGroup.cs new file mode 100644 index 0000000..c961035 --- /dev/null +++ b/Function/BNRemoteDeleteGroup.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRemoteDeleteGroup(BNRemote* remote, BNCollaborationGroup* group) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteDeleteGroup" + )] + internal static extern bool BNRemoteDeleteGroup( + + // BNRemote* remote + IntPtr remote , + + // BNCollaborationGroup* _group + IntPtr _group + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteDeleteProject.cs b/Function/BNRemoteDeleteProject.cs new file mode 100644 index 0000000..f337c93 --- /dev/null +++ b/Function/BNRemoteDeleteProject.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRemoteDeleteProject(BNRemote* remote, BNRemoteProject* project) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteDeleteProject" + )] + internal static extern bool BNRemoteDeleteProject( + + // BNRemote* remote + IntPtr remote , + + // BNRemoteProject* project + IntPtr project + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteDisconnect.cs b/Function/BNRemoteDisconnect.cs new file mode 100644 index 0000000..a76da54 --- /dev/null +++ b/Function/BNRemoteDisconnect.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRemoteDisconnect(BNRemote* remote) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteDisconnect" + )] + internal static extern bool BNRemoteDisconnect( + + // BNRemote* remote + IntPtr remote + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteFileCreateSnapshot.cs b/Function/BNRemoteFileCreateSnapshot.cs new file mode 100644 index 0000000..5c9b651 --- /dev/null +++ b/Function/BNRemoteFileCreateSnapshot.cs @@ -0,0 +1,59 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNCollaborationSnapshot* BNRemoteFileCreateSnapshot(BNRemoteFile* file, const char* name, uint8_t* contents, uint64_t contentsSize, uint8_t* analysisCacheContents, uint64_t analysisCacheContentsSize, uint8_t* fileContents, uint64_t fileContentsSize, const char** parentIds, uint64_t parentIdCount, void** progress, void* progressContext) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteFileCreateSnapshot" + )] + internal static extern IntPtr BNRemoteFileCreateSnapshot( + + // BNRemoteFile* file + IntPtr file , + + // const char* name + string name , + + // uint8_t* contents + IntPtr contents , + + // uint64_t contentsSize + ulong contentsSize , + + // uint8_t* analysisCacheContents + IntPtr analysisCacheContents , + + // uint64_t analysisCacheContentsSize + ulong analysisCacheContentsSize , + + // uint8_t* fileContents + IntPtr fileContents , + + // uint64_t fileContentsSize + ulong fileContentsSize , + + // const char** parentIds + string[] parentIds , + + // uint64_t parentIdCount + ulong parentIdCount , + + // void** progress + IntPtr progress , + + // void* progressContext + IntPtr progressContext + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteFileDeleteSnapshot.cs b/Function/BNRemoteFileDeleteSnapshot.cs new file mode 100644 index 0000000..ebcd6b8 --- /dev/null +++ b/Function/BNRemoteFileDeleteSnapshot.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRemoteFileDeleteSnapshot(BNRemoteFile* file, BNCollaborationSnapshot* snapshot) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteFileDeleteSnapshot" + )] + internal static extern bool BNRemoteFileDeleteSnapshot( + + // BNRemoteFile* file + IntPtr file , + + // BNCollaborationSnapshot* snapshot + IntPtr snapshot + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteFileDownload.cs b/Function/BNRemoteFileDownload.cs new file mode 100644 index 0000000..14ea8b8 --- /dev/null +++ b/Function/BNRemoteFileDownload.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRemoteFileDownload(BNRemoteFile* file, void** progress, void* progressCtxt, uint8_t** data, uint64_t* size) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteFileDownload" + )] + internal static extern bool BNRemoteFileDownload( + + // BNRemoteFile* file + IntPtr file , + + // void** progress + IntPtr progress , + + // void* progressCtxt + IntPtr progressCtxt , + + // uint8_t** data + IntPtr data , + + // uint64_t* size + IntPtr size + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteFileGetChatLogUrl.cs b/Function/BNRemoteFileGetChatLogUrl.cs new file mode 100644 index 0000000..5231d35 --- /dev/null +++ b/Function/BNRemoteFileGetChatLogUrl.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNRemoteFileGetChatLogUrl(BNRemoteFile* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteFileGetChatLogUrl" + )] + internal static extern IntPtr BNRemoteFileGetChatLogUrl( + + // BNRemoteFile* file + IntPtr file + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteFileGetCoreFile.cs b/Function/BNRemoteFileGetCoreFile.cs new file mode 100644 index 0000000..c23214d --- /dev/null +++ b/Function/BNRemoteFileGetCoreFile.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNProjectFile* BNRemoteFileGetCoreFile(BNRemoteFile* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteFileGetCoreFile" + )] + internal static extern IntPtr BNRemoteFileGetCoreFile( + + // BNRemoteFile* file + IntPtr file + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteFileGetCreated.cs b/Function/BNRemoteFileGetCreated.cs new file mode 100644 index 0000000..ee5b716 --- /dev/null +++ b/Function/BNRemoteFileGetCreated.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// int64_t BNRemoteFileGetCreated(BNRemoteFile* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteFileGetCreated" + )] + internal static extern long BNRemoteFileGetCreated( + + // BNRemoteFile* file + IntPtr file + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteFileGetCreatedBy.cs b/Function/BNRemoteFileGetCreatedBy.cs new file mode 100644 index 0000000..223b5cc --- /dev/null +++ b/Function/BNRemoteFileGetCreatedBy.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNRemoteFileGetCreatedBy(BNRemoteFile* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteFileGetCreatedBy" + )] + internal static extern IntPtr BNRemoteFileGetCreatedBy( + + // BNRemoteFile* file + IntPtr file + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteFileGetDescription.cs b/Function/BNRemoteFileGetDescription.cs new file mode 100644 index 0000000..52c73af --- /dev/null +++ b/Function/BNRemoteFileGetDescription.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNRemoteFileGetDescription(BNRemoteFile* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteFileGetDescription" + )] + internal static extern IntPtr BNRemoteFileGetDescription( + + // BNRemoteFile* file + IntPtr file + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteFileGetFolder.cs b/Function/BNRemoteFileGetFolder.cs new file mode 100644 index 0000000..b31f0c1 --- /dev/null +++ b/Function/BNRemoteFileGetFolder.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRemoteFolder* BNRemoteFileGetFolder(BNRemoteFile* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteFileGetFolder" + )] + internal static extern IntPtr BNRemoteFileGetFolder( + + // BNRemoteFile* file + IntPtr file + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteFileGetHash.cs b/Function/BNRemoteFileGetHash.cs new file mode 100644 index 0000000..42e6adf --- /dev/null +++ b/Function/BNRemoteFileGetHash.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNRemoteFileGetHash(BNRemoteFile* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteFileGetHash" + )] + internal static extern IntPtr BNRemoteFileGetHash( + + // BNRemoteFile* file + IntPtr file + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteFileGetId.cs b/Function/BNRemoteFileGetId.cs new file mode 100644 index 0000000..f3dfd1b --- /dev/null +++ b/Function/BNRemoteFileGetId.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNRemoteFileGetId(BNRemoteFile* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteFileGetId" + )] + internal static extern IntPtr BNRemoteFileGetId( + + // BNRemoteFile* file + IntPtr file + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteFileGetLastModified.cs b/Function/BNRemoteFileGetLastModified.cs new file mode 100644 index 0000000..7494148 --- /dev/null +++ b/Function/BNRemoteFileGetLastModified.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// int64_t BNRemoteFileGetLastModified(BNRemoteFile* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteFileGetLastModified" + )] + internal static extern long BNRemoteFileGetLastModified( + + // BNRemoteFile* file + IntPtr file + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteFileGetLastSnapshot.cs b/Function/BNRemoteFileGetLastSnapshot.cs new file mode 100644 index 0000000..173a4d4 --- /dev/null +++ b/Function/BNRemoteFileGetLastSnapshot.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// int64_t BNRemoteFileGetLastSnapshot(BNRemoteFile* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteFileGetLastSnapshot" + )] + internal static extern long BNRemoteFileGetLastSnapshot( + + // BNRemoteFile* file + IntPtr file + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteFileGetLastSnapshotBy.cs b/Function/BNRemoteFileGetLastSnapshotBy.cs new file mode 100644 index 0000000..33f55b2 --- /dev/null +++ b/Function/BNRemoteFileGetLastSnapshotBy.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNRemoteFileGetLastSnapshotBy(BNRemoteFile* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteFileGetLastSnapshotBy" + )] + internal static extern IntPtr BNRemoteFileGetLastSnapshotBy( + + // BNRemoteFile* file + IntPtr file + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteFileGetLastSnapshotName.cs b/Function/BNRemoteFileGetLastSnapshotName.cs new file mode 100644 index 0000000..a12ff0b --- /dev/null +++ b/Function/BNRemoteFileGetLastSnapshotName.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNRemoteFileGetLastSnapshotName(BNRemoteFile* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteFileGetLastSnapshotName" + )] + internal static extern IntPtr BNRemoteFileGetLastSnapshotName( + + // BNRemoteFile* file + IntPtr file + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteFileGetMetadata.cs b/Function/BNRemoteFileGetMetadata.cs new file mode 100644 index 0000000..b43a9ed --- /dev/null +++ b/Function/BNRemoteFileGetMetadata.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNRemoteFileGetMetadata(BNRemoteFile* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteFileGetMetadata" + )] + internal static extern IntPtr BNRemoteFileGetMetadata( + + // BNRemoteFile* file + IntPtr file + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteFileGetName.cs b/Function/BNRemoteFileGetName.cs new file mode 100644 index 0000000..1dbac03 --- /dev/null +++ b/Function/BNRemoteFileGetName.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNRemoteFileGetName(BNRemoteFile* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteFileGetName" + )] + internal static extern IntPtr BNRemoteFileGetName( + + // BNRemoteFile* file + IntPtr file + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteFileGetProject.cs b/Function/BNRemoteFileGetProject.cs new file mode 100644 index 0000000..cb685ce --- /dev/null +++ b/Function/BNRemoteFileGetProject.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRemoteProject* BNRemoteFileGetProject(BNRemoteFile* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteFileGetProject" + )] + internal static extern IntPtr BNRemoteFileGetProject( + + // BNRemoteFile* file + IntPtr file + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteFileGetRemote.cs b/Function/BNRemoteFileGetRemote.cs new file mode 100644 index 0000000..c643bde --- /dev/null +++ b/Function/BNRemoteFileGetRemote.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRemote* BNRemoteFileGetRemote(BNRemoteFile* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteFileGetRemote" + )] + internal static extern IntPtr BNRemoteFileGetRemote( + + // BNRemoteFile* file + IntPtr file + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteFileGetSize.cs b/Function/BNRemoteFileGetSize.cs new file mode 100644 index 0000000..98b2d87 --- /dev/null +++ b/Function/BNRemoteFileGetSize.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNRemoteFileGetSize(BNRemoteFile* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteFileGetSize" + )] + internal static extern ulong BNRemoteFileGetSize( + + // BNRemoteFile* file + IntPtr file + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteFileGetSnapshotById.cs b/Function/BNRemoteFileGetSnapshotById.cs new file mode 100644 index 0000000..4dc0c0c --- /dev/null +++ b/Function/BNRemoteFileGetSnapshotById.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNCollaborationSnapshot* BNRemoteFileGetSnapshotById(BNRemoteFile* file, const char* id) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteFileGetSnapshotById" + )] + internal static extern IntPtr BNRemoteFileGetSnapshotById( + + // BNRemoteFile* file + IntPtr file , + + // const char* id + string id + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteFileGetSnapshots.cs b/Function/BNRemoteFileGetSnapshots.cs new file mode 100644 index 0000000..e20e19b --- /dev/null +++ b/Function/BNRemoteFileGetSnapshots.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNCollaborationSnapshot** BNRemoteFileGetSnapshots(BNRemoteFile* file, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteFileGetSnapshots" + )] + internal static extern IntPtr BNRemoteFileGetSnapshots( + + // BNRemoteFile* file + IntPtr file , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteFileGetType.cs b/Function/BNRemoteFileGetType.cs new file mode 100644 index 0000000..de3d392 --- /dev/null +++ b/Function/BNRemoteFileGetType.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRemoteFileType BNRemoteFileGetType(BNRemoteFile* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteFileGetType" + )] + internal static extern RemoteFileType BNRemoteFileGetType( + + // BNRemoteFile* file + IntPtr file + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteFileGetUrl.cs b/Function/BNRemoteFileGetUrl.cs new file mode 100644 index 0000000..062dda0 --- /dev/null +++ b/Function/BNRemoteFileGetUrl.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNRemoteFileGetUrl(BNRemoteFile* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteFileGetUrl" + )] + internal static extern IntPtr BNRemoteFileGetUrl( + + // BNRemoteFile* file + IntPtr file + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteFileGetUserPositionsUrl.cs b/Function/BNRemoteFileGetUserPositionsUrl.cs new file mode 100644 index 0000000..68d4dda --- /dev/null +++ b/Function/BNRemoteFileGetUserPositionsUrl.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNRemoteFileGetUserPositionsUrl(BNRemoteFile* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteFileGetUserPositionsUrl" + )] + internal static extern IntPtr BNRemoteFileGetUserPositionsUrl( + + // BNRemoteFile* file + IntPtr file + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteFileHasPulledSnapshots.cs b/Function/BNRemoteFileHasPulledSnapshots.cs new file mode 100644 index 0000000..f2ed8b9 --- /dev/null +++ b/Function/BNRemoteFileHasPulledSnapshots.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRemoteFileHasPulledSnapshots(BNRemoteFile* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteFileHasPulledSnapshots" + )] + internal static extern bool BNRemoteFileHasPulledSnapshots( + + // BNRemoteFile* file + IntPtr file + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteFilePullSnapshots.cs b/Function/BNRemoteFilePullSnapshots.cs new file mode 100644 index 0000000..f7cc8f6 --- /dev/null +++ b/Function/BNRemoteFilePullSnapshots.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRemoteFilePullSnapshots(BNRemoteFile* file, void** progress, void* progressContext) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteFilePullSnapshots" + )] + internal static extern bool BNRemoteFilePullSnapshots( + + // BNRemoteFile* file + IntPtr file , + + // void** progress + IntPtr progress , + + // void* progressContext + IntPtr progressContext + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteFileRequestChatLog.cs b/Function/BNRemoteFileRequestChatLog.cs new file mode 100644 index 0000000..d8070a9 --- /dev/null +++ b/Function/BNRemoteFileRequestChatLog.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNRemoteFileRequestChatLog(BNRemoteFile* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteFileRequestChatLog" + )] + internal static extern IntPtr BNRemoteFileRequestChatLog( + + // BNRemoteFile* file + IntPtr file + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteFileRequestUserPositions.cs b/Function/BNRemoteFileRequestUserPositions.cs new file mode 100644 index 0000000..f4a88f2 --- /dev/null +++ b/Function/BNRemoteFileRequestUserPositions.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNRemoteFileRequestUserPositions(BNRemoteFile* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteFileRequestUserPositions" + )] + internal static extern IntPtr BNRemoteFileRequestUserPositions( + + // BNRemoteFile* file + IntPtr file + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteFileSetDescription.cs b/Function/BNRemoteFileSetDescription.cs new file mode 100644 index 0000000..2356ef5 --- /dev/null +++ b/Function/BNRemoteFileSetDescription.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRemoteFileSetDescription(BNRemoteFile* file, const char* description) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteFileSetDescription" + )] + internal static extern bool BNRemoteFileSetDescription( + + // BNRemoteFile* file + IntPtr file , + + // const char* description + string description + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteFileSetFolder.cs b/Function/BNRemoteFileSetFolder.cs new file mode 100644 index 0000000..d3dc0e7 --- /dev/null +++ b/Function/BNRemoteFileSetFolder.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRemoteFileSetFolder(BNRemoteFile* file, BNRemoteFolder* folder) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteFileSetFolder" + )] + internal static extern bool BNRemoteFileSetFolder( + + // BNRemoteFile* file + IntPtr file , + + // BNRemoteFolder* folder + IntPtr folder + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteFileSetMetadata.cs b/Function/BNRemoteFileSetMetadata.cs new file mode 100644 index 0000000..1c98a24 --- /dev/null +++ b/Function/BNRemoteFileSetMetadata.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRemoteFileSetMetadata(BNRemoteFile* file, const char* metadata) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteFileSetMetadata" + )] + internal static extern bool BNRemoteFileSetMetadata( + + // BNRemoteFile* file + IntPtr file , + + // const char* metadata + string metadata + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteFileSetName.cs b/Function/BNRemoteFileSetName.cs new file mode 100644 index 0000000..5f930ef --- /dev/null +++ b/Function/BNRemoteFileSetName.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRemoteFileSetName(BNRemoteFile* file, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteFileSetName" + )] + internal static extern bool BNRemoteFileSetName( + + // BNRemoteFile* file + IntPtr file , + + // const char* name + string name + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteFolderGetCoreFolder.cs b/Function/BNRemoteFolderGetCoreFolder.cs new file mode 100644 index 0000000..789c60a --- /dev/null +++ b/Function/BNRemoteFolderGetCoreFolder.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNProjectFolder* BNRemoteFolderGetCoreFolder(BNRemoteFolder* folder) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteFolderGetCoreFolder" + )] + internal static extern IntPtr BNRemoteFolderGetCoreFolder( + + // BNRemoteFolder* folder + IntPtr folder + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteFolderGetDescription.cs b/Function/BNRemoteFolderGetDescription.cs new file mode 100644 index 0000000..f80aecd --- /dev/null +++ b/Function/BNRemoteFolderGetDescription.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNRemoteFolderGetDescription(BNRemoteFolder* folder) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteFolderGetDescription" + )] + internal static extern IntPtr BNRemoteFolderGetDescription( + + // BNRemoteFolder* folder + IntPtr folder + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteFolderGetId.cs b/Function/BNRemoteFolderGetId.cs new file mode 100644 index 0000000..92582aa --- /dev/null +++ b/Function/BNRemoteFolderGetId.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNRemoteFolderGetId(BNRemoteFolder* folder) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteFolderGetId" + )] + internal static extern IntPtr BNRemoteFolderGetId( + + // BNRemoteFolder* folder + IntPtr folder + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteFolderGetName.cs b/Function/BNRemoteFolderGetName.cs new file mode 100644 index 0000000..ef9d06b --- /dev/null +++ b/Function/BNRemoteFolderGetName.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNRemoteFolderGetName(BNRemoteFolder* folder) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteFolderGetName" + )] + internal static extern IntPtr BNRemoteFolderGetName( + + // BNRemoteFolder* folder + IntPtr folder + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteFolderGetParent.cs b/Function/BNRemoteFolderGetParent.cs new file mode 100644 index 0000000..d6dd49a --- /dev/null +++ b/Function/BNRemoteFolderGetParent.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRemoteFolderGetParent(BNRemoteFolder* folder, BNRemoteFolder** parent) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteFolderGetParent" + )] + internal static extern bool BNRemoteFolderGetParent( + + // BNRemoteFolder* folder + IntPtr folder , + + // BNRemoteFolder** parent + IntPtr parent + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteFolderGetParentId.cs b/Function/BNRemoteFolderGetParentId.cs new file mode 100644 index 0000000..30c7284 --- /dev/null +++ b/Function/BNRemoteFolderGetParentId.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRemoteFolderGetParentId(BNRemoteFolder* folder, const char** result) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteFolderGetParentId" + )] + internal static extern bool BNRemoteFolderGetParentId( + + // BNRemoteFolder* folder + IntPtr folder , + + // const char** result + string[] result + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteFolderGetProject.cs b/Function/BNRemoteFolderGetProject.cs new file mode 100644 index 0000000..47d98b4 --- /dev/null +++ b/Function/BNRemoteFolderGetProject.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRemoteProject* BNRemoteFolderGetProject(BNRemoteFolder* folder) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteFolderGetProject" + )] + internal static extern IntPtr BNRemoteFolderGetProject( + + // BNRemoteFolder* folder + IntPtr folder + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteFolderGetRemote.cs b/Function/BNRemoteFolderGetRemote.cs new file mode 100644 index 0000000..eaa3faf --- /dev/null +++ b/Function/BNRemoteFolderGetRemote.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRemote* BNRemoteFolderGetRemote(BNRemoteFolder* folder) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteFolderGetRemote" + )] + internal static extern IntPtr BNRemoteFolderGetRemote( + + // BNRemoteFolder* folder + IntPtr folder + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteFolderGetUrl.cs b/Function/BNRemoteFolderGetUrl.cs new file mode 100644 index 0000000..6c57cd9 --- /dev/null +++ b/Function/BNRemoteFolderGetUrl.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNRemoteFolderGetUrl(BNRemoteFolder* folder) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteFolderGetUrl" + )] + internal static extern IntPtr BNRemoteFolderGetUrl( + + // BNRemoteFolder* folder + IntPtr folder + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteFolderSetDescription.cs b/Function/BNRemoteFolderSetDescription.cs new file mode 100644 index 0000000..ff67bc6 --- /dev/null +++ b/Function/BNRemoteFolderSetDescription.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRemoteFolderSetDescription(BNRemoteFolder* folder, const char* description) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteFolderSetDescription" + )] + internal static extern bool BNRemoteFolderSetDescription( + + // BNRemoteFolder* folder + IntPtr folder , + + // const char* description + string description + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteFolderSetName.cs b/Function/BNRemoteFolderSetName.cs new file mode 100644 index 0000000..3c4f853 --- /dev/null +++ b/Function/BNRemoteFolderSetName.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRemoteFolderSetName(BNRemoteFolder* folder, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteFolderSetName" + )] + internal static extern bool BNRemoteFolderSetName( + + // BNRemoteFolder* folder + IntPtr folder , + + // const char* name + string name + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteFolderSetParent.cs b/Function/BNRemoteFolderSetParent.cs new file mode 100644 index 0000000..7810fa8 --- /dev/null +++ b/Function/BNRemoteFolderSetParent.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRemoteFolderSetParent(BNRemoteFolder* folder, BNRemoteFolder* parent) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteFolderSetParent" + )] + internal static extern bool BNRemoteFolderSetParent( + + // BNRemoteFolder* folder + IntPtr folder , + + // BNRemoteFolder* parent + IntPtr parent + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteGetAddress.cs b/Function/BNRemoteGetAddress.cs new file mode 100644 index 0000000..2177540 --- /dev/null +++ b/Function/BNRemoteGetAddress.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNRemoteGetAddress(BNRemote* remote) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteGetAddress" + )] + internal static extern IntPtr BNRemoteGetAddress( + + // BNRemote* remote + IntPtr remote + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteGetAuthBackends.cs b/Function/BNRemoteGetAuthBackends.cs new file mode 100644 index 0000000..d5550b3 --- /dev/null +++ b/Function/BNRemoteGetAuthBackends.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRemoteGetAuthBackends(BNRemote* remote, const char*** backendIds, const char*** backendNames, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteGetAuthBackends" + )] + internal static extern bool BNRemoteGetAuthBackends( + + // BNRemote* remote + IntPtr remote , + + // const char*** backendIds + IntPtr backendIds , + + // const char*** backendNames + IntPtr backendNames , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteGetCurrentUser.cs b/Function/BNRemoteGetCurrentUser.cs new file mode 100644 index 0000000..b0c35c2 --- /dev/null +++ b/Function/BNRemoteGetCurrentUser.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNCollaborationUser* BNRemoteGetCurrentUser(BNRemote* remote) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteGetCurrentUser" + )] + internal static extern IntPtr BNRemoteGetCurrentUser( + + // BNRemote* remote + IntPtr remote + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteGetGroupById.cs b/Function/BNRemoteGetGroupById.cs new file mode 100644 index 0000000..21b2391 --- /dev/null +++ b/Function/BNRemoteGetGroupById.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNCollaborationGroup* BNRemoteGetGroupById(BNRemote* remote, uint64_t id) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteGetGroupById" + )] + internal static extern IntPtr BNRemoteGetGroupById( + + // BNRemote* remote + IntPtr remote , + + // uint64_t id + ulong id + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteGetGroupByName.cs b/Function/BNRemoteGetGroupByName.cs new file mode 100644 index 0000000..6b06be9 --- /dev/null +++ b/Function/BNRemoteGetGroupByName.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNCollaborationGroup* BNRemoteGetGroupByName(BNRemote* remote, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteGetGroupByName" + )] + internal static extern IntPtr BNRemoteGetGroupByName( + + // BNRemote* remote + IntPtr remote , + + // const char* name + string name + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteGetGroups.cs b/Function/BNRemoteGetGroups.cs new file mode 100644 index 0000000..f6b6e45 --- /dev/null +++ b/Function/BNRemoteGetGroups.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNCollaborationGroup** BNRemoteGetGroups(BNRemote* remote, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteGetGroups" + )] + internal static extern IntPtr BNRemoteGetGroups( + + // BNRemote* remote + IntPtr remote , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteGetName.cs b/Function/BNRemoteGetName.cs new file mode 100644 index 0000000..47a8eaa --- /dev/null +++ b/Function/BNRemoteGetName.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNRemoteGetName(BNRemote* remote) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteGetName" + )] + internal static extern IntPtr BNRemoteGetName( + + // BNRemote* remote + IntPtr remote + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteGetProjectById.cs b/Function/BNRemoteGetProjectById.cs new file mode 100644 index 0000000..74a12b9 --- /dev/null +++ b/Function/BNRemoteGetProjectById.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRemoteProject* BNRemoteGetProjectById(BNRemote* remote, const char* id) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteGetProjectById" + )] + internal static extern IntPtr BNRemoteGetProjectById( + + // BNRemote* remote + IntPtr remote , + + // const char* id + string id + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteGetProjectByName.cs b/Function/BNRemoteGetProjectByName.cs new file mode 100644 index 0000000..f983b12 --- /dev/null +++ b/Function/BNRemoteGetProjectByName.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRemoteProject* BNRemoteGetProjectByName(BNRemote* remote, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteGetProjectByName" + )] + internal static extern IntPtr BNRemoteGetProjectByName( + + // BNRemote* remote + IntPtr remote , + + // const char* name + string name + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteGetProjects.cs b/Function/BNRemoteGetProjects.cs new file mode 100644 index 0000000..a66b545 --- /dev/null +++ b/Function/BNRemoteGetProjects.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRemoteProject** BNRemoteGetProjects(BNRemote* remote, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteGetProjects" + )] + internal static extern IntPtr BNRemoteGetProjects( + + // BNRemote* remote + IntPtr remote , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteGetServerBuildId.cs b/Function/BNRemoteGetServerBuildId.cs new file mode 100644 index 0000000..2ee6bf8 --- /dev/null +++ b/Function/BNRemoteGetServerBuildId.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNRemoteGetServerBuildId(BNRemote* remote) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteGetServerBuildId" + )] + internal static extern IntPtr BNRemoteGetServerBuildId( + + // BNRemote* remote + IntPtr remote + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteGetServerBuildVersion.cs b/Function/BNRemoteGetServerBuildVersion.cs new file mode 100644 index 0000000..cbe7476 --- /dev/null +++ b/Function/BNRemoteGetServerBuildVersion.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNRemoteGetServerBuildVersion(BNRemote* remote) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteGetServerBuildVersion" + )] + internal static extern IntPtr BNRemoteGetServerBuildVersion( + + // BNRemote* remote + IntPtr remote + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteGetServerVersion.cs b/Function/BNRemoteGetServerVersion.cs new file mode 100644 index 0000000..eb1baff --- /dev/null +++ b/Function/BNRemoteGetServerVersion.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// int32_t BNRemoteGetServerVersion(BNRemote* remote) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteGetServerVersion" + )] + internal static extern int BNRemoteGetServerVersion( + + // BNRemote* remote + IntPtr remote + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteGetToken.cs b/Function/BNRemoteGetToken.cs new file mode 100644 index 0000000..df5d05e --- /dev/null +++ b/Function/BNRemoteGetToken.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNRemoteGetToken(BNRemote* remote) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteGetToken" + )] + internal static extern IntPtr BNRemoteGetToken( + + // BNRemote* remote + IntPtr remote + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteGetUniqueId.cs b/Function/BNRemoteGetUniqueId.cs new file mode 100644 index 0000000..e8d1677 --- /dev/null +++ b/Function/BNRemoteGetUniqueId.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNRemoteGetUniqueId(BNRemote* remote) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteGetUniqueId" + )] + internal static extern IntPtr BNRemoteGetUniqueId( + + // BNRemote* remote + IntPtr remote + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteGetUserById.cs b/Function/BNRemoteGetUserById.cs new file mode 100644 index 0000000..46ecc4b --- /dev/null +++ b/Function/BNRemoteGetUserById.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNCollaborationUser* BNRemoteGetUserById(BNRemote* remote, const char* id) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteGetUserById" + )] + internal static extern IntPtr BNRemoteGetUserById( + + // BNRemote* remote + IntPtr remote , + + // const char* id + string id + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteGetUserByUsername.cs b/Function/BNRemoteGetUserByUsername.cs new file mode 100644 index 0000000..df47251 --- /dev/null +++ b/Function/BNRemoteGetUserByUsername.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNCollaborationUser* BNRemoteGetUserByUsername(BNRemote* remote, const char* username) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteGetUserByUsername" + )] + internal static extern IntPtr BNRemoteGetUserByUsername( + + // BNRemote* remote + IntPtr remote , + + // const char* username + string username + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteGetUsername.cs b/Function/BNRemoteGetUsername.cs new file mode 100644 index 0000000..1d2e5d5 --- /dev/null +++ b/Function/BNRemoteGetUsername.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNRemoteGetUsername(BNRemote* remote) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteGetUsername" + )] + internal static extern IntPtr BNRemoteGetUsername( + + // BNRemote* remote + IntPtr remote + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteGetUsers.cs b/Function/BNRemoteGetUsers.cs new file mode 100644 index 0000000..29d4b73 --- /dev/null +++ b/Function/BNRemoteGetUsers.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNCollaborationUser** BNRemoteGetUsers(BNRemote* remote, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteGetUsers" + )] + internal static extern IntPtr BNRemoteGetUsers( + + // BNRemote* remote + IntPtr remote , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteHasLoadedMetadata.cs b/Function/BNRemoteHasLoadedMetadata.cs new file mode 100644 index 0000000..5e6a1a3 --- /dev/null +++ b/Function/BNRemoteHasLoadedMetadata.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRemoteHasLoadedMetadata(BNRemote* remote) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteHasLoadedMetadata" + )] + internal static extern bool BNRemoteHasLoadedMetadata( + + // BNRemote* remote + IntPtr remote + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteHasPulledGroups.cs b/Function/BNRemoteHasPulledGroups.cs new file mode 100644 index 0000000..4ca97fe --- /dev/null +++ b/Function/BNRemoteHasPulledGroups.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRemoteHasPulledGroups(BNRemote* remote) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteHasPulledGroups" + )] + internal static extern bool BNRemoteHasPulledGroups( + + // BNRemote* remote + IntPtr remote + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteHasPulledProjects.cs b/Function/BNRemoteHasPulledProjects.cs new file mode 100644 index 0000000..c9c1519 --- /dev/null +++ b/Function/BNRemoteHasPulledProjects.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRemoteHasPulledProjects(BNRemote* remote) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteHasPulledProjects" + )] + internal static extern bool BNRemoteHasPulledProjects( + + // BNRemote* remote + IntPtr remote + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteHasPulledUsers.cs b/Function/BNRemoteHasPulledUsers.cs new file mode 100644 index 0000000..c671811 --- /dev/null +++ b/Function/BNRemoteHasPulledUsers.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRemoteHasPulledUsers(BNRemote* remote) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteHasPulledUsers" + )] + internal static extern bool BNRemoteHasPulledUsers( + + // BNRemote* remote + IntPtr remote + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteImportLocalProject.cs b/Function/BNRemoteImportLocalProject.cs new file mode 100644 index 0000000..0eaf512 --- /dev/null +++ b/Function/BNRemoteImportLocalProject.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRemoteProject* BNRemoteImportLocalProject(BNRemote* remote, BNProject* localProject, void** progress, void* progressCtxt) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteImportLocalProject" + )] + internal static extern IntPtr BNRemoteImportLocalProject( + + // BNRemote* remote + IntPtr remote , + + // BNProject* localProject + IntPtr localProject , + + // void** progress + IntPtr progress , + + // void* progressCtxt + IntPtr progressCtxt + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteIsAdmin.cs b/Function/BNRemoteIsAdmin.cs new file mode 100644 index 0000000..9f9b976 --- /dev/null +++ b/Function/BNRemoteIsAdmin.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRemoteIsAdmin(BNRemote* remote) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteIsAdmin" + )] + internal static extern bool BNRemoteIsAdmin( + + // BNRemote* remote + IntPtr remote + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteIsConnected.cs b/Function/BNRemoteIsConnected.cs new file mode 100644 index 0000000..1e9c041 --- /dev/null +++ b/Function/BNRemoteIsConnected.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRemoteIsConnected(BNRemote* remote) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteIsConnected" + )] + internal static extern bool BNRemoteIsConnected( + + // BNRemote* remote + IntPtr remote + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteIsEnterprise.cs b/Function/BNRemoteIsEnterprise.cs new file mode 100644 index 0000000..98e3583 --- /dev/null +++ b/Function/BNRemoteIsEnterprise.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRemoteIsEnterprise(BNRemote* remote) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteIsEnterprise" + )] + internal static extern bool BNRemoteIsEnterprise( + + // BNRemote* remote + IntPtr remote + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteLoadMetadata.cs b/Function/BNRemoteLoadMetadata.cs new file mode 100644 index 0000000..eeca0b4 --- /dev/null +++ b/Function/BNRemoteLoadMetadata.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRemoteLoadMetadata(BNRemote* remote) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteLoadMetadata" + )] + internal static extern bool BNRemoteLoadMetadata( + + // BNRemote* remote + IntPtr remote + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteProjectCanUserAdmin.cs b/Function/BNRemoteProjectCanUserAdmin.cs new file mode 100644 index 0000000..884857e --- /dev/null +++ b/Function/BNRemoteProjectCanUserAdmin.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRemoteProjectCanUserAdmin(BNRemoteProject* project, const char* username) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteProjectCanUserAdmin" + )] + internal static extern bool BNRemoteProjectCanUserAdmin( + + // BNRemoteProject* project + IntPtr project , + + // const char* username + string username + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteProjectCanUserEdit.cs b/Function/BNRemoteProjectCanUserEdit.cs new file mode 100644 index 0000000..30ec21d --- /dev/null +++ b/Function/BNRemoteProjectCanUserEdit.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRemoteProjectCanUserEdit(BNRemoteProject* project, const char* username) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteProjectCanUserEdit" + )] + internal static extern bool BNRemoteProjectCanUserEdit( + + // BNRemoteProject* project + IntPtr project , + + // const char* username + string username + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteProjectCanUserView.cs b/Function/BNRemoteProjectCanUserView.cs new file mode 100644 index 0000000..8436c01 --- /dev/null +++ b/Function/BNRemoteProjectCanUserView.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRemoteProjectCanUserView(BNRemoteProject* project, const char* username) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteProjectCanUserView" + )] + internal static extern bool BNRemoteProjectCanUserView( + + // BNRemoteProject* project + IntPtr project , + + // const char* username + string username + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteProjectClose.cs b/Function/BNRemoteProjectClose.cs new file mode 100644 index 0000000..d7009a7 --- /dev/null +++ b/Function/BNRemoteProjectClose.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRemoteProjectClose(BNRemoteProject* project) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteProjectClose" + )] + internal static extern void BNRemoteProjectClose( + + // BNRemoteProject* project + IntPtr project + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteProjectCreateFile.cs b/Function/BNRemoteProjectCreateFile.cs new file mode 100644 index 0000000..397315a --- /dev/null +++ b/Function/BNRemoteProjectCreateFile.cs @@ -0,0 +1,53 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRemoteFile* BNRemoteProjectCreateFile(BNRemoteProject* project, const char* filename, uint8_t* contents, uint64_t contentsSize, const char* name, const char* description, BNRemoteFolder* folder, BNRemoteFileType type, void** progress, void* progressContext) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteProjectCreateFile" + )] + internal static extern IntPtr BNRemoteProjectCreateFile( + + // BNRemoteProject* project + IntPtr project , + + // const char* filename + string filename , + + // uint8_t* contents + IntPtr contents , + + // uint64_t contentsSize + ulong contentsSize , + + // const char* name + string name , + + // const char* description + string description , + + // BNRemoteFolder* folder + IntPtr folder , + + // BNRemoteFileType type + RemoteFileType type , + + // void** progress + IntPtr progress , + + // void* progressContext + IntPtr progressContext + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteProjectCreateFolder.cs b/Function/BNRemoteProjectCreateFolder.cs new file mode 100644 index 0000000..58361fc --- /dev/null +++ b/Function/BNRemoteProjectCreateFolder.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRemoteFolder* BNRemoteProjectCreateFolder(BNRemoteProject* project, const char* name, const char* description, BNRemoteFolder* parent, void** progress, void* progressContext) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteProjectCreateFolder" + )] + internal static extern IntPtr BNRemoteProjectCreateFolder( + + // BNRemoteProject* project + IntPtr project , + + // const char* name + string name , + + // const char* description + string description , + + // BNRemoteFolder* parent + IntPtr parent , + + // void** progress + IntPtr progress , + + // void* progressContext + IntPtr progressContext + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteProjectCreateGroupPermission.cs b/Function/BNRemoteProjectCreateGroupPermission.cs new file mode 100644 index 0000000..617fdbc --- /dev/null +++ b/Function/BNRemoteProjectCreateGroupPermission.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNCollaborationPermission* BNRemoteProjectCreateGroupPermission(BNRemoteProject* project, int64_t groupId, BNCollaborationPermissionLevel level, void** progress, void* progressContext) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteProjectCreateGroupPermission" + )] + internal static extern IntPtr BNRemoteProjectCreateGroupPermission( + + // BNRemoteProject* project + IntPtr project , + + // int64_t groupId + long groupId , + + // BNCollaborationPermissionLevel level + CollaborationPermissionLevel level , + + // void** progress + IntPtr progress , + + // void* progressContext + IntPtr progressContext + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteProjectCreateUserPermission.cs b/Function/BNRemoteProjectCreateUserPermission.cs new file mode 100644 index 0000000..f687919 --- /dev/null +++ b/Function/BNRemoteProjectCreateUserPermission.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNCollaborationPermission* BNRemoteProjectCreateUserPermission(BNRemoteProject* project, const char* userId, BNCollaborationPermissionLevel level, void** progress, void* progressContext) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteProjectCreateUserPermission" + )] + internal static extern IntPtr BNRemoteProjectCreateUserPermission( + + // BNRemoteProject* project + IntPtr project , + + // const char* userId + string userId , + + // BNCollaborationPermissionLevel level + CollaborationPermissionLevel level , + + // void** progress + IntPtr progress , + + // void* progressContext + IntPtr progressContext + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteProjectDeleteFile.cs b/Function/BNRemoteProjectDeleteFile.cs new file mode 100644 index 0000000..5e2874b --- /dev/null +++ b/Function/BNRemoteProjectDeleteFile.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRemoteProjectDeleteFile(BNRemoteProject* project, BNRemoteFile* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteProjectDeleteFile" + )] + internal static extern bool BNRemoteProjectDeleteFile( + + // BNRemoteProject* project + IntPtr project , + + // BNRemoteFile* file + IntPtr file + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteProjectDeleteFolder.cs b/Function/BNRemoteProjectDeleteFolder.cs new file mode 100644 index 0000000..dec6a1c --- /dev/null +++ b/Function/BNRemoteProjectDeleteFolder.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRemoteProjectDeleteFolder(BNRemoteProject* project, BNRemoteFolder* folder) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteProjectDeleteFolder" + )] + internal static extern bool BNRemoteProjectDeleteFolder( + + // BNRemoteProject* project + IntPtr project , + + // BNRemoteFolder* folder + IntPtr folder + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteProjectDeletePermission.cs b/Function/BNRemoteProjectDeletePermission.cs new file mode 100644 index 0000000..233f521 --- /dev/null +++ b/Function/BNRemoteProjectDeletePermission.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRemoteProjectDeletePermission(BNRemoteProject* project, BNCollaborationPermission* permission) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteProjectDeletePermission" + )] + internal static extern bool BNRemoteProjectDeletePermission( + + // BNRemoteProject* project + IntPtr project , + + // BNCollaborationPermission* permission + IntPtr permission + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteProjectGetCoreProject.cs b/Function/BNRemoteProjectGetCoreProject.cs new file mode 100644 index 0000000..b8167d6 --- /dev/null +++ b/Function/BNRemoteProjectGetCoreProject.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNProject* BNRemoteProjectGetCoreProject(BNRemoteProject* project) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteProjectGetCoreProject" + )] + internal static extern IntPtr BNRemoteProjectGetCoreProject( + + // BNRemoteProject* project + IntPtr project + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteProjectGetCreated.cs b/Function/BNRemoteProjectGetCreated.cs new file mode 100644 index 0000000..38cbf63 --- /dev/null +++ b/Function/BNRemoteProjectGetCreated.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// int64_t BNRemoteProjectGetCreated(BNRemoteProject* project) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteProjectGetCreated" + )] + internal static extern long BNRemoteProjectGetCreated( + + // BNRemoteProject* project + IntPtr project + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteProjectGetDescription.cs b/Function/BNRemoteProjectGetDescription.cs new file mode 100644 index 0000000..30151d9 --- /dev/null +++ b/Function/BNRemoteProjectGetDescription.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNRemoteProjectGetDescription(BNRemoteProject* project) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteProjectGetDescription" + )] + internal static extern IntPtr BNRemoteProjectGetDescription( + + // BNRemoteProject* project + IntPtr project + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteProjectGetFileById.cs b/Function/BNRemoteProjectGetFileById.cs new file mode 100644 index 0000000..247dd8a --- /dev/null +++ b/Function/BNRemoteProjectGetFileById.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRemoteFile* BNRemoteProjectGetFileById(BNRemoteProject* project, const char* id) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteProjectGetFileById" + )] + internal static extern IntPtr BNRemoteProjectGetFileById( + + // BNRemoteProject* project + IntPtr project , + + // const char* id + string id + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteProjectGetFileByName.cs b/Function/BNRemoteProjectGetFileByName.cs new file mode 100644 index 0000000..dd43712 --- /dev/null +++ b/Function/BNRemoteProjectGetFileByName.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRemoteFile* BNRemoteProjectGetFileByName(BNRemoteProject* project, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteProjectGetFileByName" + )] + internal static extern IntPtr BNRemoteProjectGetFileByName( + + // BNRemoteProject* project + IntPtr project , + + // const char* name + string name + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteProjectGetFiles.cs b/Function/BNRemoteProjectGetFiles.cs new file mode 100644 index 0000000..7cce781 --- /dev/null +++ b/Function/BNRemoteProjectGetFiles.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRemoteFile** BNRemoteProjectGetFiles(BNRemoteProject* project, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteProjectGetFiles" + )] + internal static extern IntPtr BNRemoteProjectGetFiles( + + // BNRemoteProject* project + IntPtr project , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteProjectGetFolderById.cs b/Function/BNRemoteProjectGetFolderById.cs new file mode 100644 index 0000000..8b2ae37 --- /dev/null +++ b/Function/BNRemoteProjectGetFolderById.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRemoteFolder* BNRemoteProjectGetFolderById(BNRemoteProject* project, const char* id) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteProjectGetFolderById" + )] + internal static extern IntPtr BNRemoteProjectGetFolderById( + + // BNRemoteProject* project + IntPtr project , + + // const char* id + string id + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteProjectGetFolders.cs b/Function/BNRemoteProjectGetFolders.cs new file mode 100644 index 0000000..1844f6b --- /dev/null +++ b/Function/BNRemoteProjectGetFolders.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRemoteFolder** BNRemoteProjectGetFolders(BNRemoteProject* project, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteProjectGetFolders" + )] + internal static extern IntPtr BNRemoteProjectGetFolders( + + // BNRemoteProject* project + IntPtr project , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteProjectGetGroupPermissions.cs b/Function/BNRemoteProjectGetGroupPermissions.cs new file mode 100644 index 0000000..b23a67c --- /dev/null +++ b/Function/BNRemoteProjectGetGroupPermissions.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNCollaborationPermission** BNRemoteProjectGetGroupPermissions(BNRemoteProject* project, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteProjectGetGroupPermissions" + )] + internal static extern IntPtr BNRemoteProjectGetGroupPermissions( + + // BNRemoteProject* project + IntPtr project , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteProjectGetId.cs b/Function/BNRemoteProjectGetId.cs new file mode 100644 index 0000000..5d5895b --- /dev/null +++ b/Function/BNRemoteProjectGetId.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNRemoteProjectGetId(BNRemoteProject* project) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteProjectGetId" + )] + internal static extern IntPtr BNRemoteProjectGetId( + + // BNRemoteProject* project + IntPtr project + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteProjectGetLastModified.cs b/Function/BNRemoteProjectGetLastModified.cs new file mode 100644 index 0000000..c61a136 --- /dev/null +++ b/Function/BNRemoteProjectGetLastModified.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// int64_t BNRemoteProjectGetLastModified(BNRemoteProject* project) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteProjectGetLastModified" + )] + internal static extern long BNRemoteProjectGetLastModified( + + // BNRemoteProject* project + IntPtr project + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteProjectGetName.cs b/Function/BNRemoteProjectGetName.cs new file mode 100644 index 0000000..c00af7a --- /dev/null +++ b/Function/BNRemoteProjectGetName.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNRemoteProjectGetName(BNRemoteProject* project) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteProjectGetName" + )] + internal static extern IntPtr BNRemoteProjectGetName( + + // BNRemoteProject* project + IntPtr project + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteProjectGetPermissionById.cs b/Function/BNRemoteProjectGetPermissionById.cs new file mode 100644 index 0000000..17cd5c6 --- /dev/null +++ b/Function/BNRemoteProjectGetPermissionById.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNCollaborationPermission* BNRemoteProjectGetPermissionById(BNRemoteProject* project, const char* id) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteProjectGetPermissionById" + )] + internal static extern IntPtr BNRemoteProjectGetPermissionById( + + // BNRemoteProject* project + IntPtr project , + + // const char* id + string id + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteProjectGetReceivedFileCount.cs b/Function/BNRemoteProjectGetReceivedFileCount.cs new file mode 100644 index 0000000..90a41df --- /dev/null +++ b/Function/BNRemoteProjectGetReceivedFileCount.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNRemoteProjectGetReceivedFileCount(BNRemoteProject* project) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteProjectGetReceivedFileCount" + )] + internal static extern ulong BNRemoteProjectGetReceivedFileCount( + + // BNRemoteProject* project + IntPtr project + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteProjectGetReceivedFolderCount.cs b/Function/BNRemoteProjectGetReceivedFolderCount.cs new file mode 100644 index 0000000..5985f70 --- /dev/null +++ b/Function/BNRemoteProjectGetReceivedFolderCount.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNRemoteProjectGetReceivedFolderCount(BNRemoteProject* project) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteProjectGetReceivedFolderCount" + )] + internal static extern ulong BNRemoteProjectGetReceivedFolderCount( + + // BNRemoteProject* project + IntPtr project + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteProjectGetRemote.cs b/Function/BNRemoteProjectGetRemote.cs new file mode 100644 index 0000000..f11cf2a --- /dev/null +++ b/Function/BNRemoteProjectGetRemote.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRemote* BNRemoteProjectGetRemote(BNRemoteProject* project) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteProjectGetRemote" + )] + internal static extern IntPtr BNRemoteProjectGetRemote( + + // BNRemoteProject* project + IntPtr project + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteProjectGetUrl.cs b/Function/BNRemoteProjectGetUrl.cs new file mode 100644 index 0000000..46fbe2d --- /dev/null +++ b/Function/BNRemoteProjectGetUrl.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNRemoteProjectGetUrl(BNRemoteProject* project) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteProjectGetUrl" + )] + internal static extern IntPtr BNRemoteProjectGetUrl( + + // BNRemoteProject* project + IntPtr project + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteProjectGetUserPermissions.cs b/Function/BNRemoteProjectGetUserPermissions.cs new file mode 100644 index 0000000..4e51846 --- /dev/null +++ b/Function/BNRemoteProjectGetUserPermissions.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNCollaborationPermission** BNRemoteProjectGetUserPermissions(BNRemoteProject* project, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNRemoteProjectGetUserPermissions" + )] + internal static extern IntPtr BNRemoteProjectGetUserPermissions( + + // BNRemoteProject* project + IntPtr project , + + // uint64_t* count + IntPtr count + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteProjectHasPulledFiles.cs b/Function/BNRemoteProjectHasPulledFiles.cs new file mode 100644 index 0000000..bae854d --- /dev/null +++ b/Function/BNRemoteProjectHasPulledFiles.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRemoteProjectHasPulledFiles(BNRemoteProject* project) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteProjectHasPulledFiles" + )] + internal static extern bool BNRemoteProjectHasPulledFiles( + + // BNRemoteProject* project + IntPtr project + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteProjectHasPulledFolders.cs b/Function/BNRemoteProjectHasPulledFolders.cs new file mode 100644 index 0000000..3c6706e --- /dev/null +++ b/Function/BNRemoteProjectHasPulledFolders.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRemoteProjectHasPulledFolders(BNRemoteProject* project) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteProjectHasPulledFolders" + )] + internal static extern bool BNRemoteProjectHasPulledFolders( + + // BNRemoteProject* project + IntPtr project + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteProjectHasPulledGroupPermissions.cs b/Function/BNRemoteProjectHasPulledGroupPermissions.cs new file mode 100644 index 0000000..2b2b81f --- /dev/null +++ b/Function/BNRemoteProjectHasPulledGroupPermissions.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRemoteProjectHasPulledGroupPermissions(BNRemoteProject* project) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteProjectHasPulledGroupPermissions" + )] + internal static extern bool BNRemoteProjectHasPulledGroupPermissions( + + // BNRemoteProject* project + IntPtr project + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteProjectHasPulledUserPermissions.cs b/Function/BNRemoteProjectHasPulledUserPermissions.cs new file mode 100644 index 0000000..334b346 --- /dev/null +++ b/Function/BNRemoteProjectHasPulledUserPermissions.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRemoteProjectHasPulledUserPermissions(BNRemoteProject* project) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteProjectHasPulledUserPermissions" + )] + internal static extern bool BNRemoteProjectHasPulledUserPermissions( + + // BNRemoteProject* project + IntPtr project + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteProjectIsAdmin.cs b/Function/BNRemoteProjectIsAdmin.cs new file mode 100644 index 0000000..9db9729 --- /dev/null +++ b/Function/BNRemoteProjectIsAdmin.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRemoteProjectIsAdmin(BNRemoteProject* project) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteProjectIsAdmin" + )] + internal static extern bool BNRemoteProjectIsAdmin( + + // BNRemoteProject* project + IntPtr project + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteProjectIsOpen.cs b/Function/BNRemoteProjectIsOpen.cs new file mode 100644 index 0000000..752bc93 --- /dev/null +++ b/Function/BNRemoteProjectIsOpen.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRemoteProjectIsOpen(BNRemoteProject* project) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteProjectIsOpen" + )] + internal static extern bool BNRemoteProjectIsOpen( + + // BNRemoteProject* project + IntPtr project + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteProjectOpen.cs b/Function/BNRemoteProjectOpen.cs new file mode 100644 index 0000000..17ae05f --- /dev/null +++ b/Function/BNRemoteProjectOpen.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRemoteProjectOpen(BNRemoteProject* project, void** progress, void* progressCtxt) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteProjectOpen" + )] + internal static extern bool BNRemoteProjectOpen( + + // BNRemoteProject* project + IntPtr project , + + // void** progress + IntPtr progress , + + // void* progressCtxt + IntPtr progressCtxt + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteProjectPullFiles.cs b/Function/BNRemoteProjectPullFiles.cs new file mode 100644 index 0000000..5ecd0e9 --- /dev/null +++ b/Function/BNRemoteProjectPullFiles.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRemoteProjectPullFiles(BNRemoteProject* project, void** progress, void* progressContext) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteProjectPullFiles" + )] + internal static extern bool BNRemoteProjectPullFiles( + + // BNRemoteProject* project + IntPtr project , + + // void** progress + IntPtr progress , + + // void* progressContext + IntPtr progressContext + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteProjectPullFolders.cs b/Function/BNRemoteProjectPullFolders.cs new file mode 100644 index 0000000..3edcdcf --- /dev/null +++ b/Function/BNRemoteProjectPullFolders.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRemoteProjectPullFolders(BNRemoteProject* project, void** progress, void* progressContext) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteProjectPullFolders" + )] + internal static extern bool BNRemoteProjectPullFolders( + + // BNRemoteProject* project + IntPtr project , + + // void** progress + IntPtr progress , + + // void* progressContext + IntPtr progressContext + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteProjectPullGroupPermissions.cs b/Function/BNRemoteProjectPullGroupPermissions.cs new file mode 100644 index 0000000..3e195a1 --- /dev/null +++ b/Function/BNRemoteProjectPullGroupPermissions.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRemoteProjectPullGroupPermissions(BNRemoteProject* project, void** progress, void* progressContext) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteProjectPullGroupPermissions" + )] + internal static extern bool BNRemoteProjectPullGroupPermissions( + + // BNRemoteProject* project + IntPtr project , + + // void** progress + IntPtr progress , + + // void* progressContext + IntPtr progressContext + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteProjectPullUserPermissions.cs b/Function/BNRemoteProjectPullUserPermissions.cs new file mode 100644 index 0000000..f8938ef --- /dev/null +++ b/Function/BNRemoteProjectPullUserPermissions.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRemoteProjectPullUserPermissions(BNRemoteProject* project, void** progress, void* progressContext) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteProjectPullUserPermissions" + )] + internal static extern bool BNRemoteProjectPullUserPermissions( + + // BNRemoteProject* project + IntPtr project , + + // void** progress + IntPtr progress , + + // void* progressContext + IntPtr progressContext + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteProjectPushFile.cs b/Function/BNRemoteProjectPushFile.cs new file mode 100644 index 0000000..dbd279b --- /dev/null +++ b/Function/BNRemoteProjectPushFile.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRemoteProjectPushFile(BNRemoteProject* project, BNRemoteFile* file, const char** extraFieldKeys, const char** extraFieldValues, uint64_t extraFieldCount) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteProjectPushFile" + )] + internal static extern bool BNRemoteProjectPushFile( + + // BNRemoteProject* project + IntPtr project , + + // BNRemoteFile* file + IntPtr file , + + // const char** extraFieldKeys + string[] extraFieldKeys , + + // const char** extraFieldValues + string[] extraFieldValues , + + // uint64_t extraFieldCount + ulong extraFieldCount + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteProjectPushFolder.cs b/Function/BNRemoteProjectPushFolder.cs new file mode 100644 index 0000000..25ce68a --- /dev/null +++ b/Function/BNRemoteProjectPushFolder.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRemoteProjectPushFolder(BNRemoteProject* project, BNRemoteFolder* folder, const char** extraFieldKeys, const char** extraFieldValues, uint64_t extraFieldCount) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteProjectPushFolder" + )] + internal static extern bool BNRemoteProjectPushFolder( + + // BNRemoteProject* project + IntPtr project , + + // BNRemoteFolder* folder + IntPtr folder , + + // const char** extraFieldKeys + string[] extraFieldKeys , + + // const char** extraFieldValues + string[] extraFieldValues , + + // uint64_t extraFieldCount + ulong extraFieldCount + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteProjectPushPermission.cs b/Function/BNRemoteProjectPushPermission.cs new file mode 100644 index 0000000..0bc19df --- /dev/null +++ b/Function/BNRemoteProjectPushPermission.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRemoteProjectPushPermission(BNRemoteProject* project, BNCollaborationPermission* permission, const char** extraFieldKeys, const char** extraFieldValues, uint64_t extraFieldCount) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteProjectPushPermission" + )] + internal static extern bool BNRemoteProjectPushPermission( + + // BNRemoteProject* project + IntPtr project , + + // BNCollaborationPermission* permission + IntPtr permission , + + // const char** extraFieldKeys + string[] extraFieldKeys , + + // const char** extraFieldValues + string[] extraFieldValues , + + // uint64_t extraFieldCount + ulong extraFieldCount + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteProjectSetDescription.cs b/Function/BNRemoteProjectSetDescription.cs new file mode 100644 index 0000000..cb667ec --- /dev/null +++ b/Function/BNRemoteProjectSetDescription.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRemoteProjectSetDescription(BNRemoteProject* project, const char* description) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteProjectSetDescription" + )] + internal static extern bool BNRemoteProjectSetDescription( + + // BNRemoteProject* project + IntPtr project , + + // const char* description + string description + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteProjectSetName.cs b/Function/BNRemoteProjectSetName.cs new file mode 100644 index 0000000..00fbf4a --- /dev/null +++ b/Function/BNRemoteProjectSetName.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRemoteProjectSetName(BNRemoteProject* project, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteProjectSetName" + )] + internal static extern bool BNRemoteProjectSetName( + + // BNRemoteProject* project + IntPtr project , + + // const char* name + string name + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemotePullGroups.cs b/Function/BNRemotePullGroups.cs new file mode 100644 index 0000000..bcebb75 --- /dev/null +++ b/Function/BNRemotePullGroups.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRemotePullGroups(BNRemote* remote, void** progress, void* progressContext) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemotePullGroups" + )] + internal static extern bool BNRemotePullGroups( + + // BNRemote* remote + IntPtr remote , + + // void** progress + IntPtr progress , + + // void* progressContext + IntPtr progressContext + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemotePullProjects.cs b/Function/BNRemotePullProjects.cs new file mode 100644 index 0000000..4f94f89 --- /dev/null +++ b/Function/BNRemotePullProjects.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRemotePullProjects(BNRemote* remote, void** progress, void* progressContext) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemotePullProjects" + )] + internal static extern bool BNRemotePullProjects( + + // BNRemote* remote + IntPtr remote , + + // void** progress + IntPtr progress , + + // void* progressContext + IntPtr progressContext + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemotePullUsers.cs b/Function/BNRemotePullUsers.cs new file mode 100644 index 0000000..1eaf66d --- /dev/null +++ b/Function/BNRemotePullUsers.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRemotePullUsers(BNRemote* remote, void** progress, void* progressContext) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemotePullUsers" + )] + internal static extern bool BNRemotePullUsers( + + // BNRemote* remote + IntPtr remote , + + // void** progress + IntPtr progress , + + // void* progressContext + IntPtr progressContext + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemotePushGroup.cs b/Function/BNRemotePushGroup.cs new file mode 100644 index 0000000..de81546 --- /dev/null +++ b/Function/BNRemotePushGroup.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRemotePushGroup(BNRemote* remote, BNCollaborationGroup* group, const char** extraFieldKeys, const char** extraFieldValues, uint64_t extraFieldCount) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemotePushGroup" + )] + internal static extern bool BNRemotePushGroup( + + // BNRemote* remote + IntPtr remote , + + // BNCollaborationGroup* _group + IntPtr _group , + + // const char** extraFieldKeys + string[] extraFieldKeys , + + // const char** extraFieldValues + string[] extraFieldValues , + + // uint64_t extraFieldCount + ulong extraFieldCount + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemotePushProject.cs b/Function/BNRemotePushProject.cs new file mode 100644 index 0000000..c3e7b7c --- /dev/null +++ b/Function/BNRemotePushProject.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRemotePushProject(BNRemote* remote, BNRemoteProject* project, const char** extraFieldKeys, const char** extraFieldValues, uint64_t extraFieldCount) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemotePushProject" + )] + internal static extern bool BNRemotePushProject( + + // BNRemote* remote + IntPtr remote , + + // BNRemoteProject* project + IntPtr project , + + // const char** extraFieldKeys + string[] extraFieldKeys , + + // const char** extraFieldValues + string[] extraFieldValues , + + // uint64_t extraFieldCount + ulong extraFieldCount + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemotePushUser.cs b/Function/BNRemotePushUser.cs new file mode 100644 index 0000000..4a12f91 --- /dev/null +++ b/Function/BNRemotePushUser.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRemotePushUser(BNRemote* remote, BNCollaborationUser* user, const char** extraFieldKeys, const char** extraFieldValues, uint64_t extraFieldCount) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemotePushUser" + )] + internal static extern bool BNRemotePushUser( + + // BNRemote* remote + IntPtr remote , + + // BNCollaborationUser* user + IntPtr user , + + // const char** extraFieldKeys + string[] extraFieldKeys , + + // const char** extraFieldValues + string[] extraFieldValues , + + // uint64_t extraFieldCount + ulong extraFieldCount + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteRequest.cs b/Function/BNRemoteRequest.cs new file mode 100644 index 0000000..4794bdb --- /dev/null +++ b/Function/BNRemoteRequest.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// int32_t BNRemoteRequest(BNRemote* remote, void* request, void* ret) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteRequest" + )] + internal static extern int BNRemoteRequest( + + // BNRemote* remote + IntPtr remote , + + // void* request + IntPtr request , + + // void* ret + IntPtr ret + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteRequestAuthenticationToken.cs b/Function/BNRemoteRequestAuthenticationToken.cs new file mode 100644 index 0000000..92103eb --- /dev/null +++ b/Function/BNRemoteRequestAuthenticationToken.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNRemoteRequestAuthenticationToken(BNRemote* remote, const char* username, const char* password) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteRequestAuthenticationToken" + )] + internal static extern IntPtr BNRemoteRequestAuthenticationToken( + + // BNRemote* remote + IntPtr remote , + + // const char* username + string username , + + // const char* password + string password + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteSearchGroups.cs b/Function/BNRemoteSearchGroups.cs new file mode 100644 index 0000000..4a60855 --- /dev/null +++ b/Function/BNRemoteSearchGroups.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRemoteSearchGroups(BNRemote* remote, const char* prefix, uint64_t** groupIds, const char*** groupNames, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteSearchGroups" + )] + internal static extern bool BNRemoteSearchGroups( + + // BNRemote* remote + IntPtr remote , + + // const char* prefix + string prefix , + + // uint64_t** groupIds + IntPtr groupIds , + + // const char*** groupNames + IntPtr groupNames , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoteSearchUsers.cs b/Function/BNRemoteSearchUsers.cs new file mode 100644 index 0000000..6722347 --- /dev/null +++ b/Function/BNRemoteSearchUsers.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRemoteSearchUsers(BNRemote* remote, const char* prefix, const char*** userIds, const char*** usernames, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoteSearchUsers" + )] + internal static extern bool BNRemoteSearchUsers( + + // BNRemote* remote + IntPtr remote , + + // const char* prefix + string prefix , + + // const char*** userIds + IntPtr userIds , + + // const char*** usernames + IntPtr usernames , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoveAnalysisFunction.cs b/Function/BNRemoveAnalysisFunction.cs new file mode 100644 index 0000000..86efd53 --- /dev/null +++ b/Function/BNRemoveAnalysisFunction.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRemoveAnalysisFunction(BNBinaryView* view, BNFunction* func, bool updateRefs) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNRemoveAnalysisFunction" + )] + internal static extern void BNRemoveAnalysisFunction( + + // BNBinaryView* view + IntPtr view , + + // BNFunction* func + IntPtr func , + + // bool updateRefs + bool updateRefs + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoveAutoAddressTag.cs b/Function/BNRemoveAutoAddressTag.cs new file mode 100644 index 0000000..bf997c8 --- /dev/null +++ b/Function/BNRemoveAutoAddressTag.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRemoveAutoAddressTag(BNFunction* func, BNArchitecture* arch, uint64_t addr, BNTag* tag) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNRemoveAutoAddressTag" + )] + internal static extern void BNRemoveAutoAddressTag( + + // BNFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t addr + ulong addr , + + // BNTag* tag + IntPtr tag + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoveAutoAddressTagsOfType.cs b/Function/BNRemoveAutoAddressTagsOfType.cs new file mode 100644 index 0000000..9cac0f9 --- /dev/null +++ b/Function/BNRemoveAutoAddressTagsOfType.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRemoveAutoAddressTagsOfType(BNFunction* func, BNArchitecture* arch, uint64_t addr, BNTagType* tagType) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNRemoveAutoAddressTagsOfType" + )] + internal static extern void BNRemoveAutoAddressTagsOfType( + + // BNFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t addr + ulong addr , + + // BNTagType* tagType + IntPtr tagType + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoveAutoDataTag.cs b/Function/BNRemoveAutoDataTag.cs new file mode 100644 index 0000000..bbdc0ea --- /dev/null +++ b/Function/BNRemoveAutoDataTag.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRemoveAutoDataTag(BNBinaryView* view, uint64_t addr, BNTag* tag) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNRemoveAutoDataTag" + )] + internal static extern void BNRemoveAutoDataTag( + + // BNBinaryView* view + IntPtr view , + + // uint64_t addr + ulong addr , + + // BNTag* tag + IntPtr tag + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoveAutoDataTagsOfType.cs b/Function/BNRemoveAutoDataTagsOfType.cs new file mode 100644 index 0000000..4e4687b --- /dev/null +++ b/Function/BNRemoveAutoDataTagsOfType.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRemoveAutoDataTagsOfType(BNBinaryView* view, uint64_t addr, BNTagType* tagType) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNRemoveAutoDataTagsOfType" + )] + internal static extern void BNRemoveAutoDataTagsOfType( + + // BNBinaryView* view + IntPtr view , + + // uint64_t addr + ulong addr , + + // BNTagType* tagType + IntPtr tagType + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoveAutoFunctionTag.cs b/Function/BNRemoveAutoFunctionTag.cs new file mode 100644 index 0000000..4c1795f --- /dev/null +++ b/Function/BNRemoveAutoFunctionTag.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRemoveAutoFunctionTag(BNFunction* func, BNTag* tag) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoveAutoFunctionTag" + )] + internal static extern void BNRemoveAutoFunctionTag( + + // BNFunction* func + IntPtr func , + + // BNTag* tag + IntPtr tag + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoveAutoFunctionTagsOfType.cs b/Function/BNRemoveAutoFunctionTagsOfType.cs new file mode 100644 index 0000000..cd11691 --- /dev/null +++ b/Function/BNRemoveAutoFunctionTagsOfType.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRemoveAutoFunctionTagsOfType(BNFunction* func, BNTagType* tagType) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoveAutoFunctionTagsOfType" + )] + internal static extern void BNRemoveAutoFunctionTagsOfType( + + // BNFunction* func + IntPtr func , + + // BNTagType* tagType + IntPtr tagType + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoveAutoSection.cs b/Function/BNRemoveAutoSection.cs new file mode 100644 index 0000000..4cef877 --- /dev/null +++ b/Function/BNRemoveAutoSection.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRemoveAutoSection(BNBinaryView* view, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoveAutoSection" + )] + internal static extern void BNRemoveAutoSection( + + // BNBinaryView* view + IntPtr view , + + // const char* name + string name + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoveAutoSegment.cs b/Function/BNRemoveAutoSegment.cs new file mode 100644 index 0000000..c7f4b71 --- /dev/null +++ b/Function/BNRemoveAutoSegment.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRemoveAutoSegment(BNBinaryView* view, uint64_t start, uint64_t length) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoveAutoSegment" + )] + internal static extern void BNRemoveAutoSegment( + + // BNBinaryView* view + IntPtr view , + + // uint64_t start + ulong start , + + // uint64_t length + ulong length + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoveComponent.cs b/Function/BNRemoveComponent.cs new file mode 100644 index 0000000..ea91b16 --- /dev/null +++ b/Function/BNRemoveComponent.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRemoveComponent(BNBinaryView* view, BNComponent* component) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNRemoveComponent" + )] + internal static extern bool BNRemoveComponent( + + // BNBinaryView* view + IntPtr view , + + // BNComponent* component + IntPtr component + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoveComponentByGuid.cs b/Function/BNRemoveComponentByGuid.cs new file mode 100644 index 0000000..5d16773 --- /dev/null +++ b/Function/BNRemoveComponentByGuid.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRemoveComponentByGuid(BNBinaryView* view, const char* guid) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoveComponentByGuid" + )] + internal static extern bool BNRemoveComponentByGuid( + + // BNBinaryView* view + IntPtr view , + + // const char* guid + string guid + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoveDataReference.cs b/Function/BNRemoveDataReference.cs new file mode 100644 index 0000000..3c2ded0 --- /dev/null +++ b/Function/BNRemoveDataReference.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRemoveDataReference(BNBinaryView* view, uint64_t fromAddr, uint64_t toAddr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNRemoveDataReference" + )] + internal static extern void BNRemoveDataReference( + + // BNBinaryView* view + IntPtr view , + + // uint64_t fromAddr + ulong fromAddr , + + // uint64_t toAddr + ulong toAddr + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoveDatabaseSnapshot.cs b/Function/BNRemoveDatabaseSnapshot.cs new file mode 100644 index 0000000..a6927aa --- /dev/null +++ b/Function/BNRemoveDatabaseSnapshot.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRemoveDatabaseSnapshot(BNDatabase* database, int64_t id) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoveDatabaseSnapshot" + )] + internal static extern bool BNRemoveDatabaseSnapshot( + + // BNDatabase* database + IntPtr database , + + // int64_t id + long id + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoveDebugDataVariableByAddress.cs b/Function/BNRemoveDebugDataVariableByAddress.cs new file mode 100644 index 0000000..daf5cbd --- /dev/null +++ b/Function/BNRemoveDebugDataVariableByAddress.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRemoveDebugDataVariableByAddress(BNDebugInfo* debugInfo, const char* parserName, uint64_t address) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoveDebugDataVariableByAddress" + )] + internal static extern bool BNRemoveDebugDataVariableByAddress( + + // BNDebugInfo* debugInfo + IntPtr debugInfo , + + // const char* parserName + string parserName , + + // uint64_t address + ulong address + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoveDebugFunctionByIndex.cs b/Function/BNRemoveDebugFunctionByIndex.cs new file mode 100644 index 0000000..f2f224a --- /dev/null +++ b/Function/BNRemoveDebugFunctionByIndex.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRemoveDebugFunctionByIndex(BNDebugInfo* debugInfo, const char* parserName, uint64_t index) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoveDebugFunctionByIndex" + )] + internal static extern bool BNRemoveDebugFunctionByIndex( + + // BNDebugInfo* debugInfo + IntPtr debugInfo , + + // const char* parserName + string parserName , + + // uint64_t index + ulong index + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoveDebugParserDataVariables.cs b/Function/BNRemoveDebugParserDataVariables.cs new file mode 100644 index 0000000..1af774b --- /dev/null +++ b/Function/BNRemoveDebugParserDataVariables.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRemoveDebugParserDataVariables(BNDebugInfo* debugInfo, const char* parserName) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoveDebugParserDataVariables" + )] + internal static extern bool BNRemoveDebugParserDataVariables( + + // BNDebugInfo* debugInfo + IntPtr debugInfo , + + // const char* parserName + string parserName + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoveDebugParserFunctions.cs b/Function/BNRemoveDebugParserFunctions.cs new file mode 100644 index 0000000..9c0facc --- /dev/null +++ b/Function/BNRemoveDebugParserFunctions.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRemoveDebugParserFunctions(BNDebugInfo* debugInfo, const char* parserName) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoveDebugParserFunctions" + )] + internal static extern bool BNRemoveDebugParserFunctions( + + // BNDebugInfo* debugInfo + IntPtr debugInfo , + + // const char* parserName + string parserName + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoveDebugParserInfo.cs b/Function/BNRemoveDebugParserInfo.cs new file mode 100644 index 0000000..8ef7c93 --- /dev/null +++ b/Function/BNRemoveDebugParserInfo.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRemoveDebugParserInfo(BNDebugInfo* debugInfo, const char* parserName) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoveDebugParserInfo" + )] + internal static extern bool BNRemoveDebugParserInfo( + + // BNDebugInfo* debugInfo + IntPtr debugInfo , + + // const char* parserName + string parserName + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoveDebugParserTypes.cs b/Function/BNRemoveDebugParserTypes.cs new file mode 100644 index 0000000..8288536 --- /dev/null +++ b/Function/BNRemoveDebugParserTypes.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRemoveDebugParserTypes(BNDebugInfo* debugInfo, const char* parserName) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoveDebugParserTypes" + )] + internal static extern bool BNRemoveDebugParserTypes( + + // BNDebugInfo* debugInfo + IntPtr debugInfo , + + // const char* parserName + string parserName + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoveDebugTypeByName.cs b/Function/BNRemoveDebugTypeByName.cs new file mode 100644 index 0000000..160b802 --- /dev/null +++ b/Function/BNRemoveDebugTypeByName.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRemoveDebugTypeByName(BNDebugInfo* debugInfo, const char* parserName, const char* typeName) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoveDebugTypeByName" + )] + internal static extern bool BNRemoveDebugTypeByName( + + // BNDebugInfo* debugInfo + IntPtr debugInfo , + + // const char* parserName + string parserName , + + // const char* typeName + string typeName + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoveEnumerationBuilderMember.cs b/Function/BNRemoveEnumerationBuilderMember.cs new file mode 100644 index 0000000..0d23f4c --- /dev/null +++ b/Function/BNRemoveEnumerationBuilderMember.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRemoveEnumerationBuilderMember(BNEnumerationBuilder* e, uint64_t idx) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNRemoveEnumerationBuilderMember" + )] + internal static extern void BNRemoveEnumerationBuilderMember( + + // BNEnumerationBuilder* e + IntPtr e , + + // uint64_t idx + ulong idx + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoveExpressionParserMagicValue.cs b/Function/BNRemoveExpressionParserMagicValue.cs new file mode 100644 index 0000000..202babd --- /dev/null +++ b/Function/BNRemoveExpressionParserMagicValue.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRemoveExpressionParserMagicValue(BNBinaryView* view, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoveExpressionParserMagicValue" + )] + internal static extern void BNRemoveExpressionParserMagicValue( + + // BNBinaryView* view + IntPtr view , + + // const char* name + string name + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoveExpressionParserMagicValues.cs b/Function/BNRemoveExpressionParserMagicValues.cs new file mode 100644 index 0000000..b91dcc5 --- /dev/null +++ b/Function/BNRemoveExpressionParserMagicValues.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRemoveExpressionParserMagicValues(BNBinaryView* view, const char** names, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoveExpressionParserMagicValues" + )] + internal static extern void BNRemoveExpressionParserMagicValues( + + // BNBinaryView* view + IntPtr view , + + // const char** names + string[] names , + + // uint64_t count + ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoveFlowGraphRenderLayer.cs b/Function/BNRemoveFlowGraphRenderLayer.cs new file mode 100644 index 0000000..cb6d78d --- /dev/null +++ b/Function/BNRemoveFlowGraphRenderLayer.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRemoveFlowGraphRenderLayer(BNFlowGraph* graph, BNRenderLayer* layer) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNRemoveFlowGraphRenderLayer" + )] + internal static extern void BNRemoveFlowGraphRenderLayer( + + // BNFlowGraph* graph + IntPtr graph , + + // BNRenderLayer* layer + IntPtr layer + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoveGuidedSourceBlocks.cs b/Function/BNRemoveGuidedSourceBlocks.cs new file mode 100644 index 0000000..d5d2ac8 --- /dev/null +++ b/Function/BNRemoveGuidedSourceBlocks.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRemoveGuidedSourceBlocks(BNFunction* func, BNArchitectureAndAddress* addresses, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoveGuidedSourceBlocks" + )] + internal static extern void BNRemoveGuidedSourceBlocks( + + // BNFunction* func + IntPtr func , + + // BNArchitectureAndAddress* addresses + IntPtr addresses , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoveLinearViewCursorRenderLayer.cs b/Function/BNRemoveLinearViewCursorRenderLayer.cs new file mode 100644 index 0000000..fe360db --- /dev/null +++ b/Function/BNRemoveLinearViewCursorRenderLayer.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRemoveLinearViewCursorRenderLayer(BNLinearViewCursor* cursor, BNRenderLayer* layer) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNRemoveLinearViewCursorRenderLayer" + )] + internal static extern void BNRemoveLinearViewCursorRenderLayer( + + // BNLinearViewCursor* cursor + IntPtr cursor , + + // BNRenderLayer* layer + IntPtr layer + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoveMemoryRegion.cs b/Function/BNRemoveMemoryRegion.cs new file mode 100644 index 0000000..ce436c7 --- /dev/null +++ b/Function/BNRemoveMemoryRegion.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRemoveMemoryRegion(BNBinaryView* view, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoveMemoryRegion" + )] + internal static extern bool BNRemoveMemoryRegion( + + // BNBinaryView* view + IntPtr view , + + // const char* name + string name + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoveStructureBuilderMember.cs b/Function/BNRemoveStructureBuilderMember.cs new file mode 100644 index 0000000..614c85a --- /dev/null +++ b/Function/BNRemoveStructureBuilderMember.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRemoveStructureBuilderMember(BNStructureBuilder* s, uint64_t idx) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNRemoveStructureBuilderMember" + )] + internal static extern void BNRemoveStructureBuilderMember( + + // BNStructureBuilder* s + IntPtr s , + + // uint64_t idx + ulong idx + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoveTag.cs b/Function/BNRemoveTag.cs new file mode 100644 index 0000000..556c7f1 --- /dev/null +++ b/Function/BNRemoveTag.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRemoveTag(BNBinaryView* view, BNTag* tag, bool user) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoveTag" + )] + internal static extern void BNRemoveTag( + + // BNBinaryView* view + IntPtr view , + + // BNTag* tag + IntPtr tag , + + // bool user + bool user + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoveTagReference.cs b/Function/BNRemoveTagReference.cs new file mode 100644 index 0000000..392162a --- /dev/null +++ b/Function/BNRemoveTagReference.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRemoveTagReference(BNBinaryView* view, BNTagReference @ref) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoveTagReference" + )] + internal static extern void BNRemoveTagReference( + + // BNBinaryView* view + IntPtr view , + + // BNTagReference _ref + TagReference _ref + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoveTagType.cs b/Function/BNRemoveTagType.cs new file mode 100644 index 0000000..789789f --- /dev/null +++ b/Function/BNRemoveTagType.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRemoveTagType(BNBinaryView* view, BNTagType* tagType) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNRemoveTagType" + )] + internal static extern void BNRemoveTagType( + + // BNBinaryView* view + IntPtr view , + + // BNTagType* tagType + IntPtr tagType + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoveTypeBuilderAttribute.cs b/Function/BNRemoveTypeBuilderAttribute.cs new file mode 100644 index 0000000..4f92cc6 --- /dev/null +++ b/Function/BNRemoveTypeBuilderAttribute.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRemoveTypeBuilderAttribute(BNTypeBuilder* type, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoveTypeBuilderAttribute" + )] + internal static extern void BNRemoveTypeBuilderAttribute( + + // BNTypeBuilder* type + IntPtr type , + + // const char* name + string name + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoveUserAddressTag.cs b/Function/BNRemoveUserAddressTag.cs new file mode 100644 index 0000000..af1555e --- /dev/null +++ b/Function/BNRemoveUserAddressTag.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRemoveUserAddressTag(BNFunction* func, BNArchitecture* arch, uint64_t addr, BNTag* tag) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNRemoveUserAddressTag" + )] + internal static extern void BNRemoveUserAddressTag( + + // BNFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t addr + ulong addr , + + // BNTag* tag + IntPtr tag + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoveUserAddressTagsOfType.cs b/Function/BNRemoveUserAddressTagsOfType.cs new file mode 100644 index 0000000..8513278 --- /dev/null +++ b/Function/BNRemoveUserAddressTagsOfType.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRemoveUserAddressTagsOfType(BNFunction* func, BNArchitecture* arch, uint64_t addr, BNTagType* tagType) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNRemoveUserAddressTagsOfType" + )] + internal static extern void BNRemoveUserAddressTagsOfType( + + // BNFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t addr + ulong addr , + + // BNTagType* tagType + IntPtr tagType + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoveUserCodeReference.cs b/Function/BNRemoveUserCodeReference.cs new file mode 100644 index 0000000..0b7b1c7 --- /dev/null +++ b/Function/BNRemoveUserCodeReference.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRemoveUserCodeReference(BNFunction* func, BNArchitecture* fromArch, uint64_t fromAddr, uint64_t toAddr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNRemoveUserCodeReference" + )] + internal static extern void BNRemoveUserCodeReference( + + // BNFunction* func + IntPtr func , + + // BNArchitecture* fromArch + IntPtr fromArch , + + // uint64_t fromAddr + ulong fromAddr , + + // uint64_t toAddr + ulong toAddr + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoveUserDataReference.cs b/Function/BNRemoveUserDataReference.cs new file mode 100644 index 0000000..15f8fad --- /dev/null +++ b/Function/BNRemoveUserDataReference.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRemoveUserDataReference(BNBinaryView* view, uint64_t fromAddr, uint64_t toAddr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNRemoveUserDataReference" + )] + internal static extern void BNRemoveUserDataReference( + + // BNBinaryView* view + IntPtr view , + + // uint64_t fromAddr + ulong fromAddr , + + // uint64_t toAddr + ulong toAddr + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoveUserDataTag.cs b/Function/BNRemoveUserDataTag.cs new file mode 100644 index 0000000..c92d688 --- /dev/null +++ b/Function/BNRemoveUserDataTag.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRemoveUserDataTag(BNBinaryView* view, uint64_t addr, BNTag* tag) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNRemoveUserDataTag" + )] + internal static extern void BNRemoveUserDataTag( + + // BNBinaryView* view + IntPtr view , + + // uint64_t addr + ulong addr , + + // BNTag* tag + IntPtr tag + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoveUserDataTagsOfType.cs b/Function/BNRemoveUserDataTagsOfType.cs new file mode 100644 index 0000000..f5d5939 --- /dev/null +++ b/Function/BNRemoveUserDataTagsOfType.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRemoveUserDataTagsOfType(BNBinaryView* view, uint64_t addr, BNTagType* tagType) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNRemoveUserDataTagsOfType" + )] + internal static extern void BNRemoveUserDataTagsOfType( + + // BNBinaryView* view + IntPtr view , + + // uint64_t addr + ulong addr , + + // BNTagType* tagType + IntPtr tagType + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoveUserFunction.cs b/Function/BNRemoveUserFunction.cs new file mode 100644 index 0000000..728a94f --- /dev/null +++ b/Function/BNRemoveUserFunction.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRemoveUserFunction(BNBinaryView* view, BNFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNRemoveUserFunction" + )] + internal static extern void BNRemoveUserFunction( + + // BNBinaryView* view + IntPtr view , + + // BNFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoveUserFunctionTag.cs b/Function/BNRemoveUserFunctionTag.cs new file mode 100644 index 0000000..b7f3ae5 --- /dev/null +++ b/Function/BNRemoveUserFunctionTag.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRemoveUserFunctionTag(BNFunction* func, BNTag* tag) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNRemoveUserFunctionTag" + )] + internal static extern void BNRemoveUserFunctionTag( + + // BNFunction* func + IntPtr func , + + // BNTag* tag + IntPtr tag + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoveUserFunctionTagsOfType.cs b/Function/BNRemoveUserFunctionTagsOfType.cs new file mode 100644 index 0000000..13a44a5 --- /dev/null +++ b/Function/BNRemoveUserFunctionTagsOfType.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRemoveUserFunctionTagsOfType(BNFunction* func, BNTagType* tagType) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoveUserFunctionTagsOfType" + )] + internal static extern void BNRemoveUserFunctionTagsOfType( + + // BNFunction* func + IntPtr func , + + // BNTagType* tagType + IntPtr tagType + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoveUserSection.cs b/Function/BNRemoveUserSection.cs new file mode 100644 index 0000000..e0da833 --- /dev/null +++ b/Function/BNRemoveUserSection.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRemoveUserSection(BNBinaryView* view, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoveUserSection" + )] + internal static extern void BNRemoveUserSection( + + // BNBinaryView* view + IntPtr view , + + // const char* name + string name + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoveUserSegment.cs b/Function/BNRemoveUserSegment.cs new file mode 100644 index 0000000..557b30c --- /dev/null +++ b/Function/BNRemoveUserSegment.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRemoveUserSegment(BNBinaryView* view, uint64_t start, uint64_t length) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoveUserSegment" + )] + internal static extern void BNRemoveUserSegment( + + // BNBinaryView* view + IntPtr view , + + // uint64_t start + ulong start , + + // uint64_t length + ulong length + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoveUserTypeFieldReference.cs b/Function/BNRemoveUserTypeFieldReference.cs new file mode 100644 index 0000000..11fe52f --- /dev/null +++ b/Function/BNRemoveUserTypeFieldReference.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRemoveUserTypeFieldReference(BNFunction* func, BNArchitecture* fromArch, uint64_t fromAddr, BNQualifiedName* name, uint64_t offset, uint64_t size) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoveUserTypeFieldReference" + )] + internal static extern void BNRemoveUserTypeFieldReference( + + // BNFunction* func + IntPtr func , + + // BNArchitecture* fromArch + IntPtr fromArch , + + // uint64_t fromAddr + ulong fromAddr , + + // BNQualifiedName* name + IntPtr name , + + // uint64_t offset + ulong offset , + + // uint64_t size + ulong size + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoveUserTypeReference.cs b/Function/BNRemoveUserTypeReference.cs new file mode 100644 index 0000000..36b91f2 --- /dev/null +++ b/Function/BNRemoveUserTypeReference.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRemoveUserTypeReference(BNFunction* func, BNArchitecture* fromArch, uint64_t fromAddr, BNQualifiedName* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRemoveUserTypeReference" + )] + internal static extern void BNRemoveUserTypeReference( + + // BNFunction* func + IntPtr func , + + // BNArchitecture* fromArch + IntPtr fromArch , + + // uint64_t fromAddr + ulong fromAddr , + + // BNQualifiedName* name + IntPtr name + + ); + } +} \ No newline at end of file diff --git a/Function/BNRemoveViewData.cs b/Function/BNRemoveViewData.cs new file mode 100644 index 0000000..96b4cc0 --- /dev/null +++ b/Function/BNRemoveViewData.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNRemoveViewData(BNBinaryView* view, uint64_t offset, uint64_t len) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNRemoveViewData" + )] + internal static extern ulong BNRemoveViewData( + + // BNBinaryView* view + IntPtr view , + + // uint64_t offset + ulong offset , + + // uint64_t len + ulong len + ); + } +} \ No newline at end of file diff --git a/Function/BNRenameAnalysisType.cs b/Function/BNRenameAnalysisType.cs new file mode 100644 index 0000000..4caa8b0 --- /dev/null +++ b/Function/BNRenameAnalysisType.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRenameAnalysisType(BNBinaryView* view, BNQualifiedName* oldName, BNQualifiedName* newName) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNRenameAnalysisType" + )] + internal static extern void BNRenameAnalysisType( + + // BNBinaryView* view + IntPtr view , + + // BNQualifiedName* oldName + in BNQualifiedName oldName , + + // BNQualifiedName* newName + in BNQualifiedName newName + ); + } +} \ No newline at end of file diff --git a/Function/BNRenameFile.cs b/Function/BNRenameFile.cs new file mode 100644 index 0000000..ac0fe77 --- /dev/null +++ b/Function/BNRenameFile.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRenameFile(const char* source, const char* dest) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRenameFile" + )] + internal static extern bool BNRenameFile( + + // const char* source + string source , + + // const char* dest + string dest + + ); + } +} \ No newline at end of file diff --git a/Function/BNRenameTypeArchiveType.cs b/Function/BNRenameTypeArchiveType.cs new file mode 100644 index 0000000..4c2cd89 --- /dev/null +++ b/Function/BNRenameTypeArchiveType.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRenameTypeArchiveType(BNTypeArchive* archive, const char* id, BNQualifiedName* newName) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRenameTypeArchiveType" + )] + internal static extern bool BNRenameTypeArchiveType( + + // BNTypeArchive* archive + IntPtr archive , + + // const char* id + string id , + + // BNQualifiedName* newName + IntPtr newName + + ); + } +} \ No newline at end of file diff --git a/Function/BNRenderLinesForData.cs b/Function/BNRenderLinesForData.cs new file mode 100644 index 0000000..3268ba9 --- /dev/null +++ b/Function/BNRenderLinesForData.cs @@ -0,0 +1,53 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDisassemblyTextLine* BNRenderLinesForData(BNBinaryView* data, uint64_t addr, BNType* type, BNInstructionTextToken* prefix, uint64_t prefixCount, uint64_t width, uint64_t* count, BNTypeContext* typeCtx, uint64_t ctxCount, const char* language) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRenderLinesForData" + )] + internal static extern IntPtr BNRenderLinesForData( + + // BNBinaryView* data + IntPtr data , + + // uint64_t addr + ulong addr , + + // BNType* type + IntPtr type , + + // BNInstructionTextToken* prefix + IntPtr prefix , + + // uint64_t prefixCount + ulong prefixCount , + + // uint64_t width + ulong width , + + // uint64_t* count + IntPtr count , + + // BNTypeContext* typeCtx + IntPtr typeCtx , + + // uint64_t ctxCount + ulong ctxCount , + + // const char* language + string language + + ); + } +} \ No newline at end of file diff --git a/Function/BNReplaceEnumerationBuilderMember.cs b/Function/BNReplaceEnumerationBuilderMember.cs new file mode 100644 index 0000000..67ed576 --- /dev/null +++ b/Function/BNReplaceEnumerationBuilderMember.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNReplaceEnumerationBuilderMember(BNEnumerationBuilder* e, uint64_t idx, const char* name, uint64_t value) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNReplaceEnumerationBuilderMember" + )] + internal static extern void BNReplaceEnumerationBuilderMember( + + // BNEnumerationBuilder* e + IntPtr e , + + // uint64_t idx + ulong idx , + + // const char* name + string name , + + // uint64_t _value + ulong _value + ); + } +} \ No newline at end of file diff --git a/Function/BNReplaceFlowGraphNode.cs b/Function/BNReplaceFlowGraphNode.cs new file mode 100644 index 0000000..505e1bb --- /dev/null +++ b/Function/BNReplaceFlowGraphNode.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNReplaceFlowGraphNode(BNFlowGraph* graph, uint64_t i, BNFlowGraphNode* newNode) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNReplaceFlowGraphNode" + )] + internal static extern void BNReplaceFlowGraphNode( + + // BNFlowGraph* graph + IntPtr graph , + + // uint64_t i + ulong i , + + // BNFlowGraphNode* newNode + IntPtr newNode + ); + } +} \ No newline at end of file diff --git a/Function/BNReplaceHighLevelILExpr.cs b/Function/BNReplaceHighLevelILExpr.cs new file mode 100644 index 0000000..437b410 --- /dev/null +++ b/Function/BNReplaceHighLevelILExpr.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNReplaceHighLevelILExpr(BNHighLevelILFunction* func, uint64_t expr, uint64_t newExpr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNReplaceHighLevelILExpr" + )] + internal static extern void BNReplaceHighLevelILExpr( + + // BNHighLevelILFunction* func + IntPtr func , + + // uint64_t expr + HighLevelILExpressionIndex expr , + + // uint64_t newExpr + HighLevelILExpressionIndex newExpr + ); + } +} \ No newline at end of file diff --git a/Function/BNReplaceLowLevelILExpr.cs b/Function/BNReplaceLowLevelILExpr.cs new file mode 100644 index 0000000..700ee6a --- /dev/null +++ b/Function/BNReplaceLowLevelILExpr.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNReplaceLowLevelILExpr(BNLowLevelILFunction* func, uint64_t expr, uint64_t newExpr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNReplaceLowLevelILExpr" + )] + internal static extern void BNReplaceLowLevelILExpr( + + // BNLowLevelILFunction* func + IntPtr func , + + // uint64_t expr + LowLevelILExpressionIndex expr , + + // uint64_t newExpr + LowLevelILExpressionIndex newExpr + ); + } +} \ No newline at end of file diff --git a/Function/BNReplaceMediumLevelILExpr.cs b/Function/BNReplaceMediumLevelILExpr.cs new file mode 100644 index 0000000..90caccb --- /dev/null +++ b/Function/BNReplaceMediumLevelILExpr.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNReplaceMediumLevelILExpr(BNMediumLevelILFunction* func, uint64_t expr, uint64_t newExpr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNReplaceMediumLevelILExpr" + )] + internal static extern void BNReplaceMediumLevelILExpr( + + // BNMediumLevelILFunction* func + IntPtr func , + + // uint64_t expr + MediumLevelILExpressionIndex expr , + + // uint64_t newExpr + MediumLevelILExpressionIndex newExpr + ); + } +} \ No newline at end of file diff --git a/Function/BNReplaceMediumLevelILInstruction.cs b/Function/BNReplaceMediumLevelILInstruction.cs new file mode 100644 index 0000000..128957a --- /dev/null +++ b/Function/BNReplaceMediumLevelILInstruction.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNReplaceMediumLevelILInstruction(BNMediumLevelILFunction* func, uint64_t instr, uint64_t expr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNReplaceMediumLevelILInstruction" + )] + internal static extern void BNReplaceMediumLevelILInstruction( + + // BNMediumLevelILFunction* func + IntPtr func , + + // uint64_t instr + ulong instr , + + // uint64_t expr + ulong expr + + ); + } +} \ No newline at end of file diff --git a/Function/BNReplaceStructureBuilderMember.cs b/Function/BNReplaceStructureBuilderMember.cs new file mode 100644 index 0000000..5b1a284 --- /dev/null +++ b/Function/BNReplaceStructureBuilderMember.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNReplaceStructureBuilderMember(BNStructureBuilder* s, uint64_t idx, BNTypeWithConfidence* type, const char* name, bool overwriteExisting) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNReplaceStructureBuilderMember" + )] + internal static extern void BNReplaceStructureBuilderMember( + + // BNStructureBuilder* s + IntPtr s , + + // uint64_t idx + ulong idx , + + // BNTypeWithConfidence* type + in BNTypeWithConfidence type , + + // const char* name + string name , + + // bool overwriteExisting + bool overwriteExisting + ); + } +} \ No newline at end of file diff --git a/Function/BNRepositoryFreePluginDirectoryList.cs b/Function/BNRepositoryFreePluginDirectoryList.cs new file mode 100644 index 0000000..271b5c5 --- /dev/null +++ b/Function/BNRepositoryFreePluginDirectoryList.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRepositoryFreePluginDirectoryList(const char** list, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRepositoryFreePluginDirectoryList" + )] + internal static extern void BNRepositoryFreePluginDirectoryList( + + // const char** list + string[] list , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNRepositoryGetPluginByPath.cs b/Function/BNRepositoryGetPluginByPath.cs new file mode 100644 index 0000000..08c6b9b --- /dev/null +++ b/Function/BNRepositoryGetPluginByPath.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRepoPlugin* BNRepositoryGetPluginByPath(BNRepository* r, const char* pluginPath) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRepositoryGetPluginByPath" + )] + internal static extern IntPtr BNRepositoryGetPluginByPath( + + // BNRepository* r + IntPtr r , + + // const char* pluginPath + string pluginPath + + ); + } +} \ No newline at end of file diff --git a/Function/BNRepositoryGetPlugins.cs b/Function/BNRepositoryGetPlugins.cs new file mode 100644 index 0000000..3ae4853 --- /dev/null +++ b/Function/BNRepositoryGetPlugins.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRepoPlugin** BNRepositoryGetPlugins(BNRepository* r, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRepositoryGetPlugins" + )] + internal static extern IntPtr BNRepositoryGetPlugins( + + // BNRepository* r + IntPtr r , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNRepositoryGetPluginsPath.cs b/Function/BNRepositoryGetPluginsPath.cs new file mode 100644 index 0000000..a4dfe7d --- /dev/null +++ b/Function/BNRepositoryGetPluginsPath.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNRepositoryGetPluginsPath(BNRepository* r) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRepositoryGetPluginsPath" + )] + internal static extern IntPtr BNRepositoryGetPluginsPath( + + // BNRepository* r + IntPtr r + + ); + } +} \ No newline at end of file diff --git a/Function/BNRepositoryGetRepoPath.cs b/Function/BNRepositoryGetRepoPath.cs new file mode 100644 index 0000000..802ff1e --- /dev/null +++ b/Function/BNRepositoryGetRepoPath.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNRepositoryGetRepoPath(BNRepository* r) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRepositoryGetRepoPath" + )] + internal static extern IntPtr BNRepositoryGetRepoPath( + + // BNRepository* r + IntPtr r + + ); + } +} \ No newline at end of file diff --git a/Function/BNRepositoryGetRepositoryByPath.cs b/Function/BNRepositoryGetRepositoryByPath.cs new file mode 100644 index 0000000..7c89f44 --- /dev/null +++ b/Function/BNRepositoryGetRepositoryByPath.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRepository* BNRepositoryGetRepositoryByPath(BNRepositoryManager* r, const char* repoPath) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRepositoryGetRepositoryByPath" + )] + internal static extern IntPtr BNRepositoryGetRepositoryByPath( + + // BNRepositoryManager* r + IntPtr r , + + // const char* repoPath + string repoPath + + ); + } +} \ No newline at end of file diff --git a/Function/BNRepositoryGetUrl.cs b/Function/BNRepositoryGetUrl.cs new file mode 100644 index 0000000..4cc9545 --- /dev/null +++ b/Function/BNRepositoryGetUrl.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNRepositoryGetUrl(BNRepository* r) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRepositoryGetUrl" + )] + internal static extern IntPtr BNRepositoryGetUrl( + + // BNRepository* r + IntPtr r + + ); + } +} \ No newline at end of file diff --git a/Function/BNRepositoryManagerAddRepository.cs b/Function/BNRepositoryManagerAddRepository.cs new file mode 100644 index 0000000..c6c5f48 --- /dev/null +++ b/Function/BNRepositoryManagerAddRepository.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRepositoryManagerAddRepository(BNRepositoryManager* r, const char* url, const char* repoPath) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRepositoryManagerAddRepository" + )] + internal static extern bool BNRepositoryManagerAddRepository( + + // BNRepositoryManager* r + IntPtr r , + + // const char* url + string url , + + // const char* repoPath + string repoPath + + ); + } +} \ No newline at end of file diff --git a/Function/BNRepositoryManagerCheckForUpdates.cs b/Function/BNRepositoryManagerCheckForUpdates.cs new file mode 100644 index 0000000..94c7e55 --- /dev/null +++ b/Function/BNRepositoryManagerCheckForUpdates.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRepositoryManagerCheckForUpdates(BNRepositoryManager* r) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRepositoryManagerCheckForUpdates" + )] + internal static extern bool BNRepositoryManagerCheckForUpdates( + + // BNRepositoryManager* r + IntPtr r + + ); + } +} \ No newline at end of file diff --git a/Function/BNRepositoryManagerGetDefaultRepository.cs b/Function/BNRepositoryManagerGetDefaultRepository.cs new file mode 100644 index 0000000..b457db5 --- /dev/null +++ b/Function/BNRepositoryManagerGetDefaultRepository.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRepository* BNRepositoryManagerGetDefaultRepository(BNRepositoryManager* r) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRepositoryManagerGetDefaultRepository" + )] + internal static extern IntPtr BNRepositoryManagerGetDefaultRepository( + + // BNRepositoryManager* r + IntPtr r + + ); + } +} \ No newline at end of file diff --git a/Function/BNRepositoryManagerGetRepositories.cs b/Function/BNRepositoryManagerGetRepositories.cs new file mode 100644 index 0000000..7a94e7d --- /dev/null +++ b/Function/BNRepositoryManagerGetRepositories.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNRepository** BNRepositoryManagerGetRepositories(BNRepositoryManager* r, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRepositoryManagerGetRepositories" + )] + internal static extern IntPtr BNRepositoryManagerGetRepositories( + + // BNRepositoryManager* r + IntPtr r , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNRequestAdvancedFunctionAnalysisData.cs b/Function/BNRequestAdvancedFunctionAnalysisData.cs new file mode 100644 index 0000000..d329a33 --- /dev/null +++ b/Function/BNRequestAdvancedFunctionAnalysisData.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRequestAdvancedFunctionAnalysisData(BNFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRequestAdvancedFunctionAnalysisData" + )] + internal static extern void BNRequestAdvancedFunctionAnalysisData( + + // BNFunction* func + IntPtr func + + ); + } +} \ No newline at end of file diff --git a/Function/BNRequestFunctionDebugReport.cs b/Function/BNRequestFunctionDebugReport.cs new file mode 100644 index 0000000..083157b --- /dev/null +++ b/Function/BNRequestFunctionDebugReport.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRequestFunctionDebugReport(BNFunction* func, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRequestFunctionDebugReport" + )] + internal static extern void BNRequestFunctionDebugReport( + + // BNFunction* func + IntPtr func , + + // const char* name + string name + + ); + } +} \ No newline at end of file diff --git a/Function/BNResetDisassemblyTextRendererDeduplicatedComments.cs b/Function/BNResetDisassemblyTextRendererDeduplicatedComments.cs new file mode 100644 index 0000000..11f4cdc --- /dev/null +++ b/Function/BNResetDisassemblyTextRendererDeduplicatedComments.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNResetDisassemblyTextRendererDeduplicatedComments(BNDisassemblyTextRenderer* renderer) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNResetDisassemblyTextRendererDeduplicatedComments" + )] + internal static extern void BNResetDisassemblyTextRendererDeduplicatedComments( + + // BNDisassemblyTextRenderer* renderer + IntPtr renderer + + ); + } +} \ No newline at end of file diff --git a/Function/BNResetMemoryMap.cs b/Function/BNResetMemoryMap.cs new file mode 100644 index 0000000..17ac9ba --- /dev/null +++ b/Function/BNResetMemoryMap.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNResetMemoryMap(BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNResetMemoryMap" + )] + internal static extern void BNResetMemoryMap( + + // BNBinaryView* view + IntPtr view + ); + } +} \ No newline at end of file diff --git a/Function/BNResolveStructureMemberOrBaseMember.cs b/Function/BNResolveStructureMemberOrBaseMember.cs new file mode 100644 index 0000000..8046d6e --- /dev/null +++ b/Function/BNResolveStructureMemberOrBaseMember.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNResolveStructureMemberOrBaseMember(BNStructure* s, BNBinaryView* data, uint64_t offset, uint64_t size, void* callbackContext, void** resolveFunc, bool memberIndexHintValid, uint64_t memberIndexHint) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNResolveStructureMemberOrBaseMember" + )] + internal static extern bool BNResolveStructureMemberOrBaseMember( + + // BNStructure* s + IntPtr s , + + // BNBinaryView* data + IntPtr data , + + // uint64_t offset + ulong offset , + + // uint64_t size + ulong size , + + // void* callbackContext + IntPtr callbackContext , + + // void** resolveFunc + IntPtr resolveFunc , + + // bool memberIndexHintValid + bool memberIndexHintValid , + + // uint64_t memberIndexHint + ulong memberIndexHint + + ); + } +} \ No newline at end of file diff --git a/Function/BNRevertUndoActions.cs b/Function/BNRevertUndoActions.cs new file mode 100644 index 0000000..822aa82 --- /dev/null +++ b/Function/BNRevertUndoActions.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRevertUndoActions(BNFileMetadata* file, const char* id) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRevertUndoActions" + )] + internal static extern void BNRevertUndoActions( + + // BNFileMetadata* file + IntPtr file , + + // const char* id + string id + ); + } +} \ No newline at end of file diff --git a/Function/BNRunProgressDialog.cs b/Function/BNRunProgressDialog.cs new file mode 100644 index 0000000..3e474c7 --- /dev/null +++ b/Function/BNRunProgressDialog.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNRunProgressDialog(const char* title, bool canCancel, void** task, void* taskCtxt) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRunProgressDialog" + )] + internal static extern bool BNRunProgressDialog( + + // const char* title + string title , + + // bool canCancel + bool canCancel , + + // void** task + IntPtr task , + + // void* taskCtxt + IntPtr taskCtxt + + ); + } +} \ No newline at end of file diff --git a/Function/BNRustSimplifyStrToFQN.cs b/Function/BNRustSimplifyStrToFQN.cs new file mode 100644 index 0000000..9724f1b --- /dev/null +++ b/Function/BNRustSimplifyStrToFQN.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNRustSimplifyStrToFQN(BNQualifiedName @return, const char* param1, bool param2) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRustSimplifyStrToFQN" + )] + internal static extern void BNRustSimplifyStrToFQN( + + // BNQualifiedName _return + QualifiedName _return , + + // const char* param1 + string param1 , + + // bool param2 + bool param2 + + ); + } +} \ No newline at end of file diff --git a/Function/BNRustSimplifyStrToStr.cs b/Function/BNRustSimplifyStrToStr.cs new file mode 100644 index 0000000..f8e98b5 --- /dev/null +++ b/Function/BNRustSimplifyStrToStr.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNRustSimplifyStrToStr(const char* param1) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNRustSimplifyStrToStr" + )] + internal static extern IntPtr BNRustSimplifyStrToStr( + + // const char* param1 + string param1 + + ); + } +} \ No newline at end of file diff --git a/Function/BNSaveAutoSnapshot.cs b/Function/BNSaveAutoSnapshot.cs new file mode 100644 index 0000000..c2dc3a7 --- /dev/null +++ b/Function/BNSaveAutoSnapshot.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNSaveAutoSnapshot(BNBinaryView* data, BNSaveSettings* settings) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSaveAutoSnapshot" + )] + internal static extern bool BNSaveAutoSnapshot( + + // BNBinaryView* data + IntPtr data , + + // BNSaveSettings* settings + IntPtr settings + ); + } +} \ No newline at end of file diff --git a/Function/BNSaveAutoSnapshotWithProgress.cs b/Function/BNSaveAutoSnapshotWithProgress.cs new file mode 100644 index 0000000..04b11c3 --- /dev/null +++ b/Function/BNSaveAutoSnapshotWithProgress.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNSaveAutoSnapshotWithProgress(BNBinaryView* data, void* ctxt, void** progress, BNSaveSettings* settings) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSaveAutoSnapshotWithProgress" + )] + internal static extern bool BNSaveAutoSnapshotWithProgress( + + // BNBinaryView* data + IntPtr data , + + // void* ctxt + IntPtr ctxt , + + // void* progress + IntPtr progress , + + // BNSaveSettings* settings + IntPtr settings + ); + } +} \ No newline at end of file diff --git a/Function/BNSaveLastRun.cs b/Function/BNSaveLastRun.cs new file mode 100644 index 0000000..11c54f2 --- /dev/null +++ b/Function/BNSaveLastRun.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public static partial class Core + { + public static void SaveLastRun() + { + NativeMethods.BNSaveLastRun(); + } + } + + internal static partial class NativeMethods + { + /// + /// void BNSaveLastRun() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSaveLastRun" + )] + public static extern void BNSaveLastRun(); + } +} \ No newline at end of file diff --git a/Function/BNSaveToFile.cs b/Function/BNSaveToFile.cs new file mode 100644 index 0000000..84d8390 --- /dev/null +++ b/Function/BNSaveToFile.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNSaveToFile(BNBinaryView* view, BNFileAccessor* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSaveToFile" + )] + internal static extern bool BNSaveToFile( + + // BNBinaryView* view + IntPtr view , + + // BNFileAccessor* file + in BNFileAccessor file + ); + } +} \ No newline at end of file diff --git a/Function/BNSaveToFilename.cs b/Function/BNSaveToFilename.cs new file mode 100644 index 0000000..82a35ca --- /dev/null +++ b/Function/BNSaveToFilename.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNSaveToFilename(BNBinaryView* view, const char* filename) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSaveToFilename" + )] + internal static extern bool BNSaveToFilename( + + // BNBinaryView* view + IntPtr view , + + // const char* filename + string filename + ); + } +} \ No newline at end of file diff --git a/Function/BNScriptingInstanceCompleteInput.cs b/Function/BNScriptingInstanceCompleteInput.cs new file mode 100644 index 0000000..44a52b4 --- /dev/null +++ b/Function/BNScriptingInstanceCompleteInput.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNScriptingInstanceCompleteInput(BNScriptingInstance* instance, const char* text, uint64_t state) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNScriptingInstanceCompleteInput" + )] + internal static extern IntPtr BNScriptingInstanceCompleteInput( + + // BNScriptingInstance* instance + IntPtr instance , + + // const char* text + string text , + + // uint64_t state + ulong state + + ); + } +} \ No newline at end of file diff --git a/Function/BNScriptingInstanceReleaseBinaryView.cs b/Function/BNScriptingInstanceReleaseBinaryView.cs new file mode 100644 index 0000000..0227d0d --- /dev/null +++ b/Function/BNScriptingInstanceReleaseBinaryView.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNScriptingInstanceReleaseBinaryView(BNScriptingInstance* instance, BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNScriptingInstanceReleaseBinaryView" + )] + internal static extern void BNScriptingInstanceReleaseBinaryView( + + // BNScriptingInstance* instance + IntPtr instance , + + // BNBinaryView* view + IntPtr view + + ); + } +} \ No newline at end of file diff --git a/Function/BNSearch.cs b/Function/BNSearch.cs new file mode 100644 index 0000000..f5ebc83 --- /dev/null +++ b/Function/BNSearch.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNSearch(BNBinaryView* view, const char* query, void* context, void** progressCallback, void* matchContext, void** callback) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSearch" + )] + internal static extern bool BNSearch( + + // BNBinaryView* view + IntPtr view , + + // const char* query + string query , + + // void* context + IntPtr context , + + // void* progressCallback + IntPtr progressCallback , + + // void* matchContext + IntPtr matchContext , + + // void* callback + IntPtr callback + ); + } +} \ No newline at end of file diff --git a/Function/BNSecretsProviderHasData.cs b/Function/BNSecretsProviderHasData.cs new file mode 100644 index 0000000..723416f --- /dev/null +++ b/Function/BNSecretsProviderHasData.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNSecretsProviderHasData(BNSecretsProvider* provider, const char* key) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSecretsProviderHasData" + )] + internal static extern bool BNSecretsProviderHasData( + + // BNSecretsProvider* provider + IntPtr provider , + + // const char* key + string key + + ); + } +} \ No newline at end of file diff --git a/Function/BNSectionGetAlign.cs b/Function/BNSectionGetAlign.cs new file mode 100644 index 0000000..ea088495 --- /dev/null +++ b/Function/BNSectionGetAlign.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNSectionGetAlign(BNSection* section) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSectionGetAlign" + )] + internal static extern ulong BNSectionGetAlign( + + // BNSection* section + IntPtr section + + ); + } +} \ No newline at end of file diff --git a/Function/BNSectionGetEnd.cs b/Function/BNSectionGetEnd.cs new file mode 100644 index 0000000..f33890f --- /dev/null +++ b/Function/BNSectionGetEnd.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNSectionGetEnd(BNSection* section) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSectionGetEnd" + )] + internal static extern ulong BNSectionGetEnd( + + // BNSection* section + IntPtr section + + ); + } +} \ No newline at end of file diff --git a/Function/BNSectionGetEntrySize.cs b/Function/BNSectionGetEntrySize.cs new file mode 100644 index 0000000..5a5187d --- /dev/null +++ b/Function/BNSectionGetEntrySize.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNSectionGetEntrySize(BNSection* section) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSectionGetEntrySize" + )] + internal static extern ulong BNSectionGetEntrySize( + + // BNSection* section + IntPtr section + + ); + } +} \ No newline at end of file diff --git a/Function/BNSectionGetInfoData.cs b/Function/BNSectionGetInfoData.cs new file mode 100644 index 0000000..d3106c7 --- /dev/null +++ b/Function/BNSectionGetInfoData.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNSectionGetInfoData(BNSection* section) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSectionGetInfoData" + )] + internal static extern ulong BNSectionGetInfoData( + + // BNSection* section + IntPtr section + + ); + } +} \ No newline at end of file diff --git a/Function/BNSectionGetInfoSection.cs b/Function/BNSectionGetInfoSection.cs new file mode 100644 index 0000000..513e02f --- /dev/null +++ b/Function/BNSectionGetInfoSection.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNSectionGetInfoSection(BNSection* section) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSectionGetInfoSection" + )] + internal static extern IntPtr BNSectionGetInfoSection( + + // BNSection* section + IntPtr section + + ); + } +} \ No newline at end of file diff --git a/Function/BNSectionGetLength.cs b/Function/BNSectionGetLength.cs new file mode 100644 index 0000000..91e402c --- /dev/null +++ b/Function/BNSectionGetLength.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNSectionGetLength(BNSection* section) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSectionGetLength" + )] + internal static extern ulong BNSectionGetLength( + + // BNSection* section + IntPtr section + + ); + } +} \ No newline at end of file diff --git a/Function/BNSectionGetLinkedSection.cs b/Function/BNSectionGetLinkedSection.cs new file mode 100644 index 0000000..1b488ae --- /dev/null +++ b/Function/BNSectionGetLinkedSection.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNSectionGetLinkedSection(BNSection* section) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSectionGetLinkedSection" + )] + internal static extern IntPtr BNSectionGetLinkedSection( + + // BNSection* section + IntPtr section + + ); + } +} \ No newline at end of file diff --git a/Function/BNSectionGetName.cs b/Function/BNSectionGetName.cs new file mode 100644 index 0000000..1d1684d --- /dev/null +++ b/Function/BNSectionGetName.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNSectionGetName(BNSection* section) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSectionGetName" + )] + internal static extern IntPtr BNSectionGetName( + + // BNSection* section + IntPtr section + + ); + } +} \ No newline at end of file diff --git a/Function/BNSectionGetSemantics.cs b/Function/BNSectionGetSemantics.cs new file mode 100644 index 0000000..a55413f --- /dev/null +++ b/Function/BNSectionGetSemantics.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNSectionSemantics BNSectionGetSemantics(BNSection* section) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSectionGetSemantics" + )] + internal static extern SectionSemantics BNSectionGetSemantics( + + // BNSection* section + IntPtr section + + ); + } +} \ No newline at end of file diff --git a/Function/BNSectionGetStart.cs b/Function/BNSectionGetStart.cs new file mode 100644 index 0000000..de80066 --- /dev/null +++ b/Function/BNSectionGetStart.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNSectionGetStart(BNSection* section) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSectionGetStart" + )] + internal static extern ulong BNSectionGetStart( + + // BNSection* section + IntPtr section + + ); + } +} \ No newline at end of file diff --git a/Function/BNSectionGetType.cs b/Function/BNSectionGetType.cs new file mode 100644 index 0000000..3af5f51 --- /dev/null +++ b/Function/BNSectionGetType.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNSectionGetType(BNSection* section) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSectionGetType" + )] + internal static extern IntPtr BNSectionGetType( + + // BNSection* section + IntPtr section + + ); + } +} \ No newline at end of file diff --git a/Function/BNSectionIsAutoDefined.cs b/Function/BNSectionIsAutoDefined.cs new file mode 100644 index 0000000..0bbc4b5 --- /dev/null +++ b/Function/BNSectionIsAutoDefined.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNSectionIsAutoDefined(BNSection* section) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSectionIsAutoDefined" + )] + internal static extern bool BNSectionIsAutoDefined( + + // BNSection* section + IntPtr section + + ); + } +} \ No newline at end of file diff --git a/Function/BNSeekBinaryReader.cs b/Function/BNSeekBinaryReader.cs new file mode 100644 index 0000000..fa5a350 --- /dev/null +++ b/Function/BNSeekBinaryReader.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSeekBinaryReader(BNBinaryReader* stream, uint64_t offset) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSeekBinaryReader" + )] + internal static extern void BNSeekBinaryReader( + + // BNBinaryReader* stream + IntPtr stream , + + // uint64_t offset + ulong offset + ); + } +} \ No newline at end of file diff --git a/Function/BNSeekBinaryReaderRelative.cs b/Function/BNSeekBinaryReaderRelative.cs new file mode 100644 index 0000000..6a76a4b --- /dev/null +++ b/Function/BNSeekBinaryReaderRelative.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSeekBinaryReaderRelative(BNBinaryReader* stream, int64_t offset) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSeekBinaryReaderRelative" + )] + internal static extern void BNSeekBinaryReaderRelative( + + // BNBinaryReader* stream + IntPtr stream , + + // int64_t offset + long offset + + ); + } +} \ No newline at end of file diff --git a/Function/BNSeekBinaryWriter.cs b/Function/BNSeekBinaryWriter.cs new file mode 100644 index 0000000..82a02f6 --- /dev/null +++ b/Function/BNSeekBinaryWriter.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSeekBinaryWriter(BNBinaryWriter* stream, uint64_t offset) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSeekBinaryWriter" + )] + internal static extern void BNSeekBinaryWriter( + + // BNBinaryWriter* stream + IntPtr stream , + + // uint64_t offset + ulong offset + ); + } +} \ No newline at end of file diff --git a/Function/BNSeekBinaryWriterRelative.cs b/Function/BNSeekBinaryWriterRelative.cs new file mode 100644 index 0000000..8478b4c --- /dev/null +++ b/Function/BNSeekBinaryWriterRelative.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSeekBinaryWriterRelative(BNBinaryWriter* stream, int64_t offset) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSeekBinaryWriterRelative" + )] + internal static extern void BNSeekBinaryWriterRelative( + + // BNBinaryWriter* stream + IntPtr stream , + + // int64_t offset + long offset + + ); + } +} \ No newline at end of file diff --git a/Function/BNSeekLinearViewCursorToAddress.cs b/Function/BNSeekLinearViewCursorToAddress.cs new file mode 100644 index 0000000..e1acc72 --- /dev/null +++ b/Function/BNSeekLinearViewCursorToAddress.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSeekLinearViewCursorToAddress(BNLinearViewCursor* cursor, uint64_t addr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSeekLinearViewCursorToAddress" + )] + internal static extern void BNSeekLinearViewCursorToAddress( + + // BNLinearViewCursor* cursor + IntPtr cursor , + + // uint64_t addr + ulong addr + ); + } +} \ No newline at end of file diff --git a/Function/BNSeekLinearViewCursorToBegin.cs b/Function/BNSeekLinearViewCursorToBegin.cs new file mode 100644 index 0000000..01fcee5 --- /dev/null +++ b/Function/BNSeekLinearViewCursorToBegin.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSeekLinearViewCursorToBegin(BNLinearViewCursor* cursor) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSeekLinearViewCursorToBegin" + )] + internal static extern void BNSeekLinearViewCursorToBegin( + + // BNLinearViewCursor* cursor + IntPtr cursor + ); + } +} \ No newline at end of file diff --git a/Function/BNSeekLinearViewCursorToCursorPath.cs b/Function/BNSeekLinearViewCursorToCursorPath.cs new file mode 100644 index 0000000..e5b3661 --- /dev/null +++ b/Function/BNSeekLinearViewCursorToCursorPath.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNSeekLinearViewCursorToCursorPath(BNLinearViewCursor* cursor, BNLinearViewCursor* path) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSeekLinearViewCursorToCursorPath" + )] + internal static extern bool BNSeekLinearViewCursorToCursorPath( + + // BNLinearViewCursor* cursor + IntPtr cursor , + + // BNLinearViewCursor* path + IntPtr path + + ); + } +} \ No newline at end of file diff --git a/Function/BNSeekLinearViewCursorToCursorPathAndAddress.cs b/Function/BNSeekLinearViewCursorToCursorPathAndAddress.cs new file mode 100644 index 0000000..39169e1 --- /dev/null +++ b/Function/BNSeekLinearViewCursorToCursorPathAndAddress.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNSeekLinearViewCursorToCursorPathAndAddress(BNLinearViewCursor* cursor, BNLinearViewCursor* path, uint64_t addr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSeekLinearViewCursorToCursorPathAndAddress" + )] + internal static extern bool BNSeekLinearViewCursorToCursorPathAndAddress( + + // BNLinearViewCursor* cursor + IntPtr cursor , + + // BNLinearViewCursor* path + IntPtr path , + + // uint64_t addr + ulong addr + + ); + } +} \ No newline at end of file diff --git a/Function/BNSeekLinearViewCursorToEnd.cs b/Function/BNSeekLinearViewCursorToEnd.cs new file mode 100644 index 0000000..b70e99c --- /dev/null +++ b/Function/BNSeekLinearViewCursorToEnd.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSeekLinearViewCursorToEnd(BNLinearViewCursor* cursor) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSeekLinearViewCursorToEnd" + )] + internal static extern void BNSeekLinearViewCursorToEnd( + + // BNLinearViewCursor* cursor + IntPtr cursor + ); + } +} \ No newline at end of file diff --git a/Function/BNSeekLinearViewCursorToOrderingIndex.cs b/Function/BNSeekLinearViewCursorToOrderingIndex.cs new file mode 100644 index 0000000..f3f4b47 --- /dev/null +++ b/Function/BNSeekLinearViewCursorToOrderingIndex.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSeekLinearViewCursorToOrderingIndex(BNLinearViewCursor* cursor, uint64_t idx) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSeekLinearViewCursorToOrderingIndex" + )] + internal static extern void BNSeekLinearViewCursorToOrderingIndex( + + // BNLinearViewCursor* cursor + IntPtr cursor , + + // uint64_t idx + ulong idx + ); + } +} \ No newline at end of file diff --git a/Function/BNSeekLinearViewCursorToPath.cs b/Function/BNSeekLinearViewCursorToPath.cs new file mode 100644 index 0000000..c71f0a1 --- /dev/null +++ b/Function/BNSeekLinearViewCursorToPath.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNSeekLinearViewCursorToPath(BNLinearViewCursor* cursor, BNLinearViewObjectIdentifier* ids, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSeekLinearViewCursorToPath" + )] + internal static extern bool BNSeekLinearViewCursorToPath( + + // BNLinearViewCursor* cursor + IntPtr cursor , + + // BNLinearViewObjectIdentifier* ids + BNLinearViewObjectIdentifier[] ids , + + // uint64_t count + ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNSeekLinearViewCursorToPathAndAddress.cs b/Function/BNSeekLinearViewCursorToPathAndAddress.cs new file mode 100644 index 0000000..2eed495 --- /dev/null +++ b/Function/BNSeekLinearViewCursorToPathAndAddress.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNSeekLinearViewCursorToPathAndAddress(BNLinearViewCursor* cursor, BNLinearViewObjectIdentifier* ids, uint64_t count, uint64_t addr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSeekLinearViewCursorToPathAndAddress" + )] + internal static extern bool BNSeekLinearViewCursorToPathAndAddress( + + // BNLinearViewCursor* cursor + IntPtr cursor , + + // BNLinearViewObjectIdentifier* ids + IntPtr ids , + + // uint64_t count + ulong count , + + // uint64_t addr + ulong addr + + ); + } +} \ No newline at end of file diff --git a/Function/BNSegmentGetDataEnd.cs b/Function/BNSegmentGetDataEnd.cs new file mode 100644 index 0000000..8548063 --- /dev/null +++ b/Function/BNSegmentGetDataEnd.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNSegmentGetDataEnd(BNSegment* segment) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSegmentGetDataEnd" + )] + internal static extern ulong BNSegmentGetDataEnd( + + // BNSegment* segment + IntPtr segment + + ); + } +} \ No newline at end of file diff --git a/Function/BNSegmentGetDataLength.cs b/Function/BNSegmentGetDataLength.cs new file mode 100644 index 0000000..2773f76 --- /dev/null +++ b/Function/BNSegmentGetDataLength.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNSegmentGetDataLength(BNSegment* segment) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSegmentGetDataLength" + )] + internal static extern ulong BNSegmentGetDataLength( + + // BNSegment* segment + IntPtr segment + + ); + } +} \ No newline at end of file diff --git a/Function/BNSegmentGetDataOffset.cs b/Function/BNSegmentGetDataOffset.cs new file mode 100644 index 0000000..4f3403d --- /dev/null +++ b/Function/BNSegmentGetDataOffset.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNSegmentGetDataOffset(BNSegment* segment) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSegmentGetDataOffset" + )] + internal static extern ulong BNSegmentGetDataOffset( + + // BNSegment* segment + IntPtr segment + + ); + } +} \ No newline at end of file diff --git a/Function/BNSegmentGetEnd.cs b/Function/BNSegmentGetEnd.cs new file mode 100644 index 0000000..15a1b54 --- /dev/null +++ b/Function/BNSegmentGetEnd.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNSegmentGetEnd(BNSegment* segment) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSegmentGetEnd" + )] + internal static extern ulong BNSegmentGetEnd( + + // BNSegment* segment + IntPtr segment + + ); + } +} \ No newline at end of file diff --git a/Function/BNSegmentGetFlags.cs b/Function/BNSegmentGetFlags.cs new file mode 100644 index 0000000..3cde623 --- /dev/null +++ b/Function/BNSegmentGetFlags.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint32_t BNSegmentGetFlags(BNSegment* segment) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSegmentGetFlags" + )] + internal static extern uint BNSegmentGetFlags( + + // BNSegment* segment + IntPtr segment + + ); + } +} \ No newline at end of file diff --git a/Function/BNSegmentGetLength.cs b/Function/BNSegmentGetLength.cs new file mode 100644 index 0000000..f2a60b0 --- /dev/null +++ b/Function/BNSegmentGetLength.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNSegmentGetLength(BNSegment* segment) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSegmentGetLength" + )] + internal static extern ulong BNSegmentGetLength( + + // BNSegment* segment + IntPtr segment + + ); + } +} \ No newline at end of file diff --git a/Function/BNSegmentGetStart.cs b/Function/BNSegmentGetStart.cs new file mode 100644 index 0000000..0a683bc --- /dev/null +++ b/Function/BNSegmentGetStart.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNSegmentGetStart(BNSegment* segment) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSegmentGetStart" + )] + internal static extern ulong BNSegmentGetStart( + + // BNSegment* segment + IntPtr segment + + ); + } +} \ No newline at end of file diff --git a/Function/BNSegmentIsAutoDefined.cs b/Function/BNSegmentIsAutoDefined.cs new file mode 100644 index 0000000..ea29a02 --- /dev/null +++ b/Function/BNSegmentIsAutoDefined.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNSegmentIsAutoDefined(BNSegment* segment) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSegmentIsAutoDefined" + )] + internal static extern bool BNSegmentIsAutoDefined( + + // BNSegment* segment + IntPtr segment + + ); + } +} \ No newline at end of file diff --git a/Function/BNSerializeSettings.cs b/Function/BNSerializeSettings.cs new file mode 100644 index 0000000..3a5266e --- /dev/null +++ b/Function/BNSerializeSettings.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// char* BNSerializeSettings(BNSettings* settings, BNBinaryView* view, BNFunction* func, BNSettingsScope scope) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSerializeSettings" + )] + internal static extern IntPtr BNSerializeSettings( + + // BNSettings* settings + IntPtr settings , + + // BNBinaryView* view + IntPtr view , + + // BNFunction* func + IntPtr func , + + // BNSettingsScope scope + SettingsScope scope + ); + } +} \ No newline at end of file diff --git a/Function/BNSetActiveUpdateChannel.cs b/Function/BNSetActiveUpdateChannel.cs new file mode 100644 index 0000000..596dce5 --- /dev/null +++ b/Function/BNSetActiveUpdateChannel.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetActiveUpdateChannel(const char* channel) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetActiveUpdateChannel" + )] + internal static extern void BNSetActiveUpdateChannel( + + // const char* channel + string channel + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetAnalysisHold.cs b/Function/BNSetAnalysisHold.cs new file mode 100644 index 0000000..cfd290f --- /dev/null +++ b/Function/BNSetAnalysisHold.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetAnalysisHold(BNBinaryView* view, bool enable) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSetAnalysisHold" + )] + internal static extern void BNSetAnalysisHold( + + // BNBinaryView* view + IntPtr view , + + // bool enable + bool enable + ); + } +} \ No newline at end of file diff --git a/Function/BNSetArchitectureCdeclCallingConvention.cs b/Function/BNSetArchitectureCdeclCallingConvention.cs new file mode 100644 index 0000000..27d4496 --- /dev/null +++ b/Function/BNSetArchitectureCdeclCallingConvention.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetArchitectureCdeclCallingConvention(BNArchitecture* arch, BNCallingConvention* cc) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetArchitectureCdeclCallingConvention" + )] + internal static extern void BNSetArchitectureCdeclCallingConvention( + + // BNArchitecture* arch + IntPtr arch , + + // BNCallingConvention* cc + IntPtr cc + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetArchitectureDefaultCallingConvention.cs b/Function/BNSetArchitectureDefaultCallingConvention.cs new file mode 100644 index 0000000..aed8fe2 --- /dev/null +++ b/Function/BNSetArchitectureDefaultCallingConvention.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetArchitectureDefaultCallingConvention(BNArchitecture* arch, BNCallingConvention* cc) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetArchitectureDefaultCallingConvention" + )] + internal static extern void BNSetArchitectureDefaultCallingConvention( + + // BNArchitecture* arch + IntPtr arch , + + // BNCallingConvention* cc + IntPtr cc + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetArchitectureFastcallCallingConvention.cs b/Function/BNSetArchitectureFastcallCallingConvention.cs new file mode 100644 index 0000000..552e5e2 --- /dev/null +++ b/Function/BNSetArchitectureFastcallCallingConvention.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetArchitectureFastcallCallingConvention(BNArchitecture* arch, BNCallingConvention* cc) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetArchitectureFastcallCallingConvention" + )] + internal static extern void BNSetArchitectureFastcallCallingConvention( + + // BNArchitecture* arch + IntPtr arch , + + // BNCallingConvention* cc + IntPtr cc + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetArchitectureStdcallCallingConvention.cs b/Function/BNSetArchitectureStdcallCallingConvention.cs new file mode 100644 index 0000000..437edaf --- /dev/null +++ b/Function/BNSetArchitectureStdcallCallingConvention.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetArchitectureStdcallCallingConvention(BNArchitecture* arch, BNCallingConvention* cc) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetArchitectureStdcallCallingConvention" + )] + internal static extern void BNSetArchitectureStdcallCallingConvention( + + // BNArchitecture* arch + IntPtr arch , + + // BNCallingConvention* cc + IntPtr cc + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetAutoBasicBlockHighlight.cs b/Function/BNSetAutoBasicBlockHighlight.cs new file mode 100644 index 0000000..b4c7a7a --- /dev/null +++ b/Function/BNSetAutoBasicBlockHighlight.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetAutoBasicBlockHighlight(BNBasicBlock* block, BNHighlightColor color) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSetAutoBasicBlockHighlight" + )] + internal static extern void BNSetAutoBasicBlockHighlight( + + // BNBasicBlock* block + IntPtr block , + + // BNHighlightColor color + BNHighlightColor color + ); + } +} \ No newline at end of file diff --git a/Function/BNSetAutoCallRegisterStackAdjustment.cs b/Function/BNSetAutoCallRegisterStackAdjustment.cs new file mode 100644 index 0000000..07ee0e9 --- /dev/null +++ b/Function/BNSetAutoCallRegisterStackAdjustment.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetAutoCallRegisterStackAdjustment(BNFunction* func, BNArchitecture* arch, uint64_t addr, BNRegisterStackAdjustment* adjust, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetAutoCallRegisterStackAdjustment" + )] + internal static extern void BNSetAutoCallRegisterStackAdjustment( + + // BNFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t addr + ulong addr , + + // BNRegisterStackAdjustment* adjust + IntPtr adjust , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetAutoCallRegisterStackAdjustmentForRegisterStack.cs b/Function/BNSetAutoCallRegisterStackAdjustmentForRegisterStack.cs new file mode 100644 index 0000000..0442b0d --- /dev/null +++ b/Function/BNSetAutoCallRegisterStackAdjustmentForRegisterStack.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetAutoCallRegisterStackAdjustmentForRegisterStack(BNFunction* func, BNArchitecture* arch, uint64_t addr, uint32_t regStack, int32_t adjust, uint8_t confidence) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetAutoCallRegisterStackAdjustmentForRegisterStack" + )] + internal static extern void BNSetAutoCallRegisterStackAdjustmentForRegisterStack( + + // BNFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t addr + ulong addr , + + // uint32_t regStack + uint regStack , + + // int32_t adjust + int adjust , + + // uint8_t confidence + byte confidence + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetAutoCallStackAdjustment.cs b/Function/BNSetAutoCallStackAdjustment.cs new file mode 100644 index 0000000..77e0ed4 --- /dev/null +++ b/Function/BNSetAutoCallStackAdjustment.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetAutoCallStackAdjustment(BNFunction* func, BNArchitecture* arch, uint64_t addr, int64_t adjust, uint8_t confidence) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetAutoCallStackAdjustment" + )] + internal static extern void BNSetAutoCallStackAdjustment( + + // BNFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t addr + ulong addr , + + // int64_t adjust + long adjust , + + // uint8_t confidence + byte confidence + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetAutoCallTypeAdjustment.cs b/Function/BNSetAutoCallTypeAdjustment.cs new file mode 100644 index 0000000..c8d2257 --- /dev/null +++ b/Function/BNSetAutoCallTypeAdjustment.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetAutoCallTypeAdjustment(BNFunction* func, BNArchitecture* arch, uint64_t addr, BNTypeWithConfidence* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetAutoCallTypeAdjustment" + )] + internal static extern void BNSetAutoCallTypeAdjustment( + + // BNFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t addr + ulong addr , + + // BNTypeWithConfidence* type + IntPtr type + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetAutoFunctionCallingConvention.cs b/Function/BNSetAutoFunctionCallingConvention.cs new file mode 100644 index 0000000..a30a5aa --- /dev/null +++ b/Function/BNSetAutoFunctionCallingConvention.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetAutoFunctionCallingConvention(BNFunction* func, BNCallingConventionWithConfidence* convention) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetAutoFunctionCallingConvention" + )] + internal static extern void BNSetAutoFunctionCallingConvention( + + // BNFunction* func + IntPtr func , + + // BNCallingConventionWithConfidence* convention + IntPtr convention + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetAutoFunctionCanReturn.cs b/Function/BNSetAutoFunctionCanReturn.cs new file mode 100644 index 0000000..11108f1 --- /dev/null +++ b/Function/BNSetAutoFunctionCanReturn.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetAutoFunctionCanReturn(BNFunction* func, BNBoolWithConfidence* returns) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetAutoFunctionCanReturn" + )] + internal static extern void BNSetAutoFunctionCanReturn( + + // BNFunction* func + IntPtr func , + + // BNBoolWithConfidence* returns + IntPtr returns + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetAutoFunctionClobberedRegisters.cs b/Function/BNSetAutoFunctionClobberedRegisters.cs new file mode 100644 index 0000000..d852a82 --- /dev/null +++ b/Function/BNSetAutoFunctionClobberedRegisters.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetAutoFunctionClobberedRegisters(BNFunction* func, BNRegisterSetWithConfidence* regs) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetAutoFunctionClobberedRegisters" + )] + internal static extern void BNSetAutoFunctionClobberedRegisters( + + // BNFunction* func + IntPtr func , + + // BNRegisterSetWithConfidence* regs + IntPtr regs + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetAutoFunctionHasVariableArguments.cs b/Function/BNSetAutoFunctionHasVariableArguments.cs new file mode 100644 index 0000000..4bff5e8 --- /dev/null +++ b/Function/BNSetAutoFunctionHasVariableArguments.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetAutoFunctionHasVariableArguments(BNFunction* func, BNBoolWithConfidence* varArgs) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetAutoFunctionHasVariableArguments" + )] + internal static extern void BNSetAutoFunctionHasVariableArguments( + + // BNFunction* func + IntPtr func , + + // BNBoolWithConfidence* varArgs + IntPtr varArgs + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetAutoFunctionInlinedDuringAnalysis.cs b/Function/BNSetAutoFunctionInlinedDuringAnalysis.cs new file mode 100644 index 0000000..f7a2baa --- /dev/null +++ b/Function/BNSetAutoFunctionInlinedDuringAnalysis.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetAutoFunctionInlinedDuringAnalysis(BNFunction* func, BNBoolWithConfidence inlined) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetAutoFunctionInlinedDuringAnalysis" + )] + internal static extern void BNSetAutoFunctionInlinedDuringAnalysis( + + // BNFunction* func + IntPtr func , + + // BNBoolWithConfidence inlined + BoolWithConfidence inlined + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetAutoFunctionParameterVariables.cs b/Function/BNSetAutoFunctionParameterVariables.cs new file mode 100644 index 0000000..f9b8caf --- /dev/null +++ b/Function/BNSetAutoFunctionParameterVariables.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetAutoFunctionParameterVariables(BNFunction* func, BNParameterVariablesWithConfidence* vars) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetAutoFunctionParameterVariables" + )] + internal static extern void BNSetAutoFunctionParameterVariables( + + // BNFunction* func + IntPtr func , + + // BNParameterVariablesWithConfidence* vars + IntPtr vars + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetAutoFunctionPure.cs b/Function/BNSetAutoFunctionPure.cs new file mode 100644 index 0000000..4acfeab --- /dev/null +++ b/Function/BNSetAutoFunctionPure.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetAutoFunctionPure(BNFunction* func, BNBoolWithConfidence* pure) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetAutoFunctionPure" + )] + internal static extern void BNSetAutoFunctionPure( + + // BNFunction* func + IntPtr func , + + // BNBoolWithConfidence* pure + IntPtr pure + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetAutoFunctionRegisterStackAdjustments.cs b/Function/BNSetAutoFunctionRegisterStackAdjustments.cs new file mode 100644 index 0000000..12e5545 --- /dev/null +++ b/Function/BNSetAutoFunctionRegisterStackAdjustments.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetAutoFunctionRegisterStackAdjustments(BNFunction* func, BNRegisterStackAdjustment* adjustments, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetAutoFunctionRegisterStackAdjustments" + )] + internal static extern void BNSetAutoFunctionRegisterStackAdjustments( + + // BNFunction* func + IntPtr func , + + // BNRegisterStackAdjustment* adjustments + IntPtr adjustments , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetAutoFunctionReturnRegisters.cs b/Function/BNSetAutoFunctionReturnRegisters.cs new file mode 100644 index 0000000..00d1dac --- /dev/null +++ b/Function/BNSetAutoFunctionReturnRegisters.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetAutoFunctionReturnRegisters(BNFunction* func, BNRegisterSetWithConfidence* regs) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetAutoFunctionReturnRegisters" + )] + internal static extern void BNSetAutoFunctionReturnRegisters( + + // BNFunction* func + IntPtr func , + + // BNRegisterSetWithConfidence* regs + IntPtr regs + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetAutoFunctionReturnType.cs b/Function/BNSetAutoFunctionReturnType.cs new file mode 100644 index 0000000..3f5392c --- /dev/null +++ b/Function/BNSetAutoFunctionReturnType.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetAutoFunctionReturnType(BNFunction* func, BNTypeWithConfidence* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetAutoFunctionReturnType" + )] + internal static extern void BNSetAutoFunctionReturnType( + + // BNFunction* func + IntPtr func , + + // BNTypeWithConfidence* type + IntPtr type + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetAutoFunctionStackAdjustment.cs b/Function/BNSetAutoFunctionStackAdjustment.cs new file mode 100644 index 0000000..a7fd730 --- /dev/null +++ b/Function/BNSetAutoFunctionStackAdjustment.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetAutoFunctionStackAdjustment(BNFunction* func, BNOffsetWithConfidence* stackAdjust) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetAutoFunctionStackAdjustment" + )] + internal static extern void BNSetAutoFunctionStackAdjustment( + + // BNFunction* func + IntPtr func , + + // BNOffsetWithConfidence* stackAdjust + IntPtr stackAdjust + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetAutoIndirectBranches.cs b/Function/BNSetAutoIndirectBranches.cs new file mode 100644 index 0000000..54e367d --- /dev/null +++ b/Function/BNSetAutoIndirectBranches.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetAutoIndirectBranches(BNFunction* func, BNArchitecture* sourceArch, uint64_t source, BNArchitectureAndAddress* branches, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetAutoIndirectBranches" + )] + internal static extern void BNSetAutoIndirectBranches( + + // BNFunction* func + IntPtr func , + + // BNArchitecture* sourceArch + IntPtr sourceArch , + + // uint64_t source + ulong source , + + // BNArchitectureAndAddress* branches + IntPtr branches , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetAutoInstructionHighlight.cs b/Function/BNSetAutoInstructionHighlight.cs new file mode 100644 index 0000000..07515fb --- /dev/null +++ b/Function/BNSetAutoInstructionHighlight.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetAutoInstructionHighlight(BNFunction* func, BNArchitecture* arch, uint64_t addr, BNHighlightColor color) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetAutoInstructionHighlight" + )] + internal static extern void BNSetAutoInstructionHighlight( + + // BNFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t addr + ulong addr , + + // BNHighlightColor color + HighlightColor color + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetAutoUpdatesEnabled.cs b/Function/BNSetAutoUpdatesEnabled.cs new file mode 100644 index 0000000..ddce554 --- /dev/null +++ b/Function/BNSetAutoUpdatesEnabled.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetAutoUpdatesEnabled(bool enabled) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetAutoUpdatesEnabled" + )] + internal static extern void BNSetAutoUpdatesEnabled( + + // bool enabled + bool enabled + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetBackgroundTaskProgressText.cs b/Function/BNSetBackgroundTaskProgressText.cs new file mode 100644 index 0000000..f334a88 --- /dev/null +++ b/Function/BNSetBackgroundTaskProgressText.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetBackgroundTaskProgressText(BNBackgroundTask* task, const char* text) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetBackgroundTaskProgressText" + )] + internal static extern void BNSetBackgroundTaskProgressText( + + // BNBackgroundTask* task + IntPtr task , + + // const char* text + string text + ); + } +} \ No newline at end of file diff --git a/Function/BNSetBaseStructuresForStructureBuilder.cs b/Function/BNSetBaseStructuresForStructureBuilder.cs new file mode 100644 index 0000000..5df5887 --- /dev/null +++ b/Function/BNSetBaseStructuresForStructureBuilder.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetBaseStructuresForStructureBuilder(BNStructureBuilder* s, BNBaseStructure* bases, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSetBaseStructuresForStructureBuilder" + )] + internal static extern void BNSetBaseStructuresForStructureBuilder( + + // BNStructureBuilder* s + IntPtr s , + + // BNBaseStructure* bases + BNBaseStructure[] bases , + + // uint64_t count + ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNSetBasicBlockEnd.cs b/Function/BNSetBasicBlockEnd.cs new file mode 100644 index 0000000..741b78e --- /dev/null +++ b/Function/BNSetBasicBlockEnd.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetBasicBlockEnd(BNBasicBlock* block, uint64_t end) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSetBasicBlockEnd" + )] + internal static extern void BNSetBasicBlockEnd( + + // BNBasicBlock* block + IntPtr block , + + // uint64_t end + ulong end + ); + } +} \ No newline at end of file diff --git a/Function/BNSetBasicBlockList.cs b/Function/BNSetBasicBlockList.cs new file mode 100644 index 0000000..1597704 --- /dev/null +++ b/Function/BNSetBasicBlockList.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetBasicBlockList(BNAnalysisContext* analysisContext, BNBasicBlock** basicBlocks, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetBasicBlockList" + )] + internal static extern void BNSetBasicBlockList( + + // BNAnalysisContext* analysisContext + IntPtr analysisContext , + + // BNBasicBlock** basicBlocks + IntPtr basicBlocks , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetBinaryReaderEndianness.cs b/Function/BNSetBinaryReaderEndianness.cs new file mode 100644 index 0000000..00c94be --- /dev/null +++ b/Function/BNSetBinaryReaderEndianness.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetBinaryReaderEndianness(BNBinaryReader* stream, BNEndianness endian) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSetBinaryReaderEndianness" + )] + internal static extern void BNSetBinaryReaderEndianness( + + // BNBinaryReader* stream + IntPtr stream , + + // BNEndianness endian + Endianness endian + ); + } +} \ No newline at end of file diff --git a/Function/BNSetBinaryReaderVirtualBase.cs b/Function/BNSetBinaryReaderVirtualBase.cs new file mode 100644 index 0000000..d664ff0 --- /dev/null +++ b/Function/BNSetBinaryReaderVirtualBase.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetBinaryReaderVirtualBase(BNBinaryReader* stream, uint64_t @base) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSetBinaryReaderVirtualBase" + )] + internal static extern void BNSetBinaryReaderVirtualBase( + + // BNBinaryReader* stream + IntPtr stream , + + // uint64_t _base + ulong _base + ); + } +} \ No newline at end of file diff --git a/Function/BNSetBinaryWriterEndianness.cs b/Function/BNSetBinaryWriterEndianness.cs new file mode 100644 index 0000000..7afb486 --- /dev/null +++ b/Function/BNSetBinaryWriterEndianness.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetBinaryWriterEndianness(BNBinaryWriter* stream, BNEndianness endian) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSetBinaryWriterEndianness" + )] + internal static extern void BNSetBinaryWriterEndianness( + + // BNBinaryWriter* stream + IntPtr stream , + + // BNEndianness endian + Endianness endian + ); + } +} \ No newline at end of file diff --git a/Function/BNSetBundledPluginDirectory.cs b/Function/BNSetBundledPluginDirectory.cs new file mode 100644 index 0000000..d135dd5 --- /dev/null +++ b/Function/BNSetBundledPluginDirectory.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public static partial class Core + { + public static void SetBundledPluginDirectory( string path ) + { + NativeMethods.BNSetBundledPluginDirectory(path); + } + } + + internal static partial class NativeMethods + { + /// + /// void BNSetBundledPluginDirectory(const char* path) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetBundledPluginDirectory" + )] + public static extern void BNSetBundledPluginDirectory( + + // const char* path + string path + ); + } +} \ No newline at end of file diff --git a/Function/BNSetCommentForAddress.cs b/Function/BNSetCommentForAddress.cs new file mode 100644 index 0000000..d2ddf3d --- /dev/null +++ b/Function/BNSetCommentForAddress.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetCommentForAddress(BNFunction* func, uint64_t addr, const char* comment) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetCommentForAddress" + )] + internal static extern void BNSetCommentForAddress( + + // BNFunction* func + IntPtr func , + + // uint64_t addr + ulong addr , + + // const char* comment + string comment + ); + } +} \ No newline at end of file diff --git a/Function/BNSetConditionInverted.cs b/Function/BNSetConditionInverted.cs new file mode 100644 index 0000000..556403a --- /dev/null +++ b/Function/BNSetConditionInverted.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetConditionInverted(BNFunction* func, uint64_t addr, bool invert) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetConditionInverted" + )] + internal static extern void BNSetConditionInverted( + + // BNFunction* func + IntPtr func , + + // uint64_t addr + ulong addr , + + // bool invert + bool invert + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetCurrentPluginLoadOrder.cs b/Function/BNSetCurrentPluginLoadOrder.cs new file mode 100644 index 0000000..9bde927 --- /dev/null +++ b/Function/BNSetCurrentPluginLoadOrder.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public static partial class Core + { + public static void SetCurrentPluginLoadOrder(PluginLoadOrder order) + { + NativeMethods.BNSetCurrentPluginLoadOrder(order); + } + } + + internal static partial class NativeMethods + { + /// + /// void BNSetCurrentPluginLoadOrder(BNPluginLoadOrder order) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSetCurrentPluginLoadOrder" + )] + internal static extern void BNSetCurrentPluginLoadOrder( + + // BNPluginLoadOrder order + PluginLoadOrder order + ); + } +} \ No newline at end of file diff --git a/Function/BNSetDataBufferByte.cs b/Function/BNSetDataBufferByte.cs new file mode 100644 index 0000000..21814f1 --- /dev/null +++ b/Function/BNSetDataBufferByte.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetDataBufferByte(BNDataBuffer* buf, uint64_t offset, uint8_t val) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetDataBufferByte" + )] + internal static extern void BNSetDataBufferByte( + + // BNDataBuffer* buf + IntPtr buf , + + // uint64_t offset + ulong offset , + + // uint8_t val + byte val + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetDataBufferContents.cs b/Function/BNSetDataBufferContents.cs new file mode 100644 index 0000000..4610762 --- /dev/null +++ b/Function/BNSetDataBufferContents.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetDataBufferContents(BNDataBuffer* buf, void* data, uint64_t len) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSetDataBufferContents" + )] + internal static extern void BNSetDataBufferContents( + + // BNDataBuffer* buf + IntPtr buf , + + // void* data + byte[] data , + + // uint64_t len + ulong len + ); + } +} \ No newline at end of file diff --git a/Function/BNSetDataBufferLength.cs b/Function/BNSetDataBufferLength.cs new file mode 100644 index 0000000..4a821e5 --- /dev/null +++ b/Function/BNSetDataBufferLength.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetDataBufferLength(BNDataBuffer* buf, uint64_t len) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetDataBufferLength" + )] + internal static extern void BNSetDataBufferLength( + + // BNDataBuffer* buf + IntPtr buf , + + // uint64_t len + ulong len + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetDatabaseCurrentSnapshot.cs b/Function/BNSetDatabaseCurrentSnapshot.cs new file mode 100644 index 0000000..4e18444 --- /dev/null +++ b/Function/BNSetDatabaseCurrentSnapshot.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetDatabaseCurrentSnapshot(BNDatabase* database, int64_t id) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetDatabaseCurrentSnapshot" + )] + internal static extern void BNSetDatabaseCurrentSnapshot( + + // BNDatabase* database + IntPtr database , + + // int64_t id + long id + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetDebugInfo.cs b/Function/BNSetDebugInfo.cs new file mode 100644 index 0000000..03863ae --- /dev/null +++ b/Function/BNSetDebugInfo.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetDebugInfo(BNBinaryView* view, BNDebugInfo* newDebugInfo) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSetDebugInfo" + )] + internal static extern void BNSetDebugInfo( + + // BNBinaryView* view + IntPtr view , + + // BNDebugInfo* newDebugInfo + IntPtr newDebugInfo + ); + } +} \ No newline at end of file diff --git a/Function/BNSetDefaultArchitecture.cs b/Function/BNSetDefaultArchitecture.cs new file mode 100644 index 0000000..a845ae6 --- /dev/null +++ b/Function/BNSetDefaultArchitecture.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetDefaultArchitecture(BNBinaryView* view, BNArchitecture* arch) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetDefaultArchitecture" + )] + internal static extern void BNSetDefaultArchitecture( + + // BNBinaryView* view + IntPtr view , + + // BNArchitecture* arch + IntPtr arch + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetDefaultPlatform.cs b/Function/BNSetDefaultPlatform.cs new file mode 100644 index 0000000..bfb79a5 --- /dev/null +++ b/Function/BNSetDefaultPlatform.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetDefaultPlatform(BNBinaryView* view, BNPlatform* platform) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetDefaultPlatform" + )] + internal static extern void BNSetDefaultPlatform( + + // BNBinaryView* view + IntPtr view , + + // BNPlatform* platform + IntPtr platform + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetDisassemblyAddressBaseOffset.cs b/Function/BNSetDisassemblyAddressBaseOffset.cs new file mode 100644 index 0000000..9eca089 --- /dev/null +++ b/Function/BNSetDisassemblyAddressBaseOffset.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetDisassemblyAddressBaseOffset(BNDisassemblySettings* settings, uint64_t addressBaseOffset) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetDisassemblyAddressBaseOffset" + )] + internal static extern void BNSetDisassemblyAddressBaseOffset( + + // BNDisassemblySettings* settings + IntPtr settings , + + // uint64_t addressBaseOffset + ulong addressBaseOffset + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetDisassemblyAddressMode.cs b/Function/BNSetDisassemblyAddressMode.cs new file mode 100644 index 0000000..1d0ea08 --- /dev/null +++ b/Function/BNSetDisassemblyAddressMode.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetDisassemblyAddressMode(BNDisassemblySettings* settings, BNDisassemblyAddressMode mode) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetDisassemblyAddressMode" + )] + internal static extern void BNSetDisassemblyAddressMode( + + // BNDisassemblySettings* settings + IntPtr settings , + + // BNDisassemblyAddressMode mode + DisassemblyAddressMode mode + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetDisassemblyBlockLabels.cs b/Function/BNSetDisassemblyBlockLabels.cs new file mode 100644 index 0000000..499c1bc --- /dev/null +++ b/Function/BNSetDisassemblyBlockLabels.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetDisassemblyBlockLabels(BNDisassemblySettings* settings, BNDisassemblyBlockLabels labels) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetDisassemblyBlockLabels" + )] + internal static extern void BNSetDisassemblyBlockLabels( + + // BNDisassemblySettings* settings + IntPtr settings , + + // BNDisassemblyBlockLabels labels + DisassemblyBlockLabels labels + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetDisassemblyCallParameterHints.cs b/Function/BNSetDisassemblyCallParameterHints.cs new file mode 100644 index 0000000..eefef42 --- /dev/null +++ b/Function/BNSetDisassemblyCallParameterHints.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetDisassemblyCallParameterHints(BNDisassemblySettings* settings, BNDisassemblyCallParameterHints hints) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetDisassemblyCallParameterHints" + )] + internal static extern void BNSetDisassemblyCallParameterHints( + + // BNDisassemblySettings* settings + IntPtr settings , + + // BNDisassemblyCallParameterHints hints + DisassemblyCallParameterHints hints + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetDisassemblyGutterWidth.cs b/Function/BNSetDisassemblyGutterWidth.cs new file mode 100644 index 0000000..ee9d6f8 --- /dev/null +++ b/Function/BNSetDisassemblyGutterWidth.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetDisassemblyGutterWidth(BNDisassemblySettings* settings, uint64_t width) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetDisassemblyGutterWidth" + )] + internal static extern void BNSetDisassemblyGutterWidth( + + // BNDisassemblySettings* settings + IntPtr settings , + + // uint64_t width + ulong width + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetDisassemblyMaximumSymbolWidth.cs b/Function/BNSetDisassemblyMaximumSymbolWidth.cs new file mode 100644 index 0000000..f79f0c4 --- /dev/null +++ b/Function/BNSetDisassemblyMaximumSymbolWidth.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetDisassemblyMaximumSymbolWidth(BNDisassemblySettings* settings, uint64_t width) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetDisassemblyMaximumSymbolWidth" + )] + internal static extern void BNSetDisassemblyMaximumSymbolWidth( + + // BNDisassemblySettings* settings + IntPtr settings , + + // uint64_t width + ulong width + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetDisassemblySettingsOption.cs b/Function/BNSetDisassemblySettingsOption.cs new file mode 100644 index 0000000..bf1168d --- /dev/null +++ b/Function/BNSetDisassemblySettingsOption.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetDisassemblySettingsOption(BNDisassemblySettings* settings, BNDisassemblyOption option, bool state) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetDisassemblySettingsOption" + )] + internal static extern void BNSetDisassemblySettingsOption( + + // BNDisassemblySettings* settings + IntPtr settings , + + // BNDisassemblyOption option + DisassemblyOption option , + + // bool state + bool state + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetDisassemblyTextRendererArchitecture.cs b/Function/BNSetDisassemblyTextRendererArchitecture.cs new file mode 100644 index 0000000..76f3a0f --- /dev/null +++ b/Function/BNSetDisassemblyTextRendererArchitecture.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetDisassemblyTextRendererArchitecture(BNDisassemblyTextRenderer* renderer, BNArchitecture* arch) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetDisassemblyTextRendererArchitecture" + )] + internal static extern void BNSetDisassemblyTextRendererArchitecture( + + // BNDisassemblyTextRenderer* renderer + IntPtr renderer , + + // BNArchitecture* arch + IntPtr arch + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetDisassemblyTextRendererBasicBlock.cs b/Function/BNSetDisassemblyTextRendererBasicBlock.cs new file mode 100644 index 0000000..e84c521 --- /dev/null +++ b/Function/BNSetDisassemblyTextRendererBasicBlock.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetDisassemblyTextRendererBasicBlock(BNDisassemblyTextRenderer* renderer, BNBasicBlock* block) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetDisassemblyTextRendererBasicBlock" + )] + internal static extern void BNSetDisassemblyTextRendererBasicBlock( + + // BNDisassemblyTextRenderer* renderer + IntPtr renderer , + + // BNBasicBlock* block + IntPtr block + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetDisassemblyTextRendererSettings.cs b/Function/BNSetDisassemblyTextRendererSettings.cs new file mode 100644 index 0000000..7e77233 --- /dev/null +++ b/Function/BNSetDisassemblyTextRendererSettings.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetDisassemblyTextRendererSettings(BNDisassemblyTextRenderer* renderer, BNDisassemblySettings* settings) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetDisassemblyTextRendererSettings" + )] + internal static extern void BNSetDisassemblyTextRendererSettings( + + // BNDisassemblyTextRenderer* renderer + IntPtr renderer , + + // BNDisassemblySettings* settings + IntPtr settings + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetDisassemblyWidth.cs b/Function/BNSetDisassemblyWidth.cs new file mode 100644 index 0000000..f196b1c --- /dev/null +++ b/Function/BNSetDisassemblyWidth.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetDisassemblyWidth(BNDisassemblySettings* settings, uint64_t width) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSetDisassemblyWidth" + )] + internal static extern void BNSetDisassemblyWidth( + + // BNDisassemblySettings* settings + IntPtr settings , + + // uint64_t width + ulong width + ); + } +} \ No newline at end of file diff --git a/Function/BNSetEarlyReturn.cs b/Function/BNSetEarlyReturn.cs new file mode 100644 index 0000000..f7f0cab --- /dev/null +++ b/Function/BNSetEarlyReturn.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetEarlyReturn(BNFunction* func, uint64_t addr, BNEarlyReturn mode) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetEarlyReturn" + )] + internal static extern void BNSetEarlyReturn( + + // BNFunction* func + IntPtr func , + + // uint64_t addr + ulong addr , + + // BNEarlyReturn mode + EarlyReturn mode + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetEnterpriseServerUrl.cs b/Function/BNSetEnterpriseServerUrl.cs new file mode 100644 index 0000000..c7850ed --- /dev/null +++ b/Function/BNSetEnterpriseServerUrl.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNSetEnterpriseServerUrl(const char* url) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetEnterpriseServerUrl" + )] + internal static extern bool BNSetEnterpriseServerUrl( + + // const char* url + string url + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetErrorForDownloadInstance.cs b/Function/BNSetErrorForDownloadInstance.cs new file mode 100644 index 0000000..1f280c5 --- /dev/null +++ b/Function/BNSetErrorForDownloadInstance.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetErrorForDownloadInstance(BNDownloadInstance* instance, const char* error) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetErrorForDownloadInstance" + )] + internal static extern void BNSetErrorForDownloadInstance( + + // BNDownloadInstance* instance + IntPtr instance , + + // const char* error + string error + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetExprFolding.cs b/Function/BNSetExprFolding.cs new file mode 100644 index 0000000..a0dd90a --- /dev/null +++ b/Function/BNSetExprFolding.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetExprFolding(BNFunction* func, uint64_t addr, BNExprFolding mode) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetExprFolding" + )] + internal static extern void BNSetExprFolding( + + // BNFunction* func + IntPtr func , + + // uint64_t addr + ulong addr , + + // BNExprFolding mode + ExprFolding mode + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetFieldResolutionForVariableAt.cs b/Function/BNSetFieldResolutionForVariableAt.cs new file mode 100644 index 0000000..31a89ff --- /dev/null +++ b/Function/BNSetFieldResolutionForVariableAt.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetFieldResolutionForVariableAt(BNFunction* func, BNVariable* var, BNArchitectureAndAddress* defSite, BNFieldResolutionInfo* info) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetFieldResolutionForVariableAt" + )] + internal static extern void BNSetFieldResolutionForVariableAt( + + // BNFunction* func + IntPtr func , + + // BNVariable* _var + IntPtr _var , + + // BNArchitectureAndAddress* defSite + IntPtr defSite , + + // BNFieldResolutionInfo* info + IntPtr info + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetFileMetadataNavigationHandler.cs b/Function/BNSetFileMetadataNavigationHandler.cs new file mode 100644 index 0000000..0f1ef8a --- /dev/null +++ b/Function/BNSetFileMetadataNavigationHandler.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetFileMetadataNavigationHandler(BNFileMetadata* file, BNNavigationHandler* handler) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetFileMetadataNavigationHandler" + )] + internal static extern void BNSetFileMetadataNavigationHandler( + + // BNFileMetadata* file + IntPtr file , + + // BNNavigationHandler* handler + IntPtr handler + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetFilename.cs b/Function/BNSetFilename.cs new file mode 100644 index 0000000..cd45620 --- /dev/null +++ b/Function/BNSetFilename.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetFilename(BNFileMetadata* file, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetFilename" + )] + internal static extern void BNSetFilename( + + // BNFileMetadata* file + IntPtr file , + + // const char* name + string name + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetFlowGraphBasicBlock.cs b/Function/BNSetFlowGraphBasicBlock.cs new file mode 100644 index 0000000..e86f38f --- /dev/null +++ b/Function/BNSetFlowGraphBasicBlock.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetFlowGraphBasicBlock(BNFlowGraphNode* node, BNBasicBlock* block) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSetFlowGraphBasicBlock" + )] + internal static extern void BNSetFlowGraphBasicBlock( + + // BNFlowGraphNode* node + IntPtr node , + + // BNBasicBlock* block + IntPtr block + ); + } +} \ No newline at end of file diff --git a/Function/BNSetFlowGraphHighLevelILFunction.cs b/Function/BNSetFlowGraphHighLevelILFunction.cs new file mode 100644 index 0000000..e397868 --- /dev/null +++ b/Function/BNSetFlowGraphHighLevelILFunction.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetFlowGraphHighLevelILFunction(BNFlowGraph* graph, BNHighLevelILFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSetFlowGraphHighLevelILFunction" + )] + internal static extern void BNSetFlowGraphHighLevelILFunction( + + // BNFlowGraph* graph + IntPtr graph , + + // BNHighLevelILFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNSetFlowGraphLowLevelILFunction.cs b/Function/BNSetFlowGraphLowLevelILFunction.cs new file mode 100644 index 0000000..c1eda37 --- /dev/null +++ b/Function/BNSetFlowGraphLowLevelILFunction.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetFlowGraphLowLevelILFunction(BNFlowGraph* graph, BNLowLevelILFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSetFlowGraphLowLevelILFunction" + )] + internal static extern void BNSetFlowGraphLowLevelILFunction( + + // BNFlowGraph* graph + IntPtr graph , + + // BNLowLevelILFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNSetFlowGraphMediumLevelILFunction.cs b/Function/BNSetFlowGraphMediumLevelILFunction.cs new file mode 100644 index 0000000..1a87314 --- /dev/null +++ b/Function/BNSetFlowGraphMediumLevelILFunction.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetFlowGraphMediumLevelILFunction(BNFlowGraph* graph, BNMediumLevelILFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSetFlowGraphMediumLevelILFunction" + )] + internal static extern void BNSetFlowGraphMediumLevelILFunction( + + // BNFlowGraph* graph + IntPtr graph , + + // BNMediumLevelILFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNSetFlowGraphNodeHighlight.cs b/Function/BNSetFlowGraphNodeHighlight.cs new file mode 100644 index 0000000..52480a4 --- /dev/null +++ b/Function/BNSetFlowGraphNodeHighlight.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetFlowGraphNodeHighlight(BNFlowGraphNode* node, BNHighlightColor color) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSetFlowGraphNodeHighlight" + )] + internal static extern void BNSetFlowGraphNodeHighlight( + + // BNFlowGraphNode* node + IntPtr node , + + // BNHighlightColor color + HighlightColor color + ); + } +} \ No newline at end of file diff --git a/Function/BNSetFlowGraphNodeLines.cs b/Function/BNSetFlowGraphNodeLines.cs new file mode 100644 index 0000000..4140da7 --- /dev/null +++ b/Function/BNSetFlowGraphNodeLines.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetFlowGraphNodeLines(BNFlowGraphNode* node, BNDisassemblyTextLine* lines, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSetFlowGraphNodeLines" + )] + internal static extern void BNSetFlowGraphNodeLines( + + // BNFlowGraphNode* node + IntPtr node , + + // BNDisassemblyTextLine* lines + BNDisassemblyTextLine[] lines , + + // uint64_t count + ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNSetFlowGraphNodeMargins.cs b/Function/BNSetFlowGraphNodeMargins.cs new file mode 100644 index 0000000..632a7d0 --- /dev/null +++ b/Function/BNSetFlowGraphNodeMargins.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetFlowGraphNodeMargins(BNFlowGraph* graph, int32_t horiz, int32_t vert) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSetFlowGraphNodeMargins" + )] + internal static extern void BNSetFlowGraphNodeMargins( + + // BNFlowGraph* graph + IntPtr graph , + + // int32_t horiz + int horiz , + + // int32_t vert + int vert + ); + } +} \ No newline at end of file diff --git a/Function/BNSetFlowGraphOption.cs b/Function/BNSetFlowGraphOption.cs new file mode 100644 index 0000000..7d1107d --- /dev/null +++ b/Function/BNSetFlowGraphOption.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetFlowGraphOption(BNFlowGraph* graph, BNFlowGraphOption option, bool value) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSetFlowGraphOption" + )] + internal static extern void BNSetFlowGraphOption( + + // BNFlowGraph* graph + IntPtr graph , + + // BNFlowGraphOption option + FlowGraphOption option , + + // bool value + bool value + ); + } +} \ No newline at end of file diff --git a/Function/BNSetFunctionAnalysisSkipOverride.cs b/Function/BNSetFunctionAnalysisSkipOverride.cs new file mode 100644 index 0000000..02f051c --- /dev/null +++ b/Function/BNSetFunctionAnalysisSkipOverride.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetFunctionAnalysisSkipOverride(BNFunction* func, BNFunctionAnalysisSkipOverride skip) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetFunctionAnalysisSkipOverride" + )] + internal static extern void BNSetFunctionAnalysisSkipOverride( + + // BNFunction* func + IntPtr func , + + // BNFunctionAnalysisSkipOverride skip + FunctionAnalysisSkipOverride skip + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetFunctionAnalysisUpdateDisabled.cs b/Function/BNSetFunctionAnalysisUpdateDisabled.cs new file mode 100644 index 0000000..2f3fa2e --- /dev/null +++ b/Function/BNSetFunctionAnalysisUpdateDisabled.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetFunctionAnalysisUpdateDisabled(BNBinaryView* view, bool disabled) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSetFunctionAnalysisUpdateDisabled" + )] + internal static extern void BNSetFunctionAnalysisUpdateDisabled( + + // BNBinaryView* view + IntPtr view , + + // bool disabled + bool disabled + ); + } +} \ No newline at end of file diff --git a/Function/BNSetFunctionAutoType.cs b/Function/BNSetFunctionAutoType.cs new file mode 100644 index 0000000..e334805 --- /dev/null +++ b/Function/BNSetFunctionAutoType.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetFunctionAutoType(BNFunction* func, BNType* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSetFunctionAutoType" + )] + internal static extern void BNSetFunctionAutoType( + + // BNFunction* func + IntPtr func , + + // BNType* type + IntPtr type + ); + } +} \ No newline at end of file diff --git a/Function/BNSetFunctionComment.cs b/Function/BNSetFunctionComment.cs new file mode 100644 index 0000000..bffe3ac --- /dev/null +++ b/Function/BNSetFunctionComment.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetFunctionComment(BNFunction* func, const char* comment) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetFunctionComment" + )] + internal static extern void BNSetFunctionComment( + + // BNFunction* func + IntPtr func , + + // const char* comment + string comment + ); + } +} \ No newline at end of file diff --git a/Function/BNSetFunctionForFlowGraph.cs b/Function/BNSetFunctionForFlowGraph.cs new file mode 100644 index 0000000..86e8628 --- /dev/null +++ b/Function/BNSetFunctionForFlowGraph.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetFunctionForFlowGraph(BNFlowGraph* graph, BNFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSetFunctionForFlowGraph" + )] + internal static extern void BNSetFunctionForFlowGraph( + + // BNFlowGraph* graph + IntPtr graph , + + // BNFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNSetFunctionTypeBuilderCanReturn.cs b/Function/BNSetFunctionTypeBuilderCanReturn.cs new file mode 100644 index 0000000..c7c4fed --- /dev/null +++ b/Function/BNSetFunctionTypeBuilderCanReturn.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetFunctionTypeBuilderCanReturn(BNTypeBuilder* type, BNBoolWithConfidence* canReturn) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSetFunctionTypeBuilderCanReturn" + )] + internal static extern void BNSetFunctionTypeBuilderCanReturn( + + // BNTypeBuilder* type + IntPtr type , + + // BNBoolWithConfidence* canReturn + in BNBoolWithConfidence canReturn + ); + } +} \ No newline at end of file diff --git a/Function/BNSetFunctionTypeBuilderParameters.cs b/Function/BNSetFunctionTypeBuilderParameters.cs new file mode 100644 index 0000000..c0bb6a8 --- /dev/null +++ b/Function/BNSetFunctionTypeBuilderParameters.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetFunctionTypeBuilderParameters(BNTypeBuilder* type, BNFunctionParameter* @params, uint64_t paramCount) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetFunctionTypeBuilderParameters" + )] + internal static extern void BNSetFunctionTypeBuilderParameters( + + // BNTypeBuilder* type + IntPtr type , + + // BNFunctionParameter* _params + BNFunctionParameter[] _params , + + // uint64_t paramCount + ulong paramCount + ); + } +} \ No newline at end of file diff --git a/Function/BNSetFunctionUserType.cs b/Function/BNSetFunctionUserType.cs new file mode 100644 index 0000000..15fdf1d --- /dev/null +++ b/Function/BNSetFunctionUserType.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetFunctionUserType(BNFunction* func, BNType* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetFunctionUserType" + )] + internal static extern void BNSetFunctionUserType( + + // BNFunction* func + IntPtr func , + + // BNType* type + IntPtr type + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetFunctionVariableDeadStoreElimination.cs b/Function/BNSetFunctionVariableDeadStoreElimination.cs new file mode 100644 index 0000000..fdbd7a6 --- /dev/null +++ b/Function/BNSetFunctionVariableDeadStoreElimination.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetFunctionVariableDeadStoreElimination(BNFunction* func, BNVariable* var, BNDeadStoreElimination mode) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetFunctionVariableDeadStoreElimination" + )] + internal static extern void BNSetFunctionVariableDeadStoreElimination( + + // BNFunction* func + IntPtr func , + + // BNVariable* _var + IntPtr _var , + + // BNDeadStoreElimination mode + DeadStoreElimination mode + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetGlobalCommentForAddress.cs b/Function/BNSetGlobalCommentForAddress.cs new file mode 100644 index 0000000..5cb5777 --- /dev/null +++ b/Function/BNSetGlobalCommentForAddress.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetGlobalCommentForAddress(BNBinaryView* view, uint64_t addr, const char* comment) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetGlobalCommentForAddress" + )] + internal static extern void BNSetGlobalCommentForAddress( + + // BNBinaryView* view + IntPtr view , + + // uint64_t addr + ulong addr , + + // const char* comment + string comment + ); + } +} \ No newline at end of file diff --git a/Function/BNSetGuidedSourceBlocks.cs b/Function/BNSetGuidedSourceBlocks.cs new file mode 100644 index 0000000..d4aa178 --- /dev/null +++ b/Function/BNSetGuidedSourceBlocks.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetGuidedSourceBlocks(BNFunction* func, BNArchitectureAndAddress* addresses, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetGuidedSourceBlocks" + )] + internal static extern void BNSetGuidedSourceBlocks( + + // BNFunction* func + IntPtr func , + + // BNArchitectureAndAddress* addresses + IntPtr addresses , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetHighLevelILExprAttributes.cs b/Function/BNSetHighLevelILExprAttributes.cs new file mode 100644 index 0000000..de28fec --- /dev/null +++ b/Function/BNSetHighLevelILExprAttributes.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetHighLevelILExprAttributes(BNHighLevelILFunction* func, uint64_t expr, uint32_t attributes) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSetHighLevelILExprAttributes" + )] + internal static extern void BNSetHighLevelILExprAttributes( + + // BNHighLevelILFunction* func + IntPtr func , + + // uint64_t expr + HighLevelILExpressionIndex expr , + + // uint32_t attributes + uint attributes + ); + } +} \ No newline at end of file diff --git a/Function/BNSetHighLevelILExprType.cs b/Function/BNSetHighLevelILExprType.cs new file mode 100644 index 0000000..255d2e7 --- /dev/null +++ b/Function/BNSetHighLevelILExprType.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetHighLevelILExprType(BNHighLevelILFunction* func, uint64_t expr, BNTypeWithConfidence* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSetHighLevelILExprType" + )] + internal static extern void BNSetHighLevelILExprType( + + // BNHighLevelILFunction* func + IntPtr func , + + // uint64_t expr + HighLevelILExpressionIndex expr , + + // BNTypeWithConfidence* type + in BNTypeWithConfidence type + ); + } +} \ No newline at end of file diff --git a/Function/BNSetHighLevelILFunction.cs b/Function/BNSetHighLevelILFunction.cs new file mode 100644 index 0000000..397196e --- /dev/null +++ b/Function/BNSetHighLevelILFunction.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetHighLevelILFunction(BNAnalysisContext* analysisContext, BNHighLevelILFunction* highLevelIL) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetHighLevelILFunction" + )] + internal static extern void BNSetHighLevelILFunction( + + // BNAnalysisContext* analysisContext + IntPtr analysisContext , + + // BNHighLevelILFunction* highLevelIL + IntPtr highLevelIL + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetHighLevelILRootExpr.cs b/Function/BNSetHighLevelILRootExpr.cs new file mode 100644 index 0000000..99ca3fa --- /dev/null +++ b/Function/BNSetHighLevelILRootExpr.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetHighLevelILRootExpr(BNHighLevelILFunction* func, uint64_t expr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSetHighLevelILRootExpr" + )] + internal static extern void BNSetHighLevelILRootExpr( + + // BNHighLevelILFunction* func + IntPtr func , + + // uint64_t expr + HighLevelILExpressionIndex expr + ); + } +} \ No newline at end of file diff --git a/Function/BNSetIntegerConstantDisplayType.cs b/Function/BNSetIntegerConstantDisplayType.cs new file mode 100644 index 0000000..9087dd1 --- /dev/null +++ b/Function/BNSetIntegerConstantDisplayType.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetIntegerConstantDisplayType(BNFunction* func, BNArchitecture* arch, uint64_t instrAddr, uint64_t value, uint64_t operand, BNIntegerDisplayType type, const char* typeID) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetIntegerConstantDisplayType" + )] + internal static extern void BNSetIntegerConstantDisplayType( + + // BNFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t instrAddr + ulong instrAddr , + + // uint64_t _value + ulong _value , + + // uint64_t operand + ulong operand , + + // BNIntegerDisplayType type + IntegerDisplayType type , + + // const char* typeID + string typeID + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetIntegerTypeDisplayType.cs b/Function/BNSetIntegerTypeDisplayType.cs new file mode 100644 index 0000000..593c593 --- /dev/null +++ b/Function/BNSetIntegerTypeDisplayType.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetIntegerTypeDisplayType(BNTypeBuilder* type, BNIntegerDisplayType displayType) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetIntegerTypeDisplayType" + )] + internal static extern void BNSetIntegerTypeDisplayType( + + // BNTypeBuilder* type + IntPtr type , + + // BNIntegerDisplayType displayType + IntegerDisplayType displayType + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetKeyValueStoreBuffer.cs b/Function/BNSetKeyValueStoreBuffer.cs new file mode 100644 index 0000000..c55fa2b --- /dev/null +++ b/Function/BNSetKeyValueStoreBuffer.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNSetKeyValueStoreBuffer(BNKeyValueStore* store, const char* name, BNDataBuffer* value) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetKeyValueStoreBuffer" + )] + internal static extern bool BNSetKeyValueStoreBuffer( + + // BNKeyValueStore* store + IntPtr store , + + // const char* name + string name , + + // BNDataBuffer* _value + IntPtr _value + ); + } +} \ No newline at end of file diff --git a/Function/BNSetKeyValueStoreValue.cs b/Function/BNSetKeyValueStoreValue.cs new file mode 100644 index 0000000..971988d --- /dev/null +++ b/Function/BNSetKeyValueStoreValue.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNSetKeyValueStoreValue(BNKeyValueStore* store, const char* name, const char* value) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetKeyValueStoreValue" + )] + internal static extern bool BNSetKeyValueStoreValue( + + // BNKeyValueStore* store + IntPtr store , + + // const char* name + string name , + + // const char* _value + string _value + ); + } +} \ No newline at end of file diff --git a/Function/BNSetLicense.cs b/Function/BNSetLicense.cs new file mode 100644 index 0000000..e30ecc9 --- /dev/null +++ b/Function/BNSetLicense.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public static partial class Core + { + public static void SetLicense(string licenseData ) + { + NativeMethods.BNSetLicense(licenseData); + } + } + + internal static partial class NativeMethods + { + /// + /// void BNSetLicense(const char* licenseData) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetLicense" + )] + public static extern void BNSetLicense( + + // const char* licenseData + string licenseData + ); + } +} \ No newline at end of file diff --git a/Function/BNSetLiftedILFunction.cs b/Function/BNSetLiftedILFunction.cs new file mode 100644 index 0000000..07d0d7f --- /dev/null +++ b/Function/BNSetLiftedILFunction.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetLiftedILFunction(BNAnalysisContext* analysisContext, BNLowLevelILFunction* liftedIL) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetLiftedILFunction" + )] + internal static extern void BNSetLiftedILFunction( + + // BNAnalysisContext* analysisContext + IntPtr analysisContext , + + // BNLowLevelILFunction* liftedIL + IntPtr liftedIL + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetLogicalMemoryMapEnabled.cs b/Function/BNSetLogicalMemoryMapEnabled.cs new file mode 100644 index 0000000..9f27677 --- /dev/null +++ b/Function/BNSetLogicalMemoryMapEnabled.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetLogicalMemoryMapEnabled(BNBinaryView* view, bool enabled) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSetLogicalMemoryMapEnabled" + )] + internal static extern void BNSetLogicalMemoryMapEnabled( + + // BNBinaryView* view + IntPtr view , + + // bool enabled + bool enabled + ); + } +} \ No newline at end of file diff --git a/Function/BNSetLowLevelILExprAttributes.cs b/Function/BNSetLowLevelILExprAttributes.cs new file mode 100644 index 0000000..509b9c6 --- /dev/null +++ b/Function/BNSetLowLevelILExprAttributes.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetLowLevelILExprAttributes(BNLowLevelILFunction* func, uint64_t expr, uint32_t attributes) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSetLowLevelILExprAttributes" + )] + internal static extern void BNSetLowLevelILExprAttributes( + + // BNLowLevelILFunction* func + IntPtr func , + + // uint64_t expr + LowLevelILExpressionIndex expr , + + // uint32_t attributes + uint attributes + ); + } +} \ No newline at end of file diff --git a/Function/BNSetLowLevelILFunction.cs b/Function/BNSetLowLevelILFunction.cs new file mode 100644 index 0000000..32fc356 --- /dev/null +++ b/Function/BNSetLowLevelILFunction.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetLowLevelILFunction(BNAnalysisContext* analysisContext, BNLowLevelILFunction* lowLevelIL) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetLowLevelILFunction" + )] + internal static extern void BNSetLowLevelILFunction( + + // BNAnalysisContext* analysisContext + IntPtr analysisContext , + + // BNLowLevelILFunction* lowLevelIL + IntPtr lowLevelIL + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetMaxFunctionSizeForAnalysis.cs b/Function/BNSetMaxFunctionSizeForAnalysis.cs new file mode 100644 index 0000000..a9f0a7c --- /dev/null +++ b/Function/BNSetMaxFunctionSizeForAnalysis.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetMaxFunctionSizeForAnalysis(BNBinaryView* view, uint64_t size) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSetMaxFunctionSizeForAnalysis" + )] + internal static extern void BNSetMaxFunctionSizeForAnalysis( + + // BNBinaryView* view + IntPtr view , + + // uint64_t size + ulong size + ); + } +} \ No newline at end of file diff --git a/Function/BNSetMediumLevelILExprAttributes.cs b/Function/BNSetMediumLevelILExprAttributes.cs new file mode 100644 index 0000000..f56a392 --- /dev/null +++ b/Function/BNSetMediumLevelILExprAttributes.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetMediumLevelILExprAttributes(BNMediumLevelILFunction* func, uint64_t expr, uint32_t attributes) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSetMediumLevelILExprAttributes" + )] + internal static extern void BNSetMediumLevelILExprAttributes( + + // BNMediumLevelILFunction* func + IntPtr func , + + // uint64_t expr + MediumLevelILExpressionIndex expr , + + // uint32_t attributes + uint attributes + ); + } +} \ No newline at end of file diff --git a/Function/BNSetMediumLevelILExprType.cs b/Function/BNSetMediumLevelILExprType.cs new file mode 100644 index 0000000..ed8d667 --- /dev/null +++ b/Function/BNSetMediumLevelILExprType.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetMediumLevelILExprType(BNMediumLevelILFunction* func, uint64_t expr, BNTypeWithConfidence* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSetMediumLevelILExprType" + )] + internal static extern void BNSetMediumLevelILExprType( + + // BNMediumLevelILFunction* func + IntPtr func , + + // uint64_t expr + MediumLevelILExpressionIndex expr , + + // BNTypeWithConfidence* type + in BNTypeWithConfidence type + ); + } +} \ No newline at end of file diff --git a/Function/BNSetMediumLevelILFunction.cs b/Function/BNSetMediumLevelILFunction.cs new file mode 100644 index 0000000..0182179 --- /dev/null +++ b/Function/BNSetMediumLevelILFunction.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetMediumLevelILFunction(BNAnalysisContext* analysisContext, BNMediumLevelILFunction* mediumLevelIL, uint64_t* llilSSAToMLILSSAInstrMap, uint64_t instrCount, BNExprMapInfo* llilSSAToMLILSSAExprMap, uint64_t exprCount) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetMediumLevelILFunction" + )] + internal static extern void BNSetMediumLevelILFunction( + + // BNAnalysisContext* analysisContext + IntPtr analysisContext , + + // BNMediumLevelILFunction* mediumLevelIL + IntPtr mediumLevelIL , + + // uint64_t* llilSSAToMLILSSAInstrMap + IntPtr llilSSAToMLILSSAInstrMap , + + // uint64_t instrCount + ulong instrCount , + + // BNExprMapInfo* llilSSAToMLILSSAExprMap + IntPtr llilSSAToMLILSSAExprMap , + + // uint64_t exprCount + ulong exprCount + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetMemoryRegionEnabled.cs b/Function/BNSetMemoryRegionEnabled.cs new file mode 100644 index 0000000..8f5fdc6 --- /dev/null +++ b/Function/BNSetMemoryRegionEnabled.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNSetMemoryRegionEnabled(BNBinaryView* view, const char* name, bool enable) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetMemoryRegionEnabled" + )] + internal static extern bool BNSetMemoryRegionEnabled( + + // BNBinaryView* view + IntPtr view , + + // const char* name + string name , + + // bool enable + bool enable + ); + } +} \ No newline at end of file diff --git a/Function/BNSetMemoryRegionFill.cs b/Function/BNSetMemoryRegionFill.cs new file mode 100644 index 0000000..bb28a51 --- /dev/null +++ b/Function/BNSetMemoryRegionFill.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNSetMemoryRegionFill(BNBinaryView* view, const char* name, uint8_t fill) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetMemoryRegionFill" + )] + internal static extern bool BNSetMemoryRegionFill( + + // BNBinaryView* view + IntPtr view , + + // const char* name + string name , + + // uint8_t fill + byte fill + ); + } +} \ No newline at end of file diff --git a/Function/BNSetMemoryRegionFlags.cs b/Function/BNSetMemoryRegionFlags.cs new file mode 100644 index 0000000..9cedacd --- /dev/null +++ b/Function/BNSetMemoryRegionFlags.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNSetMemoryRegionFlags(BNBinaryView* view, const char* name, uint32_t flags) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetMemoryRegionFlags" + )] + internal static extern bool BNSetMemoryRegionFlags( + + // BNBinaryView* view + IntPtr view , + + // const char* name + string name , + + // uint32_t flags + uint flags + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetMemoryRegionRebaseable.cs b/Function/BNSetMemoryRegionRebaseable.cs new file mode 100644 index 0000000..6ab039a --- /dev/null +++ b/Function/BNSetMemoryRegionRebaseable.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNSetMemoryRegionRebaseable(BNBinaryView* view, const char* name, bool rebaseable) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetMemoryRegionRebaseable" + )] + internal static extern bool BNSetMemoryRegionRebaseable( + + // BNBinaryView* view + IntPtr view , + + // const char* name + string name , + + // bool rebaseable + bool rebaseable + ); + } +} \ No newline at end of file diff --git a/Function/BNSetNamedTypeReferenceBuilderName.cs b/Function/BNSetNamedTypeReferenceBuilderName.cs new file mode 100644 index 0000000..0a52542 --- /dev/null +++ b/Function/BNSetNamedTypeReferenceBuilderName.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetNamedTypeReferenceBuilderName(BNNamedTypeReferenceBuilder* s, BNQualifiedName* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetNamedTypeReferenceBuilderName" + )] + internal static extern void BNSetNamedTypeReferenceBuilderName( + + // BNNamedTypeReferenceBuilder* s + IntPtr s , + + // BNQualifiedName* name + IntPtr name + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetNamedTypeReferenceBuilderTypeClass.cs b/Function/BNSetNamedTypeReferenceBuilderTypeClass.cs new file mode 100644 index 0000000..704decc --- /dev/null +++ b/Function/BNSetNamedTypeReferenceBuilderTypeClass.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetNamedTypeReferenceBuilderTypeClass(BNNamedTypeReferenceBuilder* s, BNNamedTypeReferenceClass type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetNamedTypeReferenceBuilderTypeClass" + )] + internal static extern void BNSetNamedTypeReferenceBuilderTypeClass( + + // BNNamedTypeReferenceBuilder* s + IntPtr s , + + // BNNamedTypeReferenceClass type + NamedTypeReferenceClass type + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetNamedTypeReferenceBuilderTypeId.cs b/Function/BNSetNamedTypeReferenceBuilderTypeId.cs new file mode 100644 index 0000000..dab6121 --- /dev/null +++ b/Function/BNSetNamedTypeReferenceBuilderTypeId.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetNamedTypeReferenceBuilderTypeId(BNNamedTypeReferenceBuilder* s, const char* id) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetNamedTypeReferenceBuilderTypeId" + )] + internal static extern void BNSetNamedTypeReferenceBuilderTypeId( + + // BNNamedTypeReferenceBuilder* s + IntPtr s , + + // const char* id + string id + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetNewAutoFunctionAnalysisSuppressed.cs b/Function/BNSetNewAutoFunctionAnalysisSuppressed.cs new file mode 100644 index 0000000..1a1ee63 --- /dev/null +++ b/Function/BNSetNewAutoFunctionAnalysisSuppressed.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetNewAutoFunctionAnalysisSuppressed(BNBinaryView* view, bool suppress) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSetNewAutoFunctionAnalysisSuppressed" + )] + internal static extern void BNSetNewAutoFunctionAnalysisSuppressed( + + // BNBinaryView* view + IntPtr view , + + // bool suppress + bool suppress + ); + } +} \ No newline at end of file diff --git a/Function/BNSetOriginalFilename.cs b/Function/BNSetOriginalFilename.cs new file mode 100644 index 0000000..2118829 --- /dev/null +++ b/Function/BNSetOriginalFilename.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetOriginalFilename(BNFileMetadata* file, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetOriginalFilename" + )] + internal static extern void BNSetOriginalFilename( + + // BNFileMetadata* file + IntPtr file , + + // const char* name + string name + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetOriginalImageBase.cs b/Function/BNSetOriginalImageBase.cs new file mode 100644 index 0000000..64e1568 --- /dev/null +++ b/Function/BNSetOriginalImageBase.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetOriginalImageBase(BNBinaryView* view, uint64_t imageBase) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetOriginalImageBase" + )] + internal static extern void BNSetOriginalImageBase( + + // BNBinaryView* view + IntPtr view , + + // uint64_t imageBase + ulong imageBase + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetParametersForAnalysis.cs b/Function/BNSetParametersForAnalysis.cs new file mode 100644 index 0000000..0509837 --- /dev/null +++ b/Function/BNSetParametersForAnalysis.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetParametersForAnalysis(BNBinaryView* view, BNAnalysisParameters @params) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSetParametersForAnalysis" + )] + internal static extern void BNSetParametersForAnalysis( + + // BNBinaryView* view + IntPtr view , + + // BNAnalysisParameters parameters + in BNAnalysisParameters parameters + ); + } +} \ No newline at end of file diff --git a/Function/BNSetPlatformSystemCallConvention.cs b/Function/BNSetPlatformSystemCallConvention.cs new file mode 100644 index 0000000..1e475e0 --- /dev/null +++ b/Function/BNSetPlatformSystemCallConvention.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetPlatformSystemCallConvention(BNPlatform* platform, BNCallingConvention* cc) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSetPlatformSystemCallConvention" + )] + internal static extern void BNSetPlatformSystemCallConvention( + + // BNPlatform* platform + IntPtr platform , + + // BNCallingConvention* cc + IntPtr cc + ); + } +} \ No newline at end of file diff --git a/Function/BNSetProjectFile.cs b/Function/BNSetProjectFile.cs new file mode 100644 index 0000000..95daa7a --- /dev/null +++ b/Function/BNSetProjectFile.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetProjectFile(BNFileMetadata* file, BNProjectFile* pfile) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSetProjectFile" + )] + internal static extern void BNSetProjectFile( + + // BNFileMetadata* file + IntPtr file , + + // BNProjectFile* pfile + IntPtr pfile + ); + } +} \ No newline at end of file diff --git a/Function/BNSetSaveSettingsName.cs b/Function/BNSetSaveSettingsName.cs new file mode 100644 index 0000000..16e2438 --- /dev/null +++ b/Function/BNSetSaveSettingsName.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetSaveSettingsName(BNSaveSettings* settings, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetSaveSettingsName" + )] + internal static extern void BNSetSaveSettingsName( + + // BNSaveSettings* settings + IntPtr settings , + + // const char* name + string name + ); + } +} \ No newline at end of file diff --git a/Function/BNSetSaveSettingsOption.cs b/Function/BNSetSaveSettingsOption.cs new file mode 100644 index 0000000..b0e74de --- /dev/null +++ b/Function/BNSetSaveSettingsOption.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetSaveSettingsOption(BNSaveSettings* settings, BNSaveOption option, bool state) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSetSaveSettingsOption" + )] + internal static extern void BNSetSaveSettingsOption( + + // BNSaveSettings* settings + IntPtr settings , + + // BNSaveOption option + SaveOption option , + + // bool state + bool state + ); + } +} \ No newline at end of file diff --git a/Function/BNSetScriptingInstanceCurrentAddress.cs b/Function/BNSetScriptingInstanceCurrentAddress.cs new file mode 100644 index 0000000..5693fee --- /dev/null +++ b/Function/BNSetScriptingInstanceCurrentAddress.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetScriptingInstanceCurrentAddress(BNScriptingInstance* instance, uint64_t addr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetScriptingInstanceCurrentAddress" + )] + internal static extern void BNSetScriptingInstanceCurrentAddress( + + // BNScriptingInstance* instance + IntPtr instance , + + // uint64_t addr + ulong addr + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetScriptingInstanceCurrentBasicBlock.cs b/Function/BNSetScriptingInstanceCurrentBasicBlock.cs new file mode 100644 index 0000000..e210a03 --- /dev/null +++ b/Function/BNSetScriptingInstanceCurrentBasicBlock.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetScriptingInstanceCurrentBasicBlock(BNScriptingInstance* instance, BNBasicBlock* block) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetScriptingInstanceCurrentBasicBlock" + )] + internal static extern void BNSetScriptingInstanceCurrentBasicBlock( + + // BNScriptingInstance* instance + IntPtr instance , + + // BNBasicBlock* block + IntPtr block + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetScriptingInstanceCurrentBinaryView.cs b/Function/BNSetScriptingInstanceCurrentBinaryView.cs new file mode 100644 index 0000000..4756cc5 --- /dev/null +++ b/Function/BNSetScriptingInstanceCurrentBinaryView.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetScriptingInstanceCurrentBinaryView(BNScriptingInstance* instance, BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetScriptingInstanceCurrentBinaryView" + )] + internal static extern void BNSetScriptingInstanceCurrentBinaryView( + + // BNScriptingInstance* instance + IntPtr instance , + + // BNBinaryView* view + IntPtr view + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetScriptingInstanceCurrentFunction.cs b/Function/BNSetScriptingInstanceCurrentFunction.cs new file mode 100644 index 0000000..7b54203 --- /dev/null +++ b/Function/BNSetScriptingInstanceCurrentFunction.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetScriptingInstanceCurrentFunction(BNScriptingInstance* instance, BNFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetScriptingInstanceCurrentFunction" + )] + internal static extern void BNSetScriptingInstanceCurrentFunction( + + // BNScriptingInstance* instance + IntPtr instance , + + // BNFunction* func + IntPtr func + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetScriptingInstanceCurrentSelection.cs b/Function/BNSetScriptingInstanceCurrentSelection.cs new file mode 100644 index 0000000..8afe322 --- /dev/null +++ b/Function/BNSetScriptingInstanceCurrentSelection.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetScriptingInstanceCurrentSelection(BNScriptingInstance* instance, uint64_t begin, uint64_t end) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetScriptingInstanceCurrentSelection" + )] + internal static extern void BNSetScriptingInstanceCurrentSelection( + + // BNScriptingInstance* instance + IntPtr instance , + + // uint64_t begin + ulong begin , + + // uint64_t end + ulong end + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetScriptingInstanceDelimiters.cs b/Function/BNSetScriptingInstanceDelimiters.cs new file mode 100644 index 0000000..a2e54d7 --- /dev/null +++ b/Function/BNSetScriptingInstanceDelimiters.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetScriptingInstanceDelimiters(BNScriptingInstance* instance, const char* delimiters) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetScriptingInstanceDelimiters" + )] + internal static extern void BNSetScriptingInstanceDelimiters( + + // BNScriptingInstance* instance + IntPtr instance , + + // const char* delimiters + string delimiters + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetSnapshotName.cs b/Function/BNSetSnapshotName.cs new file mode 100644 index 0000000..a408ead --- /dev/null +++ b/Function/BNSetSnapshotName.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetSnapshotName(BNSnapshot* snapshot, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetSnapshotName" + )] + internal static extern void BNSetSnapshotName( + + // BNSnapshot* snapshot + IntPtr snapshot , + + // const char* name + string name + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetStructureBuilderAlignment.cs b/Function/BNSetStructureBuilderAlignment.cs new file mode 100644 index 0000000..6a40a8c --- /dev/null +++ b/Function/BNSetStructureBuilderAlignment.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetStructureBuilderAlignment(BNStructureBuilder* s, uint64_t align) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSetStructureBuilderAlignment" + )] + internal static extern void BNSetStructureBuilderAlignment( + + // BNStructureBuilder* s + IntPtr s , + + // uint64_t align + ulong align + ); + } +} \ No newline at end of file diff --git a/Function/BNSetStructureBuilderPacked.cs b/Function/BNSetStructureBuilderPacked.cs new file mode 100644 index 0000000..4a744d2 --- /dev/null +++ b/Function/BNSetStructureBuilderPacked.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetStructureBuilderPacked(BNStructureBuilder* s, bool packed) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSetStructureBuilderPacked" + )] + internal static extern void BNSetStructureBuilderPacked( + + // BNStructureBuilder* s + IntPtr s , + + // bool packed + bool packed + ); + } +} \ No newline at end of file diff --git a/Function/BNSetStructureBuilderPointerOffset.cs b/Function/BNSetStructureBuilderPointerOffset.cs new file mode 100644 index 0000000..d199119 --- /dev/null +++ b/Function/BNSetStructureBuilderPointerOffset.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetStructureBuilderPointerOffset(BNStructureBuilder* s, int64_t offset) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSetStructureBuilderPointerOffset" + )] + internal static extern void BNSetStructureBuilderPointerOffset( + + // BNStructureBuilder* s + IntPtr s , + + // int64_t offset + long offset + ); + } +} \ No newline at end of file diff --git a/Function/BNSetStructureBuilderPropagatesDataVariableReferences.cs b/Function/BNSetStructureBuilderPropagatesDataVariableReferences.cs new file mode 100644 index 0000000..53a0c5a --- /dev/null +++ b/Function/BNSetStructureBuilderPropagatesDataVariableReferences.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetStructureBuilderPropagatesDataVariableReferences(BNStructureBuilder* s, bool value) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSetStructureBuilderPropagatesDataVariableReferences" + )] + internal static extern void BNSetStructureBuilderPropagatesDataVariableReferences( + + // BNStructureBuilder* s + IntPtr s , + + // bool _value + bool _value + ); + } +} \ No newline at end of file diff --git a/Function/BNSetStructureBuilderType.cs b/Function/BNSetStructureBuilderType.cs new file mode 100644 index 0000000..17f2d7d --- /dev/null +++ b/Function/BNSetStructureBuilderType.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetStructureBuilderType(BNStructureBuilder* s, BNStructureVariant type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSetStructureBuilderType" + )] + internal static extern void BNSetStructureBuilderType( + + // BNStructureBuilder* s + IntPtr s , + + // BNStructureVariant type + StructureVariant type + ); + } +} \ No newline at end of file diff --git a/Function/BNSetStructureBuilderWidth.cs b/Function/BNSetStructureBuilderWidth.cs new file mode 100644 index 0000000..06c5e73 --- /dev/null +++ b/Function/BNSetStructureBuilderWidth.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetStructureBuilderWidth(BNStructureBuilder* s, uint64_t width) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSetStructureBuilderWidth" + )] + internal static extern void BNSetStructureBuilderWidth( + + // BNStructureBuilder* s + IntPtr s , + + // uint64_t width + ulong width + ); + } +} \ No newline at end of file diff --git a/Function/BNSetSwitchRecovery.cs b/Function/BNSetSwitchRecovery.cs new file mode 100644 index 0000000..83f0e98 --- /dev/null +++ b/Function/BNSetSwitchRecovery.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetSwitchRecovery(BNFunction* func, uint64_t addr, BNSwitchRecovery mode) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetSwitchRecovery" + )] + internal static extern void BNSetSwitchRecovery( + + // BNFunction* func + IntPtr func , + + // uint64_t addr + ulong addr , + + // BNSwitchRecovery mode + SwitchRecovery mode + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetThreadName.cs b/Function/BNSetThreadName.cs new file mode 100644 index 0000000..e6528a9 --- /dev/null +++ b/Function/BNSetThreadName.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetThreadName(const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetThreadName" + )] + internal static extern void BNSetThreadName( + + // const char* name + string name + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetTypeArchiveCurrentSnapshot.cs b/Function/BNSetTypeArchiveCurrentSnapshot.cs new file mode 100644 index 0000000..b30bb45 --- /dev/null +++ b/Function/BNSetTypeArchiveCurrentSnapshot.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetTypeArchiveCurrentSnapshot(BNTypeArchive* archive, const char* id) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetTypeArchiveCurrentSnapshot" + )] + internal static extern void BNSetTypeArchiveCurrentSnapshot( + + // BNTypeArchive* archive + IntPtr archive , + + // const char* id + string id + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetTypeBuilderAttribute.cs b/Function/BNSetTypeBuilderAttribute.cs new file mode 100644 index 0000000..46be40e --- /dev/null +++ b/Function/BNSetTypeBuilderAttribute.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetTypeBuilderAttribute(BNTypeBuilder* type, const char* name, const char* value) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetTypeBuilderAttribute" + )] + internal static extern void BNSetTypeBuilderAttribute( + + // BNTypeBuilder* type + IntPtr type , + + // const char* name + string name , + + // const char* _value + string _value + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetTypeBuilderAttributeList.cs b/Function/BNSetTypeBuilderAttributeList.cs new file mode 100644 index 0000000..b6033d6 --- /dev/null +++ b/Function/BNSetTypeBuilderAttributeList.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetTypeBuilderAttributeList(BNTypeBuilder* type, BNTypeAttribute* attrs, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetTypeBuilderAttributeList" + )] + internal static extern void BNSetTypeBuilderAttributeList( + + // BNTypeBuilder* type + IntPtr type , + + // BNTypeAttribute* attrs + IntPtr attrs , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetTypeBuilderHasTemplateArguments.cs b/Function/BNSetTypeBuilderHasTemplateArguments.cs new file mode 100644 index 0000000..fdaeb4e --- /dev/null +++ b/Function/BNSetTypeBuilderHasTemplateArguments.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetTypeBuilderHasTemplateArguments(BNTypeBuilder* type, bool hasTemplateArguments) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetTypeBuilderHasTemplateArguments" + )] + internal static extern void BNSetTypeBuilderHasTemplateArguments( + + // BNTypeBuilder* type + IntPtr type , + + // bool hasTemplateArguments + bool hasTemplateArguments + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetTypeBuilderNameType.cs b/Function/BNSetTypeBuilderNameType.cs new file mode 100644 index 0000000..09c78b2 --- /dev/null +++ b/Function/BNSetTypeBuilderNameType.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetTypeBuilderNameType(BNTypeBuilder* type, BNNameType nameType) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetTypeBuilderNameType" + )] + internal static extern void BNSetTypeBuilderNameType( + + // BNTypeBuilder* type + IntPtr type , + + // BNNameType nameType + NameType nameType + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetTypeBuilderNamedTypeReference.cs b/Function/BNSetTypeBuilderNamedTypeReference.cs new file mode 100644 index 0000000..a8d54c8 --- /dev/null +++ b/Function/BNSetTypeBuilderNamedTypeReference.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetTypeBuilderNamedTypeReference(BNTypeBuilder* type, BNNamedTypeReference* ntr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetTypeBuilderNamedTypeReference" + )] + internal static extern void BNSetTypeBuilderNamedTypeReference( + + // BNTypeBuilder* type + IntPtr type , + + // BNNamedTypeReference* ntr + IntPtr ntr + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetTypeBuilderOffset.cs b/Function/BNSetTypeBuilderOffset.cs new file mode 100644 index 0000000..6a69aa5 --- /dev/null +++ b/Function/BNSetTypeBuilderOffset.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetTypeBuilderOffset(BNTypeBuilder* type, uint64_t offset) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSetTypeBuilderOffset" + )] + internal static extern void BNSetTypeBuilderOffset( + + // BNTypeBuilder* type + IntPtr type , + + // uint64_t offset + ulong offset + ); + } +} \ No newline at end of file diff --git a/Function/BNSetTypeBuilderPointerBase.cs b/Function/BNSetTypeBuilderPointerBase.cs new file mode 100644 index 0000000..cf6bead --- /dev/null +++ b/Function/BNSetTypeBuilderPointerBase.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetTypeBuilderPointerBase(BNTypeBuilder* type, BNPointerBaseType baseType, int64_t baseOffset) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSetTypeBuilderPointerBase" + )] + internal static extern void BNSetTypeBuilderPointerBase( + + // BNTypeBuilder* type + IntPtr type , + + // BNPointerBaseType baseType + PointerBaseType baseType , + + // int64_t baseOffset + long baseOffset + ); + } +} \ No newline at end of file diff --git a/Function/BNSetTypeBuilderPointerSuffix.cs b/Function/BNSetTypeBuilderPointerSuffix.cs new file mode 100644 index 0000000..7a7e5df --- /dev/null +++ b/Function/BNSetTypeBuilderPointerSuffix.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetTypeBuilderPointerSuffix(BNTypeBuilder* type, BNPointerSuffix* suffix, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSetTypeBuilderPointerSuffix" + )] + internal static extern void BNSetTypeBuilderPointerSuffix( + + // BNTypeBuilder* type + IntPtr type , + + // BNPointerSuffix* suffix + PointerSuffix[] suffix , + + // uint64_t count + ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNSetTypeBuilderPure.cs b/Function/BNSetTypeBuilderPure.cs new file mode 100644 index 0000000..9a6d6f3 --- /dev/null +++ b/Function/BNSetTypeBuilderPure.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetTypeBuilderPure(BNTypeBuilder* type, BNBoolWithConfidence* pure) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSetTypeBuilderPure" + )] + internal static extern void BNSetTypeBuilderPure( + + // BNTypeBuilder* type + IntPtr type , + + // BNBoolWithConfidence* pure + in BNBoolWithConfidence pure + ); + } +} \ No newline at end of file diff --git a/Function/BNSetTypeLibraryDependencyName.cs b/Function/BNSetTypeLibraryDependencyName.cs new file mode 100644 index 0000000..f1a80d1 --- /dev/null +++ b/Function/BNSetTypeLibraryDependencyName.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetTypeLibraryDependencyName(BNTypeLibrary* lib, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetTypeLibraryDependencyName" + )] + internal static extern void BNSetTypeLibraryDependencyName( + + // BNTypeLibrary* lib + IntPtr lib , + + // const char* name + string name + ); + } +} \ No newline at end of file diff --git a/Function/BNSetTypeLibraryGuid.cs b/Function/BNSetTypeLibraryGuid.cs new file mode 100644 index 0000000..a81e00c --- /dev/null +++ b/Function/BNSetTypeLibraryGuid.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetTypeLibraryGuid(BNTypeLibrary* lib, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetTypeLibraryGuid" + )] + internal static extern void BNSetTypeLibraryGuid( + + // BNTypeLibrary* lib + IntPtr lib , + + // const char* name + string name + ); + } +} \ No newline at end of file diff --git a/Function/BNSetTypeLibraryName.cs b/Function/BNSetTypeLibraryName.cs new file mode 100644 index 0000000..4621667 --- /dev/null +++ b/Function/BNSetTypeLibraryName.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetTypeLibraryName(BNTypeLibrary* lib, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetTypeLibraryName" + )] + internal static extern void BNSetTypeLibraryName( + + // BNTypeLibrary* lib + IntPtr lib , + + // const char* name + string name + ); + } +} \ No newline at end of file diff --git a/Function/BNSetUserBasicBlockHighlight.cs b/Function/BNSetUserBasicBlockHighlight.cs new file mode 100644 index 0000000..ab6d40b --- /dev/null +++ b/Function/BNSetUserBasicBlockHighlight.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetUserBasicBlockHighlight(BNBasicBlock* block, BNHighlightColor color) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSetUserBasicBlockHighlight" + )] + internal static extern void BNSetUserBasicBlockHighlight( + + // BNBasicBlock* block + IntPtr block , + + // BNHighlightColor color + BNHighlightColor color + ); + + } +} \ No newline at end of file diff --git a/Function/BNSetUserCallRegisterStackAdjustment.cs b/Function/BNSetUserCallRegisterStackAdjustment.cs new file mode 100644 index 0000000..e174855 --- /dev/null +++ b/Function/BNSetUserCallRegisterStackAdjustment.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetUserCallRegisterStackAdjustment(BNFunction* func, BNArchitecture* arch, uint64_t addr, BNRegisterStackAdjustment* adjust, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetUserCallRegisterStackAdjustment" + )] + internal static extern void BNSetUserCallRegisterStackAdjustment( + + // BNFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t addr + ulong addr , + + // BNRegisterStackAdjustment* adjust + IntPtr adjust , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetUserCallRegisterStackAdjustmentForRegisterStack.cs b/Function/BNSetUserCallRegisterStackAdjustmentForRegisterStack.cs new file mode 100644 index 0000000..01d5150 --- /dev/null +++ b/Function/BNSetUserCallRegisterStackAdjustmentForRegisterStack.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetUserCallRegisterStackAdjustmentForRegisterStack(BNFunction* func, BNArchitecture* arch, uint64_t addr, uint32_t regStack, int32_t adjust, uint8_t confidence) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetUserCallRegisterStackAdjustmentForRegisterStack" + )] + internal static extern void BNSetUserCallRegisterStackAdjustmentForRegisterStack( + + // BNFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t addr + ulong addr , + + // uint32_t regStack + uint regStack , + + // int32_t adjust + int adjust , + + // uint8_t confidence + byte confidence + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetUserCallStackAdjustment.cs b/Function/BNSetUserCallStackAdjustment.cs new file mode 100644 index 0000000..3035dd4 --- /dev/null +++ b/Function/BNSetUserCallStackAdjustment.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetUserCallStackAdjustment(BNFunction* func, BNArchitecture* arch, uint64_t addr, int64_t adjust, uint8_t confidence) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetUserCallStackAdjustment" + )] + internal static extern void BNSetUserCallStackAdjustment( + + // BNFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t addr + ulong addr , + + // int64_t adjust + long adjust , + + // uint8_t confidence + byte confidence + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetUserCallTypeAdjustment.cs b/Function/BNSetUserCallTypeAdjustment.cs new file mode 100644 index 0000000..533bad9 --- /dev/null +++ b/Function/BNSetUserCallTypeAdjustment.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetUserCallTypeAdjustment(BNFunction* func, BNArchitecture* arch, uint64_t addr, BNTypeWithConfidence* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetUserCallTypeAdjustment" + )] + internal static extern void BNSetUserCallTypeAdjustment( + + // BNFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t addr + ulong addr , + + // BNTypeWithConfidence* type + IntPtr type + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetUserFunctionCallingConvention.cs b/Function/BNSetUserFunctionCallingConvention.cs new file mode 100644 index 0000000..1cceaa1 --- /dev/null +++ b/Function/BNSetUserFunctionCallingConvention.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetUserFunctionCallingConvention(BNFunction* func, BNCallingConventionWithConfidence* convention) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSetUserFunctionCallingConvention" + )] + internal static extern void BNSetUserFunctionCallingConvention( + + // BNFunction* func + IntPtr func , + + // BNCallingConventionWithConfidence* convention + in BNCallingConventionWithConfidence convention + ); + } +} \ No newline at end of file diff --git a/Function/BNSetUserFunctionCanReturn.cs b/Function/BNSetUserFunctionCanReturn.cs new file mode 100644 index 0000000..174b4a2 --- /dev/null +++ b/Function/BNSetUserFunctionCanReturn.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetUserFunctionCanReturn(BNFunction* func, BNBoolWithConfidence* returns) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSetUserFunctionCanReturn" + )] + internal static extern void BNSetUserFunctionCanReturn( + + // BNFunction* func + IntPtr func , + + // BNBoolWithConfidence* returns + in BNBoolWithConfidence returns + ); + } +} \ No newline at end of file diff --git a/Function/BNSetUserFunctionClobberedRegisters.cs b/Function/BNSetUserFunctionClobberedRegisters.cs new file mode 100644 index 0000000..210e4a2 --- /dev/null +++ b/Function/BNSetUserFunctionClobberedRegisters.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetUserFunctionClobberedRegisters(BNFunction* func, BNRegisterSetWithConfidence* regs) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetUserFunctionClobberedRegisters" + )] + internal static extern void BNSetUserFunctionClobberedRegisters( + + // BNFunction* func + IntPtr func , + + // BNRegisterSetWithConfidence* regs + IntPtr regs + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetUserFunctionHasVariableArguments.cs b/Function/BNSetUserFunctionHasVariableArguments.cs new file mode 100644 index 0000000..122a7c7 --- /dev/null +++ b/Function/BNSetUserFunctionHasVariableArguments.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetUserFunctionHasVariableArguments(BNFunction* func, BNBoolWithConfidence* varArgs) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSetUserFunctionHasVariableArguments" + )] + internal static extern void BNSetUserFunctionHasVariableArguments( + + // BNFunction* func + IntPtr func , + + // BNBoolWithConfidence* varArgs + in BNBoolWithConfidence varArgs + ); + } +} \ No newline at end of file diff --git a/Function/BNSetUserFunctionInlinedDuringAnalysis.cs b/Function/BNSetUserFunctionInlinedDuringAnalysis.cs new file mode 100644 index 0000000..cbebfde --- /dev/null +++ b/Function/BNSetUserFunctionInlinedDuringAnalysis.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetUserFunctionInlinedDuringAnalysis(BNFunction* func, BNBoolWithConfidence inlined) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetUserFunctionInlinedDuringAnalysis" + )] + internal static extern void BNSetUserFunctionInlinedDuringAnalysis( + + // BNFunction* func + IntPtr func , + + // BNBoolWithConfidence inlined + BoolWithConfidence inlined + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetUserFunctionParameterVariables.cs b/Function/BNSetUserFunctionParameterVariables.cs new file mode 100644 index 0000000..e166b18 --- /dev/null +++ b/Function/BNSetUserFunctionParameterVariables.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetUserFunctionParameterVariables(BNFunction* func, BNParameterVariablesWithConfidence* vars) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSetUserFunctionParameterVariables" + )] + internal static extern void BNSetUserFunctionParameterVariables( + + // BNFunction* func + IntPtr func , + + // BNParameterVariablesWithConfidence* vars + in BNParameterVariablesWithConfidence vars + ); + } +} \ No newline at end of file diff --git a/Function/BNSetUserFunctionPure.cs b/Function/BNSetUserFunctionPure.cs new file mode 100644 index 0000000..b78355d --- /dev/null +++ b/Function/BNSetUserFunctionPure.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetUserFunctionPure(BNFunction* func, BNBoolWithConfidence* pure) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSetUserFunctionPure" + )] + internal static extern void BNSetUserFunctionPure( + + // BNFunction* func + IntPtr func , + + // BNBoolWithConfidence* pure + in BNBoolWithConfidence pure + ); + } +} \ No newline at end of file diff --git a/Function/BNSetUserFunctionRegisterStackAdjustments.cs b/Function/BNSetUserFunctionRegisterStackAdjustments.cs new file mode 100644 index 0000000..a58ca76 --- /dev/null +++ b/Function/BNSetUserFunctionRegisterStackAdjustments.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetUserFunctionRegisterStackAdjustments(BNFunction* func, BNRegisterStackAdjustment* adjustments, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetUserFunctionRegisterStackAdjustments" + )] + internal static extern void BNSetUserFunctionRegisterStackAdjustments( + + // BNFunction* func + IntPtr func , + + // BNRegisterStackAdjustment* adjustments + IntPtr adjustments , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetUserFunctionReturnRegisters.cs b/Function/BNSetUserFunctionReturnRegisters.cs new file mode 100644 index 0000000..bf61caa --- /dev/null +++ b/Function/BNSetUserFunctionReturnRegisters.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetUserFunctionReturnRegisters(BNFunction* func, BNRegisterSetWithConfidence* regs) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetUserFunctionReturnRegisters" + )] + internal static extern void BNSetUserFunctionReturnRegisters( + + // BNFunction* func + IntPtr func , + + // BNRegisterSetWithConfidence* regs + IntPtr regs + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetUserFunctionReturnType.cs b/Function/BNSetUserFunctionReturnType.cs new file mode 100644 index 0000000..16caf2f --- /dev/null +++ b/Function/BNSetUserFunctionReturnType.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetUserFunctionReturnType(BNFunction* func, BNTypeWithConfidence* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSetUserFunctionReturnType" + )] + internal static extern void BNSetUserFunctionReturnType( + + // BNFunction* func + IntPtr func , + + // BNTypeWithConfidence* type + in BNTypeWithConfidence type + ); + } +} \ No newline at end of file diff --git a/Function/BNSetUserFunctionStackAdjustment.cs b/Function/BNSetUserFunctionStackAdjustment.cs new file mode 100644 index 0000000..2f19e3e --- /dev/null +++ b/Function/BNSetUserFunctionStackAdjustment.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetUserFunctionStackAdjustment(BNFunction* func, BNOffsetWithConfidence* stackAdjust) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetUserFunctionStackAdjustment" + )] + internal static extern void BNSetUserFunctionStackAdjustment( + + // BNFunction* func + IntPtr func , + + // BNOffsetWithConfidence* stackAdjust + IntPtr stackAdjust + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetUserGlobalPointerValue.cs b/Function/BNSetUserGlobalPointerValue.cs new file mode 100644 index 0000000..37749d4 --- /dev/null +++ b/Function/BNSetUserGlobalPointerValue.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetUserGlobalPointerValue(BNBinaryView* view, BNRegisterValueWithConfidence value) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSetUserGlobalPointerValue" + )] + internal static extern void BNSetUserGlobalPointerValue( + + // BNBinaryView* view + IntPtr view , + + // BNRegisterValueWithConfidence value + in BNRegisterValueWithConfidence value + ); + } +} \ No newline at end of file diff --git a/Function/BNSetUserGotoLabelName.cs b/Function/BNSetUserGotoLabelName.cs new file mode 100644 index 0000000..31b0359 --- /dev/null +++ b/Function/BNSetUserGotoLabelName.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetUserGotoLabelName(BNFunction* func, uint64_t labelId, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetUserGotoLabelName" + )] + internal static extern void BNSetUserGotoLabelName( + + // BNFunction* func + IntPtr func , + + // uint64_t labelId + ulong labelId , + + // const char* name + string name + ); + } +} \ No newline at end of file diff --git a/Function/BNSetUserIndirectBranches.cs b/Function/BNSetUserIndirectBranches.cs new file mode 100644 index 0000000..4e6050c --- /dev/null +++ b/Function/BNSetUserIndirectBranches.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetUserIndirectBranches(BNFunction* func, BNArchitecture* sourceArch, uint64_t source, BNArchitectureAndAddress* branches, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetUserIndirectBranches" + )] + internal static extern void BNSetUserIndirectBranches( + + // BNFunction* func + IntPtr func , + + // BNArchitecture* sourceArch + IntPtr sourceArch , + + // uint64_t source + ulong source , + + // BNArchitectureAndAddress* branches + IntPtr branches , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetUserInstructionHighlight.cs b/Function/BNSetUserInstructionHighlight.cs new file mode 100644 index 0000000..a0ad91d --- /dev/null +++ b/Function/BNSetUserInstructionHighlight.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetUserInstructionHighlight(BNFunction* func, BNArchitecture* arch, uint64_t addr, BNHighlightColor color) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetUserInstructionHighlight" + )] + internal static extern void BNSetUserInstructionHighlight( + + // BNFunction* func + IntPtr func , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t addr + ulong addr , + + // BNHighlightColor color + HighlightColor color + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetUserVariableValue.cs b/Function/BNSetUserVariableValue.cs new file mode 100644 index 0000000..c155e65 --- /dev/null +++ b/Function/BNSetUserVariableValue.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetUserVariableValue(BNFunction* func, BNVariable* var, BNArchitectureAndAddress* defSite, bool after, BNPossibleValueSet* value) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSetUserVariableValue" + )] + internal static extern void BNSetUserVariableValue( + + // BNFunction* func + IntPtr func , + + // BNVariable* _var + in BNVariable _var , + + // BNArchitectureAndAddress* defSite + in BNArchitectureAndAddress defSite , + + // bool after + bool after , + + // BNPossibleValueSet* _value + in BNPossibleValueSet _value + ); + } +} \ No newline at end of file diff --git a/Function/BNSetViewForFlowGraph.cs b/Function/BNSetViewForFlowGraph.cs new file mode 100644 index 0000000..d3347cf --- /dev/null +++ b/Function/BNSetViewForFlowGraph.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetViewForFlowGraph(BNFlowGraph* graph, BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSetViewForFlowGraph" + )] + internal static extern void BNSetViewForFlowGraph( + + // BNFlowGraph* graph + IntPtr graph , + + // BNBinaryView* view + IntPtr view + ); + } +} \ No newline at end of file diff --git a/Function/BNSetVirtualPath.cs b/Function/BNSetVirtualPath.cs new file mode 100644 index 0000000..15a7414 --- /dev/null +++ b/Function/BNSetVirtualPath.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetVirtualPath(BNFileMetadata* file, const char* path) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetVirtualPath" + )] + internal static extern void BNSetVirtualPath( + + // BNFileMetadata* file + IntPtr file , + + // const char* path + string path + + ); + } +} \ No newline at end of file diff --git a/Function/BNSetWorkerThreadCount.cs b/Function/BNSetWorkerThreadCount.cs new file mode 100644 index 0000000..937b81a --- /dev/null +++ b/Function/BNSetWorkerThreadCount.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSetWorkerThreadCount(uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSetWorkerThreadCount" + )] + internal static extern void BNSetWorkerThreadCount( + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNSettingsContains.cs b/Function/BNSettingsContains.cs new file mode 100644 index 0000000..9dd783f --- /dev/null +++ b/Function/BNSettingsContains.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNSettingsContains(BNSettings* settings, const char* key) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSettingsContains" + )] + internal static extern bool BNSettingsContains( + + // BNSettings* settings + IntPtr settings , + + // const char* key + string key + + ); + } +} \ No newline at end of file diff --git a/Function/BNSettingsDeserializeSchema.cs b/Function/BNSettingsDeserializeSchema.cs new file mode 100644 index 0000000..e069918 --- /dev/null +++ b/Function/BNSettingsDeserializeSchema.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNSettingsDeserializeSchema(BNSettings* settings, const char* schema, BNSettingsScope scope, bool merge) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSettingsDeserializeSchema" + )] + internal static extern bool BNSettingsDeserializeSchema( + + // BNSettings* settings + IntPtr settings , + + // const char* schema + string schema , + + // BNSettingsScope scope + SettingsScope scope , + + // bool merge + bool merge + ); + } +} \ No newline at end of file diff --git a/Function/BNSettingsGetBool.cs b/Function/BNSettingsGetBool.cs new file mode 100644 index 0000000..a1ef57e --- /dev/null +++ b/Function/BNSettingsGetBool.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNSettingsGetBool(BNSettings* settings, const char* key, BNBinaryView* view, BNFunction* func, BNSettingsScope* scope) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSettingsGetBool" + )] + internal static extern bool BNSettingsGetBool( + + // BNSettings* settings + IntPtr settings , + + // const char* key + string key , + + // BNBinaryView* view + IntPtr view , + + // BNFunction* func + IntPtr func , + + // BNSettingsScope* scope + out SettingsScope scope + ); + } +} \ No newline at end of file diff --git a/Function/BNSettingsGetDouble.cs b/Function/BNSettingsGetDouble.cs new file mode 100644 index 0000000..9b04e4b --- /dev/null +++ b/Function/BNSettingsGetDouble.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// double BNSettingsGetDouble(BNSettings* settings, const char* key, BNBinaryView* view, BNFunction* func, BNSettingsScope* scope) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSettingsGetDouble" + )] + internal static extern double BNSettingsGetDouble( + + // BNSettings* settings + IntPtr settings , + + // const char* key + string key , + + // BNBinaryView* view + IntPtr view , + + // BNFunction* func + IntPtr func , + + // BNSettingsScope* scope + out SettingsScope scope + ); + } +} \ No newline at end of file diff --git a/Function/BNSettingsGetInt64.cs b/Function/BNSettingsGetInt64.cs new file mode 100644 index 0000000..4373211 --- /dev/null +++ b/Function/BNSettingsGetInt64.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// int64_t BNSettingsGetInt64(BNSettings* settings, const char* key, BNBinaryView* view, BNFunction* func, BNSettingsScope* scope) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSettingsGetInt64" + )] + internal static extern long BNSettingsGetInt64( + + // BNSettings* settings + IntPtr settings , + + // const char* key + string key , + + // BNBinaryView* view + IntPtr view , + + // BNFunction* func + IntPtr func , + + // BNSettingsScope* scope + IntPtr scope + + ); + } +} \ No newline at end of file diff --git a/Function/BNSettingsGetJson.cs b/Function/BNSettingsGetJson.cs new file mode 100644 index 0000000..f82e15f --- /dev/null +++ b/Function/BNSettingsGetJson.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// char* BNSettingsGetJson(BNSettings* settings, const char* key, BNBinaryView* view, BNFunction* func, BNSettingsScope* scope) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSettingsGetJson" + )] + internal static extern IntPtr BNSettingsGetJson( + + // BNSettings* settings + IntPtr settings , + + // const char* key + string key , + + // BNBinaryView* view + IntPtr view , + + // BNFunction* func + IntPtr func , + + // BNSettingsScope* scope + out SettingsScope scope + ); + } +} \ No newline at end of file diff --git a/Function/BNSettingsGetString.cs b/Function/BNSettingsGetString.cs new file mode 100644 index 0000000..c49392a --- /dev/null +++ b/Function/BNSettingsGetString.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNSettingsGetString(BNSettings* settings, const char* key, BNBinaryView* view, BNFunction* func, BNSettingsScope* scope) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSettingsGetString" + )] + internal static extern IntPtr BNSettingsGetString( + + // BNSettings* settings + IntPtr settings , + + // const char* key + string key , + + // BNBinaryView* view + IntPtr view , + + // BNFunction* func + IntPtr func , + + // BNSettingsScope* scope + out SettingsScope scope + ); + } +} \ No newline at end of file diff --git a/Function/BNSettingsGetStringList.cs b/Function/BNSettingsGetStringList.cs new file mode 100644 index 0000000..46d7bc2 --- /dev/null +++ b/Function/BNSettingsGetStringList.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char** BNSettingsGetStringList(BNSettings* settings, const char* key, BNBinaryView* view, BNFunction* func, BNSettingsScope* scope, uint64_t* inoutSize) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSettingsGetStringList" + )] + internal static extern IntPtr BNSettingsGetStringList( + + // BNSettings* settings + IntPtr settings , + + // const char* key + string key , + + // BNBinaryView* view + IntPtr view , + + // BNFunction* func + IntPtr func , + + // BNSettingsScope* scope + out SettingsScope scope , + + // uint64_t* inoutSize + out ulong inoutSize + ); + } +} \ No newline at end of file diff --git a/Function/BNSettingsGetUInt64.cs b/Function/BNSettingsGetUInt64.cs new file mode 100644 index 0000000..49015b3 --- /dev/null +++ b/Function/BNSettingsGetUInt64.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNSettingsGetUInt64(BNSettings* settings, const char* key, BNBinaryView* view, BNFunction* func, BNSettingsScope* scope) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSettingsGetUInt64" + )] + internal static extern ulong BNSettingsGetUInt64( + + // BNSettings* settings + IntPtr settings , + + // const char* key + string key , + + // BNBinaryView* view + IntPtr view , + + // BNFunction* func + IntPtr func , + + // BNSettingsScope* scope + out SettingsScope scope + ); + } +} \ No newline at end of file diff --git a/Function/BNSettingsIsEmpty.cs b/Function/BNSettingsIsEmpty.cs new file mode 100644 index 0000000..d5bda1e --- /dev/null +++ b/Function/BNSettingsIsEmpty.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNSettingsIsEmpty(BNSettings* settings, BNBinaryView* view, BNFunction* func, BNSettingsScope scope) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSettingsIsEmpty" + )] + internal static extern bool BNSettingsIsEmpty( + + // BNSettings* settings + IntPtr settings , + + // BNBinaryView* view + IntPtr view , + + // BNFunction* func + IntPtr func , + + // BNSettingsScope scope + SettingsScope scope + ); + } +} \ No newline at end of file diff --git a/Function/BNSettingsKeysList.cs b/Function/BNSettingsKeysList.cs new file mode 100644 index 0000000..ec0de57 --- /dev/null +++ b/Function/BNSettingsKeysList.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// char** BNSettingsKeysList(BNSettings* settings, uint64_t* inoutSize) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSettingsKeysList" + )] + internal static extern IntPtr BNSettingsKeysList( + + // BNSettings* settings + IntPtr settings , + + // uint64_t* inoutSize + out ulong inoutSize + ); + } +} \ No newline at end of file diff --git a/Function/BNSettingsQueryPropertyString.cs b/Function/BNSettingsQueryPropertyString.cs new file mode 100644 index 0000000..534e410 --- /dev/null +++ b/Function/BNSettingsQueryPropertyString.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNSettingsQueryPropertyString(BNSettings* settings, const char* key, const char* property) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSettingsQueryPropertyString" + )] + internal static extern IntPtr BNSettingsQueryPropertyString( + + // BNSettings* settings + IntPtr settings , + + // const char* key + string key , + + // const char* property + string property + ); + } +} \ No newline at end of file diff --git a/Function/BNSettingsQueryPropertyStringList.cs b/Function/BNSettingsQueryPropertyStringList.cs new file mode 100644 index 0000000..91182b5 --- /dev/null +++ b/Function/BNSettingsQueryPropertyStringList.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// char** BNSettingsQueryPropertyStringList(BNSettings* settings, const char* key, const char* property, uint64_t* inoutSize) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSettingsQueryPropertyStringList" + )] + internal static extern IntPtr BNSettingsQueryPropertyStringList( + + // BNSettings* settings + IntPtr settings , + + // const char* key + string key , + + // const char* property + string property , + + // uint64_t* inoutSize + out ulong inoutSize + ); + } +} \ No newline at end of file diff --git a/Function/BNSettingsRegisterGroup.cs b/Function/BNSettingsRegisterGroup.cs new file mode 100644 index 0000000..4c7a3ee --- /dev/null +++ b/Function/BNSettingsRegisterGroup.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNSettingsRegisterGroup(BNSettings* settings, const char* group, const char* title) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSettingsRegisterGroup" + )] + internal static extern bool BNSettingsRegisterGroup( + + // BNSettings* settings + IntPtr settings , + + // const char* _group + string _group , + + // const char* title + string title + ); + } +} \ No newline at end of file diff --git a/Function/BNSettingsRegisterSetting.cs b/Function/BNSettingsRegisterSetting.cs new file mode 100644 index 0000000..2935c17 --- /dev/null +++ b/Function/BNSettingsRegisterSetting.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNSettingsRegisterSetting(BNSettings* settings, const char* key, const char* properties) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSettingsRegisterSetting" + )] + internal static extern bool BNSettingsRegisterSetting( + + // BNSettings* settings + IntPtr settings , + + // const char* key + string key , + + // const char* properties + string properties + ); + } +} \ No newline at end of file diff --git a/Function/BNSettingsReset.cs b/Function/BNSettingsReset.cs new file mode 100644 index 0000000..85ea587 --- /dev/null +++ b/Function/BNSettingsReset.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNSettingsReset(BNSettings* settings, const char* key, BNBinaryView* view, BNFunction* func, BNSettingsScope scope) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSettingsReset" + )] + internal static extern bool BNSettingsReset( + + // BNSettings* settings + IntPtr settings , + + // const char* key + string key , + + // BNBinaryView* view + IntPtr view , + + // BNFunction* func + IntPtr func , + + // BNSettingsScope scope + SettingsScope scope + ); + } +} \ No newline at end of file diff --git a/Function/BNSettingsResetAll.cs b/Function/BNSettingsResetAll.cs new file mode 100644 index 0000000..df9eabc --- /dev/null +++ b/Function/BNSettingsResetAll.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNSettingsResetAll(BNSettings* settings, BNBinaryView* view, BNFunction* func, BNSettingsScope scope, bool schemaOnly) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSettingsResetAll" + )] + internal static extern bool BNSettingsResetAll( + + // BNSettings* settings + IntPtr settings , + + // BNBinaryView* view + IntPtr view , + + // BNFunction* func + IntPtr func , + + // BNSettingsScope scope + SettingsScope scope , + + // bool schemaOnly + bool schemaOnly + ); + } +} \ No newline at end of file diff --git a/Function/BNSettingsSerializeSchema.cs b/Function/BNSettingsSerializeSchema.cs new file mode 100644 index 0000000..5ddf693 --- /dev/null +++ b/Function/BNSettingsSerializeSchema.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// char* BNSettingsSerializeSchema(BNSettings* settings) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSettingsSerializeSchema" + )] + internal static extern IntPtr BNSettingsSerializeSchema( + + // BNSettings* settings + IntPtr settings + ); + } +} \ No newline at end of file diff --git a/Function/BNSettingsSetBool.cs b/Function/BNSettingsSetBool.cs new file mode 100644 index 0000000..daf21b3 --- /dev/null +++ b/Function/BNSettingsSetBool.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNSettingsSetBool(BNSettings* settings, BNBinaryView* view, BNFunction* func, BNSettingsScope scope, const char* key, bool value) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSettingsSetBool" + )] + internal static extern bool BNSettingsSetBool( + + // BNSettings* settings + IntPtr settings , + + // BNBinaryView* view + IntPtr view , + + // BNFunction* func + IntPtr func , + + // BNSettingsScope scope + SettingsScope scope , + + // const char* key + string key , + + // bool _value + bool _value + ); + } +} \ No newline at end of file diff --git a/Function/BNSettingsSetDouble.cs b/Function/BNSettingsSetDouble.cs new file mode 100644 index 0000000..a6c3dc0 --- /dev/null +++ b/Function/BNSettingsSetDouble.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNSettingsSetDouble(BNSettings* settings, BNBinaryView* view, BNFunction* func, BNSettingsScope scope, const char* key, double value) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSettingsSetDouble" + )] + internal static extern bool BNSettingsSetDouble( + + // BNSettings* settings + IntPtr settings , + + // BNBinaryView* view + IntPtr view , + + // BNFunction* func + IntPtr func , + + // BNSettingsScope scope + SettingsScope scope , + + // const char* key + string key , + + // double _value + double _value + + ); + } +} \ No newline at end of file diff --git a/Function/BNSettingsSetInt64.cs b/Function/BNSettingsSetInt64.cs new file mode 100644 index 0000000..ec8bb29 --- /dev/null +++ b/Function/BNSettingsSetInt64.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNSettingsSetInt64(BNSettings* settings, BNBinaryView* view, BNFunction* func, BNSettingsScope scope, const char* key, int64_t value) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSettingsSetInt64" + )] + internal static extern bool BNSettingsSetInt64( + + // BNSettings* settings + IntPtr settings , + + // BNBinaryView* view + IntPtr view , + + // BNFunction* func + IntPtr func , + + // BNSettingsScope scope + SettingsScope scope , + + // const char* key + string key , + + // int64_t _value + long _value + + ); + } +} \ No newline at end of file diff --git a/Function/BNSettingsSetJson.cs b/Function/BNSettingsSetJson.cs new file mode 100644 index 0000000..e1eb2b7 --- /dev/null +++ b/Function/BNSettingsSetJson.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNSettingsSetJson(BNSettings* settings, BNBinaryView* view, BNFunction* func, BNSettingsScope scope, const char* key, const char* value) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSettingsSetJson" + )] + internal static extern bool BNSettingsSetJson( + + // BNSettings* settings + IntPtr settings , + + // BNBinaryView* view + IntPtr view , + + // BNFunction* func + IntPtr func , + + // BNSettingsScope scope + SettingsScope scope , + + // const char* key + string key , + + // const char* _value + string _value + + ); + } +} \ No newline at end of file diff --git a/Function/BNSettingsSetResourceId.cs b/Function/BNSettingsSetResourceId.cs new file mode 100644 index 0000000..4ef8aa6 --- /dev/null +++ b/Function/BNSettingsSetResourceId.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSettingsSetResourceId(BNSettings* settings, const char* resourceId) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSettingsSetResourceId" + )] + internal static extern void BNSettingsSetResourceId( + + // BNSettings* settings + IntPtr settings , + + // const char* resourceId + string resourceId + ); + } +} \ No newline at end of file diff --git a/Function/BNSettingsSetString.cs b/Function/BNSettingsSetString.cs new file mode 100644 index 0000000..11bc5d1 --- /dev/null +++ b/Function/BNSettingsSetString.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNSettingsSetString(BNSettings* settings, BNBinaryView* view, BNFunction* func, BNSettingsScope scope, const char* key, const char* value) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSettingsSetString" + )] + internal static extern bool BNSettingsSetString( + + // BNSettings* settings + IntPtr settings , + + // BNBinaryView* view + IntPtr view , + + // BNFunction* func + IntPtr func , + + // BNSettingsScope scope + SettingsScope scope , + + // const char* key + string key , + + // const char* _value + string _value + ); + } +} \ No newline at end of file diff --git a/Function/BNSettingsSetStringList.cs b/Function/BNSettingsSetStringList.cs new file mode 100644 index 0000000..8a669a1 --- /dev/null +++ b/Function/BNSettingsSetStringList.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNSettingsSetStringList(BNSettings* settings, BNBinaryView* view, BNFunction* func, BNSettingsScope scope, const char* key, const char** value, uint64_t size) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSettingsSetStringList" + )] + internal static extern bool BNSettingsSetStringList( + + // BNSettings* settings + IntPtr settings , + + // BNBinaryView* view + IntPtr view , + + // BNFunction* func + IntPtr func , + + // BNSettingsScope scope + SettingsScope scope , + + // const char* key + string key , + + // const char** _value + string[] _value , + + // uint64_t size + ulong size + ); + } +} \ No newline at end of file diff --git a/Function/BNSettingsSetUInt64.cs b/Function/BNSettingsSetUInt64.cs new file mode 100644 index 0000000..dc894e7 --- /dev/null +++ b/Function/BNSettingsSetUInt64.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNSettingsSetUInt64(BNSettings* settings, BNBinaryView* view, BNFunction* func, BNSettingsScope scope, const char* key, uint64_t value) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSettingsSetUInt64" + )] + internal static extern bool BNSettingsSetUInt64( + + // BNSettings* settings + IntPtr settings , + + // BNBinaryView* view + IntPtr view , + + // BNFunction* func + IntPtr func , + + // BNSettingsScope scope + SettingsScope scope , + + // const char* key + string key , + + // uint64_t _value + ulong _value + ); + } +} \ No newline at end of file diff --git a/Function/BNSettingsUpdateBoolProperty.cs b/Function/BNSettingsUpdateBoolProperty.cs new file mode 100644 index 0000000..fd4bd28 --- /dev/null +++ b/Function/BNSettingsUpdateBoolProperty.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNSettingsUpdateBoolProperty(BNSettings* settings, const char* key, const char* property, bool value) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSettingsUpdateBoolProperty" + )] + internal static extern bool BNSettingsUpdateBoolProperty( + + // BNSettings* settings + IntPtr settings , + + // const char* key + string key , + + // const char* property + string property , + + // bool _value + bool _value + + ); + } +} \ No newline at end of file diff --git a/Function/BNSettingsUpdateDoubleProperty.cs b/Function/BNSettingsUpdateDoubleProperty.cs new file mode 100644 index 0000000..fc55262 --- /dev/null +++ b/Function/BNSettingsUpdateDoubleProperty.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNSettingsUpdateDoubleProperty(BNSettings* settings, const char* key, const char* property, double value) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSettingsUpdateDoubleProperty" + )] + internal static extern bool BNSettingsUpdateDoubleProperty( + + // BNSettings* settings + IntPtr settings , + + // const char* key + string key , + + // const char* property + string property , + + // double _value + double _value + + ); + } +} \ No newline at end of file diff --git a/Function/BNSettingsUpdateInt64Property.cs b/Function/BNSettingsUpdateInt64Property.cs new file mode 100644 index 0000000..6e4df95 --- /dev/null +++ b/Function/BNSettingsUpdateInt64Property.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNSettingsUpdateInt64Property(BNSettings* settings, const char* key, const char* property, int64_t value) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSettingsUpdateInt64Property" + )] + internal static extern bool BNSettingsUpdateInt64Property( + + // BNSettings* settings + IntPtr settings , + + // const char* key + string key , + + // const char* property + string property , + + // int64_t _value + long _value + + ); + } +} \ No newline at end of file diff --git a/Function/BNSettingsUpdateProperty.cs b/Function/BNSettingsUpdateProperty.cs new file mode 100644 index 0000000..adc7f5d --- /dev/null +++ b/Function/BNSettingsUpdateProperty.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNSettingsUpdateProperty(BNSettings* settings, const char* key, const char* property) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSettingsUpdateProperty" + )] + internal static extern bool BNSettingsUpdateProperty( + + // BNSettings* settings + IntPtr settings , + + // const char* key + string key , + + // const char* property + string property + ); + } +} \ No newline at end of file diff --git a/Function/BNSettingsUpdateStringListProperty.cs b/Function/BNSettingsUpdateStringListProperty.cs new file mode 100644 index 0000000..1f9fae7 --- /dev/null +++ b/Function/BNSettingsUpdateStringListProperty.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNSettingsUpdateStringListProperty(BNSettings* settings, const char* key, const char* property, const char** value, uint64_t size) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSettingsUpdateStringListProperty" + )] + internal static extern bool BNSettingsUpdateStringListProperty( + + // BNSettings* settings + IntPtr settings , + + // const char* key + string key , + + // const char* property + string property , + + // const char** _value + string[] _value , + + // uint64_t size + ulong size + + ); + } +} \ No newline at end of file diff --git a/Function/BNSettingsUpdateStringProperty.cs b/Function/BNSettingsUpdateStringProperty.cs new file mode 100644 index 0000000..b3be488 --- /dev/null +++ b/Function/BNSettingsUpdateStringProperty.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNSettingsUpdateStringProperty(BNSettings* settings, const char* key, const char* property, const char* value) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSettingsUpdateStringProperty" + )] + internal static extern bool BNSettingsUpdateStringProperty( + + // BNSettings* settings + IntPtr settings , + + // const char* key + string key , + + // const char* property + string property , + + // const char* _value + string _value + + ); + } +} \ No newline at end of file diff --git a/Function/BNSettingsUpdateUInt64Property.cs b/Function/BNSettingsUpdateUInt64Property.cs new file mode 100644 index 0000000..3278ab7 --- /dev/null +++ b/Function/BNSettingsUpdateUInt64Property.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNSettingsUpdateUInt64Property(BNSettings* settings, const char* key, const char* property, uint64_t value) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSettingsUpdateUInt64Property" + )] + internal static extern bool BNSettingsUpdateUInt64Property( + + // BNSettings* settings + IntPtr settings , + + // const char* key + string key , + + // const char* property + string property , + + // uint64_t _value + ulong _value + + ); + } +} \ No newline at end of file diff --git a/Function/BNShouldSkipTargetAnalysis.cs b/Function/BNShouldSkipTargetAnalysis.cs new file mode 100644 index 0000000..2512db0 --- /dev/null +++ b/Function/BNShouldSkipTargetAnalysis.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNShouldSkipTargetAnalysis(BNBinaryView* view, BNArchitectureAndAddress* source, BNFunction* sourceFunc, uint64_t sourceEnd, BNArchitectureAndAddress* target) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNShouldSkipTargetAnalysis" + )] + internal static extern bool BNShouldSkipTargetAnalysis( + + // BNBinaryView* view + IntPtr view , + + // BNArchitectureAndAddress* source + in BNArchitectureAndAddress source , + + // BNFunction* sourceFunc + IntPtr sourceFunc , + + // uint64_t sourceEnd + ulong sourceEnd , + + // BNArchitectureAndAddress* target + in BNArchitectureAndAddress target + ); + } +} \ No newline at end of file diff --git a/Function/BNShowGraphReport.cs b/Function/BNShowGraphReport.cs new file mode 100644 index 0000000..faf8d8d --- /dev/null +++ b/Function/BNShowGraphReport.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNShowGraphReport(BNBinaryView* view, const char* title, BNFlowGraph* graph) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNShowGraphReport" + )] + internal static extern void BNShowGraphReport( + + // BNBinaryView* view + IntPtr view , + + // const char* title + string title , + + // BNFlowGraph* graph + IntPtr graph + ); + } +} \ No newline at end of file diff --git a/Function/BNShowHTMLReport.cs b/Function/BNShowHTMLReport.cs new file mode 100644 index 0000000..9392891 --- /dev/null +++ b/Function/BNShowHTMLReport.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNShowHTMLReport(BNBinaryView* view, const char* title, const char* contents, const char* plaintext) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNShowHTMLReport" + )] + internal static extern void BNShowHTMLReport( + + // BNBinaryView* view + IntPtr view , + + // const char* title + string title , + + // const char* contents + string contents , + + // const char* plaintext + string plaintext + ); + } +} \ No newline at end of file diff --git a/Function/BNShowMarkdownReport.cs b/Function/BNShowMarkdownReport.cs new file mode 100644 index 0000000..cb66333 --- /dev/null +++ b/Function/BNShowMarkdownReport.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNShowMarkdownReport(BNBinaryView* view, const char* title, const char* contents, const char* plaintext) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNShowMarkdownReport" + )] + internal static extern void BNShowMarkdownReport( + + // BNBinaryView* view + IntPtr view , + + // const char* title + string title , + + // const char* contents + string contents , + + // const char* plaintext + string plaintext + ); + } +} \ No newline at end of file diff --git a/Function/BNShowMessageBox.cs b/Function/BNShowMessageBox.cs new file mode 100644 index 0000000..0a568d9 --- /dev/null +++ b/Function/BNShowMessageBox.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public static partial class Core + { + public static MessageBoxButtonResult ShowMessageBox( + string title = "info", + string text = "ok", + MessageBoxButtonSet buttons = MessageBoxButtonSet.OKButtonSet , + MessageBoxIcon icon = MessageBoxIcon.InformationIcon + ) + { + return NativeMethods.BNShowMessageBox(title ,text , buttons ,icon); + } + } + + internal static partial class NativeMethods + { + /// + /// BNMessageBoxButtonResult BNShowMessageBox(const char* title, const char* text, BNMessageBoxButtonSet buttons, BNMessageBoxIcon icon) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNShowMessageBox" + )] + internal static extern MessageBoxButtonResult BNShowMessageBox( + + // const char* title + string title , + + // const char* text + string text , + + // BNMessageBoxButtonSet buttons + MessageBoxButtonSet buttons , + + // BNMessageBoxIcon icon + MessageBoxIcon icon + ); + } +} \ No newline at end of file diff --git a/Function/BNShowPlainTextReport.cs b/Function/BNShowPlainTextReport.cs new file mode 100644 index 0000000..4487b1f --- /dev/null +++ b/Function/BNShowPlainTextReport.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNShowPlainTextReport(BNBinaryView* view, const char* title, const char* contents) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNShowPlainTextReport" + )] + internal static extern void BNShowPlainTextReport( + + // BNBinaryView* view + IntPtr view , + + // const char* title + string title , + + // const char* contents + string contents + ); + } +} \ No newline at end of file diff --git a/Function/BNShowReportCollection.cs b/Function/BNShowReportCollection.cs new file mode 100644 index 0000000..ff9804e --- /dev/null +++ b/Function/BNShowReportCollection.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNShowReportCollection(const char* title, BNReportCollection* reports) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNShowReportCollection" + )] + internal static extern void BNShowReportCollection( + + // const char* title + string title , + + // BNReportCollection* reports + IntPtr reports + ); + } +} \ No newline at end of file diff --git a/Function/BNShowWorkflowReportForBinaryView.cs b/Function/BNShowWorkflowReportForBinaryView.cs new file mode 100644 index 0000000..191d335 --- /dev/null +++ b/Function/BNShowWorkflowReportForBinaryView.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNShowWorkflowReportForBinaryView(BNBinaryView* view, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNShowWorkflowReportForBinaryView" + )] + internal static extern void BNShowWorkflowReportForBinaryView( + + // BNBinaryView* view + IntPtr view , + + // const char* name + string name + + ); + } +} \ No newline at end of file diff --git a/Function/BNShowWorkflowReportForFunction.cs b/Function/BNShowWorkflowReportForFunction.cs new file mode 100644 index 0000000..0d4fae7 --- /dev/null +++ b/Function/BNShowWorkflowReportForFunction.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNShowWorkflowReportForFunction(BNFunction* func, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNShowWorkflowReportForFunction" + )] + internal static extern void BNShowWorkflowReportForFunction( + + // BNFunction* func + IntPtr func , + + // const char* name + string name + + ); + } +} \ No newline at end of file diff --git a/Function/BNShutdown.cs b/Function/BNShutdown.cs new file mode 100644 index 0000000..e523d4a --- /dev/null +++ b/Function/BNShutdown.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public static partial class Core + { + public static void Shutdown() + { + NativeMethods.BNShutdown(); + } + } + + internal static partial class NativeMethods + { + /// + /// void BNShutdown() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNShutdown" + )] + internal static extern void BNShutdown(); + } +} \ No newline at end of file diff --git a/Function/BNSignExtend.cs b/Function/BNSignExtend.cs new file mode 100644 index 0000000..c8d45f1 --- /dev/null +++ b/Function/BNSignExtend.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// int64_t BNSignExtend(int64_t value, uint64_t sourceSize, uint64_t destSize) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSignExtend" + )] + internal static extern long BNSignExtend( + + // int64_t _value + long _value , + + // uint64_t sourceSize + ulong sourceSize , + + // uint64_t destSize + ulong destSize + ); + } +} \ No newline at end of file diff --git a/Function/BNSkipAndReturnValue.cs b/Function/BNSkipAndReturnValue.cs new file mode 100644 index 0000000..f903eef --- /dev/null +++ b/Function/BNSkipAndReturnValue.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNSkipAndReturnValue(BNBinaryView* view, BNArchitecture* arch, uint64_t addr, uint64_t value) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNSkipAndReturnValue" + )] + internal static extern bool BNSkipAndReturnValue( + + // BNBinaryView* view + IntPtr view , + + // BNArchitecture* arch + IntPtr arch , + + // uint64_t addr + ulong addr , + + // uint64_t _value + ulong value + ); + } +} \ No newline at end of file diff --git a/Function/BNSnapshotHasAncestor.cs b/Function/BNSnapshotHasAncestor.cs new file mode 100644 index 0000000..f8afd28 --- /dev/null +++ b/Function/BNSnapshotHasAncestor.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNSnapshotHasAncestor(BNSnapshot* snapshot, BNSnapshot* other) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSnapshotHasAncestor" + )] + internal static extern bool BNSnapshotHasAncestor( + + // BNSnapshot* snapshot + IntPtr snapshot , + + // BNSnapshot* other + IntPtr other + + ); + } +} \ No newline at end of file diff --git a/Function/BNSnapshotHasContents.cs b/Function/BNSnapshotHasContents.cs new file mode 100644 index 0000000..251884b --- /dev/null +++ b/Function/BNSnapshotHasContents.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNSnapshotHasContents(BNSnapshot* snapshot) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSnapshotHasContents" + )] + internal static extern bool BNSnapshotHasContents( + + // BNSnapshot* snapshot + IntPtr snapshot + + ); + } +} \ No newline at end of file diff --git a/Function/BNSnapshotHasData.cs b/Function/BNSnapshotHasData.cs new file mode 100644 index 0000000..6a729fb --- /dev/null +++ b/Function/BNSnapshotHasData.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNSnapshotHasData(BNDatabase* db, int64_t id) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSnapshotHasData" + )] + internal static extern bool BNSnapshotHasData( + + // BNDatabase* db + IntPtr db , + + // int64_t id + long id + + ); + } +} \ No newline at end of file diff --git a/Function/BNSnapshotHasUndo.cs b/Function/BNSnapshotHasUndo.cs new file mode 100644 index 0000000..42494f3 --- /dev/null +++ b/Function/BNSnapshotHasUndo.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNSnapshotHasUndo(BNSnapshot* snapshot) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSnapshotHasUndo" + )] + internal static extern bool BNSnapshotHasUndo( + + // BNSnapshot* snapshot + IntPtr snapshot + + ); + } +} \ No newline at end of file diff --git a/Function/BNSnapshotStoreData.cs b/Function/BNSnapshotStoreData.cs new file mode 100644 index 0000000..68aed08 --- /dev/null +++ b/Function/BNSnapshotStoreData.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNSnapshotStoreData(BNSnapshot* snapshot, BNKeyValueStore* data, void* ctxt, void** progress) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSnapshotStoreData" + )] + internal static extern bool BNSnapshotStoreData( + + // BNSnapshot* snapshot + IntPtr snapshot , + + // BNKeyValueStore* data + IntPtr data , + + // void* ctxt + IntPtr ctxt , + + // void** progress + IntPtr progress + + ); + } +} \ No newline at end of file diff --git a/Function/BNSplitVariable.cs b/Function/BNSplitVariable.cs new file mode 100644 index 0000000..3f11aad --- /dev/null +++ b/Function/BNSplitVariable.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNSplitVariable(BNFunction* func, BNVariable* var) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNSplitVariable" + )] + internal static extern void BNSplitVariable( + + // BNFunction* func + IntPtr func , + + // BNVariable* _var + IntPtr _var + + ); + } +} \ No newline at end of file diff --git a/Function/BNStartFlowGraphLayout.cs b/Function/BNStartFlowGraphLayout.cs new file mode 100644 index 0000000..c36eced --- /dev/null +++ b/Function/BNStartFlowGraphLayout.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFlowGraphLayoutRequest* BNStartFlowGraphLayout(BNFlowGraph* graph, void* ctxt, void** func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNStartFlowGraphLayout" + )] + internal static extern IntPtr BNStartFlowGraphLayout( + + // BNFlowGraph* graph + IntPtr graph , + + // void* ctxt + IntPtr ctxt , + + // void** func + IntPtr func + + ); + } +} \ No newline at end of file diff --git a/Function/BNStopScriptingInstance.cs b/Function/BNStopScriptingInstance.cs new file mode 100644 index 0000000..642769d --- /dev/null +++ b/Function/BNStopScriptingInstance.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNStopScriptingInstance(BNScriptingInstance* instance) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNStopScriptingInstance" + )] + internal static extern void BNStopScriptingInstance( + + // BNScriptingInstance* instance + IntPtr instance + + ); + } +} \ No newline at end of file diff --git a/Function/BNStoreSecretsProviderData.cs b/Function/BNStoreSecretsProviderData.cs new file mode 100644 index 0000000..0fd8e93 --- /dev/null +++ b/Function/BNStoreSecretsProviderData.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNStoreSecretsProviderData(BNSecretsProvider* provider, const char* key, const char* data) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNStoreSecretsProviderData" + )] + internal static extern bool BNStoreSecretsProviderData( + + // BNSecretsProvider* provider + IntPtr provider , + + // const char* key + string key , + + // const char* data + string data + + ); + } +} \ No newline at end of file diff --git a/Function/BNStringifyUnicodeData.cs b/Function/BNStringifyUnicodeData.cs new file mode 100644 index 0000000..75528e8 --- /dev/null +++ b/Function/BNStringifyUnicodeData.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNStringifyUnicodeData(BNBinaryView* data, BNArchitecture* arch, BNDataBuffer* buffer, bool nullTerminates, bool allowShortStrings, const char** @string, BNStringType* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNStringifyUnicodeData" + )] + internal static extern bool BNStringifyUnicodeData( + + // BNBinaryView* data + IntPtr data , + + // BNArchitecture* arch + IntPtr arch , + + // BNDataBuffer* buffer + IntPtr buffer , + + // bool nullTerminates + bool nullTerminates , + + // bool allowShortStrings + bool allowShortStrings , + + // char** text + out IntPtr text , + + // BNStringType* type + out StringType type + ); + } +} \ No newline at end of file diff --git a/Function/BNStructureBuilderPropagatesDataVariableReferences.cs b/Function/BNStructureBuilderPropagatesDataVariableReferences.cs new file mode 100644 index 0000000..501bab3 --- /dev/null +++ b/Function/BNStructureBuilderPropagatesDataVariableReferences.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNStructureBuilderPropagatesDataVariableReferences(BNStructureBuilder* s) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNStructureBuilderPropagatesDataVariableReferences" + )] + internal static extern bool BNStructureBuilderPropagatesDataVariableReferences( + + // BNStructureBuilder* s + IntPtr s + ); + } +} \ No newline at end of file diff --git a/Function/BNStructurePropagatesDataVariableReferences.cs b/Function/BNStructurePropagatesDataVariableReferences.cs new file mode 100644 index 0000000..33cf89e --- /dev/null +++ b/Function/BNStructurePropagatesDataVariableReferences.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNStructurePropagatesDataVariableReferences(BNStructure* s) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNStructurePropagatesDataVariableReferences" + )] + internal static extern bool BNStructurePropagatesDataVariableReferences( + + // BNStructure* s + IntPtr s + ); + } +} \ No newline at end of file diff --git a/Function/BNStructureWithReplacedEnumeration.cs b/Function/BNStructureWithReplacedEnumeration.cs new file mode 100644 index 0000000..9414d5d --- /dev/null +++ b/Function/BNStructureWithReplacedEnumeration.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNStructure* BNStructureWithReplacedEnumeration(BNStructure* s, BNEnumeration* from, BNEnumeration* to) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNStructureWithReplacedEnumeration" + )] + internal static extern IntPtr BNStructureWithReplacedEnumeration( + + // BNStructure* s + IntPtr s , + + // BNEnumeration* _from + IntPtr _from , + + // BNEnumeration* to + IntPtr to + + ); + } +} \ No newline at end of file diff --git a/Function/BNStructureWithReplacedNamedTypeReference.cs b/Function/BNStructureWithReplacedNamedTypeReference.cs new file mode 100644 index 0000000..0ab6ad5 --- /dev/null +++ b/Function/BNStructureWithReplacedNamedTypeReference.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNStructure* BNStructureWithReplacedNamedTypeReference(BNStructure* s, BNNamedTypeReference* from, BNNamedTypeReference* to) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNStructureWithReplacedNamedTypeReference" + )] + internal static extern IntPtr BNStructureWithReplacedNamedTypeReference( + + // BNStructure* s + IntPtr s , + + // BNNamedTypeReference* _from + IntPtr _from , + + // BNNamedTypeReference* to + IntPtr to + + ); + } +} \ No newline at end of file diff --git a/Function/BNStructureWithReplacedStructure.cs b/Function/BNStructureWithReplacedStructure.cs new file mode 100644 index 0000000..74bbc4d --- /dev/null +++ b/Function/BNStructureWithReplacedStructure.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNStructure* BNStructureWithReplacedStructure(BNStructure* s, BNStructure* from, BNStructure* to) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNStructureWithReplacedStructure" + )] + internal static extern IntPtr BNStructureWithReplacedStructure( + + // BNStructure* s + IntPtr s , + + // BNStructure* _from + IntPtr _from , + + // BNStructure* to + IntPtr to + + ); + } +} \ No newline at end of file diff --git a/Function/BNTagGetData.cs b/Function/BNTagGetData.cs new file mode 100644 index 0000000..3d4f8a4 --- /dev/null +++ b/Function/BNTagGetData.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// char* BNTagGetData(BNTag* tag) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNTagGetData" + )] + internal static extern IntPtr BNTagGetData( + + // BNTag* tag + IntPtr tag + ); + } +} \ No newline at end of file diff --git a/Function/BNTagGetId.cs b/Function/BNTagGetId.cs new file mode 100644 index 0000000..be56fc7 --- /dev/null +++ b/Function/BNTagGetId.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// char* BNTagGetId(BNTag* tag) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNTagGetId" + )] + internal static extern IntPtr BNTagGetId( + + // BNTag* tag + IntPtr tag + ); + } +} \ No newline at end of file diff --git a/Function/BNTagGetType.cs b/Function/BNTagGetType.cs new file mode 100644 index 0000000..09cd2fa --- /dev/null +++ b/Function/BNTagGetType.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTagType* BNTagGetType(BNTag* tag) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNTagGetType" + )] + internal static extern IntPtr BNTagGetType( + + // BNTag* tag + IntPtr tag + ); + } +} \ No newline at end of file diff --git a/Function/BNTagSetData.cs b/Function/BNTagSetData.cs new file mode 100644 index 0000000..7acbf60 --- /dev/null +++ b/Function/BNTagSetData.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNTagSetData(BNTag* tag, const char* data) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTagSetData" + )] + internal static extern void BNTagSetData( + + // BNTag* tag + IntPtr tag , + + // const char* data + string data + ); + } +} \ No newline at end of file diff --git a/Function/BNTagTypeGetIcon.cs b/Function/BNTagTypeGetIcon.cs new file mode 100644 index 0000000..7f0530a --- /dev/null +++ b/Function/BNTagTypeGetIcon.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// char* BNTagTypeGetIcon(BNTagType* tagType) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNTagTypeGetIcon" + )] + internal static extern IntPtr BNTagTypeGetIcon( + + // BNTagType* tagType + IntPtr tagType + ); + } +} \ No newline at end of file diff --git a/Function/BNTagTypeGetId.cs b/Function/BNTagTypeGetId.cs new file mode 100644 index 0000000..65020ee --- /dev/null +++ b/Function/BNTagTypeGetId.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// char* BNTagTypeGetId(BNTagType* tagType) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNTagTypeGetId" + )] + internal static extern IntPtr BNTagTypeGetId( + + // BNTagType* tagType + IntPtr tagType + ); + } +} \ No newline at end of file diff --git a/Function/BNTagTypeGetName.cs b/Function/BNTagTypeGetName.cs new file mode 100644 index 0000000..6dedb54 --- /dev/null +++ b/Function/BNTagTypeGetName.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// char* BNTagTypeGetName(BNTagType* tagType) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNTagTypeGetName" + )] + internal static extern IntPtr BNTagTypeGetName( + + // BNTagType* tagType + IntPtr tagType + ); + } +} \ No newline at end of file diff --git a/Function/BNTagTypeGetType.cs b/Function/BNTagTypeGetType.cs new file mode 100644 index 0000000..9ea0973 --- /dev/null +++ b/Function/BNTagTypeGetType.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTagTypeType BNTagTypeGetType(BNTagType* tagType) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNTagTypeGetType" + )] + internal static extern TagTypeType BNTagTypeGetType( + + // BNTagType* tagType + IntPtr tagType + ); + } +} \ No newline at end of file diff --git a/Function/BNTagTypeGetView.cs b/Function/BNTagTypeGetView.cs new file mode 100644 index 0000000..e858627 --- /dev/null +++ b/Function/BNTagTypeGetView.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBinaryView* BNTagTypeGetView(BNTagType* tagType) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTagTypeGetView" + )] + internal static extern IntPtr BNTagTypeGetView( + + // BNTagType* tagType + IntPtr tagType + + ); + } +} \ No newline at end of file diff --git a/Function/BNTagTypeGetVisible.cs b/Function/BNTagTypeGetVisible.cs new file mode 100644 index 0000000..adc9d44 --- /dev/null +++ b/Function/BNTagTypeGetVisible.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNTagTypeGetVisible(BNTagType* tagType) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTagTypeGetVisible" + )] + internal static extern bool BNTagTypeGetVisible( + + // BNTagType* tagType + IntPtr tagType + + ); + } +} \ No newline at end of file diff --git a/Function/BNTagTypeSetIcon.cs b/Function/BNTagTypeSetIcon.cs new file mode 100644 index 0000000..7130e77 --- /dev/null +++ b/Function/BNTagTypeSetIcon.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNTagTypeSetIcon(BNTagType* tagType, const char* icon) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTagTypeSetIcon" + )] + internal static extern void BNTagTypeSetIcon( + + // BNTagType* tagType + IntPtr tagType , + + // const char* icon + string icon + ); + } +} \ No newline at end of file diff --git a/Function/BNTagTypeSetName.cs b/Function/BNTagTypeSetName.cs new file mode 100644 index 0000000..0bcff8c --- /dev/null +++ b/Function/BNTagTypeSetName.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNTagTypeSetName(BNTagType* tagType, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTagTypeSetName" + )] + internal static extern void BNTagTypeSetName( + + // BNTagType* tagType + IntPtr tagType , + + // const char* name + string name + ); + } +} \ No newline at end of file diff --git a/Function/BNTagTypeSetType.cs b/Function/BNTagTypeSetType.cs new file mode 100644 index 0000000..8d3f013 --- /dev/null +++ b/Function/BNTagTypeSetType.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNTagTypeSetType(BNTagType* tagType, BNTagTypeType type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNTagTypeSetType" + )] + internal static extern void BNTagTypeSetType( + + // BNTagType* tagType + IntPtr tagType , + + // BNTagTypeType type + TagTypeType type + ); + } +} \ No newline at end of file diff --git a/Function/BNTagTypeSetVisible.cs b/Function/BNTagTypeSetVisible.cs new file mode 100644 index 0000000..1864495 --- /dev/null +++ b/Function/BNTagTypeSetVisible.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNTagTypeSetVisible(BNTagType* tagType, bool visible) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNTagTypeSetVisible" + )] + internal static extern void BNTagTypeSetVisible( + + // BNTagType* tagType + IntPtr tagType , + + // bool visible + bool visible + ); + } +} \ No newline at end of file diff --git a/Function/BNToVariableIdentifier.cs b/Function/BNToVariableIdentifier.cs new file mode 100644 index 0000000..852cf67 --- /dev/null +++ b/Function/BNToVariableIdentifier.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNToVariableIdentifier(BNVariable* variable) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNToVariableIdentifier" + )] + internal static extern ulong BNToVariableIdentifier( + + // BNVariable* variable + in BNVariable variable + ); + } +} \ No newline at end of file diff --git a/Function/BNTransformContextClearTransformParameter.cs b/Function/BNTransformContextClearTransformParameter.cs new file mode 100644 index 0000000..a16bea3 --- /dev/null +++ b/Function/BNTransformContextClearTransformParameter.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNTransformContextClearTransformParameter(BNTransformContext* context, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTransformContextClearTransformParameter" + )] + internal static extern void BNTransformContextClearTransformParameter( + + // BNTransformContext* context + IntPtr context , + + // const char* name + string name + ); + } +} \ No newline at end of file diff --git a/Function/BNTransformContextGetAvailableFiles.cs b/Function/BNTransformContextGetAvailableFiles.cs new file mode 100644 index 0000000..ad65318 --- /dev/null +++ b/Function/BNTransformContextGetAvailableFiles.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char** BNTransformContextGetAvailableFiles(BNTransformContext* context, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNTransformContextGetAvailableFiles" + )] + internal static extern IntPtr BNTransformContextGetAvailableFiles( + + // BNTransformContext* context + IntPtr context , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNTransformContextGetChild.cs b/Function/BNTransformContextGetChild.cs new file mode 100644 index 0000000..e286aa3 --- /dev/null +++ b/Function/BNTransformContextGetChild.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTransformContext* BNTransformContextGetChild(BNTransformContext* context, const char* filename) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTransformContextGetChild" + )] + internal static extern IntPtr BNTransformContextGetChild( + + // BNTransformContext* context + IntPtr context , + + // const char* filename + string filename + + ); + } +} \ No newline at end of file diff --git a/Function/BNTransformContextGetChildCount.cs b/Function/BNTransformContextGetChildCount.cs new file mode 100644 index 0000000..a8ed93f --- /dev/null +++ b/Function/BNTransformContextGetChildCount.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNTransformContextGetChildCount(BNTransformContext* context) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNTransformContextGetChildCount" + )] + internal static extern ulong BNTransformContextGetChildCount( + + // BNTransformContext* context + IntPtr context + ); + } +} \ No newline at end of file diff --git a/Function/BNTransformContextGetChildren.cs b/Function/BNTransformContextGetChildren.cs new file mode 100644 index 0000000..29650ad --- /dev/null +++ b/Function/BNTransformContextGetChildren.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTransformContext** BNTransformContextGetChildren(BNTransformContext* context, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNTransformContextGetChildren" + )] + internal static extern IntPtr BNTransformContextGetChildren( + + // BNTransformContext* context + IntPtr context , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNTransformContextGetExtractionMessage.cs b/Function/BNTransformContextGetExtractionMessage.cs new file mode 100644 index 0000000..fb1126b --- /dev/null +++ b/Function/BNTransformContextGetExtractionMessage.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNTransformContextGetExtractionMessage(BNTransformContext* context) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTransformContextGetExtractionMessage" + )] + internal static extern IntPtr BNTransformContextGetExtractionMessage( + + // BNTransformContext* context + IntPtr context + + ); + } +} \ No newline at end of file diff --git a/Function/BNTransformContextGetExtractionResult.cs b/Function/BNTransformContextGetExtractionResult.cs new file mode 100644 index 0000000..4c89633 --- /dev/null +++ b/Function/BNTransformContextGetExtractionResult.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTransformResult BNTransformContextGetExtractionResult(BNTransformContext* context) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNTransformContextGetExtractionResult" + )] + internal static extern TransformResult BNTransformContextGetExtractionResult( + + // BNTransformContext* context + IntPtr context + ); + } +} \ No newline at end of file diff --git a/Function/BNTransformContextGetFileName.cs b/Function/BNTransformContextGetFileName.cs new file mode 100644 index 0000000..912be72 --- /dev/null +++ b/Function/BNTransformContextGetFileName.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// char* BNTransformContextGetFileName(BNTransformContext* context) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNTransformContextGetFileName" + )] + internal static extern IntPtr BNTransformContextGetFileName( + + // BNTransformContext* context + IntPtr context + ); + } +} \ No newline at end of file diff --git a/Function/BNTransformContextGetInput.cs b/Function/BNTransformContextGetInput.cs new file mode 100644 index 0000000..480202e --- /dev/null +++ b/Function/BNTransformContextGetInput.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBinaryView* BNTransformContextGetInput(BNTransformContext* context) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNTransformContextGetInput" + )] + internal static extern IntPtr BNTransformContextGetInput( + + // BNTransformContext* context + IntPtr context + ); + } +} \ No newline at end of file diff --git a/Function/BNTransformContextGetMetadata.cs b/Function/BNTransformContextGetMetadata.cs new file mode 100644 index 0000000..f84417f --- /dev/null +++ b/Function/BNTransformContextGetMetadata.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNMetadata* BNTransformContextGetMetadata(BNTransformContext* context) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNTransformContextGetMetadata" + )] + internal static extern IntPtr BNTransformContextGetMetadata( + + // BNTransformContext* context + IntPtr context + ); + } +} \ No newline at end of file diff --git a/Function/BNTransformContextGetParent.cs b/Function/BNTransformContextGetParent.cs new file mode 100644 index 0000000..424a907 --- /dev/null +++ b/Function/BNTransformContextGetParent.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTransformContext* BNTransformContextGetParent(BNTransformContext* context) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNTransformContextGetParent" + )] + internal static extern IntPtr BNTransformContextGetParent( + + // BNTransformContext* context + IntPtr context + ); + } +} \ No newline at end of file diff --git a/Function/BNTransformContextGetRequestedFiles.cs b/Function/BNTransformContextGetRequestedFiles.cs new file mode 100644 index 0000000..65b5bac --- /dev/null +++ b/Function/BNTransformContextGetRequestedFiles.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char** BNTransformContextGetRequestedFiles(BNTransformContext* context, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTransformContextGetRequestedFiles" + )] + internal static extern IntPtr BNTransformContextGetRequestedFiles( + + // BNTransformContext* context + IntPtr context , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNTransformContextGetTransformName.cs b/Function/BNTransformContextGetTransformName.cs new file mode 100644 index 0000000..b5f48a6 --- /dev/null +++ b/Function/BNTransformContextGetTransformName.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// char* BNTransformContextGetTransformName(BNTransformContext* context) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNTransformContextGetTransformName" + )] + internal static extern IntPtr BNTransformContextGetTransformName( + + // BNTransformContext* context + IntPtr context + ); + } +} \ No newline at end of file diff --git a/Function/BNTransformContextGetTransformResult.cs b/Function/BNTransformContextGetTransformResult.cs new file mode 100644 index 0000000..1243ce7 --- /dev/null +++ b/Function/BNTransformContextGetTransformResult.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTransformResult BNTransformContextGetTransformResult(BNTransformContext* context) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNTransformContextGetTransformResult" + )] + internal static extern TransformResult BNTransformContextGetTransformResult( + + // BNTransformContext* context + IntPtr context + ); + } +} \ No newline at end of file diff --git a/Function/BNTransformContextHasAvailableFiles.cs b/Function/BNTransformContextHasAvailableFiles.cs new file mode 100644 index 0000000..ecea9d1 --- /dev/null +++ b/Function/BNTransformContextHasAvailableFiles.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNTransformContextHasAvailableFiles(BNTransformContext* context) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNTransformContextHasAvailableFiles" + )] + internal static extern bool BNTransformContextHasAvailableFiles( + + // BNTransformContext* context + IntPtr context + ); + } +} \ No newline at end of file diff --git a/Function/BNTransformContextHasRequestedFiles.cs b/Function/BNTransformContextHasRequestedFiles.cs new file mode 100644 index 0000000..48de4ea --- /dev/null +++ b/Function/BNTransformContextHasRequestedFiles.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNTransformContextHasRequestedFiles(BNTransformContext* context) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTransformContextHasRequestedFiles" + )] + internal static extern bool BNTransformContextHasRequestedFiles( + + // BNTransformContext* context + IntPtr context + + ); + } +} \ No newline at end of file diff --git a/Function/BNTransformContextHasTransformParameter.cs b/Function/BNTransformContextHasTransformParameter.cs new file mode 100644 index 0000000..e3ff167 --- /dev/null +++ b/Function/BNTransformContextHasTransformParameter.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNTransformContextHasTransformParameter(BNTransformContext* context, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTransformContextHasTransformParameter" + )] + internal static extern bool BNTransformContextHasTransformParameter( + + // BNTransformContext* context + IntPtr context , + + // const char* name + string name + ); + } +} \ No newline at end of file diff --git a/Function/BNTransformContextIsDatabase.cs b/Function/BNTransformContextIsDatabase.cs new file mode 100644 index 0000000..dc44d23 --- /dev/null +++ b/Function/BNTransformContextIsDatabase.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNTransformContextIsDatabase(BNTransformContext* context) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTransformContextIsDatabase" + )] + internal static extern bool BNTransformContextIsDatabase( + + // BNTransformContext* context + IntPtr context + + ); + } +} \ No newline at end of file diff --git a/Function/BNTransformContextIsLeaf.cs b/Function/BNTransformContextIsLeaf.cs new file mode 100644 index 0000000..d3a9c35 --- /dev/null +++ b/Function/BNTransformContextIsLeaf.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNTransformContextIsLeaf(BNTransformContext* context) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNTransformContextIsLeaf" + )] + internal static extern bool BNTransformContextIsLeaf( + + // BNTransformContext* context + IntPtr context + ); + } +} \ No newline at end of file diff --git a/Function/BNTransformContextIsRoot.cs b/Function/BNTransformContextIsRoot.cs new file mode 100644 index 0000000..3c2fdc6 --- /dev/null +++ b/Function/BNTransformContextIsRoot.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNTransformContextIsRoot(BNTransformContext* context) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTransformContextIsRoot" + )] + internal static extern bool BNTransformContextIsRoot( + + // BNTransformContext* context + IntPtr context + + ); + } +} \ No newline at end of file diff --git a/Function/BNTransformContextSetAvailableFiles.cs b/Function/BNTransformContextSetAvailableFiles.cs new file mode 100644 index 0000000..6444b6a --- /dev/null +++ b/Function/BNTransformContextSetAvailableFiles.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNTransformContextSetAvailableFiles(BNTransformContext* context, const char** files, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTransformContextSetAvailableFiles" + )] + internal static extern void BNTransformContextSetAvailableFiles( + + // BNTransformContext* context + IntPtr context , + + // const char** files + string[] files , + + // uint64_t count + ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNTransformContextSetChild.cs b/Function/BNTransformContextSetChild.cs new file mode 100644 index 0000000..696b87d --- /dev/null +++ b/Function/BNTransformContextSetChild.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTransformContext* BNTransformContextSetChild(BNTransformContext* context, BNDataBuffer* data, const char* filename, BNTransformResult result, const char* message) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTransformContextSetChild" + )] + internal static extern IntPtr BNTransformContextSetChild( + + // BNTransformContext* context + IntPtr context , + + // BNDataBuffer* data + IntPtr data , + + // const char* filename + string filename , + + // BNTransformResult result + TransformResult result , + + // const char* message + string message + + ); + } +} \ No newline at end of file diff --git a/Function/BNTransformContextSetRequestedFiles.cs b/Function/BNTransformContextSetRequestedFiles.cs new file mode 100644 index 0000000..f94e1c6 --- /dev/null +++ b/Function/BNTransformContextSetRequestedFiles.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNTransformContextSetRequestedFiles(BNTransformContext* context, const char** files, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTransformContextSetRequestedFiles" + )] + internal static extern void BNTransformContextSetRequestedFiles( + + // BNTransformContext* context + IntPtr context , + + // const char** files + string[] files , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNTransformContextSetTransformParameter.cs b/Function/BNTransformContextSetTransformParameter.cs new file mode 100644 index 0000000..fa642bd --- /dev/null +++ b/Function/BNTransformContextSetTransformParameter.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNTransformContextSetTransformParameter(BNTransformContext* context, const char* name, BNDataBuffer* data) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTransformContextSetTransformParameter" + )] + internal static extern void BNTransformContextSetTransformParameter( + + // BNTransformContext* context + IntPtr context , + + // const char* name + string name , + + // BNDataBuffer* data + IntPtr data + ); + } +} \ No newline at end of file diff --git a/Function/BNTransformContextSetTransformParameters.cs b/Function/BNTransformContextSetTransformParameters.cs new file mode 100644 index 0000000..39297fc --- /dev/null +++ b/Function/BNTransformContextSetTransformParameters.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNTransformContextSetTransformParameters(BNTransformContext* context, BNTransformParameter* @params, uint64_t paramCount) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNTransformContextSetTransformParameters" + )] + internal static extern void BNTransformContextSetTransformParameters( + + // BNTransformContext* context + IntPtr context , + + // BNTransformParameter* _params + BNTransformParameter[] _params , + + // uint64_t paramCount + ulong paramCount + ); + } +} \ No newline at end of file diff --git a/Function/BNTransformSessionGetAvailableFileChoices.cs b/Function/BNTransformSessionGetAvailableFileChoices.cs new file mode 100644 index 0000000..741af8b --- /dev/null +++ b/Function/BNTransformSessionGetAvailableFileChoices.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char** BNTransformSessionGetAvailableFileChoices(BNTransformSession* session, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTransformSessionGetAvailableFileChoices" + )] + internal static extern IntPtr BNTransformSessionGetAvailableFileChoices( + + // BNTransformSession* session + IntPtr session , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNTransformSessionGetCurrentContext.cs b/Function/BNTransformSessionGetCurrentContext.cs new file mode 100644 index 0000000..fe916b7 --- /dev/null +++ b/Function/BNTransformSessionGetCurrentContext.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTransformContext* BNTransformSessionGetCurrentContext(BNTransformSession* session) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTransformSessionGetCurrentContext" + )] + internal static extern IntPtr BNTransformSessionGetCurrentContext( + + // BNTransformSession* session + IntPtr session + + ); + } +} \ No newline at end of file diff --git a/Function/BNTransformSessionGetCurrentView.cs b/Function/BNTransformSessionGetCurrentView.cs new file mode 100644 index 0000000..4b0a309 --- /dev/null +++ b/Function/BNTransformSessionGetCurrentView.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBinaryView* BNTransformSessionGetCurrentView(BNTransformSession* session) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTransformSessionGetCurrentView" + )] + internal static extern IntPtr BNTransformSessionGetCurrentView( + + // BNTransformSession* session + IntPtr session + + ); + } +} \ No newline at end of file diff --git a/Function/BNTransformSessionGetRootContext.cs b/Function/BNTransformSessionGetRootContext.cs new file mode 100644 index 0000000..e573f8c --- /dev/null +++ b/Function/BNTransformSessionGetRootContext.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTransformContext* BNTransformSessionGetRootContext(BNTransformSession* session) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTransformSessionGetRootContext" + )] + internal static extern IntPtr BNTransformSessionGetRootContext( + + // BNTransformSession* session + IntPtr session + + ); + } +} \ No newline at end of file diff --git a/Function/BNTransformSessionGetSelectedContexts.cs b/Function/BNTransformSessionGetSelectedContexts.cs new file mode 100644 index 0000000..dcb6508 --- /dev/null +++ b/Function/BNTransformSessionGetSelectedContexts.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTransformContext** BNTransformSessionGetSelectedContexts(BNTransformSession* session, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTransformSessionGetSelectedContexts" + )] + internal static extern IntPtr BNTransformSessionGetSelectedContexts( + + // BNTransformSession* session + IntPtr session , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNTransformSessionHasAnyStages.cs b/Function/BNTransformSessionHasAnyStages.cs new file mode 100644 index 0000000..2396d89 --- /dev/null +++ b/Function/BNTransformSessionHasAnyStages.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNTransformSessionHasAnyStages(BNTransformSession* session) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTransformSessionHasAnyStages" + )] + internal static extern bool BNTransformSessionHasAnyStages( + + // BNTransformSession* session + IntPtr session + + ); + } +} \ No newline at end of file diff --git a/Function/BNTransformSessionHasMultipleFileChoices.cs b/Function/BNTransformSessionHasMultipleFileChoices.cs new file mode 100644 index 0000000..c15f4de --- /dev/null +++ b/Function/BNTransformSessionHasMultipleFileChoices.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNTransformSessionHasMultipleFileChoices(BNTransformSession* session) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTransformSessionHasMultipleFileChoices" + )] + internal static extern bool BNTransformSessionHasMultipleFileChoices( + + // BNTransformSession* session + IntPtr session + + ); + } +} \ No newline at end of file diff --git a/Function/BNTransformSessionHasSinglePath.cs b/Function/BNTransformSessionHasSinglePath.cs new file mode 100644 index 0000000..9a8675c --- /dev/null +++ b/Function/BNTransformSessionHasSinglePath.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNTransformSessionHasSinglePath(BNTransformSession* session) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTransformSessionHasSinglePath" + )] + internal static extern bool BNTransformSessionHasSinglePath( + + // BNTransformSession* session + IntPtr session + + ); + } +} \ No newline at end of file diff --git a/Function/BNTransformSessionProcess.cs b/Function/BNTransformSessionProcess.cs new file mode 100644 index 0000000..0ca6901 --- /dev/null +++ b/Function/BNTransformSessionProcess.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNTransformSessionProcess(BNTransformSession* session) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTransformSessionProcess" + )] + internal static extern bool BNTransformSessionProcess( + + // BNTransformSession* session + IntPtr session + + ); + } +} \ No newline at end of file diff --git a/Function/BNTransformSessionProcessFrom.cs b/Function/BNTransformSessionProcessFrom.cs new file mode 100644 index 0000000..ac67d37 --- /dev/null +++ b/Function/BNTransformSessionProcessFrom.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNTransformSessionProcessFrom(BNTransformSession* session, BNTransformContext* context) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTransformSessionProcessFrom" + )] + internal static extern bool BNTransformSessionProcessFrom( + + // BNTransformSession* session + IntPtr session , + + // BNTransformContext* context + IntPtr context + + ); + } +} \ No newline at end of file diff --git a/Function/BNTransformSessionProcessWithUserInput.cs b/Function/BNTransformSessionProcessWithUserInput.cs new file mode 100644 index 0000000..3069108 --- /dev/null +++ b/Function/BNTransformSessionProcessWithUserInput.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNTransformSessionProcessWithUserInput(BNTransformSession* session) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTransformSessionProcessWithUserInput" + )] + internal static extern bool BNTransformSessionProcessWithUserInput( + + // BNTransformSession* session + IntPtr session + + ); + } +} \ No newline at end of file diff --git a/Function/BNTransformSessionRequiresUserInput.cs b/Function/BNTransformSessionRequiresUserInput.cs new file mode 100644 index 0000000..a22870e --- /dev/null +++ b/Function/BNTransformSessionRequiresUserInput.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNTransformSessionRequiresUserInput(BNTransformSession* session) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTransformSessionRequiresUserInput" + )] + internal static extern bool BNTransformSessionRequiresUserInput( + + // BNTransformSession* session + IntPtr session + + ); + } +} \ No newline at end of file diff --git a/Function/BNTransformSessionSelectFiles.cs b/Function/BNTransformSessionSelectFiles.cs new file mode 100644 index 0000000..9a010ed --- /dev/null +++ b/Function/BNTransformSessionSelectFiles.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNTransformSessionSelectFiles(BNTransformSession* session, const char** files, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTransformSessionSelectFiles" + )] + internal static extern bool BNTransformSessionSelectFiles( + + // BNTransformSession* session + IntPtr session , + + // const char** files + string[] files , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNTransformSessionSetSelectedContexts.cs b/Function/BNTransformSessionSetSelectedContexts.cs new file mode 100644 index 0000000..8eb104f --- /dev/null +++ b/Function/BNTransformSessionSetSelectedContexts.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNTransformSessionSetSelectedContexts(BNTransformSession* session, BNTransformContext** contexts, uint64_t count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTransformSessionSetSelectedContexts" + )] + internal static extern void BNTransformSessionSetSelectedContexts( + + // BNTransformSession* session + IntPtr session , + + // BNTransformContext** contexts + IntPtr contexts , + + // uint64_t count + ulong count + + ); + } +} \ No newline at end of file diff --git a/Function/BNTransformSupportsContext.cs b/Function/BNTransformSupportsContext.cs new file mode 100644 index 0000000..29cce8e --- /dev/null +++ b/Function/BNTransformSupportsContext.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNTransformSupportsContext(BNTransform* xform) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNTransformSupportsContext" + )] + internal static extern bool BNTransformSupportsContext( + + // BNTransform* xform + IntPtr xform + ); + } +} \ No newline at end of file diff --git a/Function/BNTransformSupportsDetection.cs b/Function/BNTransformSupportsDetection.cs new file mode 100644 index 0000000..bdf521b --- /dev/null +++ b/Function/BNTransformSupportsDetection.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNTransformSupportsDetection(BNTransform* xform) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNTransformSupportsDetection" + )] + internal static extern bool BNTransformSupportsDetection( + + // BNTransform* xform + IntPtr xform + ); + } +} \ No newline at end of file diff --git a/Function/BNTrimDatabaseSnapshot.cs b/Function/BNTrimDatabaseSnapshot.cs new file mode 100644 index 0000000..89d7244 --- /dev/null +++ b/Function/BNTrimDatabaseSnapshot.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNTrimDatabaseSnapshot(BNDatabase* database, int64_t id) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTrimDatabaseSnapshot" + )] + internal static extern bool BNTrimDatabaseSnapshot( + + // BNDatabase* database + IntPtr database , + + // int64_t id + long id + + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeArchiveDeserializeSnapshot.cs b/Function/BNTypeArchiveDeserializeSnapshot.cs new file mode 100644 index 0000000..72508b1 --- /dev/null +++ b/Function/BNTypeArchiveDeserializeSnapshot.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNTypeArchiveDeserializeSnapshot(BNTypeArchive* archive, BNDataBuffer* buffer) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTypeArchiveDeserializeSnapshot" + )] + internal static extern IntPtr BNTypeArchiveDeserializeSnapshot( + + // BNTypeArchive* archive + IntPtr archive , + + // BNDataBuffer* buffer + IntPtr buffer + + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeArchiveMergeConflictGetBaseSnapshotId.cs b/Function/BNTypeArchiveMergeConflictGetBaseSnapshotId.cs new file mode 100644 index 0000000..0a7164e --- /dev/null +++ b/Function/BNTypeArchiveMergeConflictGetBaseSnapshotId.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNTypeArchiveMergeConflictGetBaseSnapshotId(BNTypeArchiveMergeConflict* conflict) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTypeArchiveMergeConflictGetBaseSnapshotId" + )] + internal static extern IntPtr BNTypeArchiveMergeConflictGetBaseSnapshotId( + + // BNTypeArchiveMergeConflict* conflict + IntPtr conflict + + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeArchiveMergeConflictGetFirstSnapshotId.cs b/Function/BNTypeArchiveMergeConflictGetFirstSnapshotId.cs new file mode 100644 index 0000000..54fc5bb --- /dev/null +++ b/Function/BNTypeArchiveMergeConflictGetFirstSnapshotId.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNTypeArchiveMergeConflictGetFirstSnapshotId(BNTypeArchiveMergeConflict* conflict) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTypeArchiveMergeConflictGetFirstSnapshotId" + )] + internal static extern IntPtr BNTypeArchiveMergeConflictGetFirstSnapshotId( + + // BNTypeArchiveMergeConflict* conflict + IntPtr conflict + + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeArchiveMergeConflictGetSecondSnapshotId.cs b/Function/BNTypeArchiveMergeConflictGetSecondSnapshotId.cs new file mode 100644 index 0000000..2b7a2d7 --- /dev/null +++ b/Function/BNTypeArchiveMergeConflictGetSecondSnapshotId.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNTypeArchiveMergeConflictGetSecondSnapshotId(BNTypeArchiveMergeConflict* conflict) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTypeArchiveMergeConflictGetSecondSnapshotId" + )] + internal static extern IntPtr BNTypeArchiveMergeConflictGetSecondSnapshotId( + + // BNTypeArchiveMergeConflict* conflict + IntPtr conflict + + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeArchiveMergeConflictGetTypeArchive.cs b/Function/BNTypeArchiveMergeConflictGetTypeArchive.cs new file mode 100644 index 0000000..df1a7f1 --- /dev/null +++ b/Function/BNTypeArchiveMergeConflictGetTypeArchive.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeArchive* BNTypeArchiveMergeConflictGetTypeArchive(BNTypeArchiveMergeConflict* conflict) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTypeArchiveMergeConflictGetTypeArchive" + )] + internal static extern IntPtr BNTypeArchiveMergeConflictGetTypeArchive( + + // BNTypeArchiveMergeConflict* conflict + IntPtr conflict + + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeArchiveMergeConflictGetTypeId.cs b/Function/BNTypeArchiveMergeConflictGetTypeId.cs new file mode 100644 index 0000000..f135588 --- /dev/null +++ b/Function/BNTypeArchiveMergeConflictGetTypeId.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNTypeArchiveMergeConflictGetTypeId(BNTypeArchiveMergeConflict* conflict) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTypeArchiveMergeConflictGetTypeId" + )] + internal static extern IntPtr BNTypeArchiveMergeConflictGetTypeId( + + // BNTypeArchiveMergeConflict* conflict + IntPtr conflict + + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeArchiveMergeConflictSuccess.cs b/Function/BNTypeArchiveMergeConflictSuccess.cs new file mode 100644 index 0000000..ebd0a23 --- /dev/null +++ b/Function/BNTypeArchiveMergeConflictSuccess.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNTypeArchiveMergeConflictSuccess(BNTypeArchiveMergeConflict* conflict, const char* value) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTypeArchiveMergeConflictSuccess" + )] + internal static extern bool BNTypeArchiveMergeConflictSuccess( + + // BNTypeArchiveMergeConflict* conflict + IntPtr conflict , + + // const char* _value + string _value + + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeArchiveMergeSnapshots.cs b/Function/BNTypeArchiveMergeSnapshots.cs new file mode 100644 index 0000000..ce86f21 --- /dev/null +++ b/Function/BNTypeArchiveMergeSnapshots.cs @@ -0,0 +1,59 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNTypeArchiveMergeSnapshots(BNTypeArchive* archive, const char* baseSnapshot, const char* firstSnapshot, const char* secondSnapshot, const char** mergeConflictKeysIn, const char** mergeConflictValuesIn, uint64_t mergeConflictCountIn, const char*** mergeConflictsOut, uint64_t* mergeConflictCountOut, const char** result, void** progress, void* context) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTypeArchiveMergeSnapshots" + )] + internal static extern bool BNTypeArchiveMergeSnapshots( + + // BNTypeArchive* archive + IntPtr archive , + + // const char* baseSnapshot + string baseSnapshot , + + // const char* firstSnapshot + string firstSnapshot , + + // const char* secondSnapshot + string secondSnapshot , + + // const char** mergeConflictKeysIn + string[] mergeConflictKeysIn , + + // const char** mergeConflictValuesIn + string[] mergeConflictValuesIn , + + // uint64_t mergeConflictCountIn + ulong mergeConflictCountIn , + + // const char*** mergeConflictsOut + IntPtr mergeConflictsOut , + + // uint64_t* mergeConflictCountOut + IntPtr mergeConflictCountOut , + + // const char** result + string[] result , + + // void** progress + IntPtr progress , + + // void* context + IntPtr context + + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeArchiveNewSnapshotTransaction.cs b/Function/BNTypeArchiveNewSnapshotTransaction.cs new file mode 100644 index 0000000..4cab990 --- /dev/null +++ b/Function/BNTypeArchiveNewSnapshotTransaction.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNTypeArchiveNewSnapshotTransaction(BNTypeArchive* archive, void** func, void* context, const char** parents, uint64_t parentCount) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTypeArchiveNewSnapshotTransaction" + )] + internal static extern IntPtr BNTypeArchiveNewSnapshotTransaction( + + // BNTypeArchive* archive + IntPtr archive , + + // void** func + IntPtr func , + + // void* context + IntPtr context , + + // const char** parents + string[] parents , + + // uint64_t parentCount + ulong parentCount + + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeArchiveQueryMetadata.cs b/Function/BNTypeArchiveQueryMetadata.cs new file mode 100644 index 0000000..8a19e15 --- /dev/null +++ b/Function/BNTypeArchiveQueryMetadata.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNMetadata* BNTypeArchiveQueryMetadata(BNTypeArchive* archive, const char* key) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTypeArchiveQueryMetadata" + )] + internal static extern IntPtr BNTypeArchiveQueryMetadata( + + // BNTypeArchive* archive + IntPtr archive , + + // const char* key + string key + + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeArchiveRemoveMetadata.cs b/Function/BNTypeArchiveRemoveMetadata.cs new file mode 100644 index 0000000..d59e11d --- /dev/null +++ b/Function/BNTypeArchiveRemoveMetadata.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNTypeArchiveRemoveMetadata(BNTypeArchive* archive, const char* key) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTypeArchiveRemoveMetadata" + )] + internal static extern bool BNTypeArchiveRemoveMetadata( + + // BNTypeArchive* archive + IntPtr archive , + + // const char* key + string key + + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeArchiveSerializeSnapshot.cs b/Function/BNTypeArchiveSerializeSnapshot.cs new file mode 100644 index 0000000..c62c5c1 --- /dev/null +++ b/Function/BNTypeArchiveSerializeSnapshot.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDataBuffer* BNTypeArchiveSerializeSnapshot(BNTypeArchive* archive, const char* snapshot) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTypeArchiveSerializeSnapshot" + )] + internal static extern IntPtr BNTypeArchiveSerializeSnapshot( + + // BNTypeArchive* archive + IntPtr archive , + + // const char* snapshot + string snapshot + + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeArchiveStoreMetadata.cs b/Function/BNTypeArchiveStoreMetadata.cs new file mode 100644 index 0000000..7f91a5d --- /dev/null +++ b/Function/BNTypeArchiveStoreMetadata.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNTypeArchiveStoreMetadata(BNTypeArchive* archive, const char* key, BNMetadata* value) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTypeArchiveStoreMetadata" + )] + internal static extern bool BNTypeArchiveStoreMetadata( + + // BNTypeArchive* archive + IntPtr archive , + + // const char* key + string key , + + // BNMetadata* _value + IntPtr _value + + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeBuilderGetPointerBaseOffset.cs b/Function/BNTypeBuilderGetPointerBaseOffset.cs new file mode 100644 index 0000000..3a95c53 --- /dev/null +++ b/Function/BNTypeBuilderGetPointerBaseOffset.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// int64_t BNTypeBuilderGetPointerBaseOffset(BNTypeBuilder* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNTypeBuilderGetPointerBaseOffset" + )] + internal static extern long BNTypeBuilderGetPointerBaseOffset( + + // BNTypeBuilder* type + IntPtr type + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeBuilderGetPointerBaseType.cs b/Function/BNTypeBuilderGetPointerBaseType.cs new file mode 100644 index 0000000..191c02c --- /dev/null +++ b/Function/BNTypeBuilderGetPointerBaseType.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNPointerBaseType BNTypeBuilderGetPointerBaseType(BNTypeBuilder* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNTypeBuilderGetPointerBaseType" + )] + internal static extern PointerBaseType BNTypeBuilderGetPointerBaseType( + + // BNTypeBuilder* type + IntPtr type + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeBuilderGetReferenceType.cs b/Function/BNTypeBuilderGetReferenceType.cs new file mode 100644 index 0000000..2804ef4 --- /dev/null +++ b/Function/BNTypeBuilderGetReferenceType.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNReferenceType BNTypeBuilderGetReferenceType(BNTypeBuilder* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTypeBuilderGetReferenceType" + )] + internal static extern ReferenceType BNTypeBuilderGetReferenceType( + + // BNTypeBuilder* type + IntPtr type + + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeBuilderGetStructureName.cs b/Function/BNTypeBuilderGetStructureName.cs new file mode 100644 index 0000000..d1eae4f --- /dev/null +++ b/Function/BNTypeBuilderGetStructureName.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNQualifiedName BNTypeBuilderGetStructureName(BNTypeBuilder* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTypeBuilderGetStructureName" + )] + internal static extern BNQualifiedName BNTypeBuilderGetStructureName( + + // BNTypeBuilder* type + IntPtr type + + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeBuilderGetSystemCallNumber.cs b/Function/BNTypeBuilderGetSystemCallNumber.cs new file mode 100644 index 0000000..1ec3b5c --- /dev/null +++ b/Function/BNTypeBuilderGetSystemCallNumber.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint32_t BNTypeBuilderGetSystemCallNumber(BNTypeBuilder* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNTypeBuilderGetSystemCallNumber" + )] + internal static extern uint BNTypeBuilderGetSystemCallNumber( + + // BNTypeBuilder* type + IntPtr type + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeBuilderGetTypeName.cs b/Function/BNTypeBuilderGetTypeName.cs new file mode 100644 index 0000000..848ce4a --- /dev/null +++ b/Function/BNTypeBuilderGetTypeName.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNQualifiedName BNTypeBuilderGetTypeName(BNTypeBuilder* nt) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTypeBuilderGetTypeName" + )] + internal static extern BNQualifiedName BNTypeBuilderGetTypeName( + + // BNTypeBuilder* nt + IntPtr nt + + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeBuilderHasTemplateArguments.cs b/Function/BNTypeBuilderHasTemplateArguments.cs new file mode 100644 index 0000000..7748dc9 --- /dev/null +++ b/Function/BNTypeBuilderHasTemplateArguments.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNTypeBuilderHasTemplateArguments(BNTypeBuilder* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTypeBuilderHasTemplateArguments" + )] + internal static extern bool BNTypeBuilderHasTemplateArguments( + + // BNTypeBuilder* type + IntPtr type + + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeBuilderHasVariableArguments.cs b/Function/BNTypeBuilderHasVariableArguments.cs new file mode 100644 index 0000000..dfa1f96 --- /dev/null +++ b/Function/BNTypeBuilderHasVariableArguments.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBoolWithConfidence BNTypeBuilderHasVariableArguments(BNTypeBuilder* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNTypeBuilderHasVariableArguments" + )] + internal static extern BNBoolWithConfidence BNTypeBuilderHasVariableArguments( + + // BNTypeBuilder* type + IntPtr type + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeBuilderIsSystemCall.cs b/Function/BNTypeBuilderIsSystemCall.cs new file mode 100644 index 0000000..57cc5c6 --- /dev/null +++ b/Function/BNTypeBuilderIsSystemCall.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNTypeBuilderIsSystemCall(BNTypeBuilder* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTypeBuilderIsSystemCall" + )] + internal static extern bool BNTypeBuilderIsSystemCall( + + // BNTypeBuilder* type + IntPtr type + + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeBuilderSetAlignment.cs b/Function/BNTypeBuilderSetAlignment.cs new file mode 100644 index 0000000..2b42476 --- /dev/null +++ b/Function/BNTypeBuilderSetAlignment.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNTypeBuilderSetAlignment(BNTypeBuilder* type, uint64_t alignment) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNTypeBuilderSetAlignment" + )] + internal static extern void BNTypeBuilderSetAlignment( + + // BNTypeBuilder* type + IntPtr type , + + // uint64_t alignment + ulong alignment + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeBuilderSetAlternateName.cs b/Function/BNTypeBuilderSetAlternateName.cs new file mode 100644 index 0000000..e5d463e --- /dev/null +++ b/Function/BNTypeBuilderSetAlternateName.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNTypeBuilderSetAlternateName(BNTypeBuilder* type, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTypeBuilderSetAlternateName" + )] + internal static extern void BNTypeBuilderSetAlternateName( + + // BNTypeBuilder* type + IntPtr type , + + // const char* name + string name + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeBuilderSetCallingConvention.cs b/Function/BNTypeBuilderSetCallingConvention.cs new file mode 100644 index 0000000..599b12a --- /dev/null +++ b/Function/BNTypeBuilderSetCallingConvention.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNTypeBuilderSetCallingConvention(BNTypeBuilder* type, BNCallingConventionWithConfidence* cc) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNTypeBuilderSetCallingConvention" + )] + internal static extern void BNTypeBuilderSetCallingConvention( + + // BNTypeBuilder* type + IntPtr type , + + // BNCallingConventionWithConfidence* cc + in BNCallingConventionWithConfidence cc + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeBuilderSetCallingConventionName.cs b/Function/BNTypeBuilderSetCallingConventionName.cs new file mode 100644 index 0000000..c4a8dee --- /dev/null +++ b/Function/BNTypeBuilderSetCallingConventionName.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNTypeBuilderSetCallingConventionName(BNTypeBuilder* type, BNCallingConventionName cc) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTypeBuilderSetCallingConventionName" + )] + internal static extern void BNTypeBuilderSetCallingConventionName( + + // BNTypeBuilder* type + IntPtr type , + + // BNCallingConventionName cc + CallingConventionName cc + + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeBuilderSetChildType.cs b/Function/BNTypeBuilderSetChildType.cs new file mode 100644 index 0000000..9cd4d6d --- /dev/null +++ b/Function/BNTypeBuilderSetChildType.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNTypeBuilderSetChildType(BNTypeBuilder* type, BNTypeWithConfidence* child) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNTypeBuilderSetChildType" + )] + internal static extern void BNTypeBuilderSetChildType( + + // BNTypeBuilder* type + IntPtr type , + + // BNTypeWithConfidence* child + in BNTypeWithConfidence child + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeBuilderSetConst.cs b/Function/BNTypeBuilderSetConst.cs new file mode 100644 index 0000000..a29496b --- /dev/null +++ b/Function/BNTypeBuilderSetConst.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNTypeBuilderSetConst(BNTypeBuilder* type, BNBoolWithConfidence* cnst) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNTypeBuilderSetConst" + )] + internal static extern void BNTypeBuilderSetConst( + + // BNTypeBuilder* type + IntPtr type , + + // BNBoolWithConfidence* cnst + in BNBoolWithConfidence cnst + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeBuilderSetSigned.cs b/Function/BNTypeBuilderSetSigned.cs new file mode 100644 index 0000000..5615ac6 --- /dev/null +++ b/Function/BNTypeBuilderSetSigned.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNTypeBuilderSetSigned(BNTypeBuilder* type, BNBoolWithConfidence* sign) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNTypeBuilderSetSigned" + )] + internal static extern void BNTypeBuilderSetSigned( + + // BNTypeBuilder* type + IntPtr type , + + // BNBoolWithConfidence* sign + in BNBoolWithConfidence sign + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeBuilderSetStackAdjustment.cs b/Function/BNTypeBuilderSetStackAdjustment.cs new file mode 100644 index 0000000..29ba850 --- /dev/null +++ b/Function/BNTypeBuilderSetStackAdjustment.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNTypeBuilderSetStackAdjustment(BNTypeBuilder* type, BNOffsetWithConfidence* adjust) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNTypeBuilderSetStackAdjustment" + )] + internal static extern void BNTypeBuilderSetStackAdjustment( + + // BNTypeBuilder* type + IntPtr type , + + // BNOffsetWithConfidence* adjust + in BNOffsetWithConfidence adjust + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeBuilderSetSystemCallNumber.cs b/Function/BNTypeBuilderSetSystemCallNumber.cs new file mode 100644 index 0000000..04b5545 --- /dev/null +++ b/Function/BNTypeBuilderSetSystemCallNumber.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNTypeBuilderSetSystemCallNumber(BNTypeBuilder* type, bool v, uint32_t n) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNTypeBuilderSetSystemCallNumber" + )] + internal static extern void BNTypeBuilderSetSystemCallNumber( + + // BNTypeBuilder* type + IntPtr type , + + // bool v + bool v , + + // uint32_t n + uint n + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeBuilderSetTypeName.cs b/Function/BNTypeBuilderSetTypeName.cs new file mode 100644 index 0000000..a7a0938 --- /dev/null +++ b/Function/BNTypeBuilderSetTypeName.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNTypeBuilderSetTypeName(BNTypeBuilder* type, BNQualifiedName* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTypeBuilderSetTypeName" + )] + internal static extern void BNTypeBuilderSetTypeName( + + // BNTypeBuilder* type + IntPtr type , + + // BNQualifiedName* name + IntPtr name + + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeBuilderSetVolatile.cs b/Function/BNTypeBuilderSetVolatile.cs new file mode 100644 index 0000000..6a80f79 --- /dev/null +++ b/Function/BNTypeBuilderSetVolatile.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNTypeBuilderSetVolatile(BNTypeBuilder* type, BNBoolWithConfidence* vltl) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTypeBuilderSetVolatile" + )] + internal static extern void BNTypeBuilderSetVolatile( + + // BNTypeBuilder* type + IntPtr type , + + // BNBoolWithConfidence* vltl + in BNBoolWithConfidence vltl + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeBuilderSetWidth.cs b/Function/BNTypeBuilderSetWidth.cs new file mode 100644 index 0000000..b3eb25e --- /dev/null +++ b/Function/BNTypeBuilderSetWidth.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNTypeBuilderSetWidth(BNTypeBuilder* type, uint64_t width) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNTypeBuilderSetWidth" + )] + internal static extern void BNTypeBuilderSetWidth( + + // BNTypeBuilder* type + IntPtr type , + + // uint64_t width + ulong width + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeContainerAddTypes.cs b/Function/BNTypeContainerAddTypes.cs new file mode 100644 index 0000000..49e8b40 --- /dev/null +++ b/Function/BNTypeContainerAddTypes.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNTypeContainerAddTypes(BNTypeContainer* container, BNQualifiedName* typeNames, BNType** types, uint64_t typeCount, void* progress, void* progressContext, BNQualifiedName** resultNames, char*** resultIds, uint64_t* resultCount) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNTypeContainerAddTypes" + )] + internal static extern bool BNTypeContainerAddTypes( + + // BNTypeContainer* container + IntPtr container , + + // BNQualifiedName* typeNames + BNQualifiedName[] typeNames , + + // BNType** types + IntPtr types , + + // uint64_t typeCount + ulong typeCount , + + // void* progress + IntPtr progress , + + // void* progressContext + IntPtr progressContext , + + // BNQualifiedName** resultNames + out IntPtr resultNames , + + // char*** resultIds + out IntPtr resultIds , + + // uint64_t* resultCount + out ulong resultCount + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeContainerDeleteType.cs b/Function/BNTypeContainerDeleteType.cs new file mode 100644 index 0000000..0c3c087 --- /dev/null +++ b/Function/BNTypeContainerDeleteType.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNTypeContainerDeleteType(BNTypeContainer* container, const char* typeId) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTypeContainerDeleteType" + )] + internal static extern bool BNTypeContainerDeleteType( + + // BNTypeContainer* container + IntPtr container , + + // const char* typeId + string typeId + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeContainerGetId.cs b/Function/BNTypeContainerGetId.cs new file mode 100644 index 0000000..8a6c1c3 --- /dev/null +++ b/Function/BNTypeContainerGetId.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// char* BNTypeContainerGetId(BNTypeContainer* container) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNTypeContainerGetId" + )] + internal static extern IntPtr BNTypeContainerGetId( + + // BNTypeContainer* container + IntPtr container + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeContainerGetName.cs b/Function/BNTypeContainerGetName.cs new file mode 100644 index 0000000..a9dedd3 --- /dev/null +++ b/Function/BNTypeContainerGetName.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNTypeContainerGetName(BNTypeContainer* container) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNTypeContainerGetName" + )] + internal static extern IntPtr BNTypeContainerGetName( + + // BNTypeContainer* container + IntPtr container + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeContainerGetPlatform.cs b/Function/BNTypeContainerGetPlatform.cs new file mode 100644 index 0000000..556aa7f --- /dev/null +++ b/Function/BNTypeContainerGetPlatform.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNPlatform* BNTypeContainerGetPlatform(BNTypeContainer* container) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNTypeContainerGetPlatform" + )] + internal static extern IntPtr BNTypeContainerGetPlatform( + + // BNTypeContainer* container + IntPtr container + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeContainerGetType.cs b/Function/BNTypeContainerGetType.cs new file mode 100644 index 0000000..d621f71 --- /dev/null +++ b/Function/BNTypeContainerGetType.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNTypeContainerType BNTypeContainerGetType(BNTypeContainer* container) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNTypeContainerGetType" + )] + internal static extern TypeContainerType BNTypeContainerGetType( + + // BNTypeContainer* container + IntPtr container + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeContainerGetTypeById.cs b/Function/BNTypeContainerGetTypeById.cs new file mode 100644 index 0000000..d3195d9 --- /dev/null +++ b/Function/BNTypeContainerGetTypeById.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNTypeContainerGetTypeById(BNTypeContainer* container, const char* typeId, BNType** result) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTypeContainerGetTypeById" + )] + internal static extern bool BNTypeContainerGetTypeById( + + // BNTypeContainer* container + IntPtr container , + + // const char* typeId + string typeId , + + // BNType** result + out IntPtr result + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeContainerGetTypeByName.cs b/Function/BNTypeContainerGetTypeByName.cs new file mode 100644 index 0000000..a001cde --- /dev/null +++ b/Function/BNTypeContainerGetTypeByName.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNTypeContainerGetTypeByName(BNTypeContainer* container, BNQualifiedName* typeName, BNType** result) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNTypeContainerGetTypeByName" + )] + internal static extern bool BNTypeContainerGetTypeByName( + + // BNTypeContainer* container + IntPtr container , + + // BNQualifiedName* typeName + in BNQualifiedName typeName , + + // BNType** result + out IntPtr result + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeContainerGetTypeId.cs b/Function/BNTypeContainerGetTypeId.cs new file mode 100644 index 0000000..82b9f65 --- /dev/null +++ b/Function/BNTypeContainerGetTypeId.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNTypeContainerGetTypeId(BNTypeContainer* container, BNQualifiedName* typeName, char** result) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTypeContainerGetTypeId" + )] + internal static extern bool BNTypeContainerGetTypeId( + + // BNTypeContainer* container + IntPtr container , + + // BNQualifiedName* typeName + in BNQualifiedName typeName , + + // char** result + out IntPtr result + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeContainerGetTypeIds.cs b/Function/BNTypeContainerGetTypeIds.cs new file mode 100644 index 0000000..1c16126 --- /dev/null +++ b/Function/BNTypeContainerGetTypeIds.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNTypeContainerGetTypeIds(BNTypeContainer* container, const char*** typeIds, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNTypeContainerGetTypeIds" + )] + internal static extern bool BNTypeContainerGetTypeIds( + + // BNTypeContainer* container + IntPtr container , + + // char*** typeIds + out IntPtr typeIds , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeContainerGetTypeName.cs b/Function/BNTypeContainerGetTypeName.cs new file mode 100644 index 0000000..d77b08d --- /dev/null +++ b/Function/BNTypeContainerGetTypeName.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNTypeContainerGetTypeName(BNTypeContainer* container, const char* typeId, BNQualifiedName* result) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTypeContainerGetTypeName" + )] + internal static extern bool BNTypeContainerGetTypeName( + + // BNTypeContainer* container + IntPtr container , + + // const char* typeId + string typeId , + + // BNQualifiedName* result + out BNQualifiedName result + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeContainerGetTypeNames.cs b/Function/BNTypeContainerGetTypeNames.cs new file mode 100644 index 0000000..6c07707 --- /dev/null +++ b/Function/BNTypeContainerGetTypeNames.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNTypeContainerGetTypeNames(BNTypeContainer* container, BNQualifiedName** typeNames, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNTypeContainerGetTypeNames" + )] + internal static extern bool BNTypeContainerGetTypeNames( + + // BNTypeContainer* container + IntPtr container , + + // BNQualifiedName** typeNames + out IntPtr typeNames , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeContainerGetTypeNamesAndIds.cs b/Function/BNTypeContainerGetTypeNamesAndIds.cs new file mode 100644 index 0000000..b97827e --- /dev/null +++ b/Function/BNTypeContainerGetTypeNamesAndIds.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNTypeContainerGetTypeNamesAndIds(BNTypeContainer* container, const char*** typeIds, BNQualifiedName** typeNames, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNTypeContainerGetTypeNamesAndIds" + )] + internal static extern bool BNTypeContainerGetTypeNamesAndIds( + + // BNTypeContainer* container + IntPtr container , + + // const char*** typeIds + out IntPtr typeIds , + + // BNQualifiedName** typeNames + out IntPtr typeNames , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeContainerGetTypes.cs b/Function/BNTypeContainerGetTypes.cs new file mode 100644 index 0000000..94becaa --- /dev/null +++ b/Function/BNTypeContainerGetTypes.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNTypeContainerGetTypes(BNTypeContainer* container, const char*** typeIds, BNQualifiedName** typeNames, BNType*** types, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNTypeContainerGetTypes" + )] + internal static extern bool BNTypeContainerGetTypes( + + // BNTypeContainer* container + IntPtr container , + + // char*** typeIds + out IntPtr typeIds , + + // BNQualifiedName** typeNames + out IntPtr typeNames , + + // BNType*** types + out IntPtr types , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeContainerIsMutable.cs b/Function/BNTypeContainerIsMutable.cs new file mode 100644 index 0000000..d0e7461 --- /dev/null +++ b/Function/BNTypeContainerIsMutable.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNTypeContainerIsMutable(BNTypeContainer* container) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNTypeContainerIsMutable" + )] + internal static extern bool BNTypeContainerIsMutable( + + // BNTypeContainer* container + IntPtr container + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeContainerParseTypeString.cs b/Function/BNTypeContainerParseTypeString.cs new file mode 100644 index 0000000..444f573 --- /dev/null +++ b/Function/BNTypeContainerParseTypeString.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNTypeContainerParseTypeString(BNTypeContainer* container, const char* source, bool importDepencencies, BNQualifiedNameAndType* result, BNTypeParserError** errors, uint64_t* errorCount) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTypeContainerParseTypeString" + )] + internal static extern bool BNTypeContainerParseTypeString( + + // BNTypeContainer* container + IntPtr container , + + // const char* source + string source , + + // bool importDepencencies + bool importDepencencies , + + // BNQualifiedNameAndType* result + out BNQualifiedNameAndType result , + + // BNTypeParserError** errors + out IntPtr errors , + + // uint64_t* errorCount + out ulong errorCount + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeContainerParseTypesFromSource.cs b/Function/BNTypeContainerParseTypesFromSource.cs new file mode 100644 index 0000000..844d2b1 --- /dev/null +++ b/Function/BNTypeContainerParseTypesFromSource.cs @@ -0,0 +1,59 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNTypeContainerParseTypesFromSource(BNTypeContainer* container, const char* source, const char* fileName, const char** options, uint64_t optionCount, const char** includeDirs, uint64_t includeDirCount, const char* autoTypeSource, bool importDepencencies, BNTypeParserResult* result, BNTypeParserError** errors, uint64_t* errorCount) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTypeContainerParseTypesFromSource" + )] + internal static extern bool BNTypeContainerParseTypesFromSource( + + // BNTypeContainer* container + IntPtr container , + + // const char* source + string source , + + // const char* fileName + string fileName , + + // const char** options + string[] options , + + // uint64_t optionCount + ulong optionCount , + + // const char** includeDirs + string[] includeDirs , + + // uint64_t includeDirCount + ulong includeDirCount , + + // const char* autoTypeSource + string autoTypeSource , + + // bool importDepencencies + bool importDepencencies , + + // BNTypeParserResult* result + IntPtr result , + + // BNTypeParserError** errors + IntPtr errors , + + // uint64_t* errorCount + IntPtr errorCount + + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeContainerRenameType.cs b/Function/BNTypeContainerRenameType.cs new file mode 100644 index 0000000..2055b2a --- /dev/null +++ b/Function/BNTypeContainerRenameType.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNTypeContainerRenameType(BNTypeContainer* container, const char* typeId, BNQualifiedName* newName) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTypeContainerRenameType" + )] + internal static extern bool BNTypeContainerRenameType( + + // BNTypeContainer* container + IntPtr container , + + // const char* typeId + string typeId , + + // BNQualifiedName* newName + in BNQualifiedName newName + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeGetNameType.cs b/Function/BNTypeGetNameType.cs new file mode 100644 index 0000000..a7cfae4 --- /dev/null +++ b/Function/BNTypeGetNameType.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNNameType BNTypeGetNameType(BNType* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNTypeGetNameType" + )] + internal static extern NameType BNTypeGetNameType( + + // BNType* type + IntPtr type + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeGetPointerBaseOffset.cs b/Function/BNTypeGetPointerBaseOffset.cs new file mode 100644 index 0000000..0721ef0 --- /dev/null +++ b/Function/BNTypeGetPointerBaseOffset.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// int64_t BNTypeGetPointerBaseOffset(BNType* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNTypeGetPointerBaseOffset" + )] + internal static extern long BNTypeGetPointerBaseOffset( + + // BNType* type + IntPtr type + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeGetPointerBaseType.cs b/Function/BNTypeGetPointerBaseType.cs new file mode 100644 index 0000000..b2bc431 --- /dev/null +++ b/Function/BNTypeGetPointerBaseType.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNPointerBaseType BNTypeGetPointerBaseType(BNType* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNTypeGetPointerBaseType" + )] + internal static extern PointerBaseType BNTypeGetPointerBaseType( + + // BNType* type + IntPtr type + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeGetReferenceType.cs b/Function/BNTypeGetReferenceType.cs new file mode 100644 index 0000000..5c56386 --- /dev/null +++ b/Function/BNTypeGetReferenceType.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNReferenceType BNTypeGetReferenceType(BNType* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTypeGetReferenceType" + )] + internal static extern ReferenceType BNTypeGetReferenceType( + + // BNType* type + IntPtr type + + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeGetStructureName.cs b/Function/BNTypeGetStructureName.cs new file mode 100644 index 0000000..b200fb9 --- /dev/null +++ b/Function/BNTypeGetStructureName.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNQualifiedName BNTypeGetStructureName(BNType* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNTypeGetStructureName" + )] + internal static extern BNQualifiedName BNTypeGetStructureName( + + // BNType* type + IntPtr type + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeGetSystemCallNumber.cs b/Function/BNTypeGetSystemCallNumber.cs new file mode 100644 index 0000000..0692a26 --- /dev/null +++ b/Function/BNTypeGetSystemCallNumber.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint32_t BNTypeGetSystemCallNumber(BNType* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNTypeGetSystemCallNumber" + )] + internal static extern uint BNTypeGetSystemCallNumber( + + // BNType* type + IntPtr type + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeGetTypeName.cs b/Function/BNTypeGetTypeName.cs new file mode 100644 index 0000000..806bfb7 --- /dev/null +++ b/Function/BNTypeGetTypeName.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNQualifiedName BNTypeGetTypeName(BNType* nt) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNTypeGetTypeName" + )] + internal static extern BNQualifiedName BNTypeGetTypeName( + + // BNType* nt + IntPtr nt + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeHasTemplateArguments.cs b/Function/BNTypeHasTemplateArguments.cs new file mode 100644 index 0000000..3deb85c --- /dev/null +++ b/Function/BNTypeHasTemplateArguments.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNTypeHasTemplateArguments(BNType* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTypeHasTemplateArguments" + )] + internal static extern bool BNTypeHasTemplateArguments( + + // BNType* type + IntPtr type + + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeHasVariableArguments.cs b/Function/BNTypeHasVariableArguments.cs new file mode 100644 index 0000000..fa0ff55 --- /dev/null +++ b/Function/BNTypeHasVariableArguments.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNBoolWithConfidence BNTypeHasVariableArguments(BNType* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNTypeHasVariableArguments" + )] + internal static extern BNBoolWithConfidence BNTypeHasVariableArguments( + + // BNType* type + IntPtr type + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeIsSystemCall.cs b/Function/BNTypeIsSystemCall.cs new file mode 100644 index 0000000..c00b745 --- /dev/null +++ b/Function/BNTypeIsSystemCall.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNTypeIsSystemCall(BNType* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNTypeIsSystemCall" + )] + internal static extern bool BNTypeIsSystemCall( + + // BNType* type + IntPtr type + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeLibraryDecompressToFile.cs b/Function/BNTypeLibraryDecompressToFile.cs new file mode 100644 index 0000000..b422f65 --- /dev/null +++ b/Function/BNTypeLibraryDecompressToFile.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNTypeLibraryDecompressToFile(const char* file, const char* output) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTypeLibraryDecompressToFile" + )] + public static extern bool BNTypeLibraryDecompressToFile( + + // const char* file + string file , + + // const char* output + string output + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeLibraryGetMetadata.cs b/Function/BNTypeLibraryGetMetadata.cs new file mode 100644 index 0000000..c0c3b9c --- /dev/null +++ b/Function/BNTypeLibraryGetMetadata.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNMetadata* BNTypeLibraryGetMetadata(BNTypeLibrary* lib) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNTypeLibraryGetMetadata" + )] + internal static extern IntPtr BNTypeLibraryGetMetadata( + + // BNTypeLibrary* lib + IntPtr lib + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeLibraryQueryMetadata.cs b/Function/BNTypeLibraryQueryMetadata.cs new file mode 100644 index 0000000..3d03b6a --- /dev/null +++ b/Function/BNTypeLibraryQueryMetadata.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNMetadata* BNTypeLibraryQueryMetadata(BNTypeLibrary* lib, const char* key) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTypeLibraryQueryMetadata" + )] + internal static extern IntPtr BNTypeLibraryQueryMetadata( + + // BNTypeLibrary* lib + IntPtr lib , + + // const char* key + string key + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeLibraryRemoveMetadata.cs b/Function/BNTypeLibraryRemoveMetadata.cs new file mode 100644 index 0000000..28398c9 --- /dev/null +++ b/Function/BNTypeLibraryRemoveMetadata.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNTypeLibraryRemoveMetadata(BNTypeLibrary* lib, const char* key) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTypeLibraryRemoveMetadata" + )] + internal static extern void BNTypeLibraryRemoveMetadata( + + // BNTypeLibrary* lib + IntPtr lib , + + // const char* key + string key + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeLibraryStoreMetadata.cs b/Function/BNTypeLibraryStoreMetadata.cs new file mode 100644 index 0000000..3577fec --- /dev/null +++ b/Function/BNTypeLibraryStoreMetadata.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNTypeLibraryStoreMetadata(BNTypeLibrary* lib, const char* key, BNMetadata* value) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTypeLibraryStoreMetadata" + )] + internal static extern void BNTypeLibraryStoreMetadata( + + // BNTypeLibrary* lib + IntPtr lib , + + // const char* key + string key , + + // BNMetadata* _value + IntPtr _value + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeParserParseTypeString.cs b/Function/BNTypeParserParseTypeString.cs new file mode 100644 index 0000000..85605b2 --- /dev/null +++ b/Function/BNTypeParserParseTypeString.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNTypeParserParseTypeString(BNTypeParser* parser, const char* source, BNPlatform* platform, BNTypeContainer* existingTypes, BNQualifiedNameAndType* result, BNTypeParserError** errors, uint64_t* errorCount) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTypeParserParseTypeString" + )] + internal static extern bool BNTypeParserParseTypeString( + + // BNTypeParser* parser + IntPtr parser , + + // const char* source + string source , + + // BNPlatform* platform + IntPtr platform , + + // BNTypeContainer* existingTypes + IntPtr existingTypes , + + // BNQualifiedNameAndType* result + IntPtr result , + + // BNTypeParserError** errors + IntPtr errors , + + // uint64_t* errorCount + IntPtr errorCount + + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeParserParseTypesFromSource.cs b/Function/BNTypeParserParseTypesFromSource.cs new file mode 100644 index 0000000..278dbf1 --- /dev/null +++ b/Function/BNTypeParserParseTypesFromSource.cs @@ -0,0 +1,62 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNTypeParserParseTypesFromSource(BNTypeParser* parser, const char* source, const char* fileName, BNPlatform* platform, BNTypeContainer* existingTypes, const char** options, uint64_t optionCount, const char** includeDirs, uint64_t includeDirCount, const char* autoTypeSource, BNTypeParserResult* result, BNTypeParserError** errors, uint64_t* errorCount) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTypeParserParseTypesFromSource" + )] + internal static extern bool BNTypeParserParseTypesFromSource( + + // BNTypeParser* parser + IntPtr parser , + + // const char* source + string source , + + // const char* fileName + string fileName , + + // BNPlatform* platform + IntPtr platform , + + // BNTypeContainer* existingTypes + IntPtr existingTypes , + + // const char** options + string[] options , + + // uint64_t optionCount + ulong optionCount , + + // const char** includeDirs + string[] includeDirs , + + // uint64_t includeDirCount + ulong includeDirCount , + + // const char* autoTypeSource + string autoTypeSource , + + // BNTypeParserResult* result + IntPtr result , + + // BNTypeParserError** errors + IntPtr errors , + + // uint64_t* errorCount + IntPtr errorCount + + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeParserPreprocessSource.cs b/Function/BNTypeParserPreprocessSource.cs new file mode 100644 index 0000000..909b8b6 --- /dev/null +++ b/Function/BNTypeParserPreprocessSource.cs @@ -0,0 +1,59 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNTypeParserPreprocessSource(BNTypeParser* parser, const char* source, const char* fileName, BNPlatform* platform, BNTypeContainer* existingTypes, const char** options, uint64_t optionCount, const char** includeDirs, uint64_t includeDirCount, const char** output, BNTypeParserError** errors, uint64_t* errorCount) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTypeParserPreprocessSource" + )] + internal static extern bool BNTypeParserPreprocessSource( + + // BNTypeParser* parser + IntPtr parser , + + // const char* source + string source , + + // const char* fileName + string fileName , + + // BNPlatform* platform + IntPtr platform , + + // BNTypeContainer* existingTypes + IntPtr existingTypes , + + // const char** options + string[] options , + + // uint64_t optionCount + ulong optionCount , + + // const char** includeDirs + string[] includeDirs , + + // uint64_t includeDirCount + ulong includeDirCount , + + // const char** output + string[] output , + + // BNTypeParserError** errors + IntPtr errors , + + // uint64_t* errorCount + IntPtr errorCount + + ); + } +} \ No newline at end of file diff --git a/Function/BNTypePrinterDefaultPrintAllTypes.cs b/Function/BNTypePrinterDefaultPrintAllTypes.cs new file mode 100644 index 0000000..8d9a9ab --- /dev/null +++ b/Function/BNTypePrinterDefaultPrintAllTypes.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNTypePrinterDefaultPrintAllTypes(BNTypePrinter* printer, BNQualifiedName* names, BNType** types, uint64_t typeCount, BNBinaryView* data, int32_t paddingCols, BNTokenEscapingType escaping, const char** result) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTypePrinterDefaultPrintAllTypes" + )] + internal static extern bool BNTypePrinterDefaultPrintAllTypes( + + // BNTypePrinter* printer + IntPtr printer , + + // BNQualifiedName* names + IntPtr names , + + // BNType** types + IntPtr types , + + // uint64_t typeCount + ulong typeCount , + + // BNBinaryView* data + IntPtr data , + + // int32_t paddingCols + int paddingCols , + + // BNTokenEscapingType escaping + TokenEscapingType escaping , + + // const char** result + string[] result + + ); + } +} \ No newline at end of file diff --git a/Function/BNTypePrinterPrintAllTypes.cs b/Function/BNTypePrinterPrintAllTypes.cs new file mode 100644 index 0000000..553dbef --- /dev/null +++ b/Function/BNTypePrinterPrintAllTypes.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNTypePrinterPrintAllTypes(BNTypePrinter* printer, BNQualifiedName* names, BNType** types, uint64_t typeCount, BNBinaryView* data, int32_t paddingCols, BNTokenEscapingType escaping, const char** result) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTypePrinterPrintAllTypes" + )] + internal static extern bool BNTypePrinterPrintAllTypes( + + // BNTypePrinter* printer + IntPtr printer , + + // BNQualifiedName* names + IntPtr names , + + // BNType** types + IntPtr types , + + // uint64_t typeCount + ulong typeCount , + + // BNBinaryView* data + IntPtr data , + + // int32_t paddingCols + int paddingCols , + + // BNTokenEscapingType escaping + TokenEscapingType escaping , + + // const char** result + string[] result + + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeShouldDisplayReturnType.cs b/Function/BNTypeShouldDisplayReturnType.cs new file mode 100644 index 0000000..39dde0a --- /dev/null +++ b/Function/BNTypeShouldDisplayReturnType.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNTypeShouldDisplayReturnType(BNType* type) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNTypeShouldDisplayReturnType" + )] + internal static extern bool BNTypeShouldDisplayReturnType( + + // BNType* type + IntPtr type + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeWithReplacedEnumeration.cs b/Function/BNTypeWithReplacedEnumeration.cs new file mode 100644 index 0000000..48f470d --- /dev/null +++ b/Function/BNTypeWithReplacedEnumeration.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNType* BNTypeWithReplacedEnumeration(BNType* type, BNEnumeration* from, BNEnumeration* to) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTypeWithReplacedEnumeration" + )] + internal static extern IntPtr BNTypeWithReplacedEnumeration( + + // BNType* type + IntPtr type , + + // BNEnumeration* _from + IntPtr _from , + + // BNEnumeration* to + IntPtr to + + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeWithReplacedNamedTypeReference.cs b/Function/BNTypeWithReplacedNamedTypeReference.cs new file mode 100644 index 0000000..6efb863 --- /dev/null +++ b/Function/BNTypeWithReplacedNamedTypeReference.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNType* BNTypeWithReplacedNamedTypeReference(BNType* type, BNNamedTypeReference* from, BNNamedTypeReference* to) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTypeWithReplacedNamedTypeReference" + )] + internal static extern IntPtr BNTypeWithReplacedNamedTypeReference( + + // BNType* type + IntPtr type , + + // BNNamedTypeReference* _from + IntPtr _from , + + // BNNamedTypeReference* to + IntPtr to + + ); + } +} \ No newline at end of file diff --git a/Function/BNTypeWithReplacedStructure.cs b/Function/BNTypeWithReplacedStructure.cs new file mode 100644 index 0000000..727a6cd --- /dev/null +++ b/Function/BNTypeWithReplacedStructure.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNType* BNTypeWithReplacedStructure(BNType* type, BNStructure* from, BNStructure* to) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTypeWithReplacedStructure" + )] + internal static extern IntPtr BNTypeWithReplacedStructure( + + // BNType* type + IntPtr type , + + // BNStructure* _from + IntPtr _from , + + // BNStructure* to + IntPtr to + + ); + } +} \ No newline at end of file diff --git a/Function/BNTypesEqual.cs b/Function/BNTypesEqual.cs new file mode 100644 index 0000000..4bef4ae --- /dev/null +++ b/Function/BNTypesEqual.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNTypesEqual(BNType* a, BNType* b) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTypesEqual" + )] + internal static extern bool BNTypesEqual( + + // BNType* a + IntPtr a , + + // BNType* b + IntPtr b + + ); + } +} \ No newline at end of file diff --git a/Function/BNTypesNotEqual.cs b/Function/BNTypesNotEqual.cs new file mode 100644 index 0000000..b4702b9 --- /dev/null +++ b/Function/BNTypesNotEqual.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNTypesNotEqual(BNType* a, BNType* b) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNTypesNotEqual" + )] + internal static extern bool BNTypesNotEqual( + + // BNType* a + IntPtr a , + + // BNType* b + IntPtr b + + ); + } +} \ No newline at end of file diff --git a/Function/BNUndefineAnalysisType.cs b/Function/BNUndefineAnalysisType.cs new file mode 100644 index 0000000..f31b79e --- /dev/null +++ b/Function/BNUndefineAnalysisType.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNUndefineAnalysisType(BNBinaryView* view, const char* id) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNUndefineAnalysisType" + )] + internal static extern void BNUndefineAnalysisType( + + // BNBinaryView* view + IntPtr view , + + // const char* id + string id + ); + } +} \ No newline at end of file diff --git a/Function/BNUndefineAutoSymbol.cs b/Function/BNUndefineAutoSymbol.cs new file mode 100644 index 0000000..2a51fac --- /dev/null +++ b/Function/BNUndefineAutoSymbol.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNUndefineAutoSymbol(BNBinaryView* view, BNSymbol* sym) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNUndefineAutoSymbol" + )] + internal static extern void BNUndefineAutoSymbol( + + // BNBinaryView* view + IntPtr view , + + // BNSymbol* sym + IntPtr sym + ); + } +} \ No newline at end of file diff --git a/Function/BNUndefineDataVariable.cs b/Function/BNUndefineDataVariable.cs new file mode 100644 index 0000000..7cdb9e8 --- /dev/null +++ b/Function/BNUndefineDataVariable.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNUndefineDataVariable(BNBinaryView* view, uint64_t addr, bool blacklist) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNUndefineDataVariable" + )] + internal static extern void BNUndefineDataVariable( + + // BNBinaryView* view + IntPtr view , + + // uint64_t addr + ulong addr , + + // bool blacklist + bool blacklist + ); + } +} \ No newline at end of file diff --git a/Function/BNUndefineUserAnalysisType.cs b/Function/BNUndefineUserAnalysisType.cs new file mode 100644 index 0000000..ca375db --- /dev/null +++ b/Function/BNUndefineUserAnalysisType.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNUndefineUserAnalysisType(BNBinaryView* view, BNQualifiedName* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNUndefineUserAnalysisType" + )] + internal static extern void BNUndefineUserAnalysisType( + + // BNBinaryView* view + IntPtr view , + + // BNQualifiedName* name + in BNQualifiedName name + ); + } +} \ No newline at end of file diff --git a/Function/BNUndefineUserDataVariable.cs b/Function/BNUndefineUserDataVariable.cs new file mode 100644 index 0000000..84781f9 --- /dev/null +++ b/Function/BNUndefineUserDataVariable.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNUndefineUserDataVariable(BNBinaryView* view, uint64_t addr) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNUndefineUserDataVariable" + )] + internal static extern void BNUndefineUserDataVariable( + + // BNBinaryView* view + IntPtr view , + + // uint64_t addr + ulong addr + ); + } +} \ No newline at end of file diff --git a/Function/BNUndefineUserSymbol.cs b/Function/BNUndefineUserSymbol.cs new file mode 100644 index 0000000..3e76f56 --- /dev/null +++ b/Function/BNUndefineUserSymbol.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNUndefineUserSymbol(BNBinaryView* view, BNSymbol* sym) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNUndefineUserSymbol" + )] + internal static extern void BNUndefineUserSymbol( + + // BNBinaryView* view + IntPtr view , + + // BNSymbol* sym + IntPtr sym + ); + } +} \ No newline at end of file diff --git a/Function/BNUndo.cs b/Function/BNUndo.cs new file mode 100644 index 0000000..0b4bcfe --- /dev/null +++ b/Function/BNUndo.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNUndo(BNFileMetadata* file) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNUndo" + )] + internal static extern bool BNUndo( + + // BNFileMetadata* file + IntPtr file + ); + } +} \ No newline at end of file diff --git a/Function/BNUndoActionGetSummary.cs b/Function/BNUndoActionGetSummary.cs new file mode 100644 index 0000000..010d256 --- /dev/null +++ b/Function/BNUndoActionGetSummary.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNInstructionTextToken* BNUndoActionGetSummary(BNUndoAction* action, uint64_t* tokenCount) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNUndoActionGetSummary" + )] + internal static extern IntPtr BNUndoActionGetSummary( + + // BNUndoAction* action + IntPtr action , + + // uint64_t* tokenCount + IntPtr tokenCount + + ); + } +} \ No newline at end of file diff --git a/Function/BNUndoActionGetSummaryText.cs b/Function/BNUndoActionGetSummaryText.cs new file mode 100644 index 0000000..0525f76 --- /dev/null +++ b/Function/BNUndoActionGetSummaryText.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// char* BNUndoActionGetSummaryText(BNUndoAction* action) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNUndoActionGetSummaryText" + )] + internal static extern IntPtr BNUndoActionGetSummaryText( + + // BNUndoAction* action + IntPtr action + ); + } +} \ No newline at end of file diff --git a/Function/BNUndoEntryGetActions.cs b/Function/BNUndoEntryGetActions.cs new file mode 100644 index 0000000..26ba7f3 --- /dev/null +++ b/Function/BNUndoEntryGetActions.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNUndoAction** BNUndoEntryGetActions(BNUndoEntry* entry, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNUndoEntryGetActions" + )] + internal static extern IntPtr BNUndoEntryGetActions( + + // BNUndoEntry* entry + IntPtr entry , + + // uint64_t* count + out ulong count + ); + } +} \ No newline at end of file diff --git a/Function/BNUndoEntryGetId.cs b/Function/BNUndoEntryGetId.cs new file mode 100644 index 0000000..bfeb62a --- /dev/null +++ b/Function/BNUndoEntryGetId.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNUndoEntryGetId(BNUndoEntry* entry) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNUndoEntryGetId" + )] + internal static extern IntPtr BNUndoEntryGetId( + + // BNUndoEntry* entry + IntPtr entry + + ); + } +} \ No newline at end of file diff --git a/Function/BNUndoEntryGetTimestamp.cs b/Function/BNUndoEntryGetTimestamp.cs new file mode 100644 index 0000000..9e2bf61 --- /dev/null +++ b/Function/BNUndoEntryGetTimestamp.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNUndoEntryGetTimestamp(BNUndoEntry* entry) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNUndoEntryGetTimestamp" + )] + internal static extern ulong BNUndoEntryGetTimestamp( + + // BNUndoEntry* entry + IntPtr entry + + ); + } +} \ No newline at end of file diff --git a/Function/BNUnescapeTypeName.cs b/Function/BNUnescapeTypeName.cs new file mode 100644 index 0000000..ad7277a --- /dev/null +++ b/Function/BNUnescapeTypeName.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNUnescapeTypeName(const char* name, BNTokenEscapingType escaping) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNUnescapeTypeName" + )] + internal static extern IntPtr BNUnescapeTypeName( + + // const char* name + string name , + + // BNTokenEscapingType escaping + TokenEscapingType escaping + + ); + } +} \ No newline at end of file diff --git a/Function/BNUnicodeGetBlockNames.cs b/Function/BNUnicodeGetBlockNames.cs new file mode 100644 index 0000000..f467b68 --- /dev/null +++ b/Function/BNUnicodeGetBlockNames.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNUnicodeGetBlockNames(const char*** names, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNUnicodeGetBlockNames" + )] + internal static extern void BNUnicodeGetBlockNames( + + // const char*** names + IntPtr names , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNUnicodeGetBlockRange.cs b/Function/BNUnicodeGetBlockRange.cs new file mode 100644 index 0000000..73089ff --- /dev/null +++ b/Function/BNUnicodeGetBlockRange.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNUnicodeGetBlockRange(const char* name, uint32_t* rangeStart, uint32_t* rangeEnd) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNUnicodeGetBlockRange" + )] + internal static extern bool BNUnicodeGetBlockRange( + + // const char* name + string name , + + // uint32_t* rangeStart + IntPtr rangeStart , + + // uint32_t* rangeEnd + IntPtr rangeEnd + + ); + } +} \ No newline at end of file diff --git a/Function/BNUnicodeGetBlockRanges.cs b/Function/BNUnicodeGetBlockRanges.cs new file mode 100644 index 0000000..9c4b4e8 --- /dev/null +++ b/Function/BNUnicodeGetBlockRanges.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNUnicodeGetBlockRanges(const char*** names, uint32_t** rangeStarts, uint32_t** rangeEnds, uint64_t* count) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNUnicodeGetBlockRanges" + )] + internal static extern void BNUnicodeGetBlockRanges( + + // const char*** names + IntPtr names , + + // uint32_t** rangeStarts + IntPtr rangeStarts , + + // uint32_t** rangeEnds + IntPtr rangeEnds , + + // uint64_t* count + IntPtr count + + ); + } +} \ No newline at end of file diff --git a/Function/BNUnicodeGetBlocksForNames.cs b/Function/BNUnicodeGetBlocksForNames.cs new file mode 100644 index 0000000..139b5a3 --- /dev/null +++ b/Function/BNUnicodeGetBlocksForNames.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNUnicodeGetBlocksForNames(const char** names, uint64_t nameCount, uint32_t*** starts, uint32_t*** ends, uint64_t** blockListCounts, uint64_t* blockCount) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNUnicodeGetBlocksForNames" + )] + internal static extern void BNUnicodeGetBlocksForNames( + + // const char** names + string[] names , + + // uint64_t nameCount + ulong nameCount , + + // uint32_t*** starts + IntPtr starts , + + // uint32_t*** ends + IntPtr ends , + + // uint64_t** blockListCounts + IntPtr blockListCounts , + + // uint64_t* blockCount + IntPtr blockCount + + ); + } +} \ No newline at end of file diff --git a/Function/BNUnicodeGetUTF8String.cs b/Function/BNUnicodeGetUTF8String.cs new file mode 100644 index 0000000..ad6dc1b --- /dev/null +++ b/Function/BNUnicodeGetUTF8String.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNUnicodeGetUTF8String(uint32_t** starts, uint32_t** ends, uint64_t* blockListCounts, uint64_t blockCount, uint8_t* data, uint64_t offset, uint64_t dataLen) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNUnicodeGetUTF8String" + )] + internal static extern IntPtr BNUnicodeGetUTF8String( + + // uint32_t** starts + IntPtr starts , + + // uint32_t** ends + IntPtr ends , + + // uint64_t* blockListCounts + IntPtr blockListCounts , + + // uint64_t blockCount + ulong blockCount , + + // uint8_t* data + IntPtr data , + + // uint64_t offset + ulong offset , + + // uint64_t dataLen + ulong dataLen + + ); + } +} \ No newline at end of file diff --git a/Function/BNUnicodeToEscapedString.cs b/Function/BNUnicodeToEscapedString.cs new file mode 100644 index 0000000..764f9b6 --- /dev/null +++ b/Function/BNUnicodeToEscapedString.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNUnicodeToEscapedString(uint32_t** starts, uint32_t** ends, uint64_t* blockListCounts, uint64_t blockCount, bool utf8Enabled, void* data, uint64_t dataLen) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNUnicodeToEscapedString" + )] + internal static extern IntPtr BNUnicodeToEscapedString( + + // uint32_t** starts + IntPtr starts , + + // uint32_t** ends + IntPtr ends , + + // uint64_t* blockListCounts + IntPtr blockListCounts , + + // uint64_t blockCount + ulong blockCount , + + // bool utf8Enabled + bool utf8Enabled , + + // void* data + IntPtr data , + + // uint64_t dataLen + ulong dataLen + + ); + } +} \ No newline at end of file diff --git a/Function/BNUnicodeUTF16ToUTF8.cs b/Function/BNUnicodeUTF16ToUTF8.cs new file mode 100644 index 0000000..025aa11 --- /dev/null +++ b/Function/BNUnicodeUTF16ToUTF8.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNUnicodeUTF16ToUTF8(uint8_t* utf16, uint64_t len) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNUnicodeUTF16ToUTF8" + )] + internal static extern IntPtr BNUnicodeUTF16ToUTF8( + + // uint8_t* utf16 + IntPtr utf16 , + + // uint64_t len + ulong len + + ); + } +} \ No newline at end of file diff --git a/Function/BNUnicodeUTF32ToUTF8.cs b/Function/BNUnicodeUTF32ToUTF8.cs new file mode 100644 index 0000000..06317d5 --- /dev/null +++ b/Function/BNUnicodeUTF32ToUTF8.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNUnicodeUTF32ToUTF8(uint8_t* utf32) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNUnicodeUTF32ToUTF8" + )] + internal static extern IntPtr BNUnicodeUTF32ToUTF8( + + // uint8_t* utf32 + IntPtr utf32 + + ); + } +} \ No newline at end of file diff --git a/Function/BNUnmergeVariables.cs b/Function/BNUnmergeVariables.cs new file mode 100644 index 0000000..1d575cc --- /dev/null +++ b/Function/BNUnmergeVariables.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNUnmergeVariables(BNFunction* func, BNVariable* target, BNVariable* sources, uint64_t sourceCount) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNUnmergeVariables" + )] + internal static extern void BNUnmergeVariables( + + // BNFunction* func + IntPtr func , + + // BNVariable* target + IntPtr target , + + // BNVariable* sources + IntPtr sources , + + // uint64_t sourceCount + ulong sourceCount + + ); + } +} \ No newline at end of file diff --git a/Function/BNUnregisterDataNotification.cs b/Function/BNUnregisterDataNotification.cs new file mode 100644 index 0000000..b7305d1 --- /dev/null +++ b/Function/BNUnregisterDataNotification.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNUnregisterDataNotification(BNBinaryView* view, BNBinaryDataNotification* notify) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNUnregisterDataNotification" + )] + internal static extern void BNUnregisterDataNotification( + + // BNBinaryView* view + IntPtr view , + + // BNBinaryDataNotification* notify + IntPtr notify + + ); + } +} \ No newline at end of file diff --git a/Function/BNUnregisterDebugInfoParser.cs b/Function/BNUnregisterDebugInfoParser.cs new file mode 100644 index 0000000..e084b16 --- /dev/null +++ b/Function/BNUnregisterDebugInfoParser.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNUnregisterDebugInfoParser(const char* rawName) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNUnregisterDebugInfoParser" + )] + internal static extern void BNUnregisterDebugInfoParser( + + // const char* rawName + string rawName + + ); + } +} \ No newline at end of file diff --git a/Function/BNUnregisterEnterpriseServerNotification.cs b/Function/BNUnregisterEnterpriseServerNotification.cs new file mode 100644 index 0000000..b2257ff --- /dev/null +++ b/Function/BNUnregisterEnterpriseServerNotification.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNUnregisterEnterpriseServerNotification(BNEnterpriseServerCallbacks* notify) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNUnregisterEnterpriseServerNotification" + )] + internal static extern void BNUnregisterEnterpriseServerNotification( + + // BNEnterpriseServerCallbacks* notify + IntPtr notify + + ); + } +} \ No newline at end of file diff --git a/Function/BNUnregisterLogListener.cs b/Function/BNUnregisterLogListener.cs new file mode 100644 index 0000000..bbcb943 --- /dev/null +++ b/Function/BNUnregisterLogListener.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNUnregisterLogListener(BNLogListener* listener) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNUnregisterLogListener" + )] + internal static extern void BNUnregisterLogListener( + + // BNLogListener* listener + IntPtr listener + ); + } +} \ No newline at end of file diff --git a/Function/BNUnregisterObjectDestructionCallbacks.cs b/Function/BNUnregisterObjectDestructionCallbacks.cs new file mode 100644 index 0000000..eb29293 --- /dev/null +++ b/Function/BNUnregisterObjectDestructionCallbacks.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNUnregisterObjectDestructionCallbacks(BNObjectDestructionCallbacks* callbacks) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNUnregisterObjectDestructionCallbacks" + )] + internal static extern void BNUnregisterObjectDestructionCallbacks( + + // BNObjectDestructionCallbacks* callbacks + IntPtr callbacks + + ); + } +} \ No newline at end of file diff --git a/Function/BNUnregisterObjectRefDebugTrace.cs b/Function/BNUnregisterObjectRefDebugTrace.cs new file mode 100644 index 0000000..bf913d2 --- /dev/null +++ b/Function/BNUnregisterObjectRefDebugTrace.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNUnregisterObjectRefDebugTrace(const char* typeName, void* trace) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNUnregisterObjectRefDebugTrace" + )] + internal static extern void BNUnregisterObjectRefDebugTrace( + + // const char* typeName + string typeName , + + // void* trace + IntPtr trace + + ); + } +} \ No newline at end of file diff --git a/Function/BNUnregisterProjectNotification.cs b/Function/BNUnregisterProjectNotification.cs new file mode 100644 index 0000000..5fcf069 --- /dev/null +++ b/Function/BNUnregisterProjectNotification.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNUnregisterProjectNotification(BNProject* project, BNProjectNotification* notify) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNUnregisterProjectNotification" + )] + internal static extern void BNUnregisterProjectNotification( + + // BNProject* project + IntPtr project , + + // BNProjectNotification* notify + IntPtr notify + + ); + } +} \ No newline at end of file diff --git a/Function/BNUnregisterScriptingInstanceOutputListener.cs b/Function/BNUnregisterScriptingInstanceOutputListener.cs new file mode 100644 index 0000000..aa26557 --- /dev/null +++ b/Function/BNUnregisterScriptingInstanceOutputListener.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNUnregisterScriptingInstanceOutputListener(BNScriptingInstance* instance, BNScriptingOutputListener* callbacks) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNUnregisterScriptingInstanceOutputListener" + )] + internal static extern void BNUnregisterScriptingInstanceOutputListener( + + // BNScriptingInstance* instance + IntPtr instance , + + // BNScriptingOutputListener* callbacks + IntPtr callbacks + + ); + } +} \ No newline at end of file diff --git a/Function/BNUnregisterTypeArchiveNotification.cs b/Function/BNUnregisterTypeArchiveNotification.cs new file mode 100644 index 0000000..947287f --- /dev/null +++ b/Function/BNUnregisterTypeArchiveNotification.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNUnregisterTypeArchiveNotification(BNTypeArchive* archive, BNTypeArchiveNotification* notification) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNUnregisterTypeArchiveNotification" + )] + internal static extern void BNUnregisterTypeArchiveNotification( + + // BNTypeArchive* archive + IntPtr archive , + + // BNTypeArchiveNotification* notification + IntPtr notification + + ); + } +} \ No newline at end of file diff --git a/Function/BNUnregisterViewOfType.cs b/Function/BNUnregisterViewOfType.cs new file mode 100644 index 0000000..5a6705f --- /dev/null +++ b/Function/BNUnregisterViewOfType.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNUnregisterViewOfType(BNFileMetadata* file, const char* type, BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNUnregisterViewOfType" + )] + internal static extern void BNUnregisterViewOfType( + + // BNFileMetadata* file + IntPtr file , + + // const char* type + string type , + + // BNBinaryView* view + IntPtr view + ); + } +} \ No newline at end of file diff --git a/Function/BNUnsplitVariable.cs b/Function/BNUnsplitVariable.cs new file mode 100644 index 0000000..69b8cd0 --- /dev/null +++ b/Function/BNUnsplitVariable.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNUnsplitVariable(BNFunction* func, BNVariable* var) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNUnsplitVariable" + )] + internal static extern void BNUnsplitVariable( + + // BNFunction* func + IntPtr func , + + // BNVariable* _var + IntPtr _var + + ); + } +} \ No newline at end of file diff --git a/Function/BNUpdateAnalysis.cs b/Function/BNUpdateAnalysis.cs new file mode 100644 index 0000000..c139543 --- /dev/null +++ b/Function/BNUpdateAnalysis.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNUpdateAnalysis(BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNUpdateAnalysis" + )] + internal static extern void BNUpdateAnalysis( + + // BNBinaryView* view + IntPtr view + ); + } +} \ No newline at end of file diff --git a/Function/BNUpdateAnalysisAndWait.cs b/Function/BNUpdateAnalysisAndWait.cs new file mode 100644 index 0000000..63152d8 --- /dev/null +++ b/Function/BNUpdateAnalysisAndWait.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNUpdateAnalysisAndWait(BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNUpdateAnalysisAndWait" + )] + internal static extern void BNUpdateAnalysisAndWait( + + // BNBinaryView* view + IntPtr view + ); + } +} \ No newline at end of file diff --git a/Function/BNUpdateEnterpriseServerLicense.cs b/Function/BNUpdateEnterpriseServerLicense.cs new file mode 100644 index 0000000..4bd357b --- /dev/null +++ b/Function/BNUpdateEnterpriseServerLicense.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNUpdateEnterpriseServerLicense(uint64_t timeout) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNUpdateEnterpriseServerLicense" + )] + internal static extern bool BNUpdateEnterpriseServerLicense( + + // uint64_t timeout + ulong timeout + + ); + } +} \ No newline at end of file diff --git a/Function/BNUpdateFlowGraph.cs b/Function/BNUpdateFlowGraph.cs new file mode 100644 index 0000000..6d77243 --- /dev/null +++ b/Function/BNUpdateFlowGraph.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFlowGraph* BNUpdateFlowGraph(BNFlowGraph* graph) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNUpdateFlowGraph" + )] + internal static extern IntPtr BNUpdateFlowGraph( + + // BNFlowGraph* graph + IntPtr graph + ); + } +} \ No newline at end of file diff --git a/Function/BNUpdateHighLevelILOperand.cs b/Function/BNUpdateHighLevelILOperand.cs new file mode 100644 index 0000000..4bcb4b4 --- /dev/null +++ b/Function/BNUpdateHighLevelILOperand.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNUpdateHighLevelILOperand(BNHighLevelILFunction* func, uint64_t instr, uint64_t operandIndex, uint64_t value) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNUpdateHighLevelILOperand" + )] + internal static extern void BNUpdateHighLevelILOperand( + + // BNHighLevelILFunction* func + IntPtr func , + + // uint64_t instr + ulong instr , + + // uint64_t operandIndex + ulong operandIndex , + + // uint64_t _value + ulong _value + + ); + } +} \ No newline at end of file diff --git a/Function/BNUpdateLogListeners.cs b/Function/BNUpdateLogListeners.cs new file mode 100644 index 0000000..5495901 --- /dev/null +++ b/Function/BNUpdateLogListeners.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNUpdateLogListeners() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNUpdateLogListeners" + )] + public static extern void BNUpdateLogListeners(); + } +} \ No newline at end of file diff --git a/Function/BNUpdateLowLevelILOperand.cs b/Function/BNUpdateLowLevelILOperand.cs new file mode 100644 index 0000000..eaf7910 --- /dev/null +++ b/Function/BNUpdateLowLevelILOperand.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNUpdateLowLevelILOperand(BNLowLevelILFunction* func, uint64_t instr, uint64_t operandIndex, uint64_t value) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNUpdateLowLevelILOperand" + )] + internal static extern void BNUpdateLowLevelILOperand( + + // BNLowLevelILFunction* func + IntPtr func , + + // uint64_t instr + LowLevelILInstructionIndex instr , + + // uint64_t operandIndex + OperandIndex operandIndex , + + // uint64_t _value + ulong _value + ); + } +} \ No newline at end of file diff --git a/Function/BNUpdateMediumLevelILOperand.cs b/Function/BNUpdateMediumLevelILOperand.cs new file mode 100644 index 0000000..ae0484b --- /dev/null +++ b/Function/BNUpdateMediumLevelILOperand.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNUpdateMediumLevelILOperand(BNMediumLevelILFunction* func, uint64_t instr, uint64_t operandIndex, uint64_t value) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNUpdateMediumLevelILOperand" + )] + internal static extern void BNUpdateMediumLevelILOperand( + + // BNMediumLevelILFunction* func + IntPtr func , + + // uint64_t instr + ulong instr , + + // uint64_t operandIndex + ulong operandIndex , + + // uint64_t _value + ulong _value + + ); + } +} \ No newline at end of file diff --git a/Function/BNUpdateReportFlowGraph.cs b/Function/BNUpdateReportFlowGraph.cs new file mode 100644 index 0000000..5b4ca80 --- /dev/null +++ b/Function/BNUpdateReportFlowGraph.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNUpdateReportFlowGraph(BNReportCollection* reports, uint64_t i, BNFlowGraph* graph) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNUpdateReportFlowGraph" + )] + internal static extern void BNUpdateReportFlowGraph( + + // BNReportCollection* reports + IntPtr reports , + + // uint64_t i + ulong i , + + // BNFlowGraph* graph + IntPtr graph + + ); + } +} \ No newline at end of file diff --git a/Function/BNUpdateToLatestVersion.cs b/Function/BNUpdateToLatestVersion.cs new file mode 100644 index 0000000..daaa539 --- /dev/null +++ b/Function/BNUpdateToLatestVersion.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNUpdateResult BNUpdateToLatestVersion(const char* channel, const char** errors, void** progress, void* context) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNUpdateToLatestVersion" + )] + internal static extern UpdateResult BNUpdateToLatestVersion( + + // const char* channel + string channel , + + // const char** errors + string[] errors , + + // void** progress + IntPtr progress , + + // void* context + IntPtr context + + ); + } +} \ No newline at end of file diff --git a/Function/BNUpdateToVersion.cs b/Function/BNUpdateToVersion.cs new file mode 100644 index 0000000..e82347f --- /dev/null +++ b/Function/BNUpdateToVersion.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNUpdateResult BNUpdateToVersion(const char* channel, const char* version, const char** errors, void** progress, void* context) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNUpdateToVersion" + )] + internal static extern UpdateResult BNUpdateToVersion( + + // const char* channel + string channel , + + // const char* version + string version , + + // const char** errors + string[] errors , + + // void** progress + IntPtr progress , + + // void* context + IntPtr context + + ); + } +} \ No newline at end of file diff --git a/Function/BNUpdatesChecked.cs b/Function/BNUpdatesChecked.cs new file mode 100644 index 0000000..dcae159 --- /dev/null +++ b/Function/BNUpdatesChecked.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNUpdatesChecked() + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNUpdatesChecked" + )] + internal static extern void BNUpdatesChecked( + + ); + } +} \ No newline at end of file diff --git a/Function/BNUserGlobalPointerValueSet.cs b/Function/BNUserGlobalPointerValueSet.cs new file mode 100644 index 0000000..14621ba --- /dev/null +++ b/Function/BNUserGlobalPointerValueSet.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNUserGlobalPointerValueSet(BNBinaryView* view) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNUserGlobalPointerValueSet" + )] + internal static extern bool BNUserGlobalPointerValueSet( + + // BNBinaryView* view + IntPtr view + ); + } +} \ No newline at end of file diff --git a/Function/BNVersionLessThan.cs b/Function/BNVersionLessThan.cs new file mode 100644 index 0000000..96043a3 --- /dev/null +++ b/Function/BNVersionLessThan.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNVersionLessThan(BNVersionInfo smaller, BNVersionInfo larger) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNVersionLessThan" + )] + internal static extern bool BNVersionLessThan( + + // BNVersionInfo smaller + VersionInfo smaller , + + // BNVersionInfo larger + VersionInfo larger + + ); + } +} \ No newline at end of file diff --git a/Function/BNWaitForMainThreadAction.cs b/Function/BNWaitForMainThreadAction.cs new file mode 100644 index 0000000..505b141 --- /dev/null +++ b/Function/BNWaitForMainThreadAction.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNWaitForMainThreadAction(BNMainThreadAction* action) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNWaitForMainThreadAction" + )] + internal static extern void BNWaitForMainThreadAction( + + // BNMainThreadAction* action + IntPtr action + + ); + } +} \ No newline at end of file diff --git a/Function/BNWasFunctionAutomaticallyDiscovered.cs b/Function/BNWasFunctionAutomaticallyDiscovered.cs new file mode 100644 index 0000000..813dd57 --- /dev/null +++ b/Function/BNWasFunctionAutomaticallyDiscovered.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNWasFunctionAutomaticallyDiscovered(BNFunction* func) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNWasFunctionAutomaticallyDiscovered" + )] + internal static extern bool BNWasFunctionAutomaticallyDiscovered( + + // BNFunction* func + IntPtr func + ); + } +} \ No newline at end of file diff --git a/Function/BNWorkerEnqueue.cs b/Function/BNWorkerEnqueue.cs new file mode 100644 index 0000000..200c461 --- /dev/null +++ b/Function/BNWorkerEnqueue.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNWorkerEnqueue(void* ctxt, void** action) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNWorkerEnqueue" + )] + internal static extern void BNWorkerEnqueue( + + // void* ctxt + IntPtr ctxt , + + // void** action + IntPtr action + + ); + } +} \ No newline at end of file diff --git a/Function/BNWorkerEnqueueNamed.cs b/Function/BNWorkerEnqueueNamed.cs new file mode 100644 index 0000000..da42129 --- /dev/null +++ b/Function/BNWorkerEnqueueNamed.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNWorkerEnqueueNamed(void* ctxt, void** action, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNWorkerEnqueueNamed" + )] + internal static extern void BNWorkerEnqueueNamed( + + // void* ctxt + IntPtr ctxt , + + // void** action + IntPtr action , + + // const char* name + string name + + ); + } +} \ No newline at end of file diff --git a/Function/BNWorkerInteractiveEnqueue.cs b/Function/BNWorkerInteractiveEnqueue.cs new file mode 100644 index 0000000..07338b2 --- /dev/null +++ b/Function/BNWorkerInteractiveEnqueue.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNWorkerInteractiveEnqueue(void* ctxt, void** action) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNWorkerInteractiveEnqueue" + )] + internal static extern void BNWorkerInteractiveEnqueue( + + // void* ctxt + IntPtr ctxt , + + // void** action + IntPtr action + + ); + } +} \ No newline at end of file diff --git a/Function/BNWorkerInteractiveEnqueueNamed.cs b/Function/BNWorkerInteractiveEnqueueNamed.cs new file mode 100644 index 0000000..2d5cabe --- /dev/null +++ b/Function/BNWorkerInteractiveEnqueueNamed.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNWorkerInteractiveEnqueueNamed(void* ctxt, void** action, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNWorkerInteractiveEnqueueNamed" + )] + internal static extern void BNWorkerInteractiveEnqueueNamed( + + // void* ctxt + IntPtr ctxt , + + // void** action + IntPtr action , + + // const char* name + string name + + ); + } +} \ No newline at end of file diff --git a/Function/BNWorkerPriorityEnqueue.cs b/Function/BNWorkerPriorityEnqueue.cs new file mode 100644 index 0000000..ec11ef8 --- /dev/null +++ b/Function/BNWorkerPriorityEnqueue.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNWorkerPriorityEnqueue(void* ctxt, void** action) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNWorkerPriorityEnqueue" + )] + internal static extern void BNWorkerPriorityEnqueue( + + // void* ctxt + IntPtr ctxt , + + // void** action + IntPtr action + + ); + } +} \ No newline at end of file diff --git a/Function/BNWorkerPriorityEnqueueNamed.cs b/Function/BNWorkerPriorityEnqueueNamed.cs new file mode 100644 index 0000000..b0860c6 --- /dev/null +++ b/Function/BNWorkerPriorityEnqueueNamed.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNWorkerPriorityEnqueueNamed(void* ctxt, void** action, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNWorkerPriorityEnqueueNamed" + )] + internal static extern void BNWorkerPriorityEnqueueNamed( + + // void* ctxt + IntPtr ctxt , + + // void** action + IntPtr action , + + // const char* name + string name + + ); + } +} \ No newline at end of file diff --git a/Function/BNWorkflowAssignSubactivities.cs b/Function/BNWorkflowAssignSubactivities.cs new file mode 100644 index 0000000..0f8f0a1 --- /dev/null +++ b/Function/BNWorkflowAssignSubactivities.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNWorkflowAssignSubactivities(BNWorkflow* workflow, const char* activity, const char** activities, uint64_t size) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNWorkflowAssignSubactivities" + )] + internal static extern bool BNWorkflowAssignSubactivities( + + // BNWorkflow* workflow + IntPtr workflow , + + // const char* activity + string activity , + + // const char** activities + string[] activities , + + // uint64_t size + ulong size + + ); + } +} \ No newline at end of file diff --git a/Function/BNWorkflowClear.cs b/Function/BNWorkflowClear.cs new file mode 100644 index 0000000..b9f2fca --- /dev/null +++ b/Function/BNWorkflowClear.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNWorkflowClear(BNWorkflow* workflow) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNWorkflowClear" + )] + internal static extern bool BNWorkflowClear( + + // BNWorkflow* workflow + IntPtr workflow + + ); + } +} \ No newline at end of file diff --git a/Function/BNWorkflowClone.cs b/Function/BNWorkflowClone.cs new file mode 100644 index 0000000..d22794d --- /dev/null +++ b/Function/BNWorkflowClone.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNWorkflow* BNWorkflowClone(BNWorkflow* workflow, const char* name, const char* activity) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNWorkflowClone" + )] + internal static extern IntPtr BNWorkflowClone( + + // BNWorkflow* workflow + IntPtr workflow , + + // const char* name + string name , + + // const char* activity + string activity + ); + } +} \ No newline at end of file diff --git a/Function/BNWorkflowContains.cs b/Function/BNWorkflowContains.cs new file mode 100644 index 0000000..11a9c9c --- /dev/null +++ b/Function/BNWorkflowContains.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNWorkflowContains(BNWorkflow* workflow, const char* activity) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNWorkflowContains" + )] + internal static extern bool BNWorkflowContains( + + // BNWorkflow* workflow + IntPtr workflow , + + // const char* activity + string activity + + ); + } +} \ No newline at end of file diff --git a/Function/BNWorkflowGet.cs b/Function/BNWorkflowGet.cs new file mode 100644 index 0000000..189b8ca --- /dev/null +++ b/Function/BNWorkflowGet.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNWorkflow* BNWorkflowGet(const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNWorkflowGet" + )] + internal static extern IntPtr BNWorkflowGet( + + // const char* name + string name + + ); + } +} \ No newline at end of file diff --git a/Function/BNWorkflowGetActivity.cs b/Function/BNWorkflowGetActivity.cs new file mode 100644 index 0000000..e176232 --- /dev/null +++ b/Function/BNWorkflowGetActivity.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNActivity* BNWorkflowGetActivity(BNWorkflow* workflow, const char* activity) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNWorkflowGetActivity" + )] + internal static extern IntPtr BNWorkflowGetActivity( + + // BNWorkflow* workflow + IntPtr workflow , + + // const char* activity + string activity + + ); + } +} \ No newline at end of file diff --git a/Function/BNWorkflowGetActivityRoots.cs b/Function/BNWorkflowGetActivityRoots.cs new file mode 100644 index 0000000..f51d457 --- /dev/null +++ b/Function/BNWorkflowGetActivityRoots.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char** BNWorkflowGetActivityRoots(BNWorkflow* workflow, const char* activity, uint64_t* inoutSize) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNWorkflowGetActivityRoots" + )] + internal static extern IntPtr BNWorkflowGetActivityRoots( + + // BNWorkflow* workflow + IntPtr workflow , + + // const char* activity + string activity , + + // uint64_t* inoutSize + ref ulong inoutSize + ); + } +} \ No newline at end of file diff --git a/Function/BNWorkflowGetConfiguration.cs b/Function/BNWorkflowGetConfiguration.cs new file mode 100644 index 0000000..fff0b5b --- /dev/null +++ b/Function/BNWorkflowGetConfiguration.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char* BNWorkflowGetConfiguration(BNWorkflow* workflow, const char* activity) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNWorkflowGetConfiguration" + )] + internal static extern IntPtr BNWorkflowGetConfiguration( + + // BNWorkflow* workflow + IntPtr workflow , + + // const char* activity + string activity + + ); + } +} \ No newline at end of file diff --git a/Function/BNWorkflowGetEligibilitySettings.cs b/Function/BNWorkflowGetEligibilitySettings.cs new file mode 100644 index 0000000..014cc7a --- /dev/null +++ b/Function/BNWorkflowGetEligibilitySettings.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// const char** BNWorkflowGetEligibilitySettings(BNWorkflow* workflow, uint64_t* inoutSize) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNWorkflowGetEligibilitySettings" + )] + internal static extern IntPtr BNWorkflowGetEligibilitySettings( + + // BNWorkflow* workflow + IntPtr workflow , + + // uint64_t* inoutSize + IntPtr inoutSize + + ); + } +} \ No newline at end of file diff --git a/Function/BNWorkflowGetGraph.cs b/Function/BNWorkflowGetGraph.cs new file mode 100644 index 0000000..43e3bc7 --- /dev/null +++ b/Function/BNWorkflowGetGraph.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNFlowGraph* BNWorkflowGetGraph(BNWorkflow* workflow, const char* activity, bool sequential) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNWorkflowGetGraph" + )] + internal static extern IntPtr BNWorkflowGetGraph( + + // BNWorkflow* workflow + IntPtr workflow , + + // const char* activity + string activity , + + // bool sequential + bool sequential + + ); + } +} \ No newline at end of file diff --git a/Function/BNWorkflowGetOrCreate.cs b/Function/BNWorkflowGetOrCreate.cs new file mode 100644 index 0000000..bb29017 --- /dev/null +++ b/Function/BNWorkflowGetOrCreate.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNWorkflow* BNWorkflowGetOrCreate(const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNWorkflowGetOrCreate" + )] + internal static extern IntPtr BNWorkflowGetOrCreate( + + // const char* name + string name + ); + } +} \ No newline at end of file diff --git a/Function/BNWorkflowGetSubactivities.cs b/Function/BNWorkflowGetSubactivities.cs new file mode 100644 index 0000000..9d3f6e7 --- /dev/null +++ b/Function/BNWorkflowGetSubactivities.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// char** BNWorkflowGetSubactivities(BNWorkflow* workflow, const char* activity, bool immediate, uint64_t* inoutSize) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNWorkflowGetSubactivities" + )] + internal static extern IntPtr BNWorkflowGetSubactivities( + + // BNWorkflow* workflow + IntPtr workflow , + + // const char* activity + string activity , + + // bool immediate + bool immediate , + + // uint64_t* inoutSize + ref ulong inoutSize + ); + } +} \ No newline at end of file diff --git a/Function/BNWorkflowInsert.cs b/Function/BNWorkflowInsert.cs new file mode 100644 index 0000000..2d29851 --- /dev/null +++ b/Function/BNWorkflowInsert.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNWorkflowInsert(BNWorkflow* workflow, const char* activity, const char** activities, uint64_t size) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNWorkflowInsert" + )] + internal static extern bool BNWorkflowInsert( + + // BNWorkflow* workflow + IntPtr workflow , + + // const char* activity + string activity , + + // const char** activities + string[] activities , + + // uint64_t size + ulong size + ); + } +} \ No newline at end of file diff --git a/Function/BNWorkflowInsertAfter.cs b/Function/BNWorkflowInsertAfter.cs new file mode 100644 index 0000000..ffe22d9 --- /dev/null +++ b/Function/BNWorkflowInsertAfter.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNWorkflowInsertAfter(BNWorkflow* workflow, const char* activity, const char** activities, uint64_t size) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNWorkflowInsertAfter" + )] + internal static extern bool BNWorkflowInsertAfter( + + // BNWorkflow* workflow + IntPtr workflow , + + // const char* activity + string activity , + + // const char** activities + string[] activities , + + // uint64_t size + ulong size + + ); + } +} \ No newline at end of file diff --git a/Function/BNWorkflowIsRegistered.cs b/Function/BNWorkflowIsRegistered.cs new file mode 100644 index 0000000..3cfd63d --- /dev/null +++ b/Function/BNWorkflowIsRegistered.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNWorkflowIsRegistered(BNWorkflow* workflow) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNWorkflowIsRegistered" + )] + internal static extern bool BNWorkflowIsRegistered( + + // BNWorkflow* workflow + IntPtr workflow + ); + } +} \ No newline at end of file diff --git a/Function/BNWorkflowRegisterActivity.cs b/Function/BNWorkflowRegisterActivity.cs new file mode 100644 index 0000000..a310fe5 --- /dev/null +++ b/Function/BNWorkflowRegisterActivity.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNActivity* BNWorkflowRegisterActivity(BNWorkflow* workflow, BNActivity* activity, const char** subactivities, uint64_t size) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNWorkflowRegisterActivity" + )] + internal static extern IntPtr BNWorkflowRegisterActivity( + + // BNWorkflow* workflow + IntPtr workflow , + + // BNActivity* activity + IntPtr activity , + + // const char** subactivities + string[] subactivities , + + // uint64_t size + ulong size + + ); + } +} \ No newline at end of file diff --git a/Function/BNWorkflowRemove.cs b/Function/BNWorkflowRemove.cs new file mode 100644 index 0000000..d57d220 --- /dev/null +++ b/Function/BNWorkflowRemove.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNWorkflowRemove(BNWorkflow* workflow, const char* activity) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNWorkflowRemove" + )] + internal static extern bool BNWorkflowRemove( + + // BNWorkflow* workflow + IntPtr workflow , + + // const char* activity + string activity + + ); + } +} \ No newline at end of file diff --git a/Function/BNWorkflowReplace.cs b/Function/BNWorkflowReplace.cs new file mode 100644 index 0000000..023c939 --- /dev/null +++ b/Function/BNWorkflowReplace.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNWorkflowReplace(BNWorkflow* workflow, const char* activity, const char* newActivity) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNWorkflowReplace" + )] + internal static extern bool BNWorkflowReplace( + + // BNWorkflow* workflow + IntPtr workflow , + + // const char* activity + string activity , + + // const char* newActivity + string newActivity + + ); + } +} \ No newline at end of file diff --git a/Function/BNWorkflowShowReport.cs b/Function/BNWorkflowShowReport.cs new file mode 100644 index 0000000..b26c162 --- /dev/null +++ b/Function/BNWorkflowShowReport.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// void BNWorkflowShowReport(BNWorkflow* workflow, const char* name) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNWorkflowShowReport" + )] + internal static extern void BNWorkflowShowReport( + + // BNWorkflow* workflow + IntPtr workflow , + + // const char* name + string name + + ); + } +} \ No newline at end of file diff --git a/Function/BNWorkflowSize.cs b/Function/BNWorkflowSize.cs new file mode 100644 index 0000000..a6266ac --- /dev/null +++ b/Function/BNWorkflowSize.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNWorkflowSize(BNWorkflow* workflow) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNWorkflowSize" + )] + internal static extern ulong BNWorkflowSize( + + // BNWorkflow* workflow + IntPtr workflow + ); + } +} \ No newline at end of file diff --git a/Function/BNWrite16.cs b/Function/BNWrite16.cs new file mode 100644 index 0000000..325619d --- /dev/null +++ b/Function/BNWrite16.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNWrite16(BNBinaryWriter* stream, uint16_t val) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNWrite16" + )] + internal static extern bool BNWrite16( + + // BNBinaryWriter* stream + IntPtr stream , + + // uint16_t val + ushort val + ); + } +} \ No newline at end of file diff --git a/Function/BNWrite32.cs b/Function/BNWrite32.cs new file mode 100644 index 0000000..4f90819 --- /dev/null +++ b/Function/BNWrite32.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNWrite32(BNBinaryWriter* stream, uint32_t val) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNWrite32" + )] + internal static extern bool BNWrite32( + + // BNBinaryWriter* stream + IntPtr stream , + + // uint32_t val + uint val + ); + } +} \ No newline at end of file diff --git a/Function/BNWrite64.cs b/Function/BNWrite64.cs new file mode 100644 index 0000000..09487ed --- /dev/null +++ b/Function/BNWrite64.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNWrite64(BNBinaryWriter* stream, uint64_t val) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNWrite64" + )] + internal static extern bool BNWrite64( + + // BNBinaryWriter* stream + IntPtr stream , + + // uint64_t val + ulong val + ); + } +} \ No newline at end of file diff --git a/Function/BNWrite8.cs b/Function/BNWrite8.cs new file mode 100644 index 0000000..902a2a6 --- /dev/null +++ b/Function/BNWrite8.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNWrite8(BNBinaryWriter* stream, uint8_t val) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNWrite8" + )] + internal static extern bool BNWrite8( + + // BNBinaryWriter* stream + IntPtr stream , + + // uint8_t val + byte val + ); + } +} \ No newline at end of file diff --git a/Function/BNWriteBE16.cs b/Function/BNWriteBE16.cs new file mode 100644 index 0000000..1a5cc5c --- /dev/null +++ b/Function/BNWriteBE16.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNWriteBE16(BNBinaryWriter* stream, uint16_t val) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNWriteBE16" + )] + internal static extern bool BNWriteBE16( + + // BNBinaryWriter* stream + IntPtr stream , + + // uint16_t val + ushort val + ); + } +} \ No newline at end of file diff --git a/Function/BNWriteBE32.cs b/Function/BNWriteBE32.cs new file mode 100644 index 0000000..c7e583a --- /dev/null +++ b/Function/BNWriteBE32.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNWriteBE32(BNBinaryWriter* stream, uint32_t val) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNWriteBE32" + )] + internal static extern bool BNWriteBE32( + + // BNBinaryWriter* stream + IntPtr stream , + + // uint32_t val + uint val + + ); + } +} \ No newline at end of file diff --git a/Function/BNWriteBE64.cs b/Function/BNWriteBE64.cs new file mode 100644 index 0000000..bda4ab1 --- /dev/null +++ b/Function/BNWriteBE64.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNWriteBE64(BNBinaryWriter* stream, uint64_t val) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNWriteBE64" + )] + internal static extern bool BNWriteBE64( + + // BNBinaryWriter* stream + IntPtr stream , + + // uint64_t val + ulong val + + ); + } +} \ No newline at end of file diff --git a/Function/BNWriteData.cs b/Function/BNWriteData.cs new file mode 100644 index 0000000..5496434 --- /dev/null +++ b/Function/BNWriteData.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNWriteData(BNBinaryWriter* stream, void* src, uint64_t len) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNWriteData" + )] + internal static extern bool BNWriteData( + + // BNBinaryWriter* stream + IntPtr stream , + + // void* src + byte[] src , + + // uint64_t len + ulong len + ); + } +} \ No newline at end of file diff --git a/Function/BNWriteDataForDownloadInstance.cs b/Function/BNWriteDataForDownloadInstance.cs new file mode 100644 index 0000000..758c654 --- /dev/null +++ b/Function/BNWriteDataForDownloadInstance.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNWriteDataForDownloadInstance(BNDownloadInstance* instance, uint8_t* data, uint64_t len) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNWriteDataForDownloadInstance" + )] + internal static extern ulong BNWriteDataForDownloadInstance( + + // BNDownloadInstance* instance + IntPtr instance , + + // uint8_t* data + IntPtr data , + + // uint64_t len + ulong len + + ); + } +} \ No newline at end of file diff --git a/Function/BNWriteDatabaseAnalysisCache.cs b/Function/BNWriteDatabaseAnalysisCache.cs new file mode 100644 index 0000000..50bf438 --- /dev/null +++ b/Function/BNWriteDatabaseAnalysisCache.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNWriteDatabaseAnalysisCache(BNDatabase* database, BNKeyValueStore* val) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNWriteDatabaseAnalysisCache" + )] + internal static extern bool BNWriteDatabaseAnalysisCache( + + // BNDatabase* database + IntPtr database , + + // BNKeyValueStore* val + IntPtr val + + ); + } +} \ No newline at end of file diff --git a/Function/BNWriteDatabaseGlobal.cs b/Function/BNWriteDatabaseGlobal.cs new file mode 100644 index 0000000..ff6168a --- /dev/null +++ b/Function/BNWriteDatabaseGlobal.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNWriteDatabaseGlobal(BNDatabase* database, const char* key, const char* val) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNWriteDatabaseGlobal" + )] + internal static extern bool BNWriteDatabaseGlobal( + + // BNDatabase* database + IntPtr database , + + // const char* key + string key , + + // const char* val + string val + + ); + } +} \ No newline at end of file diff --git a/Function/BNWriteDatabaseGlobalData.cs b/Function/BNWriteDatabaseGlobalData.cs new file mode 100644 index 0000000..0c904c5 --- /dev/null +++ b/Function/BNWriteDatabaseGlobalData.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNWriteDatabaseGlobalData(BNDatabase* database, const char* key, BNDataBuffer* val) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNWriteDatabaseGlobalData" + )] + internal static extern bool BNWriteDatabaseGlobalData( + + // BNDatabase* database + IntPtr database , + + // const char* key + string key , + + // BNDataBuffer* val + IntPtr val + + ); + } +} \ No newline at end of file diff --git a/Function/BNWriteDatabaseSnapshotData.cs b/Function/BNWriteDatabaseSnapshotData.cs new file mode 100644 index 0000000..34b06ad --- /dev/null +++ b/Function/BNWriteDatabaseSnapshotData.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// int64_t BNWriteDatabaseSnapshotData(BNDatabase* database, int64_t* parents, uint64_t parentCount, BNBinaryView* file, const char* name, BNKeyValueStore* data, bool autoSave, void* ctxt, void** progress) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNWriteDatabaseSnapshotData" + )] + internal static extern long BNWriteDatabaseSnapshotData( + + // BNDatabase* database + IntPtr database , + + // int64_t* parents + IntPtr parents , + + // uint64_t parentCount + ulong parentCount , + + // BNBinaryView* file + IntPtr file , + + // const char* name + string name , + + // BNKeyValueStore* data + IntPtr data , + + // bool autoSave + bool autoSave , + + // void* ctxt + IntPtr ctxt , + + // void** progress + IntPtr progress + + ); + } +} \ No newline at end of file diff --git a/Function/BNWriteLE16.cs b/Function/BNWriteLE16.cs new file mode 100644 index 0000000..b1552e8 --- /dev/null +++ b/Function/BNWriteLE16.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNWriteLE16(BNBinaryWriter* stream, uint16_t val) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNWriteLE16" + )] + internal static extern bool BNWriteLE16( + + // BNBinaryWriter* stream + IntPtr stream , + + // uint16_t val + ushort val + ); + } +} \ No newline at end of file diff --git a/Function/BNWriteLE32.cs b/Function/BNWriteLE32.cs new file mode 100644 index 0000000..457153c --- /dev/null +++ b/Function/BNWriteLE32.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNWriteLE32(BNBinaryWriter* stream, uint32_t val) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNWriteLE32" + )] + internal static extern bool BNWriteLE32( + + // BNBinaryWriter* stream + IntPtr stream , + + // uint32_t val + uint val + + ); + } +} \ No newline at end of file diff --git a/Function/BNWriteLE64.cs b/Function/BNWriteLE64.cs new file mode 100644 index 0000000..c6ee800 --- /dev/null +++ b/Function/BNWriteLE64.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNWriteLE64(BNBinaryWriter* stream, uint64_t val) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNWriteLE64" + )] + internal static extern bool BNWriteLE64( + + // BNBinaryWriter* stream + IntPtr stream , + + // uint64_t val + ulong val + + ); + } +} \ No newline at end of file diff --git a/Function/BNWriteTypeLibraryToFile.cs b/Function/BNWriteTypeLibraryToFile.cs new file mode 100644 index 0000000..f941163 --- /dev/null +++ b/Function/BNWriteTypeLibraryToFile.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// bool BNWriteTypeLibraryToFile(BNTypeLibrary* lib, const char* path) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNWriteTypeLibraryToFile" + )] + internal static extern bool BNWriteTypeLibraryToFile( + + // BNTypeLibrary* lib + IntPtr lib , + + // const char* path + string path + ); + } +} \ No newline at end of file diff --git a/Function/BNWriteViewBuffer.cs b/Function/BNWriteViewBuffer.cs new file mode 100644 index 0000000..4d70fb1 --- /dev/null +++ b/Function/BNWriteViewBuffer.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNWriteViewBuffer(BNBinaryView* view, uint64_t offset, BNDataBuffer* data) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNWriteViewBuffer" + )] + internal static extern ulong BNWriteViewBuffer( + + // BNBinaryView* view + IntPtr view , + + // uint64_t offset + ulong offset , + + // BNDataBuffer* data + IntPtr data + ); + } +} \ No newline at end of file diff --git a/Function/BNWriteViewData.cs b/Function/BNWriteViewData.cs new file mode 100644 index 0000000..51eca47 --- /dev/null +++ b/Function/BNWriteViewData.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNWriteViewData(BNBinaryView* view, uint64_t offset, void* data, uint64_t len) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNWriteViewData" + )] + internal static extern ulong BNWriteViewData( + + // BNBinaryView* view + IntPtr view , + + // uint64_t offset + ulong offset , + + // void* data + byte[] data , + + // uint64_t len + ulong len + ); + } +} \ No newline at end of file diff --git a/Function/BNWriteWebsocketClientData.cs b/Function/BNWriteWebsocketClientData.cs new file mode 100644 index 0000000..fcaf1fc --- /dev/null +++ b/Function/BNWriteWebsocketClientData.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// uint64_t BNWriteWebsocketClientData(BNWebsocketClient* client, uint8_t* data, uint64_t len) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNWriteWebsocketClientData" + )] + internal static extern ulong BNWriteWebsocketClientData( + + // BNWebsocketClient* client + IntPtr client , + + // uint8_t* data + IntPtr data , + + // uint64_t len + ulong len + + ); + } +} \ No newline at end of file diff --git a/Function/BNXzDecompress.cs b/Function/BNXzDecompress.cs new file mode 100644 index 0000000..fe95127 --- /dev/null +++ b/Function/BNXzDecompress.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDataBuffer* BNXzDecompress(BNDataBuffer* buf) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNXzDecompress" + )] + internal static extern IntPtr BNXzDecompress( + + // BNDataBuffer* buf + IntPtr buf + + ); + } +} \ No newline at end of file diff --git a/Function/BNZeroExtend.cs b/Function/BNZeroExtend.cs new file mode 100644 index 0000000..0565b02 --- /dev/null +++ b/Function/BNZeroExtend.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// int64_t BNZeroExtend(int64_t value, uint64_t sourceSize, uint64_t destSize) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + EntryPoint = "BNZeroExtend" + )] + internal static extern long BNZeroExtend( + + // int64_t _value + long _value , + + // uint64_t sourceSize + ulong sourceSize , + + // uint64_t destSize + ulong destSize + ); + } +} \ No newline at end of file diff --git a/Function/BNZlibCompress.cs b/Function/BNZlibCompress.cs new file mode 100644 index 0000000..30c2e8e --- /dev/null +++ b/Function/BNZlibCompress.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDataBuffer* BNZlibCompress(BNDataBuffer* buf) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNZlibCompress" + )] + internal static extern IntPtr BNZlibCompress( + + // BNDataBuffer* buf + IntPtr buf + + ); + } +} \ No newline at end of file diff --git a/Function/BNZlibDecompress.cs b/Function/BNZlibDecompress.cs new file mode 100644 index 0000000..acc4a41 --- /dev/null +++ b/Function/BNZlibDecompress.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + internal static partial class NativeMethods + { + /// + /// BNDataBuffer* BNZlibDecompress(BNDataBuffer* buf) + /// + [DllImport( + "binaryninjacore", + CallingConvention = System.Runtime.InteropServices.CallingConvention.Cdecl, + CharSet = CharSet.Ansi, + EntryPoint = "BNZlibDecompress" + )] + internal static extern IntPtr BNZlibDecompress( + + // BNDataBuffer* buf + IntPtr buf + + ); + } +} \ No newline at end of file diff --git a/Handle/BNActivity.cs b/Handle/BNActivity.cs new file mode 100644 index 0000000..9bef7de --- /dev/null +++ b/Handle/BNActivity.cs @@ -0,0 +1,103 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class Activity : AbstractSafeHandle + { + internal Activity(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static Activity? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new Activity( + NativeMethods.BNNewActivityReference(handle) , + true + ); + } + + internal static Activity MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new Activity( + NativeMethods.BNNewActivityReference(handle) , + true + ); + } + + internal static Activity? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new Activity(handle, true); + } + + internal static Activity MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new Activity(handle, true); + } + + internal static Activity? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new Activity(handle, false); + } + + internal static Activity MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new Activity(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeActivity(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + + public string Name + { + get + { + return UnsafeUtils.TakeAnsiString( + NativeMethods.BNActivityGetName(this.handle) + ); + } + } + } +} \ No newline at end of file diff --git a/Handle/BNAnalysisCompletionEvent.cs b/Handle/BNAnalysisCompletionEvent.cs new file mode 100644 index 0000000..2cffc3b --- /dev/null +++ b/Handle/BNAnalysisCompletionEvent.cs @@ -0,0 +1,93 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class AnalysisCompletionEvent : AbstractSafeHandle + { + internal AnalysisCompletionEvent(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static AnalysisCompletionEvent? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new AnalysisCompletionEvent( + NativeMethods.BNNewAnalysisCompletionEventReference(handle) , + true + ); + } + + internal static AnalysisCompletionEvent MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new AnalysisCompletionEvent( + NativeMethods.BNNewAnalysisCompletionEventReference(handle) , + true + ); + } + + internal static AnalysisCompletionEvent? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new AnalysisCompletionEvent(handle, true); + } + + internal static AnalysisCompletionEvent MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new AnalysisCompletionEvent(handle, true); + } + + internal static AnalysisCompletionEvent? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new AnalysisCompletionEvent(handle, false); + } + + internal static AnalysisCompletionEvent MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new AnalysisCompletionEvent(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeAnalysisCompletionEvent(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + } +} \ No newline at end of file diff --git a/Handle/BNAnalysisContext.cs b/Handle/BNAnalysisContext.cs new file mode 100644 index 0000000..a1151ca --- /dev/null +++ b/Handle/BNAnalysisContext.cs @@ -0,0 +1,94 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class AnalysisContext : AbstractSafeHandle + { + internal AnalysisContext(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + + internal static AnalysisContext? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new AnalysisContext( + NativeMethods.BNNewAnalysisContextReference(handle) , + true + ); + } + + internal static AnalysisContext MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new AnalysisContext( + NativeMethods.BNNewAnalysisContextReference(handle) , + true + ); + } + + internal static AnalysisContext? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new AnalysisContext(handle, true); + } + + internal static AnalysisContext MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new AnalysisContext(handle, true); + } + + internal static AnalysisContext? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new AnalysisContext(handle, false); + } + + internal static AnalysisContext MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new AnalysisContext(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeAnalysisContext(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + } +} \ No newline at end of file diff --git a/Handle/BNAnalysisMergeConflict.cs b/Handle/BNAnalysisMergeConflict.cs new file mode 100644 index 0000000..6ee020f --- /dev/null +++ b/Handle/BNAnalysisMergeConflict.cs @@ -0,0 +1,93 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class AnalysisMergeConflict : AbstractSafeHandle + { + internal AnalysisMergeConflict(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static AnalysisMergeConflict? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new AnalysisMergeConflict( + NativeMethods.BNNewAnalysisMergeConflictReference(handle) , + true + ); + } + + internal static AnalysisMergeConflict MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new AnalysisMergeConflict( + NativeMethods.BNNewAnalysisMergeConflictReference(handle) , + true + ); + } + + internal static AnalysisMergeConflict? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new AnalysisMergeConflict(handle, true); + } + + internal static AnalysisMergeConflict MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new AnalysisMergeConflict(handle, true); + } + + internal static AnalysisMergeConflict? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new AnalysisMergeConflict(handle, false); + } + + internal static AnalysisMergeConflict MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new AnalysisMergeConflict(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeAnalysisMergeConflict(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + } +} \ No newline at end of file diff --git a/Handle/BNAnalysisMergeConflictSplitter.cs b/Handle/BNAnalysisMergeConflictSplitter.cs new file mode 100644 index 0000000..df5f75c --- /dev/null +++ b/Handle/BNAnalysisMergeConflictSplitter.cs @@ -0,0 +1,37 @@ + +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class AnalysisMergeConflictSplitter : AbstractSafeHandle + { + internal AnalysisMergeConflictSplitter(IntPtr handle) + :base(handle, false) + { + + } + + internal static AnalysisMergeConflictSplitter? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new AnalysisMergeConflictSplitter(handle); + } + + internal static AnalysisMergeConflictSplitter MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new AnalysisMergeConflictSplitter(handle); + } + } +} \ No newline at end of file diff --git a/Handle/BNArchitecture.cs b/Handle/BNArchitecture.cs new file mode 100644 index 0000000..7b11242 --- /dev/null +++ b/Handle/BNArchitecture.cs @@ -0,0 +1,896 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class Architecture : AbstractSafeHandle + { + internal Architecture(IntPtr handle) + :base(handle, false) + { + + } + + internal static Architecture? FromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new Architecture(handle); + } + + internal static Architecture MustFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new Architecture(handle); + } + + public static Architecture? FromName(string name) + { + return Architecture.FromHandle( + NativeMethods.BNGetArchitectureByName(name) + ); + } + + public static Architecture[] GetAllArchitectures() + { + IntPtr arrayPointer = NativeMethods.BNGetArchitectureList( + out ulong arrayLength + ); + + return UnsafeUtils.TakeHandleArray( + arrayPointer , + arrayLength , + Architecture.MustFromHandle , + NativeMethods.BNFreeArchitectureList + ); + } + + public static Architecture NativeTypeParserArchitecture() + { + return Architecture.MustFromHandle( + NativeMethods.BNGetNativeTypeParserArchitecture() + ); + } + + public override string ToString() + { + return this.Name; + } + + public string Name + { + get + { + IntPtr raw = NativeMethods.BNGetArchitectureName(this.handle); + + return UnsafeUtils.TakeAnsiString(raw); + } + } + + public Endianness Endianness + { + get + { + return NativeMethods.BNGetArchitectureEndianness(this.handle);; + } + } + + public ulong AddressSize + { + get + { + return NativeMethods.BNGetArchitectureAddressSize(this.handle);; + } + } + + public ulong DefaultIntegerSize + { + get + { + return NativeMethods.BNGetArchitectureDefaultIntegerSize(this.handle);; + } + } + + public ulong InstructionAlignment + { + get + { + return NativeMethods.BNGetArchitectureInstructionAlignment(this.handle);; + } + } + + public ulong MaxInstructionLength + { + get + { + return NativeMethods.BNGetArchitectureMaxInstructionLength(this.handle);; + } + } + + public ulong OpcodeDisplayLength + { + get + { + return NativeMethods.BNGetArchitectureOpcodeDisplayLength(this.handle);; + } + } + + public ILRegister[] FullWidthRegisters + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetFullWidthArchitectureRegisters( + this.handle , + out ulong arrayLength + ); + + uint[] indexes = UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNFreeRegisterList + ); + + List targets = new List(); + + foreach (RegisterIndex index in indexes) + { + targets.Add( new ILRegister(this , index) ); + } + + return targets.ToArray(); + } + } + + public ILRegister[] Registers + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetAllArchitectureRegisters( + this.handle , + out ulong arrayLength + ); + + uint[] indexes = UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNFreeRegisterList + ); + + List targets = new List(); + + foreach (RegisterIndex index in indexes) + { + targets.Add( new ILRegister(this , index) ); + } + + return targets.ToArray(); + } + } + + public ILRegister[] GlobalRegister + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetArchitectureGlobalRegisters( + this.handle , + out ulong arrayLength + ); + + uint[] indexes = UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNFreeRegisterList + ); + + List targets = new List(); + + foreach (RegisterIndex index in indexes) + { + targets.Add( new ILRegister(this , index) ); + } + + return targets.ToArray(); + } + } + + public ILRegister[] SystemRegister + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetArchitectureSystemRegisters( + this.handle , + out ulong arrayLength + ); + + uint[] indexes = UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNFreeRegisterList + ); + + List targets = new List(); + + foreach (RegisterIndex index in indexes) + { + targets.Add( new ILRegister(this , index) ); + } + + return targets.ToArray(); + } + } + + public ILFlag[] Flags + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetAllArchitectureFlags( + this.handle , + out ulong arrayLength + ); + + uint[] indexes = UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNFreeRegisterList + ); + + List targets = new List(); + + foreach (FlagIndex index in indexes) + { + targets.Add( new ILFlag(this , index) ); + } + + return targets.ToArray(); + } + } + + public uint[] FlagWriteTypes + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetAllArchitectureFlagWriteTypes( + this.handle , + out ulong arrayLength + ); + + return UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNFreeRegisterList + ); + } + } + + public SemanticFlagClass[] SemanticFlagClasses + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetAllArchitectureSemanticFlagClasses( + this.handle , + out ulong arrayLength + ); + + uint[] indexes = UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNFreeRegisterList + ); + + List targets = new List(); + + foreach (SemanticFlagClassIndex index in indexes) + { + targets.Add( new SemanticFlagClass(this , index) ); + } + + return targets.ToArray(); + } + } + + public SemanticFlagGroup[] SemanticFlagGroups + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetAllArchitectureSemanticFlagGroups( + this.handle , + out ulong arrayLength + ); + + uint[] indexes = UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNFreeRegisterList + ); + + List targets = new List(); + + foreach (SemanticFlagGroupIndex index in indexes) + { + targets.Add( new SemanticFlagGroup(this , index) ); + } + + return targets.ToArray(); + } + } + + public BinaryNinja.CallingConvention[] CallingConventions + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetArchitectureCallingConventions( + this.handle , + out ulong arrayLength + ); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer , + arrayLength , + BinaryNinja.CallingConvention.MustNewFromHandle , + NativeMethods.BNFreeCallingConventionList + ); + } + } + + public Platform StandalonePlatform + { + get + { + return Platform.MustTakeHandle( + NativeMethods.BNGetArchitectureStandalonePlatform(this.handle ) + ); + } + } + + public TypeLibrary[] TypeLibrares + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetArchitectureTypeLibraries( + this.handle , + out ulong arrayLength + ); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer , + arrayLength , + TypeLibrary.MustNewFromHandle, + NativeMethods.BNFreeTypeLibraryList + ); + } + } + + public bool CanAssemble + { + get + { + return NativeMethods.BNCanArchitectureAssemble(this.handle); + } + } + + + public string GetFlagName(FlagIndex flag) + { + return UnsafeUtils.TakeAnsiString( + NativeMethods.BNGetArchitectureFlagName(this.handle, flag) + ); + } + + public string GetFlagWriteTypeName(uint flags) + { + return UnsafeUtils.TakeAnsiString( + NativeMethods.BNGetArchitectureFlagWriteTypeName(this.handle, flags) + ); + } + + public string GetSemanticFlagClassName(SemanticFlagClassIndex semClass) + { + return UnsafeUtils.TakeAnsiString( + NativeMethods.BNGetArchitectureSemanticFlagClassName(this.handle, semClass) + ); + } + + public string GetSemanticFlagGroupName(SemanticFlagGroupIndex semGroup) + { + return UnsafeUtils.TakeAnsiString( + NativeMethods.BNGetArchitectureSemanticFlagGroupName(this.handle, semGroup) + ); + } + + public FlagRole GetFlagRole(uint flag , uint semClass) + { + return NativeMethods.BNGetArchitectureFlagRole(this.handle, flag, semClass); + } + + public uint[] GetFlagsRequiredForFlagCondition( + LowLevelILFlagCondition condition, + uint semClass + ) + { + IntPtr arrayPointer = NativeMethods.BNGetArchitectureFlagsRequiredForFlagCondition( + this.handle , + condition , + semClass , + out ulong arrayLength + ); + + return UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNFreeRegisterList + ); + } + + public uint[] GetFlagsRequiredForSemanticFlagGroup( + uint semGroup + ) + { + IntPtr arrayPointer = NativeMethods.BNGetArchitectureFlagsRequiredForSemanticFlagGroup( + this.handle , + semGroup, + out ulong arrayLength + ); + + return UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNFreeRegisterList + ); + } + + public FlagConditionForSemanticClass[] GetFlagConditionsForSemanticFlagGroup(uint semGroup) + { + IntPtr arrayPointer = NativeMethods.BNGetArchitectureFlagConditionsForSemanticFlagGroup( + this.handle , + semGroup, + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArray( + arrayPointer , + arrayLength , + FlagConditionForSemanticClass.FromNative, + NativeMethods.BNFreeFlagConditionsForSemanticFlagGroup + ); + } + + public uint[] GetFlagsWrittenByFlagWriteType(uint writeType) + { + IntPtr arrayPointer = NativeMethods.BNGetArchitectureFlagsWrittenByFlagWriteType( + this.handle , + writeType, + out ulong arrayLength + ); + + return UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNFreeRegisterList + ); + } + + public uint GetSemanticClassForFlagWriteType(uint writeType) + { + return NativeMethods.BNGetArchitectureSemanticClassForFlagWriteType( + this.handle , + writeType + ); + } + + + + + public bool GetInstructionInfo( + byte[] data , + ulong address , + ulong maxLength , + out InstructionInfo info + ) + { + bool ok = false; + + BNInstructionInfo raw; + + ok = NativeMethods.BNGetInstructionInfo( + this.handle , + data , + address , + maxLength , + out raw + ); + + if (ok) + { + info = InstructionInfo.FromNative(raw); + } + else + { + info = new InstructionInfo(); + } + + return ok; + } + + public InstructionTextToken[] GetInstructionText(byte[]data , ulong address , ref ulong length ) + { + IntPtr arrayPointer = IntPtr.Zero; + + ulong arrayLength = 0; + + bool ok = false; + + length = (ulong)data.Length; + + ok = NativeMethods.BNGetInstructionText( + this.handle , + data , + address , + ref length , + out arrayPointer , + out arrayLength + ); + + InstructionTextToken[] tokens = Array.Empty(); + + if (ok ) + { + tokens = UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength, + InstructionTextToken.FromNative, + NativeMethods.BNFreeInstructionText + ); + } + + return tokens; + } + + public string GetRegisterName(RegisterIndex reg) + { + return UnsafeUtils.TakeAnsiString( + NativeMethods.BNGetArchitectureRegisterName(this.handle, reg) + ); + } + + public RegisterInfo GetRegisterInfo(RegisterIndex reg) + { + return RegisterInfo.FromNative( + NativeMethods.BNGetArchitectureRegisterInfo(this.handle , reg) + ); + } + + public ILRegister GetRegisterByName(string name) + { + return new ILRegister( + this , + NativeMethods.BNGetArchitectureRegisterByName(this.handle , name) + ); + } + + public string GetRegisterStackName(RegisterStackIndex regStack) + { + return UnsafeUtils.TakeAnsiString( + NativeMethods.BNGetArchitectureRegisterStackName(this.handle, regStack) + ); + } + + public ulong? GetInstructionLowLevelIL( + byte[] data , + ulong address , + LowLevelILFunction function + ) + { + ulong size = (ulong)data.Length; + + bool ok = NativeMethods.BNGetInstructionLowLevelIL( + this.handle, + data , + address, + ref size, + function.DangerousGetHandle() + ); + + if (!ok) + { + return null; + } + + return size; + } + + public ulong GetFlagWriteLowLevelIL( + LowLevelILOperation operation, + ulong size , + uint flagWriteType , + uint flag, + RegisterOrConstant[] operands, + LowLevelILFunction il + ) + { + return NativeMethods.BNGetArchitectureFlagWriteLowLevelIL( + this.handle , + operation , + size , + flagWriteType , + flag , + UnsafeUtils.ConvertToNativeArray(operands) , + (uint)operands.Length , + il.DangerousGetHandle() + ); + } + + public ulong GetDefaultFlagWriteLowLevelIL( + LowLevelILOperation operation, + ulong size , + FlagRole role , + RegisterOrConstant[] operands, + LowLevelILFunction il + ) + { + return NativeMethods.BNGetDefaultArchitectureFlagWriteLowLevelIL( + this.handle , + operation , + size , + role, + UnsafeUtils.ConvertToNativeArray(operands) , + (uint)operands.Length , + il.DangerousGetHandle() + ); + } + + public ulong GetFlagConditionLowLevelIL( + LowLevelILFlagCondition condition, + uint semClass, + LowLevelILFunction il + ) + { + return NativeMethods.BNGetArchitectureFlagConditionLowLevelIL( + this.handle , + condition, + semClass, + il.DangerousGetHandle() + ); + } + + public ulong GetSemanticFlagGroupLowLevelIL( + uint semGroup, + LowLevelILFunction il + ) + { + return NativeMethods.BNGetArchitectureSemanticFlagGroupLowLevelIL( + this.handle , + semGroup, + il.DangerousGetHandle() + ); + } + + public uint[] GetModifiedRegistersOnWrite(uint reg) + { + IntPtr arrayPointer = NativeMethods.BNGetModifiedArchitectureRegistersOnWrite( + this.handle , + reg, + out ulong arrayLength + ); + + return UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNFreeRegisterList + ); + } + + public Architecture? GetAssociatedArchitectureByAddress(ref ulong address) + { + return Architecture.FromHandle( + NativeMethods.BNGetAssociatedArchitectureByAddress(this.handle , ref address) + ); + } + + + public bool Assemble( + string code , + ulong address , + out byte[] data, + out string errors + ) + { + DataBuffer buffer = new DataBuffer( Array.Empty()); + + IntPtr errorPtr = IntPtr.Zero; + + bool ok = false; + + data = Array.Empty(); + + errors = ""; + + ok = NativeMethods.BNAssemble( + this.handle , + code , + address , + buffer.DangerousGetHandle() , + out errorPtr + ); + + errors = UnsafeUtils.TakeAnsiString(errorPtr); + + if (ok) + { + data = buffer.Contents; + } + + return ok; + } + + public bool IsNeverBranchPatchAvailable(byte[] data , ulong address) + { + return NativeMethods.BNIsArchitectureNeverBranchPatchAvailable( + this.handle , + data , + address , + (ulong)data.Length + ); + } + + public bool IsAlwaysBranchPatchAvailable(byte[] data , ulong address) + { + return NativeMethods.BNIsArchitectureAlwaysBranchPatchAvailable( + this.handle , + data , + address , + (ulong)data.Length + ); + } + + public bool IsInvertBranchPatchAvailable(byte[] data , ulong address) + { + return NativeMethods.BNIsArchitectureInvertBranchPatchAvailable( + this.handle , + data , + address , + (ulong)data.Length + ); + } + + public bool IsSkipAndReturnZeroPatchAvailable(byte[] data , ulong address) + { + return NativeMethods.BNIsArchitectureSkipAndReturnZeroPatchAvailable( + this.handle , + data , + address , + (ulong)data.Length + ); + } + + public bool IsSkipAndReturnValuePatchAvailable(byte[] data , ulong address) + { + return NativeMethods.BNIsArchitectureSkipAndReturnValuePatchAvailable( + this.handle , + data , + address , + (ulong)data.Length + ); + } + + public bool ConvertToNop(byte[] data , ulong address) + { + return NativeMethods.BNArchitectureConvertToNop( + this.handle , + data , + address , + (ulong)data.Length + ); + } + + public bool AlwaysBranch(byte[] data , ulong address) + { + return NativeMethods.BNArchitectureAlwaysBranch( + this.handle , + data , + address , + (ulong)data.Length + ); + } + + public bool InvertBranch(byte[] data , ulong address) + { + return NativeMethods.BNArchitectureInvertBranch( + this.handle , + data , + address , + (ulong)data.Length + ); + } + + public bool SkipAndReturnValue(byte[] data , ulong address , ulong _value) + { + return NativeMethods.BNArchitectureSkipAndReturnValue( + this.handle , + data , + address , + (ulong)data.Length, + _value + ); + } + + public TypeLibrary? LookupTypeLibraryByName(string name) + { + IntPtr raw = NativeMethods.BNLookupTypeLibraryByName(this.handle ,name); + + if (IntPtr.Zero == raw) + { + return null; + } + + return new TypeLibrary(raw, true); + } + + public TypeLibrary? LookupTypeLibraryByGuid(string name) + { + IntPtr raw = NativeMethods.BNLookupTypeLibraryByGuid(this.handle ,name); + + if (IntPtr.Zero == raw) + { + return null; + } + + return new TypeLibrary(raw, true); + } + + public Intrinsic[] Intrinsics + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetAllArchitectureIntrinsics( + this.handle , + out ulong arrayLength + ); + + uint[] indexes = UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNFreeRegisterList + ); + + List targets = new List(); + + foreach (IntrinsicIndex index in indexes) + { + targets.Add( + new Intrinsic(this , index) + ); + } + + return targets.ToArray(); + } + } + + public void FinalizeArchitectureHook() + { + NativeMethods.BNFinalizeArchitectureHook(this.handle); + } + + public ILRegister StackPointerRegister + { + get + { + return new ILRegister( + this , + (RegisterIndex)NativeMethods.BNGetArchitectureStackPointerRegister(this.handle) + ); + } + } + + + } + +} \ No newline at end of file diff --git a/Handle/BNBackgroundTask.cs b/Handle/BNBackgroundTask.cs new file mode 100644 index 0000000..4193372 --- /dev/null +++ b/Handle/BNBackgroundTask.cs @@ -0,0 +1,170 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class BackgroundTask : AbstractSafeHandle + { + public BackgroundTask(string initialText , bool canCancel) + : this( NativeMethods.BNBeginBackgroundTask(initialText, canCancel ) , true ) + { + + } + + internal BackgroundTask(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static BackgroundTask? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new BackgroundTask( + NativeMethods.BNNewBackgroundTaskReference(handle) , + true + ); + } + + internal static BackgroundTask MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new BackgroundTask( + NativeMethods.BNNewBackgroundTaskReference(handle) , + true + ); + } + + internal static BackgroundTask? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new BackgroundTask(handle, true); + } + + internal static BackgroundTask MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new BackgroundTask(handle, true); + } + + internal static BackgroundTask? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new BackgroundTask(handle, false); + } + + internal static BackgroundTask MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new BackgroundTask(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeBackgroundTask(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + + public static BackgroundTask[] GetRunningTasks() + { + IntPtr arrayPointer = NativeMethods.BNGetRunningBackgroundTasks( + out ulong arrayLength + ); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer , + arrayLength, + BackgroundTask.MustNewFromHandle, + NativeMethods.BNFreeBackgroundTaskList + ); + } + + public bool CanCancel + { + get + { + return NativeMethods.BNCanCancelBackgroundTask(this.handle); + } + } + + public bool Cancelled + { + get + { + return NativeMethods.BNIsBackgroundTaskCancelled(this.handle); + } + } + + public bool Finished + { + get + { + return NativeMethods.BNIsBackgroundTaskFinished(this.handle); + } + } + + public string ProgressText + { + get + { + return UnsafeUtils.TakeUtf8String( + NativeMethods.BNGetBackgroundTaskProgressText(this.handle) + ); + } + + set + { + NativeMethods.BNSetBackgroundTaskProgressText(this.handle, value); + } + } + + public ulong RuntimeSeconds + { + get + { + return NativeMethods.BNGetBackgroundTaskRuntimeSeconds(this.handle); + } + } + + public void Cancel() + { + NativeMethods.BNCancelBackgroundTask(this.handle); + } + + public void Finish() + { + NativeMethods.BNFinishBackgroundTask(this.handle); + } + } +} \ No newline at end of file diff --git a/Handle/BNBaseAddressDetection.cs b/Handle/BNBaseAddressDetection.cs new file mode 100644 index 0000000..5ca6c9a --- /dev/null +++ b/Handle/BNBaseAddressDetection.cs @@ -0,0 +1,68 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class BaseAddressDetection : AbstractSafeHandle + { + internal BaseAddressDetection(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + + internal static BaseAddressDetection? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new BaseAddressDetection(handle, true); + } + + internal static BaseAddressDetection MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new BaseAddressDetection(handle, true); + } + + internal static BaseAddressDetection? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new BaseAddressDetection(handle, false); + } + + internal static BaseAddressDetection MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new BaseAddressDetection(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeBaseAddressDetection(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + } +} \ No newline at end of file diff --git a/Handle/BNBasicBlock.cs b/Handle/BNBasicBlock.cs new file mode 100644 index 0000000..4997197 --- /dev/null +++ b/Handle/BNBasicBlock.cs @@ -0,0 +1,760 @@ +using System; +using System.Collections.Generic; +using System.Data; +using System.Drawing; +using System.Runtime.InteropServices; +using System.Text; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public abstract class AbstractBasicBlock : AbstractSafeHandle + where T_SELF : AbstractBasicBlock + { + internal AbstractBasicBlock(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeBasicBlock(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + + public Function? Function + { + get + { + return Function.TakeHandle( + NativeMethods.BNGetBasicBlockFunction(this.handle) + ); + } + } + + public FunctionGraphType FunctionGraphType + { + get + { + return NativeMethods.BNGetBasicBlockFunctionGraphType(this.handle); + } + } + + public LowLevelILFunction? LowLevelIlFunction + { + get + { + return LowLevelILFunction.TakeHandle( + NativeMethods.BNGetBasicBlockLowLevelILFunction(this.handle) + ); + } + } + + public MediumLevelILFunction? MediumLevelILFunction + { + get + { + return MediumLevelILFunction.TakeHandle( + NativeMethods.BNGetBasicBlockMediumLevelILFunction(this.handle) + ); + } + } + + public HighLevelILFunction? HighLevelILFunction + { + get + { + return HighLevelILFunction.TakeHandle( + NativeMethods.BNGetBasicBlockHighLevelILFunction(this.handle) + ); + } + } + + public BinaryView? View + { + get + { + return this.Function?.View; + } + } + + public Architecture Architecture + { + get + { + IntPtr raw = NativeMethods.BNGetBasicBlockArchitecture(this.handle); + + if (IntPtr.Zero == raw) + { + throw new NoNullAllowedException("basic block must have an architecture."); + } + + return new Architecture(raw); + } + } + + /// + /// address + /// + public ulong Start + { + get + { + return NativeMethods.BNGetBasicBlockStart(this.handle); + } + } + + /// + /// address + /// + public ulong End + { + get + { + return NativeMethods.BNGetBasicBlockEnd(this.handle); + } + + set + { + NativeMethods.BNSetBasicBlockEnd(this.handle, value); + } + } + + public ulong InstructionCount + { + get + { + return (ulong)this.End - (ulong)this.Start; + } + } + + public ulong Length + { + get + { + return NativeMethods.BNGetBasicBlockLength(this.handle); + } + } + + public ulong Index + { + get + { + return NativeMethods.BNGetBasicBlockIndex(this.handle); + } + } + + public bool HasUndeterminedOutgoingEdges + { + get + { + return NativeMethods.BNBasicBlockHasUndeterminedOutgoingEdges(this.handle); + } + + set + { + NativeMethods.BNBasicBlockSetUndeterminedOutgoingEdges(this.handle, value); + } + } + + public bool CanExit + { + get + { + return NativeMethods.BNBasicBlockCanExit(this.handle); + } + + set + { + NativeMethods.BNBasicBlockSetCanExit(this.handle, value); + } + } + + public bool HasInvalidInstructions + { + get + { + return NativeMethods.BNBasicBlockHasInvalidInstructions(this.handle); + } + + set + { + NativeMethods.BNBasicBlockSetHasInvalidInstructions(this.handle, value); + } + } + + public PendingBasicBlockEdge[] PendingOutgoingEdges + { + get + { + ulong arrayLength = 0; + + IntPtr arrayPointer = NativeMethods.BNGetBasicBlockPendingOutgoingEdges(this.handle , out arrayLength); + + return UnsafeUtils.TakeStructArray( + arrayPointer , + arrayLength , + PendingBasicBlockEdge.FromNative , + NativeMethods.BNFreePendingBasicBlockEdgeList + ); + } + } + + public void AddPendingOutgoingEdge( + BranchType kind , + ulong address, + Architecture arch , + bool fallThrough + ) + { + NativeMethods.BNBasicBlockAddPendingOutgoingEdge( + this.handle, + kind, + address, + arch.DangerousGetHandle(), + fallThrough + ); + } + + public void ClearPendingOutgoingEdges() + { + NativeMethods.BNClearBasicBlockPendingOutgoingEdges(this.handle); + } + + public byte[] GetInstructionData(ulong address) + { + ulong size = 0; + + IntPtr dataPtr = NativeMethods.BNBasicBlockGetInstructionData(this.handle , address , out size ); + + if (IntPtr.Zero == dataPtr || size == 0) + { + return Array.Empty(); + } + + byte[] data = new byte[size]; + + Marshal.Copy(dataPtr, data, 0, (int)size); + + return data; + } + + public void AddInstructionData(byte[] data) + { + NativeMethods.BNBasicBlockAddInstructionData(this.handle , data , (ulong)data.Length); + } + + public bool FallThroughToFunction + { + get + { + return NativeMethods.BNBasicBlockIsFallThroughToFunction(this.handle); + } + + set + { + NativeMethods.BNBasicBlockSetFallThroughToFunction(this.handle, value); + } + } + + public void SetAutoHighlight(HighlightColor color) + { + NativeMethods.BNSetAutoBasicBlockHighlight(this.handle, color.ToNative()); + } + + public void SetUserHighlight(HighlightColor color) + { + NativeMethods.BNSetUserBasicBlockHighlight(this.handle, color.ToNative()); + } + + public bool IsIL + { + get + { + return NativeMethods.BNIsILBasicBlock(this.handle); + } + } + + public bool IsLowLevelIL + { + get + { + return NativeMethods.BNIsLowLevelILBasicBlock(this.handle); + } + } + + public bool IsMediumLevelIL + { + get + { + return NativeMethods.BNIsMediumLevelILBasicBlock(this.handle); + } + } + + public bool IsHighLevelIL + { + get + { + return NativeMethods.BNIsHighLevelILBasicBlock(this.handle); + } + } + + public void MarkRecentlyUsed() + { + NativeMethods.BNMarkBasicBlockAsRecentlyUsed(this.handle); + } + + public DisassemblyTextLine[] GetDisassemblyTextLines(DisassemblySettings? settings = null) + { + if (null == settings) + { + settings = DisassemblySettings.DefaultLinear(); + } + + IntPtr arrayPointer = NativeMethods.BNGetBasicBlockDisassemblyText( + this.handle, + settings == null ? IntPtr.Zero : settings.DangerousGetHandle(), + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer, + arrayLength, + DisassemblyTextLine.FromNative, + NativeMethods.BNFreeDisassemblyTextLines + ); + } + + public DisassemblyTextLine[] DisassemblyTextLines + { + get + { + return this.GetDisassemblyTextLines(); + } + } + + public ulong? GetInstructionContainingAddress(ulong address ) + { + bool ok = NativeMethods.BNGetBasicBlockInstructionContainingAddress( + this.handle , + address , + out ulong start + ); + + if (!ok) + { + return null; + } + + return start; + } + + public HighlightColor Highlight + { + get + { + BNHighlightColor raw = NativeMethods.BNGetBasicBlockHighlight(this.handle); + + return HighlightColor.FromNative(raw); + } + + set + { + this.SetUserHighlight(value); + } + } + + public DisassemblyTextLine[] GetLanguageRepresentationLines( + DisassemblySettings? settings = null, + string language = "Pseudo C" + ) + { + Function? function = this.Function; + + if (null == function) + { + return Array.Empty(); + } + + LanguageRepresentationFunction? pseudo = function.GetLanguageRepresentation(language); + + if (null == pseudo) + { + return Array.Empty(); + } + + IntPtr arrayPointer = NativeMethods.BNGetLanguageRepresentationFunctionBlockLines( + pseudo.DangerousGetHandle() , + this.DangerousGetHandle() , + null == settings ? IntPtr.Zero : settings.DangerousGetHandle() , + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + DisassemblyTextLine.FromNative , + NativeMethods.BNFreeDisassemblyTextLines + ); + } + + public DisassemblyTextLine[] PseudoCLines + { + get + { + return this.GetLanguageRepresentationLines(); + } + } + + public string PseudoCText + { + get + { + StringBuilder builder = new StringBuilder(); + + foreach (DisassemblyTextLine line in this.PseudoCLines) + { + builder.AppendLine(line.ToString()); + } + + return builder.ToString(); + } + } + } + + public class BasicBlock : AbstractBasicBlock + { + internal BasicBlock(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + public BasicBlock? Source + { + get + { + return BasicBlock.TakeHandle( + NativeMethods.BNGetBasicBlockSource(this.handle) + ); + } + } + + internal static BasicBlock? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new BasicBlock( + NativeMethods.BNNewBasicBlockReference(handle) , + true + ); + } + + internal static BasicBlock MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new BasicBlock( + NativeMethods.BNNewBasicBlockReference(handle) , + true + ); + } + + internal static BasicBlock? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new BasicBlock(handle, true); + } + + internal static BasicBlock MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new BasicBlock(handle, true); + } + + internal static BasicBlock? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new BasicBlock(handle, false); + } + + internal static BasicBlock MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new BasicBlock(handle, false); + } + + public virtual BasicBlockEdge[] OutgoingEdges + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetBasicBlockOutgoingEdges( + this.handle , + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + (_native) => BasicBlockEdge.FromNativeEx( + _native , + this , + true + ) , + NativeMethods.BNFreeBasicBlockEdgeList + ); + } + } + + public BasicBlockEdge[] IncomingEdges + { + get + { + ulong arrayLength = 0; + + IntPtr arrayPointer = NativeMethods.BNGetBasicBlockIncomingEdges(this.handle , out arrayLength); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + (_native) => BasicBlockEdge.FromNativeEx( + _native , + this , + false + ) , + NativeMethods.BNFreeBasicBlockEdgeList + ); + } + } + + public BasicBlock[] GetDominators(bool post) + { + ulong arrayLength = 0; + + IntPtr arrayPointer = NativeMethods.BNGetBasicBlockDominators( + this.handle , + out arrayLength , + post + ); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer , + arrayLength , + BasicBlock.MustNewFromHandle, + NativeMethods.BNFreeBasicBlockList + ); + } + + public BasicBlock[] Dominators + { + get + { + return this.GetDominators(false); + } + } + + public BasicBlock[] PostDominators + { + get + { + return this.GetDominators(true); + } + } + + public BasicBlock[] GetStrictDominators(bool post) + { + ulong arrayLength = 0; + + IntPtr arrayPointer = NativeMethods.BNGetBasicBlockStrictDominators( + this.handle , + out arrayLength , + post + ); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer , + arrayLength , + BasicBlock.MustNewFromHandle, + NativeMethods.BNFreeBasicBlockList + ); + } + + public BasicBlock[] StrictDominators + { + get + { + return this.GetStrictDominators(false); + } + } + + public BasicBlock[] StrictPostDominators + { + get + { + return this.GetStrictDominators(true); + } + } + + public BasicBlock? GetImmediateDominator(bool post) + { + return BasicBlock.TakeHandle( + NativeMethods.BNGetBasicBlockImmediateDominator(this.handle , post) + ); + } + + public BasicBlock? ImmediateDominator + { + get + { + return this.GetImmediateDominator(false); + } + } + + public BasicBlock? ImmediatePostDominator + { + get + { + return this.GetImmediateDominator(true); + } + } + + public BasicBlock[] GetDominatorTreeChildren(bool post) + { + ulong arrayLength = 0; + + IntPtr arrayPointer = NativeMethods.BNGetBasicBlockDominatorTreeChildren( + this.handle , + out arrayLength , + post + ); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer , + arrayLength , + BasicBlock.MustNewFromHandle, + NativeMethods.BNFreeBasicBlockList + ); + } + + public BasicBlock[] DominatorTreeChildren + { + get + { + return this.GetDominatorTreeChildren(false); + } + } + + public BasicBlock[] PostDominatorTreeChildren + { + get + { + return this.GetDominatorTreeChildren(true); + } + } + + + public BasicBlock[] GetDominanceFrontier(bool post) + { + ulong arrayLength = 0; + + IntPtr arrayPointer = NativeMethods.BNGetBasicBlockDominanceFrontier( + this.handle , + out arrayLength , + post + ); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer , + arrayLength , + BasicBlock.MustNewFromHandle, + NativeMethods.BNFreeBasicBlockList + ); + } + + public BasicBlock[] DominanceFrontier + { + get + { + return this.GetDominanceFrontier(false); + } + } + + public BasicBlock[] PostDominanceFrontier + { + get + { + return this.GetDominanceFrontier(true); + } + } + + public IEnumerable InstructionTextLines + { + get + { + return this.GetInstructionTextLines(); + } + } + + public IEnumerable GetInstructionTextLines() + { + if (null == this.View) + { + throw new Exception("View is null"); + } + + ulong address = this.Start; + + while (address < this.End) + { + ulong length = this.End - address; + + length = Math.Min(this.Architecture.MaxInstructionLength, this.Length - address); + + byte[] data = this.View.ReadData(address , length); + + InstructionTextToken[] tokens = this.Architecture.GetInstructionText( + data , + address , + ref length + ); + + if (0 == length) + { + break; + } + + yield return new InstructionTextLine(tokens); + address += length; + } + + } + } +} \ No newline at end of file diff --git a/Handle/BNBinaryReader.cs b/Handle/BNBinaryReader.cs new file mode 100644 index 0000000..d988f42 --- /dev/null +++ b/Handle/BNBinaryReader.cs @@ -0,0 +1,761 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Runtime.InteropServices; +using System.Text; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class BinaryReader : AbstractSafeHandle + { + public BinaryReader(BinaryView view) + : this(NativeMethods.BNCreateBinaryReader(view.DangerousGetHandle()) , true) + { + + } + + internal BinaryReader(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static BinaryReader? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new BinaryReader(handle, true); + } + + internal static BinaryReader MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new BinaryReader(handle, true); + } + + internal static BinaryReader? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new BinaryReader(handle, false); + } + + internal static BinaryReader MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new BinaryReader(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeBinaryReader(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + + public Endianness Endianness + { + get + { + return NativeMethods.BNGetBinaryReaderEndianness(this.handle); + } + set + { + NativeMethods.BNSetBinaryReaderEndianness(this.handle, value); + } + } + + public ulong Position + { + get + { + return NativeMethods.BNGetReaderPosition(this.handle); + } + + set + { + if (this.Position != value) + { + NativeMethods.BNSeekBinaryReader(this.handle, value); + } + } + } + + + public ulong VirtualBase + { + get + { + return NativeMethods.BNGetBinaryReaderVirtualBase(this.handle); + } + + set + { + NativeMethods.BNSetBinaryReaderVirtualBase(this.handle, value); + } + } + + public bool IsEOF + { + get + { + return NativeMethods.BNIsEndOfFile(this.handle); + } + } + + + public bool ReadData(byte[] buffer) + { + return NativeMethods.BNReadData( + this.handle , + buffer , + (ulong)buffer.Length + ); + } + + #region easy + + public byte[]? ReadData(ulong length) + { + if (0 == length) + { + return null; + } + + byte[] buffer = new byte[length]; + + bool ok = NativeMethods.BNReadData( + this.handle , + buffer , + (ulong)buffer.Length + ); + + if (!ok) + { + return null; + } + + return buffer; + } + + public sbyte? ReadInt8() + { + bool ok = NativeMethods.BNRead8(this.handle, out byte slug); + + if (!ok) + { + return null; + } + + return (sbyte)slug; + } + + public short? ReadInt16() + { + bool ok = NativeMethods.BNRead16(this.handle, out ushort slug); + + if (!ok) + { + return null; + } + + return (short)slug; + } + + public short? ReadInt16BE() + { + bool ok = NativeMethods.BNReadBE16(this.handle, out ushort slug); + + if (!ok) + { + return null; + } + + return (short)slug; + } + + public short? ReadInt16LE() + { + bool ok = NativeMethods.BNReadLE16(this.handle, out ushort slug); + + if (!ok) + { + return null; + } + + return (short)slug; + } + + public int? ReadInt32() + { + bool ok = NativeMethods.BNRead32(this.handle, out uint slug); + + if (!ok) + { + return null; + } + + return (int)slug; + } + + public int? ReadInt32BE() + { + bool ok = NativeMethods.BNReadBE32(this.handle, out uint slug); + + if (!ok) + { + return null; + } + + return (int)slug; + } + + public int? ReadInt32LE() + { + bool ok = NativeMethods.BNReadLE32(this.handle, out uint slug); + + if (!ok) + { + return null; + } + + return (int)slug; + } + + public long? ReadInt64() + { + bool ok = NativeMethods.BNReadLE64(this.handle, out ulong slug); + + if (!ok) + { + return null; + } + + return (long)slug; + } + + public long? ReadInt64BE() + { + bool ok = NativeMethods.BNReadBE64(this.handle, out ulong slug); + + if (!ok) + { + return null; + } + + return (long)slug; + } + + public long? ReadInt64LE() + { + bool ok = NativeMethods.BNReadLE64(this.handle, out ulong slug); + + if (!ok) + { + return null; + } + + return (long)slug; + } + + #endregion + + #region unsigned + + + + public byte? ReadUInt8() + { + bool ok = NativeMethods.BNRead8(this.handle, out byte slug); + + if (!ok) + { + return null; + } + + return slug; + } + + + + public ushort? ReadUInt16() + { + bool ok = NativeMethods.BNRead16(this.handle, out ushort slug); + + if (!ok) + { + return null; + } + + return (ushort)slug; + } + + public ushort? ReadUInt16BE() + { + bool ok = NativeMethods.BNReadBE16(this.handle, out ushort slug); + + if (!ok) + { + return null; + } + + return (ushort)slug; + } + + public ushort? ReadUInt16LE() + { + bool ok = NativeMethods.BNReadLE16(this.handle, out ushort slug); + + if (!ok) + { + return null; + } + + return (ushort)slug; + } + + + + + public uint? ReadUInt32() + { + bool ok = NativeMethods.BNRead32(this.handle, out uint slug); + + if (!ok) + { + return null; + } + + return (uint)slug; + } + + public uint? ReadUInt32BE() + { + bool ok = NativeMethods.BNReadBE32(this.handle, out uint slug); + + if (!ok) + { + return null; + } + + return (uint)slug; + } + + public uint? ReadUInt32LE() + { + bool ok = NativeMethods.BNReadLE32(this.handle, out uint slug); + + if (!ok) + { + return null; + } + + return (uint)slug; + } + + public ulong? ReadUInt64() + { + bool ok = NativeMethods.BNReadLE64(this.handle, out ulong slug); + + if (!ok) + { + return null; + } + + return (ulong)slug; + } + + public ulong? ReadUInt64BE() + { + bool ok = NativeMethods.BNReadBE64(this.handle, out ulong slug); + + if (!ok) + { + return null; + } + + return (ulong)slug; + } + + public ulong? ReadUInt64LE() + { + bool ok = NativeMethods.BNReadLE64(this.handle, out ulong slug); + + if (!ok) + { + return null; + } + + return (ulong)slug; + } + + #endregion + + // alias + public sbyte? ReadSByte() + { + return this.ReadInt8(); + } + + public byte? ReadByte() + { + return this.ReadUInt8(); + } + + public short? ReadShort() + { + return this.ReadInt16(); + } + + public ushort? ReadUShort() + { + return this.ReadUInt16(); + } + + public int? ReadInt() + { + return this.ReadInt32(); + } + + public uint? ReadUInt() + { + return this.ReadUInt32(); + } + + public long? ReadLong() + { + return this.ReadInt64(); + } + + public ulong? ReadULong() + { + return this.ReadUInt64(); + } + + + public sbyte? PeekInt8(ulong? offset = null) + { + ulong old = this.Position; + + this.Position = offset ?? this.Position; + + sbyte? value = this.ReadInt8(); + + this.Position = old; + + return value; + } + + public byte? PeekUInt8(ulong? offset = null) + { + ulong old = this.Position; + + this.Position = offset ?? this.Position; + + byte? value = this.ReadUInt8(); + + this.Position = old; + + return value; + } + + + public short? PeekInt16(ulong? offset = null) + { + ulong old = this.Position; + + this.Position = offset ?? this.Position; + + short? value = this.ReadInt16(); + + this.Position = old; + + return value; + } + + public short? PeekInt16BE(ulong? offset = null) + { + ulong old = this.Position; + + this.Position = offset ?? this.Position; + + short? value = this.ReadInt16BE(); + + this.Position = old; + + return value; + } + + public short? PeekInt16LE(ulong? offset = null) + { + ulong old = this.Position; + + this.Position = offset ?? this.Position; + + short? value = this.ReadInt16LE(); + + this.Position = old; + + return value; + } + + public ushort? PeekUInt16(ulong? offset = null) + { + ulong old = this.Position; + + this.Position = offset ?? this.Position; + + ushort? value = this.ReadUInt16(); + + this.Position = old; + + return value; + } + + public ushort? PeekUInt16BE(ulong? offset = null) + { + ulong old = this.Position; + + this.Position = offset ?? this.Position; + + ushort? value = this.ReadUInt16BE(); + + this.Position = old; + + return value; + } + + public ushort? PeekUInt16LE(ulong? offset = null) + { + ulong old = this.Position; + + this.Position = offset ?? this.Position; + + ushort? value = this.ReadUInt16LE(); + + this.Position = old; + + return value; + } + + // + public int? PeekInt32(ulong? offset = null) + { + ulong old = this.Position; + + this.Position = offset ?? this.Position; + + int? value = this.ReadInt32(); + + this.Position = old; + + return value; + } + + public int? PeekInt32BE(ulong? offset = null) + { + ulong old = this.Position; + + this.Position = offset ?? this.Position; + + int? value = this.ReadInt32BE(); + + this.Position = old; + + return value; + } + + public int? PeekInt32LE(ulong? offset = null) + { + ulong old = this.Position; + + this.Position = offset ?? this.Position; + + int? value = this.ReadInt32LE(); + + this.Position = old; + + return value; + } + + public uint? PeekUInt32(ulong? offset = null) + { + ulong old = this.Position; + + this.Position = offset ?? this.Position; + + uint? value = this.ReadUInt32(); + + this.Position = old; + + return value; + } + + public uint? PeekUInt32BE(ulong? offset = null) + { + ulong old = this.Position; + + this.Position = offset ?? this.Position; + + uint? value = this.ReadUInt32BE(); + + this.Position = old; + + return value; + } + + public uint? PeekUInt32LE(ulong? offset = null) + { + ulong old = this.Position; + + this.Position = offset ?? this.Position; + + uint? value = this.ReadUInt32LE(); + + this.Position = old; + + return value; + } + + + public long? PeekInt64(ulong? offset = null) + { + ulong old = this.Position; + + this.Position = offset ?? this.Position; + + long? value = this.ReadInt64(); + + this.Position = old; + + return value; + } + + public long? PeekInt64BE(ulong? offset = null) + { + ulong old = this.Position; + + this.Position = offset ?? this.Position; + + long? value = this.ReadInt64BE(); + + this.Position = old; + + return value; + } + + + public long? PeekInt64LE(ulong? offset = null) + { + ulong old = this.Position; + + this.Position = offset ?? this.Position; + + long? value = this.ReadInt64LE(); + + this.Position = old; + + return value; + } + + public ulong? PeekUInt64(ulong? offset = null) + { + ulong old = this.Position; + + this.Position = offset ?? this.Position; + + ulong? value = this.ReadUInt64(); + + this.Position = old; + + return value; + } + + public ulong? PeekUInt64BE(ulong? offset = null) + { + ulong old = this.Position; + + this.Position = offset ?? this.Position; + + ulong? value = this.ReadUInt64BE(); + + this.Position = old; + + return value; + } + + public ulong? PeekUInt64LE(ulong? offset = null) + { + ulong old = this.Position; + + this.Position = offset ?? this.Position; + + ulong? value = this.ReadUInt64LE(); + + this.Position = old; + + return value; + } + + + // alias peek + public sbyte? PeekSByte(ulong? offset = null) + { + return this.PeekInt8(offset); + } + + public byte? PeekByte(ulong? offset = null) + { + return this.PeekUInt8(offset); + } + + public short? PeekShort(ulong? offset = null) + { + return this.PeekInt16(offset); + } + + public ushort? PeekUShort(ulong? offset = null) + { + return this.PeekUInt16(offset); + } + + public int? PeekInt(ulong? offset = null) + { + return this.PeekInt32(offset); + } + + public uint? PeekUInt(ulong? offset = null) + { + return this.PeekUInt32(offset); + } + + public long? PeekLong(ulong? offset = null) + { + return this.PeekInt64(offset); + } + + public ulong? PeekULong(ulong? offset = null) + { + return this.PeekUInt64(offset); + } + } +} \ No newline at end of file diff --git a/Handle/BNBinaryView.cs b/Handle/BNBinaryView.cs new file mode 100644 index 0000000..2a34c7d --- /dev/null +++ b/Handle/BNBinaryView.cs @@ -0,0 +1,5605 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class BinaryView : AbstractSafeHandle + { + internal BinaryView(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static BinaryView? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new BinaryView(handle, true); + } + + internal static BinaryView MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new BinaryView(handle, true); + } + + internal static BinaryView? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new BinaryView(handle, false); + } + + internal static BinaryView MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new BinaryView(handle, false); + } + + protected override bool ReleaseHandle() + { + if (!this.IsInvalid) + { + NativeMethods.BNFreeBinaryView(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + + public ulong Length + { + get + { + return NativeMethods.BNGetViewLength(this.handle); + } + } + + public static BinaryView? FromFile( + string filename , + FileMetadata? file = null + ) + { + FileMetadata? autoFile = file; + + if (null == autoFile) + { + autoFile = new FileMetadata(filename); + } + + return BinaryView.TakeHandle( + NativeMethods.BNCreateBinaryDataViewFromFilename( + autoFile.DangerousGetHandle() , + filename + ) + ); + } + + public static BinaryView? Create(FileMetadata file) + { + return BinaryView.TakeHandle( + NativeMethods.BNCreateBinaryDataView(file.DangerousGetHandle()) + ); + } + + public static BinaryView? FromBuffer( DataBuffer buffer , FileMetadata? file = null ) + { + if (null == file) + { + file = new FileMetadata(); + } + + return BinaryView.TakeHandle( + NativeMethods.BNCreateBinaryDataViewFromBuffer( + file.DangerousGetHandle() , + buffer.DangerousGetHandle() + ) + ); + } + + public static BinaryView? FromBytes(byte[] data , FileMetadata? file = null ) + { + if (null == file) + { + file = new FileMetadata(); + } + + return BinaryView.TakeHandle( + NativeMethods.BNCreateBinaryDataViewFromData( + file.DangerousGetHandle() , + data, + (ulong)data.Length + ) + ); + } + + public BinaryView? Load( + bool updateAnalysis , + string options , + ProgressDelegate? progress + ) + { + return BinaryView.TakeHandle( + NativeMethods.BNLoadBinaryView( + this.handle , + updateAnalysis , + options , + null == progress + ? IntPtr.Zero + : Marshal.GetFunctionPointerForDelegate( + UnsafeUtils.WrapProgressDelegate(progress) + ) , + IntPtr.Zero + ) + ); + } + + /// + /// + /// + /// like afd.sys.bndb + /// + /// + /// + /// + public static BinaryView? LoadFile( + string filename , + bool updateAnalysis = false , + string options = "", + ProgressDelegate? progress = null + ) + { + return BinaryView.TakeHandle( + NativeMethods.BNLoadFilename( + filename , + updateAnalysis , + options , + null == progress + ? IntPtr.Zero + : Marshal.GetFunctionPointerForDelegate( + UnsafeUtils.WrapProgressDelegate(progress)) , + IntPtr.Zero + ) + ); + } + + public static BinaryView? OpenExisting(string filename , ProgressDelegate? progress = null) + { + FileMetadata file = new FileMetadata(filename); + + if (null == progress) + { + return BinaryView.TakeHandle( + NativeMethods.BNOpenExistingDatabase( + file.DangerousGetHandle() , + filename + ) + ); + } + else + { + return BinaryView.TakeHandle( + NativeMethods.BNOpenExistingDatabaseWithProgress( + file.DangerousGetHandle() , + filename, + IntPtr.Zero, + Marshal.GetFunctionPointerForDelegate( + UnsafeUtils.WrapProgressDelegate(progress) + ) + ) + ); + } + } + + public BinaryView? Parent + { + get + { + return BinaryView.TakeHandle( + NativeMethods.BNGetParentView(this.handle) + ); + } + } + + public FileMetadata File + { + get + { + return FileMetadata.MustTakeHandle( + NativeMethods.BNGetFileForView(this.handle) + ); + } + } + + public ulong ImageBase + { + get + { + return NativeMethods.BNGetImageBase(this.handle); + } + } + + public ulong OriginalImageBase + { + get + { + return NativeMethods.BNGetOriginalImageBase(this.handle); + } + + set + { + NativeMethods.BNSetOriginalImageBase(this.handle , value); + } + } + + public ulong Start + { + get + { + return NativeMethods.BNGetStartOffset(this.handle); + } + } + + public ulong End + { + get + { + return NativeMethods.BNGetEndOffset(this.handle); + } + } + + public ulong EntryPoint + { + get + { + return NativeMethods.BNGetEntryPoint(this.handle); + } + } + + public Architecture? DefaultArchitecture + { + get + { + return Architecture.FromHandle( + NativeMethods.BNGetDefaultArchitecture(this.handle) + ); + } + + set + { + NativeMethods.BNSetDefaultArchitecture( + this.handle , + null == value ? IntPtr.Zero : value.DangerousGetHandle() + ); + } + } + + public Platform? DefaultPlatform + { + get + { + IntPtr raw = NativeMethods.BNGetDefaultPlatform(this.handle); + + if (IntPtr.Zero == raw) + { + return null; + } + + return new Platform(raw , true); + } + + set + { + NativeMethods.BNSetDefaultPlatform( + this.handle , + null == value ? IntPtr.Zero : value.DangerousGetHandle() + ); + } + } + + public Endianness DefaultEndiannes + { + get + { + return NativeMethods.BNGetDefaultEndianness(this.handle); + } + } + + public bool Relocatable + { + get + { + return NativeMethods.BNIsRelocatable(this.handle); + } + } + + public ulong AddressSize + { + get + { + return NativeMethods.BNGetViewAddressSize(this.handle); + } + } + + public bool Modified + { + get + { + return NativeMethods.BNIsViewModified(this.handle); + } + } + + public bool Executable + { + get + { + return NativeMethods.BNIsExecutableView(this.handle); + } + } + + public Function[] Functions + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetAnalysisFunctionList( + this.handle , + out ulong arrayLength + ); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer , + arrayLength , + Function.MustNewFromHandle , + NativeMethods.BNFreeFunctionList + ); + } + } + + public IEnumerable BasicBlocks + { + get + { + foreach (Function function in this.Functions) + { + foreach (BasicBlock basicBlock in function.BasicBlocks) + { + yield return basicBlock; + } + } + } + } + + public IEnumerable LowLevelILFunctions + { + get + { + foreach (Function function in this.Functions) + { + yield return function.LowLevelIL; + } + } + } + + public IEnumerable LowLevelILBasicBlocks + { + get + { + foreach (LowLevelILFunction function in this.LowLevelILFunctions) + { + foreach (LowLevelILBasicBlock basicBlock in function.BasicBlocks) + { + yield return basicBlock; + } + } + } + } + + public IEnumerable LiftedILFunctions + { + get + { + foreach (Function function in this.Functions) + { + yield return function.LiftedIL; + } + } + } + + public IEnumerable LiftedILBasicBlocks + { + get + { + foreach (LowLevelILFunction function in this.LiftedILFunctions) + { + foreach (LowLevelILBasicBlock basicBlock in function.BasicBlocks) + { + yield return basicBlock; + } + } + } + } + + public IEnumerable MediumLevelILFunctions + { + get + { + foreach (Function function in this.Functions) + { + yield return function.MediumLevelIL; + } + } + } + + public IEnumerable MediumLevelILBasicBlocks + { + get + { + foreach (MediumLevelILFunction function in this.MediumLevelILFunctions) + { + foreach (MediumLevelILBasicBlock basicBlock in function.BasicBlocks) + { + yield return basicBlock; + } + } + } + } + + public IEnumerable MappedMediumLevelILFunctions + { + get + { + foreach (Function function in this.Functions) + { + yield return function.MappedMediumLevelIL; + } + } + } + + public IEnumerable MappedMediumLevelILBasicBlocks + { + get + { + foreach (MediumLevelILFunction function in this.MappedMediumLevelILFunctions) + { + foreach (MediumLevelILBasicBlock basicBlock in function.BasicBlocks) + { + yield return basicBlock; + } + } + } + } + + public IEnumerable HighLevelILFunctions + { + get + { + foreach (Function function in this.Functions) + { + yield return function.HighLevelIL; + } + } + } + + public IEnumerable HighLevelILBasicBlocks + { + get + { + foreach (HighLevelILFunction function in this.HighLevelILFunctions) + { + foreach (HighLevelILBasicBlock basicBlock in function.BasicBlocks) + { + yield return basicBlock; + } + } + } + } + + + public bool HasFunctions + { + get + { + return NativeMethods.BNHasFunctions(this.handle); + } + } + + public bool HasSymbols + { + get + { + return NativeMethods.BNHasSymbols(this.handle); + } + } + + public bool HasDataVariables + { + get + { + return NativeMethods.BNHasDataVariables(this.handle); + } + } + + public Function? EntryFunction + { + get + { + IntPtr raw = NativeMethods.BNGetAnalysisEntryPoint(this.handle); + + if (IntPtr.Zero == raw) + { + return null; + } + + return new Function(raw , true); + } + } + + public Function[] EntryFunctions + { + get + { + ulong arrayLength = 0; + + IntPtr arrayPointer = NativeMethods.BNGetAllEntryFunctions(this.handle , out arrayLength); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer , + arrayLength , + Function.MustNewFromHandle , + NativeMethods.BNFreeFunctionList + ); + } + } + + public NameSpace[] NameSpaces + { + get + { + ulong arrayLength = 0; + + IntPtr arrayPointer = NativeMethods.BNGetNameSpaces(this.handle , out arrayLength); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + NameSpace.FromNative , + NativeMethods.BNFreeNameSpaceList + ); + } + } + + public string ViewType + { + get + { + return UnsafeUtils.TakeAnsiString( + NativeMethods.BNGetViewType(this.handle) + ); + } + } + + public BinaryViewType[] ViewTypes + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetBinaryViewTypesForData( + this.handle , + out ulong arrayLength + ); + + return UnsafeUtils.TakeHandleArray( + arrayPointer , + arrayLength , + BinaryViewType.MustFromHandle , + NativeMethods.BNFreeBinaryViewTypeList + ); + } + } + + public StringReference[] Strings + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetStrings( + this.handle , + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArray( + arrayPointer , + arrayLength , + StringReference.FromNative , + NativeMethods.BNFreeStringReferenceList + ); + } + } + + public AnalysisInfo GetAnalysisInfo() + { + return AnalysisInfo.MustTakeNativePointer( + NativeMethods.BNGetAnalysisInfo(this.handle) + ); + } + + public AnalysisProgress AnalysisProgress + { + get + { + return AnalysisProgress.FromNative(NativeMethods.BNGetAnalysisProgress(this.handle)); + } + } + + public AnalysisState AnalysisState + { + get + { + return NativeMethods.BNGetAnalysisState(this.handle); + } + } + + public LinearViewObject CreateLinearViewDisassembly( + DisassemblySettings? settings = null + ) + { + if (null == settings) + { + settings = DisassemblySettings.DefaultLinear(); + } + + return LinearViewObject.MustTakeHandle( + NativeMethods.BNCreateLinearViewDisassembly( + this.handle , + null == settings ? IntPtr.Zero : settings.DangerousGetHandle() + ) + ); + } + + public LinearViewObject CreateLinearViewLiftedIL( + DisassemblySettings? settings = null + ) + { + if (null == settings) + { + settings = DisassemblySettings.DefaultLinear(); + } + + return LinearViewObject.MustTakeHandle( + NativeMethods.BNCreateLinearViewLiftedIL( + this.handle , + null == settings ? IntPtr.Zero : settings.DangerousGetHandle() + ) + ); + } + + public LinearViewObject CreateLinearViewLowLevelIL( + DisassemblySettings? settings = null + ) + { + if (null == settings) + { + settings = DisassemblySettings.DefaultLinear(); + } + + return LinearViewObject.MustTakeHandle( + NativeMethods.BNCreateLinearViewLowLevelIL( + this.handle , + null == settings ? IntPtr.Zero : settings.DangerousGetHandle() + ) + ); + } + + public LinearViewObject CreateLinearViewLowLevelILSSAForm( + DisassemblySettings? settings = null + ) + { + if (null == settings) + { + settings = DisassemblySettings.DefaultLinear(); + } + + return LinearViewObject.MustTakeHandle( + NativeMethods.BNCreateLinearViewLowLevelILSSAForm( + this.handle , + null == settings ? IntPtr.Zero : settings.DangerousGetHandle() + ) + ); + } + + public LinearViewObject CreateLinearViewMediumLevelIL( + DisassemblySettings? settings = null + ) + { + if (null == settings) + { + settings = DisassemblySettings.DefaultLinear(); + } + + return LinearViewObject.MustTakeHandle( + NativeMethods.BNCreateLinearViewMediumLevelIL( + this.handle , + null == settings ? IntPtr.Zero : settings.DangerousGetHandle() + ) + ); + } + + public LinearViewObject CreateLinearViewMediumLevelILSSAForm( + DisassemblySettings? settings = null + ) + { + if (null == settings) + { + settings = DisassemblySettings.DefaultLinear(); + } + + return LinearViewObject.MustTakeHandle( + NativeMethods.BNCreateLinearViewMediumLevelILSSAForm( + this.handle , + null == settings ? IntPtr.Zero : settings.DangerousGetHandle() + ) + ); + } + + public LinearViewObject CreateLinearViewMappedMediumLevelIL( + DisassemblySettings? settings = null + ) + { + if (null == settings) + { + settings = DisassemblySettings.DefaultLinear(); + } + + return LinearViewObject.MustTakeHandle( + NativeMethods.BNCreateLinearViewMappedMediumLevelIL( + this.handle , + null == settings ? IntPtr.Zero : settings.DangerousGetHandle() + ) + ); + } + + public LinearViewObject CreateLinearViewMappedMediumLevelILSSAForm( + DisassemblySettings? settings = null + ) + { + if (null == settings) + { + settings = DisassemblySettings.DefaultLinear(); + } + + return LinearViewObject.MustTakeHandle( + NativeMethods.BNCreateLinearViewMappedMediumLevelILSSAForm( + this.handle , + null == settings ? IntPtr.Zero : settings.DangerousGetHandle() + ) + ); + } + + public LinearViewObject CreateLinearViewHighLevelIL(DisassemblySettings? settings = null) + { + if (null == settings) + { + settings = DisassemblySettings.DefaultLinear(); + } + + return LinearViewObject.MustTakeHandle( + NativeMethods.BNCreateLinearViewHighLevelIL( + this.handle , + null == settings ? IntPtr.Zero : settings.DangerousGetHandle() + ) + ); + } + + public LinearViewObject CreateLinearViewHighLevelILSSAForm(DisassemblySettings? settings = null) + { + if (null == settings) + { + settings = DisassemblySettings.DefaultLinear(); + } + + return LinearViewObject.MustTakeHandle( + NativeMethods.BNCreateLinearViewHighLevelILSSAForm( + this.handle , + null == settings ? IntPtr.Zero : settings.DangerousGetHandle() + ) + ); + } + + public LinearViewObject CreateLinearViewLanguageRepresentation( + DisassemblySettings? settings = null , + string language = "Pseudo C" + ) + { + if (null == settings) + { + settings = DisassemblySettings.DefaultLinear(); + } + + return LinearViewObject.MustTakeHandle( + NativeMethods.BNCreateLinearViewLanguageRepresentation( + this.handle , + null == settings ? IntPtr.Zero : settings.DangerousGetHandle() , + language + ) + ); + } + + public LinearViewObject CreateLinearViewDataOnly(DisassemblySettings? settings = null) + { + if (null == settings) + { + settings = DisassemblySettings.Default(); + } + + return LinearViewObject.MustTakeHandle( + NativeMethods.BNCreateLinearViewDataOnly( + this.handle , + null == settings ? IntPtr.Zero : settings.DangerousGetHandle() + ) + ); + } + + public DataVariable[] DataVariables + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetDataVariables( + this.handle , + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + DataVariable.FromNative , + NativeMethods.BNFreeDataVariables + ); + } + } + + public QualifiedNameAndType[] Types + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetAnalysisTypeList( + this.handle , + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + QualifiedNameAndType.FromNative , + NativeMethods.BNFreeTypeAndNameList + ); + } + } + + public QualifiedNameAndType[] DependencySortedTypes + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetAnalysisDependencySortedTypeList( + this.handle , + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + QualifiedNameAndType.FromNative , + NativeMethods.BNFreeTypeAndNameList + ); + } + } + + public QualifiedName[] GetTypeNames(string match) + { + IntPtr arrayPointer = NativeMethods.BNGetAnalysisTypeNames( + this.handle , + out ulong arrayLength , + match + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + QualifiedName.FromNative , + NativeMethods.BNFreeTypeNameList + ); + } + + public TypeLibrary[] TypeLibraries + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetBinaryViewTypeLibraries( + this.handle , + out ulong arrayLength + ); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer , + arrayLength , + TypeLibrary.MustNewFromHandle , + NativeMethods.BNFreeTypeLibraryList + ); + } + } + + public IDictionary TypeArchives + { + get + { + ulong arrayLength = NativeMethods.BNBinaryViewGetTypeArchives( + this.handle , + out IntPtr idArrayPointer , + out IntPtr pathArrayPointer + ); + + string[] ids = UnsafeUtils.TakeAnsiStringArray( + idArrayPointer , + arrayLength, + NativeMethods.BNFreeStringList + ); + + string[] paths = UnsafeUtils.TakeAnsiStringArray( + pathArrayPointer , + arrayLength, + NativeMethods.BNFreeStringList + ); + + Dictionary targets = new Dictionary(); + + for (ulong i = 0; i < arrayLength; i++) + { + targets[ids[i]] = paths[i]; + } + + return targets; + } + } + + public TypeArchive? GetTypeArchive(string id) + { + return TypeArchive.TakeHandle( + NativeMethods.BNBinaryViewGetTypeArchive(this.handle , id) + ); + } + + public TypeArchive[] ConnectedTypeArchives + { + get + { + List targets = new List(); + + foreach (string id in this.TypeArchives.Keys) + { + TypeArchive? archive = this.GetTypeArchive(id); + + if (null != archive) + { + targets.Add(archive); + } + } + + return targets.ToArray(); + } + } + + public Segment[] Segments + { + get + { + ulong arrayLength = 0; + + IntPtr arrayPointer = NativeMethods.BNGetSegments(this.handle , out arrayLength); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer , + arrayLength , + Segment.MustNewFromHandle , + NativeMethods.BNFreeSegmentList + ); + } + } + + public Section[] Sections + { + get + { + ulong arrayLength = 0; + + IntPtr arrayPointer = NativeMethods.BNGetSections(this.handle , out arrayLength); + + return UnsafeUtils.TakeHandleArrayEx
( + arrayPointer , + arrayLength , + Section.MustNewFromHandle , + NativeMethods.BNFreeSectionList + ); + } + } + + public AddressRange[] AllocatedRanges + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetAllocatedRanges( + this.handle , + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArray( + arrayPointer , + arrayLength , + AddressRange.FromNative , + NativeMethods.BNFreeAddressRanges + ); + } + } + + public AddressRange[] MappedAddressRange + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetMappedAddressRanges( + this.handle , + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArray( + arrayPointer , + arrayLength , + AddressRange.FromNative , + NativeMethods.BNFreeAddressRanges + ); + } + } + + public AddressRange[] BackedAddressRanges + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetBackedAddressRanges( + this.handle , + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArray( + arrayPointer , + arrayLength , + AddressRange.FromNative , + NativeMethods.BNFreeAddressRanges + ); + } + } + + public RegisterValueWithConfidence GlobalPointerValue + { + get + { + return RegisterValueWithConfidence.FromNative( + NativeMethods.BNGetGlobalPointerValue(this.handle) + ); + } + + set + { + NativeMethods.BNSetUserGlobalPointerValue( + this.handle , + value.ToNative() + ); + } + } + + public bool UserGlobalPointerValueSet + { + get + { + return NativeMethods.BNUserGlobalPointerValueSet(this.handle); + } + } + + public void ClearUserGlobalPointerValue() + { + NativeMethods.BNClearUserGlobalPointerValue(this.handle); + } + + + public AnalysisParameters ParametersForAnalysis + { + get + { + return AnalysisParameters.FromNative( + NativeMethods.BNGetParametersForAnalysis(this.handle) + ); + } + + set + { + NativeMethods.BNSetParametersForAnalysis(this.handle , value.ToNative()); + } + } + + public ulong MaxFunctionSizeForAnalysis + { + get + { + return NativeMethods.BNGetMaxFunctionSizeForAnalysis(this.handle); + } + + set + { + NativeMethods.BNSetMaxFunctionSizeForAnalysis(this.handle , value); + } + } + + public Relocation[] GetRelocationsAt(ulong address) + { + IntPtr arrayPointer = NativeMethods.BNGetRelocationsAt( + this.handle , + address , + out ulong arrayLength + ); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer , + arrayLength , + Relocation.MustNewFromHandle , + NativeMethods.BNFreeRelocationList + ); + } + + public Range[] RelocationRanges + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetRelocationRanges( + this.handle , + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArray( + arrayPointer , + arrayLength , + Range.FromNative , + NativeMethods.BNFreeRelocationRanges + ); + } + } + + public Range[] GetRelocationRangesAtAddress(ulong address) + { + IntPtr arrayPointer = NativeMethods.BNGetRelocationRangesAtAddress( + this.handle , + address , + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArray( + arrayPointer , + arrayLength , + Range.FromNative , + NativeMethods.BNFreeRelocationRanges + ); + } + + public Range[] GetRelocationRangesInRange(ulong address , ulong length) + { + IntPtr arrayPointer = NativeMethods.BNGetRelocationRangesInRange( + this.handle , + address , + length , + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArray( + arrayPointer , + arrayLength , + Range.FromNative , + NativeMethods.BNFreeRelocationRanges + ); + } + + public bool FinalizeNewSegments() + { + return NativeMethods.BNBinaryViewFinalizeNewSegments(this.handle); + } + + public bool RangeContainsRelocation(ulong address , ulong length) + { + return NativeMethods.BNRangeContainsRelocation(this.handle , address , length); + } + + public bool NewAutoFunctionAnalysisSuppressed + { + get + { + return NativeMethods.BNGetNewAutoFunctionAnalysisSuppressed(this.handle); + } + + set + { + NativeMethods.BNSetNewAutoFunctionAnalysisSuppressed(this.handle , value); + } + } + + public DataBuffer ReadBuffer(ulong offset , ulong length) + { + return DataBuffer.MustTakeHandle( + NativeMethods.BNReadViewBuffer(this.handle , offset , length) + ); + } + + public byte[] ReadData(ulong offset , ulong length) + { + if (0 == length) + { + return Array.Empty(); + } + + byte[] buffer = new byte[length]; + + + ulong readed = NativeMethods.BNReadViewData( + this.handle , + buffer , + offset , + length + ); + + if (readed < length) + { + if (0 == readed) + { + return Array.Empty(); + } + + byte[] part = new byte[readed]; + + Array.Copy( + buffer, + 0, + part, + 0, + (int)readed + ); + + return part; + } + + return buffer; + } + + + public ulong? ReadPointer(ulong offset) + { + BinaryReader reader = new BinaryReader(this); + + reader.Position = offset; + + bool ok = NativeMethods.BNReadPointer( + this.handle , + reader.DangerousGetHandle(), + out ulong value + ); + + return ok ? value : null; + } + + public ulong WriteBuffer(ulong offset , DataBuffer buffer) + { + return NativeMethods.BNWriteViewBuffer( + this.handle , + offset , + buffer.DangerousGetHandle() + ); + } + + public ulong WriteData(ulong offset , byte[] data) + { + return NativeMethods.BNWriteViewData( + this.handle , + offset , + data, + (ulong)data.Length + ); + } + + public ulong InsertBuffer(ulong offset , DataBuffer buffer) + { + return NativeMethods.BNInsertViewBuffer( + this.handle , + offset , + buffer.DangerousGetHandle() + ); + } + + public ulong InsertData(ulong offset , byte[] data) + { + return NativeMethods.BNInsertViewData( + this.handle , + offset , + data, + (ulong)data.Length + ); + } + + + public ulong RemoveData(ulong offset , ulong length) + { + return NativeMethods.BNRemoveViewData(this.handle , offset , length); + } + + public float[] GetEntropy(ulong offset , ulong length , ulong blockSize) + { + if (0 == length) + { + return Array.Empty(); + } + + if (0 == blockSize) + { + blockSize = this.Length; + } + + float[] entropy= new float[ ( length / blockSize) + 1]; + + ulong arrayLength = NativeMethods.BNGetEntropy( + this.handle , + offset , + length , + blockSize, + ref entropy + ); + + return entropy; + } + + public ModificationStatus GetModification(ulong offset) + { + return NativeMethods.BNGetModification( + this.handle , + offset + ); + } + + public ModificationStatus[] GetModificationStatus(ulong offset , ulong length ) + { + ModificationStatus[] buffer = new ModificationStatus[length]; + + ulong written = NativeMethods.BNGetModificationArray( + this.handle , + offset , + buffer, + length + ); + + if (0 == written) + { + return Array.Empty(); + } + + if (written == length) + { + return buffer; + } + + ModificationStatus[] status = new ModificationStatus[written]; + + Array.Copy(buffer, status, (long)written); + + return status; + } + + public ulong GetNextValidOffset(ulong offset) + { + return NativeMethods.BNGetNextValidOffset(this.handle , offset); + } + + public bool IsValidOffset(ulong offset) + { + return NativeMethods.BNIsValidOffset(this.handle , offset); + } + + public bool IsOffsetReadable(ulong offset) + { + return NativeMethods.BNIsOffsetReadable(this.handle , offset); + } + + public bool IsOffsetWritable(ulong offset) + { + return NativeMethods.BNIsOffsetWritable(this.handle , offset); + } + + public bool IsOffsetExecutable(ulong offset) + { + return NativeMethods.BNIsOffsetExecutable(this.handle , offset); + } + + public bool IsOffsetBackedByFile(ulong offset) + { + return NativeMethods.BNIsOffsetBackedByFile(this.handle , offset); + } + + public bool IsOffsetCodeSemantics(ulong offset) + { + return NativeMethods.BNIsOffsetCodeSemantics(this.handle , offset); + } + + public bool IsOffsetExternSemantics(ulong offset) + { + return NativeMethods.BNIsOffsetExternSemantics(this.handle , offset); + } + + public bool IsOffsetWritableSemantics(ulong offset) + { + return NativeMethods.BNIsOffsetWritableSemantics(this.handle , offset); + } + + public bool SaveToFile(FileAccessor accessor) + { + return NativeMethods.BNSaveToFile(this.handle , accessor.ToNative()); + } + + public bool SaveToFilename(string filename) + { + if (!Path.IsPathRooted(filename)) + { + filename = Path.GetFullPath(filename); + } + + string? dirname = Path.GetDirectoryName(filename); + if (!string.IsNullOrEmpty(dirname) && !Directory.Exists(dirname)) + { + Directory.CreateDirectory(dirname); + } + + return NativeMethods.BNSaveToFilename( + this.handle , + filename + ); + } + + public Function? AddFunctionForAnalysis( + ulong address , + Platform? platform = null, + bool autoDiscovered = false, + BinaryNinja.Type? functionType = null + ) + { + if (null == platform) + { + platform = this.DefaultPlatform; + } + + return Function.TakeHandle( + + NativeMethods.BNAddFunctionForAnalysis( + this.handle , + null == platform ? IntPtr.Zero : platform.DangerousGetHandle() , + address , + autoDiscovered , + null == functionType ? IntPtr.Zero : functionType.DangerousGetHandle() + ) + ); + } + + public void AddEntryPointForAnalysis(ulong address , Platform? platform = null ) + { + if (null == platform) + { + platform = this.DefaultPlatform; + } + + NativeMethods.BNAddEntryPointForAnalysis( + this.handle , + null == platform ? IntPtr.Zero : platform.DangerousGetHandle() , + address + ); + } + + public void AddToEntryFunctions(Function function) + { + NativeMethods.BNAddToEntryFunctions( + this.handle , + function.DangerousGetHandle() + ); + } + + public void RemoveAnalysisFunction(Function function , bool updateRefs = false ) + { + NativeMethods.BNRemoveAnalysisFunction( + this.handle , + function.DangerousGetHandle(), + updateRefs + ); + } + + public Function? CreateUserFunction(ulong address , Platform? platform = null) + { + if (null == platform) + { + platform = this.DefaultPlatform; + } + + return Function.TakeHandle( + + NativeMethods.BNCreateUserFunction( + this.handle , + null == platform ? IntPtr.Zero : platform.DangerousGetHandle() , + address + ) + ); + } + + public void RemoveUserFunction(Function function ) + { + NativeMethods.BNRemoveUserFunction( + this.handle , + function.DangerousGetHandle() + ); + } + + public void AddAnalysisOption(string option) + { + NativeMethods.BNAddAnalysisOption(this.handle , option); + } + + public bool HasInitialAnalysis + { + get + { + return NativeMethods.BNHasInitialAnalysis(this.handle); + } + } + + public void SetAnalysisHold(bool enable ) + { + NativeMethods.BNSetAnalysisHold(this.handle , enable); + } + + public bool FunctionAnalysisUpdateDisabled + { + get + { + return NativeMethods.BNGetFunctionAnalysisUpdateDisabled(this.handle); + } + + set + { + NativeMethods.BNSetFunctionAnalysisUpdateDisabled(this.handle ,value); + } + } + + public void UpdateAnalysis() + { + NativeMethods.BNUpdateAnalysis(this.handle); + } + + public void UpdateAnalysisAndWait() + { + NativeMethods.BNUpdateAnalysisAndWait(this.handle); + } + + public void AbortAnalysis() + { + NativeMethods.BNAbortAnalysis(this.handle); + } + + public bool AnalysisIsAborted + { + get + { + return NativeMethods.BNAnalysisIsAborted(this.handle); + } + } + + public bool ShouldSkipTargetAnalysis( + ArchitectureAndAddress source , + Function sourceFunction, + ulong sourceEnd, + ArchitectureAndAddress target + ) + { + return NativeMethods.BNShouldSkipTargetAnalysis( + this.handle, + source.ToNative(), + sourceFunction.DangerousGetHandle(), + sourceEnd, + target.ToNative() + ); + } + + public void DefineDataVariable(ulong address , TypeWithConfidence type) + { + NativeMethods.BNDefineDataVariable( + this.handle, + address , + type.ToNative() + ); + } + + public void DefineUserDataVariable(ulong address , TypeWithConfidence type) + { + NativeMethods.BNDefineUserDataVariable( + this.handle, + address , + type.ToNative() + ); + } + + public void UndefineDataVariable(ulong address , bool blacklist = false) + { + NativeMethods.BNUndefineDataVariable(this.handle , address , blacklist); + } + + public void UndefineUserDataVariable(ulong address ) + { + NativeMethods.BNUndefineUserDataVariable(this.handle , address); + } + + public DataVariable? GetDataVariableAtAddress(ulong address) + { + bool ok = NativeMethods.BNGetDataVariableAtAddress( + this.handle , + address , + out BNDataVariable native + ); + + if (!ok) + { + return null; + } + + return DataVariable.TakeNative(native); + } + + public Function[] GetFunctionsContainingAddress(ulong address) + { + IntPtr arrayPointer = NativeMethods.BNGetAnalysisFunctionsContainingAddress( + this.handle , + address , + out ulong arrayLength + ); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer , + arrayLength , + Function.MustNewFromHandle, + NativeMethods.BNFreeFunctionList + ); + } + + public Function[] GetFunctionsByName(string name) + { + Symbol[] symbols = this.GetSymbolsByName(name); + + List functions = new List(); + + foreach (Symbol symbol in symbols) + { + Function? function = this.GetFunctionByAddress( + symbol.Address + ); + + if (null != function) + { + functions.Add(function); + } + } + + return functions.ToArray(); + } + + public Function? GetFunctionByRawName(string name , Platform? platform = null) + { + Symbol? symbol = this.GetSymbolByRawName(name); + + if (null == symbol) + { + return null; + } + + return this.GetFunctionByAddress(symbol.Address); + } + + public LowLevelILFunction? GetLowLevelILFunctionByRawName( + string name , + Platform? platform = null) + { + Function? function = this.GetFunctionByRawName(name); + + if (null == function) + { + return null; + } + + return function.GetLowLevelIL(); + } + + public MediumLevelILFunction? GetMediumLevelILFunctionByRawName( + string name , + Platform? platform = null) + { + Function? function = this.GetFunctionByRawName(name); + + if (null == function) + { + return null; + } + + return function.GetMediumLevelIL(); + } + + public HighLevelILFunction? GetHighLevelILFunctionByRawName( + string name , + Platform? platform = null) + { + Function? function = this.GetFunctionByRawName(name); + + if (null == function) + { + return null; + } + + return function.GetHighLevelIL(); + } + + public LanguageRepresentationFunction? GetLanguageRepresentationFunctionByRawName( + string name , + string language = "Pseudo C", + Platform? platform = null) + { + Function? function = this.GetFunctionByRawName(name); + + if (null == function) + { + return null; + } + + return function.GetLanguageRepresentation(language); + } + + public Function? GetFunctionByAddress(ulong address , Platform? platform = null) + { + if (null == platform) + { + platform = this.DefaultPlatform; + } + + return Function.TakeHandle( + NativeMethods.BNGetAnalysisFunction( + this.handle , + null == platform ? IntPtr.Zero : platform.DangerousGetHandle() , + address + ) + ); + } + + public Function[] GetFunctionsForAddress(ulong address) + { + IntPtr arrayPointer = NativeMethods.BNGetAnalysisFunctionsForAddress( + this.handle , + address , + out ulong arrayLength + ); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer , + arrayLength , + Function.MustNewFromHandle, + NativeMethods.BNFreeFunctionList + ); + } + + public Function? GetRecentFunctionForAddress(ulong address ) + { + return Function.TakeHandle( + NativeMethods.BNGetRecentAnalysisFunctionForAddress( + this.handle , + address + ) + ); + } + + public BasicBlock[] GetBasicBlocksForAddress(ulong address) + { + IntPtr arrayPointer = NativeMethods.BNGetBasicBlocksForAddress( + this.handle , + address , + out ulong arrayLength + ); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer , + arrayLength , + BasicBlock.MustNewFromHandle, + NativeMethods.BNFreeBasicBlockList + ); + } + + public BasicBlock[] GetBasicBlocksStartingAtAddress(ulong address) + { + IntPtr arrayPointer = NativeMethods.BNGetBasicBlocksStartingAtAddress( + this.handle , + address , + out ulong arrayLength + ); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer , + arrayLength , + BasicBlock.MustNewFromHandle , + NativeMethods.BNFreeBasicBlockList + ); + } + + public BasicBlock? GetRecentBasicBlockForAddress(ulong address ) + { + return BasicBlock.TakeHandle( + NativeMethods.BNGetRecentBasicBlockForAddress( + this.handle , + address + ) + ); + } + + public ReferenceSource[] GetCodeReferences( + ulong address, + bool limit = false, + ulong maxItems = 0 + ) + { + IntPtr arrayPointer = NativeMethods.BNGetCodeReferences( + this.handle , + address , + out ulong arrayLength , + limit , + maxItems + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + ReferenceSource.FromNative , + NativeMethods.BNFreeCodeReferences + ); + } + + public ReferenceSource[] GetCodeReferencesInRange( + ulong address, + ulong length, + bool limit = false, + ulong maxItems = 0 + ) + { + IntPtr arrayPointer = NativeMethods.BNGetCodeReferencesInRange( + this.handle , + address , + length, + out ulong arrayLength , + limit , + maxItems + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + ReferenceSource.FromNative , + NativeMethods.BNFreeCodeReferences + ); + } + + public ulong[] GetCodeReferencesFrom(ReferenceSource source) + { + IntPtr arrayPointer = NativeMethods.BNGetCodeReferencesFrom( + this.handle , + source.ToNative() , + out ulong arrayLength + ); + + return UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNFreeAddressList + ); + } + + public ulong[] GetCodeReferencesFromInRange(ReferenceSource source , ulong length) + { + IntPtr arrayPointer = NativeMethods.BNGetCodeReferencesFromInRange( + this.handle , + source.ToNative() , + length, + out ulong arrayLength + ); + + return UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNFreeAddressList + ); + } + + public ulong[] GetDataReferences( + ulong address, + bool limit = false, + ulong maxItems = 0 + ) + { + IntPtr arrayPointer = NativeMethods.BNGetDataReferences( + this.handle , + address , + out ulong arrayLength , + limit, + maxItems + ); + + return UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNFreeDataReferences + ); + } + + public ulong[] GetDataReferencesInRange( + ulong address, + ulong length, + bool limit = false, + ulong maxItems = 0 + ) + { + IntPtr arrayPointer = NativeMethods.BNGetDataReferencesInRange( + this.handle , + address , + length, + out ulong arrayLength , + limit, + maxItems + ); + + return UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNFreeDataReferences + ); + } + + public ulong[] GetDataReferencesFrom(ulong address) + { + IntPtr arrayPointer = NativeMethods.BNGetDataReferencesFrom( + this.handle , + address , + out ulong arrayLength + ); + + return UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNFreeDataReferences + ); + } + + public ulong[] GetDataReferencesFromInRange(ulong address , ulong length) + { + IntPtr arrayPointer = NativeMethods.BNGetDataReferencesFromInRange( + this.handle , + address , + length, + out ulong arrayLength + ); + + return UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNFreeDataReferences + ); + } + + public ReferenceSource[] GetCodeReferencesForType( + QualifiedName type, + bool limit = false, + ulong maxItems = 0 + ) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + IntPtr arrayPointer = NativeMethods.BNGetCodeReferencesForType( + this.handle , + type.ToNativeEx(allocator) , + out ulong arrayLength , + limit , + maxItems + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + ReferenceSource.FromNative , + NativeMethods.BNFreeCodeReferences + ); + } + } + + public ReferenceSource[] GetCodeReferencesForTypeField( + QualifiedName type, + ulong offset, + bool limit = false, + ulong maxItems = 0 + ) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + IntPtr arrayPointer = NativeMethods.BNGetCodeReferencesForTypeField( + this.handle , + type.ToNativeEx(allocator) , + offset, + out ulong arrayLength , + limit , + maxItems + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + ReferenceSource.FromNative , + NativeMethods.BNFreeCodeReferences + ); + } + } + + public ulong[] GetDataReferencesForType( + QualifiedName type, + bool limit = false, + ulong maxItems = 0 + ) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + IntPtr arrayPointer = NativeMethods.BNGetDataReferencesForType( + this.handle , + type.ToNativeEx(allocator) , + out ulong arrayLength , + limit , + maxItems + ); + + return UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNFreeDataReferences + ); + } + } + + public ulong[] GetDataReferencesForTypeField( + QualifiedName type, + ulong offset, + bool limit = false, + ulong maxItems = 0 + ) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + IntPtr arrayPointer = NativeMethods.BNGetDataReferencesForTypeField( + this.handle , + type.ToNativeEx(allocator) , + offset, + out ulong arrayLength , + limit , + maxItems + ); + + return UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNFreeDataReferences + ); + } + } + + public ulong[] GetDataReferencesFromForTypeField( + QualifiedName type, + ulong offset, + bool limit = false, + ulong maxItems = 0 + ) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + IntPtr arrayPointer = NativeMethods.BNGetDataReferencesFromForTypeField( + this.handle , + type.ToNativeEx(allocator) , + offset, + out ulong arrayLength , + limit , + maxItems + ); + + return UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNFreeDataReferences + ); + } + } + + public TypeReferenceSource[] GetTypeReferencesForType( + QualifiedName type, + bool limit = false, + ulong maxItems = 0 + ) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + IntPtr arrayPointer = NativeMethods.BNGetTypeReferencesForType( + this.handle , + type.ToNativeEx(allocator) , + out ulong arrayLength , + limit , + maxItems + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + TypeReferenceSource.FromNative , + NativeMethods.BNFreeTypeReferences + ); + } + } + + public TypeReferenceSource[] GetTypeReferencesForTypeField( + QualifiedName type, + ulong offset , + bool limit = false, + ulong maxItems = 0 + ) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + IntPtr arrayPointer = NativeMethods.BNGetTypeReferencesForTypeField( + this.handle , + type.ToNativeEx(allocator) , + offset, + out ulong arrayLength , + limit , + maxItems + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + TypeReferenceSource.FromNative , + NativeMethods.BNFreeTypeReferences + ); + } + } + + public TypeReferenceSource[] GetCodeReferencesForTypeFrom(ReferenceSource source) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + IntPtr arrayPointer = NativeMethods.BNGetCodeReferencesForTypeFrom( + this.handle , + source.ToNative(), + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + TypeReferenceSource.FromNative , + NativeMethods.BNFreeTypeReferences + ); + } + } + + public TypeReferenceSource[] GetCodeReferencesForTypeFromInRange( + ReferenceSource source, + ulong length + ) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + IntPtr arrayPointer = NativeMethods.BNGetCodeReferencesForTypeFromInRange( + this.handle , + source.ToNative(), + length, + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + TypeReferenceSource.FromNative , + NativeMethods.BNFreeTypeReferences + ); + } + } + + public TypeReferenceSource[] GetCodeReferencesForTypeFieldsFrom(ReferenceSource source) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + IntPtr arrayPointer = NativeMethods.BNGetCodeReferencesForTypeFieldsFrom( + this.handle , + source.ToNative(), + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + TypeReferenceSource.FromNative , + NativeMethods.BNFreeTypeReferences + ); + } + } + + public TypeReferenceSource[] GetCodeReferencesForTypeFieldsFromInRange( + ReferenceSource source, + ulong length + ) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + IntPtr arrayPointer = NativeMethods.BNGetCodeReferencesForTypeFieldsFromInRange( + this.handle , + source.ToNative(), + length, + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + TypeReferenceSource.FromNative , + NativeMethods.BNFreeTypeReferences + ); + } + } + + + public void AddUserDataReference(ulong from , ulong to) + { + NativeMethods.BNAddUserDataReference(this.handle ,from ,to); + } + + public void RemoveDataReference(ulong from , ulong to) + { + NativeMethods.BNRemoveDataReference(this.handle ,from ,to); + } + + public void RemoveUserDataReference(ulong from , ulong to) + { + NativeMethods.BNRemoveUserDataReference(this.handle ,from ,to); + } + + public ulong[] GetAllFieldsReferenced(QualifiedName type) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + IntPtr arrayPointer = NativeMethods.BNGetAllFieldsReferenced( + this.handle , + type.ToNativeEx(allocator) , + out ulong arrayLength + ); + + return UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNFreeDataReferences + ); + } + } + + public TypeFieldReferenceSizeInfo[] GetAllSizesReferenced(QualifiedName type) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + IntPtr arrayPointer = NativeMethods.BNGetAllSizesReferenced( + this.handle , + type.ToNativeEx(allocator) , + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + TypeFieldReferenceSizeInfo.FromNative, + NativeMethods.BNFreeTypeFieldReferenceSizeInfo + ); + } + } + + public TypeFieldReferenceTypeInfo[] GetAllTypesReferenced(QualifiedName type) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + IntPtr arrayPointer = NativeMethods.BNGetAllTypesReferenced( + this.handle , + type.ToNativeEx(allocator) , + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + TypeFieldReferenceTypeInfo.FromNative, + NativeMethods.BNFreeTypeFieldReferenceTypeInfo + ); + } + } + + public ulong[] GetSizesReferenced(QualifiedName type , ulong offset) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + IntPtr arrayPointer = NativeMethods.BNGetSizesReferenced( + this.handle , + type.ToNativeEx(allocator) , + offset, + out ulong arrayLength + ); + + return UnsafeUtils.TakeNumberArrayEx( + arrayPointer , + arrayLength , + NativeMethods.BNFreeTypeFieldReferenceSizes + ); + } + } + + public TypeWithConfidence[] GetTypesReferenced(QualifiedName type , ulong offset) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + IntPtr arrayPointer = NativeMethods.BNGetTypesReferenced( + this.handle , + type.ToNativeEx(allocator) , + offset, + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + TypeWithConfidence.FromNative, + NativeMethods.BNFreeTypeFieldReferenceTypes + ); + } + } + + public QualifiedName[] GetOutgoingDirectTypeReferences(QualifiedName type) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + IntPtr arrayPointer = NativeMethods.BNGetOutgoingDirectTypeReferences( + this.handle , + type.ToNativeEx(allocator) , + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + QualifiedName.FromNative, + NativeMethods.BNFreeTypeNameList + ); + } + } + + public QualifiedName[] GetOutgoingRecursiveTypeReferences(QualifiedName[] types) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + IntPtr arrayPointer = NativeMethods.BNGetOutgoingRecursiveTypeReferences( + this.handle , + allocator.ConvertToNativeArrayEx( + types), + (ulong)types.Length, + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + QualifiedName.FromNative, + NativeMethods.BNFreeTypeNameList + ); + } + } + + public QualifiedName[] GetIncomingDirectTypeReferences(QualifiedName type) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + IntPtr arrayPointer = NativeMethods.BNGetIncomingDirectTypeReferences( + this.handle , + type.ToNativeEx(allocator) , + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + QualifiedName.FromNative, + NativeMethods.BNFreeTypeNameList + ); + } + } + + public QualifiedName[] GetIncomingRecursiveTypeReferences(QualifiedName[] types) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + IntPtr arrayPointer = NativeMethods.BNGetIncomingRecursiveTypeReferences( + this.handle , + allocator.ConvertToNativeArrayEx( + types), + (ulong)types.Length, + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + QualifiedName.FromNative, + NativeMethods.BNFreeTypeNameList + ); + } + } + + public Structure CreateStructureFromOffsetAccess(QualifiedName name , out bool newMember) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + return Structure.MustTakeHandle( + NativeMethods.BNCreateStructureFromOffsetAccess( + this.handle, + name.ToNativeEx(allocator) , + out newMember + ) + ); + } + } + + public TypeWithConfidence CreateStructureMemberFromAccess(QualifiedName name , ulong offset) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + return TypeWithConfidence.FromNative( + NativeMethods.BNCreateStructureMemberFromAccess( + this.handle, + name.ToNativeEx(allocator) , + offset + ) + ); + } + } + + public void AddExpressionParserMagicValue(string name , ulong value) + { + NativeMethods.BNAddExpressionParserMagicValue(this.handle , name , value); + } + + public void RemoveExpressionParserMagicValue(string name ) + { + NativeMethods.BNRemoveExpressionParserMagicValue(this.handle , name ); + } + + public void AddExpressionParserMagicValues(IDictionary items) + { + NativeMethods.BNAddExpressionParserMagicValues( + this.handle , + items.Keys.ToArray() , + items.Values.ToArray(), + (ulong)items.Count + ); + } + + public void RemoveExpressionParserMagicValues(string[] names) + { + NativeMethods.BNRemoveExpressionParserMagicValues( + this.handle , + names, + (ulong)names.Length + ); + } + + public bool GetExpressionParserMagicValue(string name , out ulong value) + { + return NativeMethods.BNGetExpressionParserMagicValue( + this.handle , + name , + out value + ); + } + + + public ReferenceSource[] GetCallers(ulong callee) + { + IntPtr arrayPointer = NativeMethods.BNGetCallers( + this.handle , + callee , + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + ReferenceSource.FromNative , + NativeMethods.BNFreeCodeReferences + ); + } + + public ulong[] GetCallees(ReferenceSource callSite) + { + IntPtr arrayPointer = NativeMethods.BNGetCallees( + this.handle , + callSite.ToNative() , + out ulong arrayLength + ); + + return UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNFreeAddressList + ); + } + + public Symbol? GetSymbolByAddress(ulong address , NameSpace? ns = null) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + return Symbol.TakeHandle( + NativeMethods.BNGetSymbolByAddress( + this.handle , + address , + null == ns + ? IntPtr.Zero + : allocator.AllocStruct( + ns.ToNativeEx(allocator) + ) + ) + ); + } + } + + public Symbol[] GetSymbolsByRawName(string name, NameSpace? ns = null) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + IntPtr arrayPointer = NativeMethods.BNGetSymbolsByRawName( + this.handle , + name , + out ulong arrayLength , + null == ns + ? IntPtr.Zero + : allocator.AllocStruct( + ns.ToNativeEx(allocator) + ) + ); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer , + arrayLength , + Symbol.MustNewFromHandle , + NativeMethods.BNFreeSymbolList + ); + } + } + + public Symbol? GetSymbolByRawName(string name, NameSpace? ns = null) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + return Symbol.TakeHandle( + NativeMethods.BNGetSymbolByRawName( + this.handle , + name , + null == ns + ? IntPtr.Zero + : allocator.AllocStruct( + ns.ToNativeEx(allocator) + ) + ) + ); + } + } + + public Symbol[] GetSymbolsByName(string name, NameSpace? ns = null) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + IntPtr arrayPointer = NativeMethods.BNGetSymbolsByName( + this.handle , + name , + out ulong arrayLength , + null == ns + ? IntPtr.Zero + : allocator.AllocStruct( + ns.ToNativeEx(allocator) + ) + ); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer , + arrayLength , + Symbol.MustNewFromHandle , + NativeMethods.BNFreeSymbolList + ); + } + } + + public Symbol[] GetSymbols(NameSpace? ns = null) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + IntPtr arrayPointer = NativeMethods.BNGetSymbols( + this.handle , + out ulong arrayLength , + null == ns + ? IntPtr.Zero + : allocator.AllocStruct( + ns.ToNativeEx(allocator) + ) + ); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer , + arrayLength , + Symbol.MustNewFromHandle , + NativeMethods.BNFreeSymbolList + ); + } + } + + + public Symbol[] Symbols + { + get + { + return this.GetSymbols(null); + } + } + + public string[] SymbolNames + { + get + { + List items = new List(); + + foreach (Symbol symbol in this.Symbols) + { + items.Add(symbol.RawName); + } + + return items.ToArray(); + } + } + + public string[] SymbolFullNames + { + get + { + List items = new List(); + + foreach (Symbol symbol in this.Symbols) + { + items.Add(symbol.FullName); + } + + return items.ToArray(); + } + } + + public Symbol[] GetSymbolsInRange( + ulong start , + ulong length, + NameSpace? ns = null) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + IntPtr arrayPointer = NativeMethods.BNGetSymbolsInRange( + this.handle , + start, + length, + out ulong arrayLength , + null == ns + ? IntPtr.Zero + : allocator.AllocStruct( + ns.ToNativeEx(allocator) + ) + ); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer , + arrayLength , + Symbol.MustNewFromHandle , + NativeMethods.BNFreeSymbolList + ); + } + } + + + public Symbol[] GetSymbolsOfType( + SymbolType type, + NameSpace? ns = null) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + IntPtr arrayPointer = NativeMethods.BNGetSymbolsOfType( + this.handle , + type, + out ulong arrayLength , + null == ns + ? IntPtr.Zero + : allocator.AllocStruct( + ns.ToNativeEx(allocator) + ) + ); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer , + arrayLength , + Symbol.MustNewFromHandle , + NativeMethods.BNFreeSymbolList + ); + } + } + + public Symbol[] GetSymbolsOfTypeInRange( + SymbolType type, + ulong start , + ulong length, + NameSpace? ns = null) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + IntPtr arrayPointer = NativeMethods.BNGetSymbolsOfTypeInRange( + this.handle , + type, + start, + length, + out ulong arrayLength , + null == ns + ? IntPtr.Zero + : allocator.AllocStruct( + ns.ToNativeEx(allocator) + ) + ); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer , + arrayLength , + Symbol.MustNewFromHandle , + NativeMethods.BNFreeSymbolList + ); + } + } + + public void DefineAutoSymbol(Symbol symbol) + { + NativeMethods.BNDefineAutoSymbol(this.handle , symbol.DangerousGetHandle()); + } + + public Symbol? DefineAutoSymbolAndVariableOrFunction( + Symbol symbol, + Platform? platform = null, + TypeWithConfidence? type = null + ) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + return Symbol.TakeHandle( + NativeMethods.BNDefineAutoSymbolAndVariableOrFunction( + this.handle , + symbol.DangerousGetHandle(), + symbol.DangerousGetHandle(), + null == type ? IntPtr.Zero : + allocator.AllocStruct( type.ToNative() ) + ) + ); + } + } + + public void UndefineAutoSymbol(Symbol symbol) + { + NativeMethods.BNUndefineAutoSymbol(this.handle , symbol.DangerousGetHandle()); + } + + public void DefineUserSymbol(Symbol symbol) + { + NativeMethods.BNDefineUserSymbol(this.handle , symbol.DangerousGetHandle()); + } + + public void UndefineUserSymbol(Symbol symbol) + { + NativeMethods.BNUndefineUserSymbol(this.handle , symbol.DangerousGetHandle()); + } + + public void DefineImportedFunction( + Symbol symbol, + Function function, + BinaryNinja.Type? type + ) + { + NativeMethods.BNDefineImportedFunction( + this.handle , + symbol.DangerousGetHandle(), + function.DangerousGetHandle(), + null == type ? IntPtr.Zero : type.DangerousGetHandle() + ); + } + + public void BeginBulkModifySymbols() + { + NativeMethods.BNBeginBulkModifySymbols(this.handle ); + } + + public void EndBulkModifySymbols() + { + NativeMethods.BNEndBulkModifySymbols(this.handle ); + } + + public TagType CreateTagType() + { + return TagType.MustTakeHandle( + NativeMethods.BNCreateTagType(this.handle) + ); + } + + public void AddTagType(TagType tagType) + { + NativeMethods.BNAddTagType(this.handle , tagType.DangerousGetHandle()); + } + + public void RemoveTag(Tag tag , bool user) + { + NativeMethods.BNRemoveTag(this.handle , tag.DangerousGetHandle() , user); + } + + public void RemoveTagType(TagType tagType) + { + NativeMethods.BNRemoveTagType(this.handle , tagType.DangerousGetHandle()); + } + + public TagType[] TagTypes + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetTagTypes( + this.handle, + out ulong arrayLength + ); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer , + arrayLength, + TagType.MustNewFromHandle, + NativeMethods.BNFreeTagTypeList + ); + } + } + + public TagType? GetTagType(string name) + { + return TagType.TakeHandle( + NativeMethods.BNGetTagType(this.handle , name ) + ); + } + + public TagType? GetTagTypeById(string name) + { + return TagType.TakeHandle( + NativeMethods.BNGetTagTypeById(this.handle , name ) + ); + } + + public void AddTag(Tag tag , bool user) + { + NativeMethods.BNAddTag(this.handle , tag.DangerousGetHandle() , user); + } + + public void AddUserDataTag(ulong address , Tag tag ) + { + NativeMethods.BNAddUserDataTag( + this.handle , + address , tag.DangerousGetHandle()); + } + + public TagReference[] TagReferences + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetAllTagReferences( + this.handle , + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + TagReference.FromNative , + NativeMethods.BNFreeTagReferences + ); + } + } + + public TagReference[] AddressTagReferences + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetAllAddressTagReferences( + this.handle , + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + TagReference.FromNative , + NativeMethods.BNFreeTagReferences + ); + } + } + + public TagReference[] FunctionTagReferences + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetAllFunctionTagReferences( + this.handle , + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + TagReference.FromNative , + NativeMethods.BNFreeTagReferences + ); + } + } + + public TagReference[] DataTagReferences + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetDataTagReferences( + this.handle , + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + TagReference.FromNative , + NativeMethods.BNFreeTagReferences + ); + } + } + + public TagReference[] AutoDataTagReferences + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetAutoDataTagReferences( + this.handle , + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + TagReference.FromNative , + NativeMethods.BNFreeTagReferences + ); + } + } + + public TagReference[] UserDataTagReferences + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetUserDataTagReferences( + this.handle , + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + TagReference.FromNative , + NativeMethods.BNFreeTagReferences + ); + } + } + + + + public Tag[] GetDataTags(ulong address) + { + IntPtr arrayPointer = NativeMethods.BNGetDataTags( + this.handle , + address, + out ulong arrayLength + ); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer , + arrayLength , + Tag.MustNewFromHandle , + NativeMethods.BNFreeTagList + ); + } + + public Tag[] GetAutoDataTags(ulong address) + { + IntPtr arrayPointer = NativeMethods.BNGetAutoDataTags( + this.handle , + address, + out ulong arrayLength + ); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer , + arrayLength , + Tag.MustNewFromHandle , + NativeMethods.BNFreeTagList + ); + } + + public Tag[] GetUserDataTags(ulong address) + { + IntPtr arrayPointer = NativeMethods.BNGetUserDataTags( + this.handle , + address, + out ulong arrayLength + ); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer , + arrayLength , + Tag.MustNewFromHandle , + NativeMethods.BNFreeTagList + ); + } + + + public TagReference[] GetDataTagsInRange(ulong start , ulong end) + { + IntPtr arrayPointer = NativeMethods.BNGetDataTagsInRange( + this.handle , + start, + end, + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + TagReference.FromNative , + NativeMethods.BNFreeTagReferences + ); + } + + public TagReference[] GetAutoDataTagsInRange(ulong start , ulong end) + { + IntPtr arrayPointer = NativeMethods.BNGetAutoDataTagsInRange( + this.handle , + start, + end, + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + TagReference.FromNative , + NativeMethods.BNFreeTagReferences + ); + } + + public TagReference[] GetUserDataTagsInRange(ulong start , ulong end) + { + IntPtr arrayPointer = NativeMethods.BNGetUserDataTagsInRange( + this.handle , + start, + end, + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + TagReference.FromNative , + NativeMethods.BNFreeTagReferences + ); + } + + public void RemoveUserDataTag(ulong address , Tag tag) + { + NativeMethods.BNRemoveUserDataTag( + this.handle , + address , + tag.DangerousGetHandle() + ); + } + + public void RemoveUserDataTagsOfType(ulong address , TagType tagType) + { + NativeMethods.BNRemoveUserDataTagsOfType( + this.handle , + address , + tagType.DangerousGetHandle() + ); + } + + + public void RemoveAutoDataTag(ulong address , Tag tag) + { + NativeMethods.BNRemoveAutoDataTag( + this.handle , + address , + tag.DangerousGetHandle() + ); + } + + public void RemoveAutoDataTagsOfType(ulong address , TagType tagType) + { + NativeMethods.BNRemoveAutoDataTagsOfType( + this.handle , + address , + tagType.DangerousGetHandle() + ); + } + + public string CheckForStringAnnotationType( + + ulong address , + + out StringType strType , + + bool allowShortStrings , + + bool allowLargeStrings , + + ulong childWidth + ) + { + bool ok = NativeMethods.BNCheckForStringAnnotationType( + this.handle , + address , + out IntPtr textPointer , + out strType , + allowShortStrings , + allowLargeStrings , + childWidth + ); + + if (!ok) + { + return string.Empty; + } + + return UnsafeUtils.TakeUtf8String(textPointer); + } + + public bool CanAssemble(Architecture? arch = null) + { + if (null == arch) + { + arch = this.DefaultArchitecture; + } + + return NativeMethods.BNCanAssemble( + this.handle , + null == arch ? IntPtr.Zero : arch.DangerousGetHandle() + ); + } + + public bool IsNeverBranchPatchAvailable(ulong address , Architecture? arch = null) + { + if (null == arch) + { + arch = this.DefaultArchitecture; + } + + return NativeMethods.BNIsNeverBranchPatchAvailable( + this.handle , + null == arch ? IntPtr.Zero : arch.DangerousGetHandle(), + address + ); + } + + public bool IsAlwaysBranchPatchAvailable(ulong address , Architecture? arch = null) + { + if (null == arch) + { + arch = this.DefaultArchitecture; + } + + return NativeMethods.BNIsAlwaysBranchPatchAvailable( + this.handle , + null == arch ? IntPtr.Zero : arch.DangerousGetHandle(), + address + ); + } + + public bool IsInvertBranchPatchAvailable(ulong address , Architecture? arch = null) + { + if (null == arch) + { + arch = this.DefaultArchitecture; + } + + return NativeMethods.BNIsInvertBranchPatchAvailable( + this.handle , + null == arch ? IntPtr.Zero : arch.DangerousGetHandle(), + address + ); + } + + public bool IsSkipAndReturnZeroPatchAvailable(ulong address , Architecture? arch = null) + { + if (null == arch) + { + arch = this.DefaultArchitecture; + } + + return NativeMethods.BNIsSkipAndReturnZeroPatchAvailable( + this.handle , + null == arch ? IntPtr.Zero : arch.DangerousGetHandle(), + address + ); + } + + public bool IsSkipAndReturnValuePatchAvailable(ulong address , Architecture? arch = null) + { + if (null == arch) + { + arch = this.DefaultArchitecture; + } + + return NativeMethods.BNIsSkipAndReturnValuePatchAvailable( + this.handle , + null == arch ? IntPtr.Zero : arch.DangerousGetHandle(), + address + ); + } + + public bool ConvertToNop(ulong address , Architecture? arch = null) + { + if (null == arch) + { + arch = this.DefaultArchitecture; + } + + + return NativeMethods.BNConvertToNop( + this.handle , + null == arch ? IntPtr.Zero : arch.DangerousGetHandle(), + address + ); + } + + public bool AlwaysBranch(ulong address , Architecture? arch = null) + { + if (null == arch) + { + arch = this.DefaultArchitecture; + } + + + return NativeMethods.BNAlwaysBranch( + this.handle , + null == arch ? IntPtr.Zero : arch.DangerousGetHandle(), + address + ); + } + + public bool InvertBranch(ulong address , Architecture? arch = null) + { + if (null == arch) + { + arch = this.DefaultArchitecture; + } + + + return NativeMethods.BNInvertBranch( + this.handle , + null == arch ? IntPtr.Zero : arch.DangerousGetHandle(), + address + ); + } + + public bool SkipAndReturnValue( + ulong address , + ulong value = 0, + Architecture? arch = null) + { + if (null == arch) + { + arch = this.DefaultArchitecture; + } + + + return NativeMethods.BNSkipAndReturnValue( + this.handle , + null == arch ? IntPtr.Zero : arch.DangerousGetHandle(), + address, + value + ); + } + + public ulong GetInstructionLength(ulong address , Architecture? arch = null) + { + if (null == arch) + { + arch = this.DefaultArchitecture; + } + + return NativeMethods.BNGetInstructionLength( + this.handle , + null == arch ? IntPtr.Zero : arch.DangerousGetHandle(), + address + ); + } + + public void NotifyDataWritten(ulong offset , ulong length) + { + NativeMethods.BNNotifyDataWritten( + this.handle , + offset, + length + ); + } + + public void NotifyDataInserted(ulong offset , ulong length) + { + NativeMethods.BNNotifyDataInserted( + this.handle , + offset, + length + ); + } + + public void NotifyDataRemoved(ulong offset , ulong length) + { + NativeMethods.BNNotifyDataRemoved( + this.handle , + offset, + length + ); + } + + public Component? GetComponentByGuid( string guid) + { + return Component.TakeHandle( + NativeMethods.BNGetComponentByGuid(this.handle , guid) + ); + } + + public Component? GetComponentByPath( string path) + { + return Component.TakeHandle( + NativeMethods.BNGetComponentByPath(this.handle , path) + ); + } + + public Component RootComponent + { + get + { + return Component.MustTakeHandle( + NativeMethods.BNGetRootComponent(this.handle ) + ); + } + } + + public Component CreateComponent() + { + return Component.MustTakeHandle( + NativeMethods.BNCreateComponent( + this.handle + ) + ); + } + + public Component CreateComponentWithParent(string parentGUID) + { + return Component.MustTakeHandle( + NativeMethods.BNCreateComponentWithParent( + this.handle , + parentGUID + ) + ); + } + + public Component CreateComponentWithName( string name) + { + return Component.MustTakeHandle( + NativeMethods.BNCreateComponentWithName( + this.handle , + name + ) + ); + } + + public Component CreateComponentWithParentAndName(string parentGUID , string name) + { + return Component.MustTakeHandle( + NativeMethods.BNCreateComponentWithParentAndName( + this.handle , + parentGUID , + name + ) + ); + } + + public bool RemoveComponent(Component component) + { + return NativeMethods.BNRemoveComponent( + this.handle , + component.DangerousGetHandle() + ); + } + + public bool RemoveComponentByGuid(string guid) + { + return NativeMethods.BNRemoveComponentByGuid( + this.handle , + guid + ); + } + + public Component[] GetFunctionParentComponents(Function function) + { + IntPtr arrayPointer = NativeMethods.BNGetFunctionParentComponents( + this.handle , + function.DangerousGetHandle() , + out ulong arrayLength + ); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer , + arrayLength, + Component.MustNewFromHandle, + NativeMethods.BNFreeComponents + ); + } + + public Component[] GetDataVariableParentComponents(ulong dataVariable) + { + IntPtr arrayPointer = NativeMethods.BNGetDataVariableParentComponents( + this.handle , + dataVariable, + out ulong arrayLength + ); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer , + arrayLength, + Component.MustNewFromHandle, + NativeMethods.BNFreeComponents + ); + } + + public StringReference[] StringReferences + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetStrings( + this.handle , + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArray( + arrayPointer , + arrayLength , + StringReference.FromNative , + NativeMethods.BNFreeStringReferenceList + ); + } + } + + public StringReference[] GetStringsInRange(ulong start , ulong length) + { + IntPtr arrayPointer = NativeMethods.BNGetStringsInRange( + this.handle , + start, + length, + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArray( + arrayPointer , + arrayLength , + StringReference.FromNative , + NativeMethods.BNFreeStringReferenceList + ); + } + + public StringReference? GetStringAtAddress(ulong address) + { + bool ok = NativeMethods.BNGetStringAtAddress( + this.handle , + address, + out BNStringReference strRef + ); + + if (!ok) + { + return null; + } + + return StringReference.FromNative(strRef); + } + + public ulong GetNextFunctionStartAfterAddress(ulong address) + { + return NativeMethods.BNGetNextFunctionStartAfterAddress(this.handle , address); + } + + public ulong GetNextBasicBlockStartAfterAddress(ulong address) + { + return NativeMethods.BNGetNextBasicBlockStartAfterAddress(this.handle , address); + } + + public ulong GetNextDataAfterAddress(ulong address) + { + return NativeMethods.BNGetNextDataAfterAddress(this.handle , address); + } + + public ulong GetNextDataVariableStartAfterAddress(ulong address) + { + return NativeMethods.BNGetNextDataVariableStartAfterAddress(this.handle , address); + } + + public DataVariable? GetNextDataVariableAfterAddress(ulong address) + { + while (address < this.End) + { + ulong dataVariableStart = this.GetNextDataVariableStartAfterAddress(address); + + if (dataVariableStart == this.End) + { + return null; + } + + DataVariable? variable = this.GetDataVariableAtAddress(dataVariableStart); + + if (null != variable) + { + if (variable.Address < dataVariableStart) + { + address = variable.Address + variable.Type.Width; + continue; + } + + return variable; + } + else + { + return null; + } + } + + return null; + } + + public ulong GetPreviousFunctionStartBeforeAddress(ulong address) + { + return NativeMethods.BNGetPreviousFunctionStartBeforeAddress(this.handle , address); + } + + public ulong GetPreviousBasicBlockStartBeforeAddress(ulong address) + { + return NativeMethods.BNGetPreviousBasicBlockStartBeforeAddress(this.handle , address); + } + + public ulong GetPreviousBasicBlockEndBeforeAddress(ulong address) + { + return NativeMethods.BNGetPreviousBasicBlockEndBeforeAddress(this.handle , address); + } + + public ulong GetPreviousDataBeforeAddress(ulong address) + { + return NativeMethods.BNGetPreviousDataBeforeAddress(this.handle , address); + } + + + public ulong GetPreviousDataVariableStartBeforeAddress(ulong address) + { + return NativeMethods.BNGetPreviousDataVariableStartBeforeAddress(this.handle , address); + } + + public DataVariable? GetPreviousDataVariableBeforeAddress(ulong address) + { + ulong dataVariableStart = this.GetNextDataVariableStartAfterAddress(address); + + if (dataVariableStart == this.Start) + { + return null; + } + + return this.GetDataVariableAtAddress(dataVariableStart); + } + + public QualifiedNameAndType? ParseTypeString( + string text , + QualifiedName[]? typesAllowRedefinition = null, + bool importDepencencies = true + ) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + bool ok = NativeMethods.BNParseTypeString( + this.handle , + text, + out BNQualifiedNameAndType result, + out IntPtr errorPointer, + new QualifiedNameList(typesAllowRedefinition).ToNativeEx(allocator), + importDepencencies + ); + + if (!ok) + { + string errors = UnsafeUtils.TakeAnsiString(errorPointer); + + if (!string.IsNullOrEmpty(errors)) + { + throw new Exception(errors); + } + + return null; + } + + return QualifiedNameAndType.TakeNative(result); + } + } + + public TypeParserResult? ParseTypesString( + string text , + string[] options, + string[] includeDirs, + QualifiedName[]? typesAllowRedefinition = null, + bool importDepencencies = true + ) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + bool ok = NativeMethods.BNParseTypesString( + this.handle , + text, + options, + (ulong)options.Length, + includeDirs, + (ulong)includeDirs.Length, + out BNTypeParserResult result, + out IntPtr errorPointer, + new QualifiedNameList(typesAllowRedefinition).ToNativeEx(allocator), + importDepencencies + ); + + if (!ok) + { + string errors = UnsafeUtils.TakeAnsiString(errorPointer); + + if (!string.IsNullOrEmpty(errors)) + { + throw new Exception(errors); + } + + return null; + } + + return TypeParserResult.TakeNative(result); + } + } + + public PossibleValueSet? ParsePossibleValueSet( + string text, + RegisterValueType state, + ulong here + ) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + bool ok = NativeMethods.BNParsePossibleValueSet( + this.handle , + text, + state, + out BNPossibleValueSet result, + here, + out IntPtr errorPointer + ); + + if (!ok) + { + string errors = UnsafeUtils.TakeAnsiString(errorPointer); + + if (!string.IsNullOrEmpty(errors)) + { + throw new Exception(errors); + } + + return null; + } + + return PossibleValueSet.TakeNative(result); + } + } + + public TypeContainer TypeContainer + { + get + { + return TypeContainer.MustTakeHandle( + NativeMethods.BNGetAnalysisTypeContainer(this.handle) + ); + } + } + + public TypeContainer AutoTypeContainer + { + get + { + return TypeContainer.MustTakeHandle( + NativeMethods.BNGetAnalysisAutoTypeContainer(this.handle) + ); + } + } + + public TypeContainer UserTypeContainer + { + get + { + return TypeContainer.MustTakeHandle( + NativeMethods.BNGetAnalysisUserTypeContainer(this.handle) + ); + } + } + + public BinaryNinja.Type? GetTypeByName(QualifiedName name) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + return BinaryNinja.Type.TakeHandle( + + NativeMethods.BNGetAnalysisTypeByName( + this.handle , + name.ToNativeEx(allocator) + ) + ); + } + } + + public BinaryNinja.Type? GetTypeById(string id) + { + return BinaryNinja.Type.TakeHandle( + + NativeMethods.BNGetAnalysisTypeById( + this.handle , + id + ) + ); + } + + public QualifiedName GetTypeNameById(string id) + { + return QualifiedName.TakeNative( + + NativeMethods.BNGetAnalysisTypeNameById( + this.handle , + id + ) + ); + } + + public string GetTypeId(QualifiedName name) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + return UnsafeUtils.TakeAnsiString( + + NativeMethods.BNGetAnalysisTypeId( + this.handle , + name.ToNativeEx(allocator) + ) + ); + } + } + + public void AddTypeLibrary(TypeLibrary library) + { + NativeMethods.BNAddBinaryViewTypeLibrary( + this.handle, + library.DangerousGetHandle() + ); + } + + public TypeLibrary? GetTypeLibrary(string name) + { + return TypeLibrary.TakeHandle( + NativeMethods.BNGetBinaryViewTypeLibrary( + this.handle , + name + ) + ); + } + + public bool IsTypeAutoDefined(QualifiedName name) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + return NativeMethods.BNIsAnalysisTypeAutoDefined( + this.handle , + name.ToNativeEx(allocator) + ); + } + } + + public QualifiedName DefineType( + string typeId , + QualifiedName defaultName, + BinaryNinja.Type type + ) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + return QualifiedName.TakeNative( + + NativeMethods.BNDefineAnalysisType( + this.handle , + typeId, + defaultName.ToNativeEx(allocator), + type.DangerousGetHandle() + ) + ); + } + } + + public void DefineUserType( + QualifiedName name , + BinaryNinja.Type type + ) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + NativeMethods.BNDefineUserAnalysisType( + this.handle , + name.ToNativeEx(allocator), + type.DangerousGetHandle() + ); + } + } + + public QualifiedNameAndId[] DefineTypes( + QualifiedNameTypeAndId[] types, + ProgressDelegate? progress = null + ) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + ulong arrayLength = NativeMethods.BNDefineAnalysisTypes( + this.handle , + allocator.ConvertToNativeArrayEx(types), + (ulong)types.Length, + null == progress ? IntPtr.Zero : + Marshal.GetFunctionPointerForDelegate( + UnsafeUtils.WrapProgressDelegate(progress) + ) , + IntPtr.Zero, + out IntPtr idsPointer, + out IntPtr namesPointer + ); + + string[] ids = UnsafeUtils.TakeStringArrayEx( + idsPointer , + arrayLength); + + QualifiedName[] names = UnsafeUtils.TakeStructArrayEx( + namesPointer , + arrayLength, + QualifiedName.FromNative, + NativeMethods.BNFreeTypeNameList + ); + + List targets = new List(); + + for (ulong i = 0; i < arrayLength; i++) + { + targets.Add( + new QualifiedNameAndId( + names[i], + ids[i] + ) + ); + } + + return targets.ToArray(); + } + } + + public void DefineUserTypes( + QualifiedNameAndType[] types, + ProgressDelegate? progress = null + ) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + NativeMethods.BNDefineUserAnalysisTypes( + this.handle , + allocator.ConvertToNativeArrayEx(types), + (ulong)types.Length, + null == progress ? IntPtr.Zero : + Marshal.GetFunctionPointerForDelegate( + UnsafeUtils.WrapProgressDelegate(progress) + ) , + IntPtr.Zero + ); + } + } + + public void UndefineType(string typeId) + { + NativeMethods.BNUndefineAnalysisType(this.handle , typeId); + } + + public void UndefineUserType(QualifiedName name) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + NativeMethods.BNUndefineUserAnalysisType( + this.handle , + name.ToNativeEx(allocator) + ); + } + } + + public void RenameType(QualifiedName oldName , QualifiedName newName) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + NativeMethods.BNRenameAnalysisType( + this.handle , + oldName.ToNativeEx(allocator), + newName.ToNativeEx(allocator) + ); + } + } + + public BinaryNinja.Type? GetSystemCallType(uint id , Platform? platform = null) + { + if (null == platform) + { + platform = this.DefaultPlatform; + } + + return BinaryNinja.Type.TakeHandle( + + NativeMethods.BNGetAnalysisSystemCallType( + this.handle , + null == platform ? IntPtr.Zero : platform.DangerousGetHandle() , + id + ) + ); + } + + public string GetSystemCallName(uint id , Platform? platform = null) + { + if (null == platform) + { + platform = this.DefaultPlatform; + } + + return UnsafeUtils.TakeAnsiString( + + NativeMethods.BNGetAnalysisSystemCallName( + this.handle , + null == platform ? IntPtr.Zero : platform.DangerousGetHandle() , + id + ) + ); + } + + public BinaryNinja.Type? ImportTypeLibraryType(QualifiedName name , TypeLibrary? library = null) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + return BinaryNinja.Type.TakeHandle( + + NativeMethods.BNBinaryViewImportTypeLibraryType( + this.handle , + null == library ? IntPtr.Zero : library.DangerousGetHandle() , + name.ToNativeEx(allocator) + ) + ); + } + } + + public BinaryNinja.Type? ImportTypeLibraryTypeByGuid(string guid ) + { + return BinaryNinja.Type.TakeHandle( + + NativeMethods.BNBinaryViewImportTypeLibraryTypeByGuid( + this.handle , + guid + ) + ); + } + + public BinaryNinja.Type? ImportTypeLibraryObject( + QualifiedName name , + TypeLibrary? library + ) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + IntPtr libraryHandle = ( null == library ? IntPtr.Zero : library.DangerousGetHandle() ); + + IntPtr typeHandle = NativeMethods.BNBinaryViewImportTypeLibraryObject( + this.handle , + ref libraryHandle , + name.ToNativeEx(allocator) + ); + + return BinaryNinja.Type.TakeHandle( + + typeHandle + ); + } + } + + public void ExportTypeToTypeLibrary( + TypeLibrary library , + QualifiedName name , + BinaryNinja.Type type + ) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + NativeMethods.BNBinaryViewExportTypeToTypeLibrary( + this.handle , + library.DangerousGetHandle(), + name.ToNativeEx(allocator), + type.DangerousGetHandle() + ); + } + } + + public void ExportObjectToTypeLibrar( + TypeLibrary library , + QualifiedName name , + BinaryNinja.Type type + ) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + NativeMethods.BNBinaryViewExportObjectToTypeLibrary( + this.handle , + library.DangerousGetHandle(), + name.ToNativeEx(allocator), + type.DangerousGetHandle() + ); + } + } + + public void SetManualDependencies( + TypeLibrary library , + QualifiedName[] viewTypeNames, + QualifiedName[] libTypeNames, + string[] libNames + ) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + NativeMethods.BNBinaryViewSetManualDependencies( + this.handle, + allocator.ConvertToNativeArrayEx(viewTypeNames), + allocator.ConvertToNativeArrayEx(libTypeNames), + libNames, + ( ulong )libNames.Length + ); + } + } + + public void RecordImportedObjectLibrary( + ulong address, + TypeLibrary library , + QualifiedName name , + Platform? platform = null + ) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + NativeMethods.BNBinaryViewRecordImportedObjectLibrary( + this.handle , + null == platform ? IntPtr.Zero : platform.DangerousGetHandle(), + address, + library.DangerousGetHandle(), + name.ToNativeEx(allocator) + ); + } + } + + + public TypeLibrary? LookupImportedObjectLibrary( + ulong address, + out QualifiedName? name, + Platform? platform = null + ) + { + bool ok = NativeMethods.BNBinaryViewLookupImportedObjectLibrary( + this.handle , + null == platform ? IntPtr.Zero : platform.DangerousGetHandle(), + address, + out IntPtr libraryHandle, + out BNQualifiedName rawName + ); + + if (!ok) + { + name = null; + return null; + } + + name = QualifiedName.TakeNative(rawName); + + return TypeLibrary.MustTakeHandle(libraryHandle); + } + + public TypeLibrary? LookupImportedTypeLibrary( + QualifiedName typeName, + out QualifiedName? libraryName + ) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + bool ok = NativeMethods.BNBinaryViewLookupImportedTypeLibrary( + this.handle , + typeName.ToNativeEx(allocator), + out IntPtr libraryHandle, + out BNQualifiedName rawLibraryName + ); + + if (!ok) + { + libraryName = null; + return null; + } + + libraryName = QualifiedName.TakeNative(rawLibraryName); + + return TypeLibrary.MustTakeHandle(libraryHandle); + } + + } + + public TypeArchive? AttachTypeArchive(string id , string path) + { + return TypeArchive.TakeHandle( + NativeMethods.BNBinaryViewAttachTypeArchive(this.handle , id , path) + ); + } + + public bool DetachTypeArchive(string id) + { + return NativeMethods.BNBinaryViewDetachTypeArchive(this.handle , id); + } + + public string GetTypeArchivePath(string id) + { + return UnsafeUtils.TakeAnsiString( + NativeMethods.BNBinaryViewGetTypeArchivePath(this.handle , id) + ); + } + + public void RegisterPlatformTypes(Platform platform) + { + NativeMethods.BNRegisterPlatformTypes(this.handle , platform.DangerousGetHandle()); + } + + public Platform? LookupImportedTypePlatform( + QualifiedName typeName, + out QualifiedName? resultName + ) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + bool ok = NativeMethods.BNLookupImportedTypePlatform( + this.handle , + typeName.ToNativeEx(allocator) , + out IntPtr platformHandle , + out BNQualifiedName rawResultName + ); + + if (!ok) + { + resultName = null; + return null; + } + + resultName = QualifiedName.TakeNative(rawResultName); + + return Platform.MustTakeHandle(platformHandle); + } + } + + public ulong? FindNextData( + byte[] data , + ulong start = 0 , + FindFlag flags = FindFlag.FindCaseSensitive + ) + { + bool ok = NativeMethods.BNFindNextData( + this.handle , + start , + new DataBuffer(data).DangerousGetHandle() , + out ulong result , + flags + ); + + if (!ok) + { + return null; + } + + return result; + } + + public ulong? FindNextDataWithProgress( + byte[] data , + ulong start , + ulong end , + ProgressDelegate progress , + FindFlag flags = FindFlag.FindCaseSensitive + ) + { + bool ok = NativeMethods.BNFindNextDataWithProgress( + this.handle , + start , + end , + new DataBuffer(data).DangerousGetHandle() , + out ulong result , + flags , + IntPtr.Zero , + Marshal.GetFunctionPointerForDelegate( + UnsafeUtils.WrapProgressDelegate(progress) + ) + ); + + if (!ok) + { + return null; + } + + return result; + } + + public ulong? FindNextText( + string data , + ulong start , + FunctionViewType viewType , + DisassemblySettings? settings = null , + FindFlag flags = FindFlag.FindCaseSensitive + ) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + bool ok = NativeMethods.BNFindNextText( + this.handle , + start , + data , + out ulong result , + null == settings ? IntPtr.Zero : settings.DangerousGetHandle() , + flags , + viewType.ToNativeEx(allocator) + ); + + if (!ok) + { + return null; + } + + return result; + } + } + + public ulong? FindNextTextWithProgress( + string data , + ulong start , + ulong end , + ProgressDelegate progress , + FunctionViewType viewType , + DisassemblySettings? settings = null , + FindFlag flags = FindFlag.FindCaseSensitive + ) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + bool ok = NativeMethods.BNFindNextTextWithProgress( + this.handle , + start , + end , + data , + out ulong result , + null == settings ? IntPtr.Zero : settings.DangerousGetHandle() , + flags , + viewType.ToNativeEx(allocator) , + IntPtr.Zero , + Marshal.GetFunctionPointerForDelegate( + UnsafeUtils.WrapProgressDelegate(progress) + ) + ); + + if (!ok) + { + return null; + } + + return result; + } + } + + public ulong? FindNextConstant( + ulong start , + ulong value , + FunctionViewType viewType , + DisassemblySettings? settings = null + ) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + bool ok = NativeMethods.BNFindNextConstant( + this.handle , + start , + value , + out ulong result , + null == settings ? IntPtr.Zero : settings.DangerousGetHandle() , + viewType.ToNativeEx(allocator) + ); + + if (!ok) + { + return null; + } + + return result; + } + } + + public ulong? FindNextConstantWithProgress( + ulong data, + ulong start, + ulong end, + ProgressDelegate progress, + FunctionViewType viewType, + DisassemblySettings? settings = null + ) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + bool ok = NativeMethods.BNFindNextConstantWithProgress( + this.handle , + start, + end, + data, + out ulong result, + null == settings ? IntPtr.Zero : settings.DangerousGetHandle(), + viewType.ToNativeEx(allocator), + IntPtr.Zero, + Marshal.GetFunctionPointerForDelegate( + UnsafeUtils.WrapProgressDelegate(progress) + ) + ); + + if (!ok) + { + return null; + } + + return result; + } + } + + public bool FindAllData( + byte[] data , + ulong start , + ulong end , + MatchDataDelegate match , + ProgressDelegate? progress = null , + FindFlag flags = FindFlag.FindCaseSensitive + ) + { + return NativeMethods.BNFindAllDataWithProgress( + this.handle , + start , + end , + new DataBuffer(data).DangerousGetHandle() , + flags , + IntPtr.Zero , + null == progress + ? IntPtr.Zero + : Marshal.GetFunctionPointerForDelegate( + UnsafeUtils.WrapProgressDelegate(progress) + ) , + IntPtr.Zero , + Marshal.GetFunctionPointerForDelegate( + UnsafeUtils.WrapMatchDataDelegate(match) + ) + ); + } + + + public bool FindAllText( + string data , + ulong start , + ulong end , + MatchDataDelegate match , + FunctionViewType viewType , + ProgressDelegate? progress = null , + FindFlag flags = FindFlag.FindCaseSensitive , + DisassemblySettings? settings = null + ) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + return NativeMethods.BNFindAllTextWithProgress( + this.handle , + start , + end , + data , + null == settings ? IntPtr.Zero : settings.DangerousGetHandle() , + flags , + viewType.ToNativeEx(allocator) , + IntPtr.Zero , + null == progress + ? IntPtr.Zero + : Marshal.GetFunctionPointerForDelegate( + UnsafeUtils.WrapProgressDelegate(progress) + ) , + IntPtr.Zero , + Marshal.GetFunctionPointerForDelegate( + UnsafeUtils.WrapMatchDataDelegate(match) + ) + ); + } + } + + public bool FindAllConstant( + ulong data , + ulong start , + ulong end , + MatchDataDelegate match , + FunctionViewType viewType , + ProgressDelegate? progress = null , + DisassemblySettings? settings = null + ) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + return NativeMethods.BNFindAllConstantWithProgress( + this.handle , + start , + end , + data , + null == settings ? IntPtr.Zero : settings.DangerousGetHandle() , + viewType.ToNativeEx(allocator) , + IntPtr.Zero , + null == progress + ? IntPtr.Zero + : Marshal.GetFunctionPointerForDelegate( + UnsafeUtils.WrapProgressDelegate(progress) + ) , + IntPtr.Zero , + Marshal.GetFunctionPointerForDelegate( + UnsafeUtils.WrapMatchDataDelegate(match) + ) + ); + } + } + + public bool Search( + string query , + MatchDataDelegate match , + ProgressDelegate? progress = null + ) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + return NativeMethods.BNSearch( + this.handle , + query , + IntPtr.Zero , + null == progress + ? IntPtr.Zero + : Marshal.GetFunctionPointerForDelegate( + UnsafeUtils.WrapProgressDelegate(progress) + ) , + IntPtr.Zero , + Marshal.GetFunctionPointerForDelegate( + UnsafeUtils.WrapMatchDataDelegate(match) + ) + ); + } + } + + public void Reanalyze() + { + NativeMethods.BNReanalyzeAllFunctions(this.handle); + } + + public Workflow? Workflow + { + get + { + return Workflow.TakeHandle( + + NativeMethods.BNGetWorkflowForBinaryView(this.handle) + ); + } + } + + public bool Rebase(ulong address , ProgressDelegate? progress) + { + if (null == progress) + { + return NativeMethods.BNRebase( + this.handle, + address + ); + } + else + { + return NativeMethods.BNRebaseWithProgress( + this.handle, + address, + IntPtr.Zero, + Marshal.GetFunctionPointerForDelegate( + UnsafeUtils.WrapProgressDelegate(progress) + ) + ); + } + + } + + public void ShowPlainTextReport(string title , string contents) + { + NativeMethods.BNShowPlainTextReport(this.handle , title , contents); + } + + public void ShowMarkdownReport(string title , string contents , string plaintext) + { + NativeMethods.BNShowMarkdownReport(this.handle , title , contents , plaintext); + } + + public void ShowHTMLReport(string title , string contents , string plaintext) + { + NativeMethods.BNShowHTMLReport(this.handle , title , contents , plaintext); + } + + public void ShowGraphReport(string title , FlowGraph graph) + { + NativeMethods.BNShowGraphReport( + this.handle , + title , + graph.DangerousGetHandle() + ) ; + } + + public bool GetAddressInput( + out ulong result, + string prompt, + string title , + ulong? currentAddress = null + ) + { + if (null == currentAddress) + { + currentAddress = this.File.Offset; + } + + return NativeMethods.BNGetAddressInput( + out result, + prompt, + title, + this.handle, + currentAddress?? 0 + ); + } + + public void BeginBulkAddSegments() + { + NativeMethods.BNBeginBulkAddSegments(this.handle); + } + + public void EndBulkAddSegments() + { + NativeMethods.BNEndBulkAddSegments(this.handle); + } + + public void CancelBulkAddSegments() + { + NativeMethods.BNCancelBulkAddSegments(this.handle); + } + + public void AddAutoSegment( + ulong start , + ulong length , + ulong dataOffset , + ulong dataLength, + uint flags + ) + { + NativeMethods.BNAddAutoSegment( + this.handle , + start , + length , + dataOffset , + dataLength , + flags + ); + } + + public void AddAutoSegments(SegmentInfo[] segments) + { + NativeMethods.BNAddAutoSegments( + this.handle, + UnsafeUtils.ConvertToNativeArray( + segments + ), + (ulong)segments.Length + ); + } + + public void RemoveAutoSegment(ulong start , ulong length) + { + NativeMethods.BNRemoveAutoSegment( + this.handle , + start , + length + ); + } + + public void AddUserSegment( + ulong start , + ulong length , + ulong dataOffset , + ulong dataLength, + uint flags + ) + { + NativeMethods.BNAddUserSegment( + this.handle , + start , + length , + dataOffset , + dataLength , + flags + ); + } + + public void AddUserSegments(SegmentInfo[] segments) + { + NativeMethods.BNAddUserSegments( + this.handle, + UnsafeUtils.ConvertToNativeArray( + segments + ), + (ulong)segments.Length + ); + } + + public void RemoveUserSegment( + ulong start , + ulong length + ) + { + NativeMethods.BNRemoveUserSegment( + this.handle , + start , + length + ); + } + + + + public Segment? GetSegmentAt(ulong address) + { + return Segment.TakeHandle( + NativeMethods.BNGetSegmentAt(this.handle , address) + ); + } + + public bool GetAddressForDataOffset(ulong offset , out ulong address) + { + return NativeMethods.BNGetAddressForDataOffset(this.handle , offset , out address); + } + + public bool GetDataOffsetForAddress(ulong address , out ulong offset) + { + offset = 0; + + Segment? segment = this.GetSegmentAt(address); + + if (null == segment) + { + return false; + } + + if (address >= segment.Start && address < segment.End) + { + offset = address - segment.Start; + + if (offset >segment.DataLength) + { + return false; + } + + offset = segment.DataOffset + offset; + + return true; + } + + return false; + } + + + public void AddAutoSection( + string name , + ulong start, + ulong length , + SectionSemantics semantics = SectionSemantics.DefaultSectionSemantics, + string type = "", + ulong align = 1, + ulong entrySize = 1 , + string linkedSection = "", + string infoSection = "", + ulong infoData = 0 + ) + { + NativeMethods.BNAddAutoSection( + this.handle , + name, + start , + length , + semantics, + type, + align , + entrySize , + linkedSection, + infoSection, + infoData + ); + } + + public void RemoveAutoSection(string name) + { + NativeMethods.BNRemoveAutoSection(this.handle , name); + } + + public void AddUserSection( + string name , + ulong start, + ulong length , + SectionSemantics semantics = SectionSemantics.DefaultSectionSemantics, + string type = "", + ulong align = 1, + ulong entrySize = 1 , + string linkedSection = "", + string infoSection = "", + ulong infoData = 0 + ) + { + NativeMethods.BNAddUserSection( + this.handle , + name, + start , + length , + semantics, + type, + align , + entrySize , + linkedSection, + infoSection, + infoData + ); + } + + public void RemoveUserSection(string name) + { + NativeMethods.BNRemoveUserSection(this.handle , name); + } + + public Section[] GetSectionsAt(ulong address) + { + IntPtr arrayPointer = NativeMethods.BNGetSectionsAt( + this.handle , + address, + out ulong arrayLength + ); + + return UnsafeUtils.TakeHandleArrayEx
( + arrayPointer, + arrayLength, + Section.MustNewFromHandle, + NativeMethods.BNFreeSectionList + ); + } + + public Section? GetSectionByName(string name) + { + return Section.TakeHandle( + NativeMethods.BNGetSectionByName(this.handle , name) + ); + } + + + + public ulong[] GlobalCommentedAddresses + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetGlobalCommentedAddresses( + this.handle , + out ulong arrayLength + ); + + return UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNFreeAddressList + ); + } + } + + public string GetGlobalCommentForAddress(ulong address) + { + return UnsafeUtils.TakeAnsiString( + NativeMethods.BNGetGlobalCommentForAddress(this.handle , address) + ); + } + + public void SetGlobalCommentForAddress(ulong address , string comment) + { + NativeMethods.BNSetGlobalCommentForAddress(this.handle , address, comment); + } + + public DebugInfo DebugInfo + { + get + { + return DebugInfo.MustTakeHandle( + NativeMethods.BNGetDebugInfo(this.handle) + ); + } + + set + { + NativeMethods.BNSetDebugInfo( + this.handle, + null == value ? IntPtr.Zero : value.DangerousGetHandle() + ); + } + } + + public void ApplyDebugInfo(DebugInfo debugInfo) + { + NativeMethods.BNApplyDebugInfo(this.handle, debugInfo.DangerousGetHandle()); + } + + public Metadata? QueryMetadata(string key) + { + return Metadata.TakeHandle( + NativeMethods.BNBinaryViewQueryMetadata(this.handle , key) + ); + } + + public void StoreMetadata(string key , Metadata data , bool isAuto = false ) + { + NativeMethods.BNBinaryViewStoreMetadata( + this.handle , + key , + data.DangerousGetHandle() , + isAuto + ); + } + + public void RemoveMetadata(string key) + { + NativeMethods.BNBinaryViewRemoveMetadata(this.handle , key); + } + + public Metadata Metadata + { + get + { + return Metadata.MustTakeHandle( + NativeMethods.BNBinaryViewGetMetadata(this.handle) + ); + } + } + + public Metadata AutoMetadata + { + get + { + return Metadata.MustTakeHandle( + NativeMethods.BNBinaryViewGetAutoMetadata(this.handle) + ); + } + } + + public string[] LoadSettingsTypeNames + { + get + { + IntPtr arrayPointer = NativeMethods.BNBinaryViewGetLoadSettingsTypeNames( + this.handle , + out ulong arrayLength + ); + + return UnsafeUtils.TakeAnsiStringArray( + arrayPointer , + arrayLength, + NativeMethods.BNFreeStringList + ); + } + } + + public Settings? GetLoadSettings(string typeName) + { + return Settings.TakeHandle( + NativeMethods.BNBinaryViewGetLoadSettings(this.handle , typeName) + ); + } + + public void SetLoadSettings(string typeName , Settings settings) + { + NativeMethods.BNBinaryViewSetLoadSettings( + this.handle , + typeName , + settings.DangerousGetHandle() + ); + } + + public ulong ParseExpression(string expression, ulong here = 0) + { + bool ok = NativeMethods.BNParseExpression( + this.handle , + expression , + out ulong offset , + here , + out IntPtr errorPointer + ); + + if (!ok) + { + string errors = UnsafeUtils.TakeUtf8String( + errorPointer , + NativeMethods.BNFreeParseError + ); + + throw new Exception(errors); + } + + return offset; + } + + public BinaryReader CreateReader() + { + return new BinaryReader(this); + } + + public BinaryWriter CreateWriter() + { + return new BinaryWriter(this); + } + + + public ExternalLibrary AddExternalLibrary( + string name , + ProjectFile? projectFile = null, + bool isAuto = false + ) + { + return ExternalLibrary.MustTakeHandle( + NativeMethods.BNBinaryViewAddExternalLibrary( + this.handle , + name , + null == projectFile ? IntPtr.Zero : projectFile.DangerousGetHandle() , + isAuto + ) + ); + } + + public void RemoveExternalLibrary(string name ) + { + NativeMethods.BNBinaryViewRemoveExternalLibrary(this.handle , name); + } + + public ExternalLibrary? GetExternalLibrary(string name) + { + return ExternalLibrary.TakeHandle( + NativeMethods.BNBinaryViewGetExternalLibrary(this.handle , name) + ); + } + + public ExternalLibrary[] ExternalLibraries + { + get + { + IntPtr arrayPointer = NativeMethods.BNBinaryViewGetExternalLibraries( + this.handle, + out ulong arrayLength + ); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer , + arrayLength , + ExternalLibrary.MustNewFromHandle, + NativeMethods.BNFreeExternalLibraryList + ); + } + } + + public string StringifyUnicodeData( + Architecture arch, + DataBuffer buffer, + bool nullTerminates, + bool allowShortStrings, + out StringType stringType + ) + { + string text = string.Empty; + + bool ok = NativeMethods.BNStringifyUnicodeData( + this.handle , + arch.DangerousGetHandle() , + buffer.DangerousGetHandle() , + nullTerminates , + allowShortStrings , + out IntPtr textPointer , + out stringType + ); + + if (ok) + { + if (StringType.AsciiString == stringType) + { + text = UnsafeUtils.TakeAnsiString(textPointer); + } + else if (StringType.Utf16String == stringType) + { + text = UnsafeUtils.TakeUtf16String(textPointer); + } + else if (StringType.Utf32String == stringType) + { + text = UnsafeUtils.TakeUtf32String(textPointer); + } + else if (StringType.Utf8String == stringType) + { + text = UnsafeUtils.TakeUtf8String(textPointer); + } + else + { + throw new Exception("unknown string type"); + } + } + else + { + text = String.Empty; + stringType = StringType.AsciiString; + } + + return text; + } + + + public PluginCommand[] ValidPluginCommands + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetValidPluginCommands( + this.handle, + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArray( + arrayPointer , + arrayLength , + PluginCommand.FromNative , + NativeMethods.BNFreePluginCommandList + ); + } + } + + public PluginCommand[] GetValidPluginCommandsForAddress(ulong address) + { + + IntPtr arrayPointer = NativeMethods.BNGetValidPluginCommandsForAddress( + this.handle, + address, + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArray( + arrayPointer , + arrayLength , + PluginCommand.FromNative , + NativeMethods.BNFreePluginCommandList + ); + } + + public PluginCommand[] GetValidPluginCommandsForRange( + ulong address, + ulong length + ) + { + + IntPtr arrayPointer = NativeMethods.BNGetValidPluginCommandsForRange( + this.handle, + address, + length, + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArray( + arrayPointer , + arrayLength , + PluginCommand.FromNative , + NativeMethods.BNFreePluginCommandList + ); + } + + public PluginCommand[] GetValidPluginCommandsForFunction(Function function) + { + IntPtr arrayPointer = NativeMethods.BNGetValidPluginCommandsForFunction( + this.handle, + function.DangerousGetHandle(), + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArray( + arrayPointer , + arrayLength , + PluginCommand.FromNative , + NativeMethods.BNFreePluginCommandList + ); + } + + public PluginCommand[] GetValidPluginCommandsForLowLevelILFunction(LowLevelILFunction function) + { + IntPtr arrayPointer = NativeMethods.BNGetValidPluginCommandsForLowLevelILFunction( + this.handle, + function.DangerousGetHandle(), + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArray( + arrayPointer , + arrayLength , + PluginCommand.FromNative , + NativeMethods.BNFreePluginCommandList + ); + } + + public PluginCommand[] GetValidPluginCommandsForLowLevelILInstruction( + LowLevelILFunction function, + ulong instruction + ) + { + IntPtr arrayPointer = NativeMethods.BNGetValidPluginCommandsForLowLevelILInstruction( + this.handle, + function.DangerousGetHandle(), + instruction, + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArray( + arrayPointer , + arrayLength , + PluginCommand.FromNative , + NativeMethods.BNFreePluginCommandList + ); + } + + + public PluginCommand[] GetValidPluginCommandsForMediumLevelILFunction(MediumLevelILFunction function) + { + IntPtr arrayPointer = NativeMethods.BNGetValidPluginCommandsForMediumLevelILFunction( + this.handle, + function.DangerousGetHandle(), + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArray( + arrayPointer , + arrayLength , + PluginCommand.FromNative , + NativeMethods.BNFreePluginCommandList + ); + } + + public PluginCommand[] GetValidPluginCommandsForMediumLevelILInstruction( + MediumLevelILFunction function, + ulong instruction + ) + { + IntPtr arrayPointer = NativeMethods.BNGetValidPluginCommandsForMediumLevelILInstruction( + this.handle, + function.DangerousGetHandle(), + instruction, + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArray( + arrayPointer , + arrayLength , + PluginCommand.FromNative , + NativeMethods.BNFreePluginCommandList + ); + } + + public PluginCommand[] GetValidPluginCommandsForHighLevelILFunction(HighLevelILFunction function) + { + IntPtr arrayPointer = NativeMethods.BNGetValidPluginCommandsForHighLevelILFunction( + this.handle, + function.DangerousGetHandle(), + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArray( + arrayPointer , + arrayLength , + PluginCommand.FromNative , + NativeMethods.BNFreePluginCommandList + ); + } + + public PluginCommand[] GetValidPluginCommandsForHighLevelILInstruction( + HighLevelILFunction function, + ulong instruction + ) + { + IntPtr arrayPointer = NativeMethods.BNGetValidPluginCommandsForHighLevelILInstruction( + this.handle, + function.DangerousGetHandle(), + instruction, + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArray( + arrayPointer , + arrayLength , + PluginCommand.FromNative , + NativeMethods.BNFreePluginCommandList + ); + } + + public bool CreateDatabase( + string filename, + SaveSettings? settings = null, + ProgressDelegate? progress = null) + { + if (null == progress) + { + return NativeMethods.BNCreateDatabase( + this.handle , + filename, + null == settings ? IntPtr.Zero : settings.DangerousGetHandle() + ); + } + else + { + return NativeMethods.BNCreateDatabaseWithProgress( + this.handle , + filename , + IntPtr.Zero , + Marshal.GetFunctionPointerForDelegate( + UnsafeUtils.WrapProgressDelegate(progress) + ) , + null == settings ? IntPtr.Zero : settings.DangerousGetHandle() + ); + } + } + + public bool SaveAutoSnapshot( + SaveSettings? settings = null, + ProgressDelegate? progress = null) + { + if (null == progress) + { + return NativeMethods.BNSaveAutoSnapshot( + this.handle , + null == settings ? IntPtr.Zero : settings.DangerousGetHandle() + ); + } + else + { + return NativeMethods.BNSaveAutoSnapshotWithProgress( + this.handle , + IntPtr.Zero , + Marshal.GetFunctionPointerForDelegate + (UnsafeUtils.WrapProgressDelegate(progress)) , + null == settings ? IntPtr.Zero : settings.DangerousGetHandle() + ); + } + } + + public string BaseMemoryMapDescription + { + get + { + return UnsafeUtils.TakeAnsiString( + NativeMethods.BNGetBaseMemoryMapDescription(this.handle) + ); + } + } + + public string MemoryMapDescription + { + get + { + return UnsafeUtils.TakeAnsiString( + NativeMethods.BNGetMemoryMapDescription(this.handle) + ); + } + } + + public bool LogicalMemoryMapEnabled + { + set + { + NativeMethods.BNSetLogicalMemoryMapEnabled(this.handle, value); + } + } + + public bool MemoryMapActivated + { + get + { + return NativeMethods.BNIsMemoryMapActivated(this.handle); + } + } + + public bool AddMemoryRegion( + string name, + ulong start, + BinaryView data, + uint flags + ) + { + return NativeMethods.BNAddBinaryMemoryRegion( + this.handle, + name, + start, + data.DangerousGetHandle(), + flags + ); + } + + public bool AddMemoryRegion( + string name, + ulong start, + DataBuffer data, + uint flags + ) + { + return NativeMethods.BNAddDataMemoryRegion( + this.handle, + name, + start, + data.DangerousGetHandle(), + flags + ); + } + + public bool AddMemoryRegion( + string name, + ulong start, + FileAccessor data, + uint flags + ) + { + return NativeMethods.BNAddRemoteMemoryRegion( + this.handle, + name, + start, + data.ToNative(), + flags + ); + } + + public bool AddMemoryRegion( + string name, + ulong start, + ulong length, + uint flags, + byte fill + ) + { + return NativeMethods.BNAddUnbackedMemoryRegion( + this.handle, + name, + start, + length, + flags, + fill + ); + } + + public bool RemoveMemoryRegion(string name) + { + return NativeMethods.BNRemoveMemoryRegion(this.handle, name); + } + + public string GetActiveMemoryRegionAt(ulong address) + { + return UnsafeUtils.TakeAnsiString( + NativeMethods.BNGetActiveMemoryRegionAt(this.handle , address) + ); + } + + public uint GetMemoryRegionFlags(string name) + { + return NativeMethods.BNGetMemoryRegionFlags(this.handle , name); + } + + public bool SetMemoryRegionFlags(string name , uint flags) + { + return NativeMethods.BNSetMemoryRegionFlags(this.handle , name , flags); + } + + public bool IsMemoryRegionEnabled(string name) + { + return NativeMethods.BNIsMemoryRegionEnabled(this.handle , name); + } + + public bool SetMemoryRegionEnabled(string name , bool enable) + { + return NativeMethods.BNSetMemoryRegionEnabled(this.handle , name , enable); + } + + public bool IsMemoryRegionRebaseable(string name) + { + return NativeMethods.BNIsMemoryRegionRebaseable(this.handle , name ); + } + + public bool SetMemoryRegionRebaseable(string name , bool rebaseable) + { + return NativeMethods.BNSetMemoryRegionRebaseable(this.handle , name , rebaseable); + } + + public byte GetMemoryRegionFill(string name) + { + return NativeMethods.BNGetMemoryRegionFill(this.handle , name); + } + + public bool SetMemoryRegionFill(string name , byte fill) + { + return NativeMethods.BNSetMemoryRegionFill(this.handle , name , fill); + } + + public bool IsMemoryRegionLocal(string name) + { + return NativeMethods.BNIsMemoryRegionLocal(this.handle , name ); + } + + public void ResetMemoryMap() + { + NativeMethods.BNResetMemoryMap(this.handle); + } + + public BinaryViewType[] BinaryViewTypes + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetBinaryViewTypesForData( + this.handle, + out ulong arrayLength + ); + + return UnsafeUtils.TakeHandleArray( + arrayPointer, + arrayLength, + BinaryViewType.MustFromHandle, + NativeMethods.BNFreeBinaryViewTypeList + ); + } + } + + public Logger? GetLogger(string name) + { + return Logger.GetLogger(name , this.File.SessionId); + } + + public Logger CreateLogger(string name) + { + return Logger.CreateLogger(name , this.File.SessionId); + } + + public Logger GetOrCreateLogger(string name) + { + return Logger.GetOrCreateLogger(name , this.File.SessionId); + } + + public BinaryView? CreateCustomView( + string name, + CustomBinaryView view, + FileMetadata? file = null + ) + { + if (null == file) + { + file = this.File; + } + + return BinaryView.TakeHandle( + NativeMethods.BNCreateCustomBinaryView( + name , + file.DangerousGetHandle() , + this.DangerousGetHandle() , + view.ToNative() + ) + ); + } + + public Symbol? ChooseSymbol(string prompt = "Choose" , string title = "Choose a symbol") + { + int? index = Core.GetLargeChoiceInput( + prompt , + title , + this.SymbolNames + ); + + if (null == index) + { + return null; + } + + return this.GetSymbolByRawName(this.SymbolNames[(int)index]); + } + + public Function? ChooseFunction(string prompt = "Choose" , string title = "Choose a function") + { + int? index = Core.GetLargeChoiceInput( + prompt , + title , + this.SymbolNames + ); + + if (null == index) + { + return null; + } + + return this.GetFunctionByRawName(this.SymbolNames[(int)index]); + } + } + +} \ No newline at end of file diff --git a/Handle/BNBinaryViewType.cs b/Handle/BNBinaryViewType.cs new file mode 100644 index 0000000..a333d48 --- /dev/null +++ b/Handle/BNBinaryViewType.cs @@ -0,0 +1,275 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class BinaryViewType : AbstractSafeHandle + { + internal BinaryViewType(IntPtr handle) + :base(handle, false) + { + + } + + internal static BinaryViewType? FromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new BinaryViewType(handle); + } + + internal static BinaryViewType MustFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new BinaryViewType(handle); + } + + public static BinaryViewType? FromName(string name) + { + return BinaryViewType.FromHandle( + NativeMethods.BNGetBinaryViewTypeByName(name) + ); + } + + public static BinaryViewType[] GetTypes() + { + IntPtr arrayPointer = NativeMethods.BNGetBinaryViewTypes( + out ulong arrayLength + ); + + return UnsafeUtils.TakeHandleArray( + arrayPointer, + arrayLength, + BinaryViewType.MustFromHandle, + BinaryNinja.NativeMethods.BNFreeBinaryViewTypeList + ); + } + + public static BinaryViewType? Register( + string name , + string longName, + CustomBinaryViewType type + ) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + return BinaryViewType.FromHandle( + NativeMethods.BNRegisterBinaryViewType( + name , + longName , + allocator.AllocStruct(type.ToNative()) + ) + ); + } + } + + + public string Name + { + get + { + IntPtr raw = NativeMethods.BNGetBinaryViewTypeName(this.handle); + + return UnsafeUtils.TakeAnsiString(raw); + } + } + + public string LongName + { + get + { + IntPtr raw = NativeMethods.BNGetBinaryViewTypeLongName(this.handle); + + return UnsafeUtils.TakeAnsiString(raw); + } + } + + public bool Deprecated + { + get + { + return NativeMethods.BNIsBinaryViewTypeDeprecated(this.handle); + } + } + + public BinaryView? CreateBinaryView(BinaryView data) + { + return BinaryView.TakeHandle( + NativeMethods.BNCreateBinaryViewOfType( + this.handle , + data.DangerousGetHandle() + ) + ); + } + + public BinaryView? ParseBinaryView(BinaryView data) + { + return BinaryView.TakeHandle( + NativeMethods.BNParseBinaryViewOfType( + this.handle , + data.DangerousGetHandle() + ) + ); + } + + public bool IsValidForData(BinaryView data) + { + return NativeMethods.BNIsBinaryViewTypeValidForData( + this.handle , + data.DangerousGetHandle() + ); + } + + public bool ForceLoadable + { + get + { + return NativeMethods.BNIsBinaryViewTypeForceLoadable(this.handle); + } + } + + public Settings? GetDefaultLoadSettingsForData(BinaryView data) + { + return Settings.TakeHandle( + NativeMethods.BNGetBinaryViewDefaultLoadSettingsForData( + this.handle , + data.DangerousGetHandle() + ) + ); + } + + public Settings? GetLoadSettingsForData(BinaryView data) + { + return Settings.TakeHandle( + NativeMethods.BNGetBinaryViewLoadSettingsForData( + this.handle , + data.DangerousGetHandle() + ) + ); + } + + public void RegisterArchitecture( + uint id , + Endianness endianness, + Architecture arch + ) + { + NativeMethods.BNRegisterArchitectureForViewType( + this.handle, + id , + endianness, + arch.DangerousGetHandle() + ); + } + + public Architecture? GetArchitecture(uint id , Endianness endianness) + { + return Architecture.FromHandle( + NativeMethods.BNGetArchitectureForViewType( + this.handle , + id , + endianness + ) + ); + } + + + public void RegisterPlatform( + uint id , + Architecture arch , + Platform platform + ) + { + NativeMethods.BNRegisterPlatformForViewType( + this.handle, + id , + arch.DangerousGetHandle() , + platform.DangerousGetHandle() + ); + } + + public Platform? GetPlatform(uint id , Architecture arch ) + { + return Platform.TakeHandle( + NativeMethods.BNGetPlatformForViewType( + this.handle , + id , + arch.DangerousGetHandle() + ) + ); + } + + public void RegisterDefaultPlatform(Architecture arch , Platform platform) + { + NativeMethods.BNRegisterDefaultPlatformForViewType( + this.handle, + arch.DangerousGetHandle() , + platform.DangerousGetHandle() + ); + } + + public void RegisterPlatformRecognizer( + uint id , + Endianness endianness, + Func recognize + ) + { + Func adapter = (ctx , view , metadata) => { + + Platform? platform = recognize( + BinaryView.MustBorrowHandle(view), + Metadata.MustBorrowHandle(metadata) + ); + + if (null == platform) + { + return IntPtr.Zero; + } + + return platform.DangerousGetHandle(); + }; + + NativeMethods.BNRegisterPlatformRecognizerForViewType( + this.handle, + id , + endianness, + Marshal.GetFunctionPointerForDelegate>( + adapter + ), + IntPtr.Zero + ); + } + + /// + /// this function should be called from the BNCustomBinaryView::init implementation + /// + /// + /// + /// + /// + public void RegisterPlatform( + uint id , + BinaryNinja.Endianness endianness, + BinaryView view, + Metadata metadata + ) + { + NativeMethods.BNRecognizePlatformForViewType( + this.handle, + id , + endianness, + view.DangerousGetHandle(), + metadata.DangerousGetHandle() + ); + } + } +} \ No newline at end of file diff --git a/Handle/BNBinaryWriter.cs b/Handle/BNBinaryWriter.cs new file mode 100644 index 0000000..5620d2d --- /dev/null +++ b/Handle/BNBinaryWriter.cs @@ -0,0 +1,236 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class BinaryWriter : AbstractSafeHandle + { + public BinaryWriter(BinaryView view) + : this(NativeMethods.BNCreateBinaryWriter(view.DangerousGetHandle()) , true) + { + + } + + internal BinaryWriter(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static BinaryWriter? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new BinaryWriter(handle, true); + } + + internal static BinaryWriter MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new BinaryWriter(handle, true); + } + + internal static BinaryWriter? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new BinaryWriter(handle, false); + } + + internal static BinaryWriter MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new BinaryWriter(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeBinaryWriter(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + + public Endianness Endianness + { + get + { + return NativeMethods.BNGetBinaryWriterEndianness(this.handle); + } + set + { + NativeMethods.BNSetBinaryWriterEndianness(this.handle, value); + } + } + + public ulong Position + { + get + { + return NativeMethods.BNGetWriterPosition(this.handle); + } + + set + { + if (this.Position != value) + { + NativeMethods.BNSeekBinaryWriter(this.handle, value); + } + } + } + + public bool WriteData(byte[] data) + { + return NativeMethods.BNWriteData( + this.handle , + data , + (ulong)data.Length + ); + } + + public bool WriteByte(byte value) + { + return NativeMethods.BNWrite8(this.handle ,value); + } + + public bool WriteInt8(sbyte value) + { + return NativeMethods.BNWrite8(this.handle ,(byte)value); + } + + public bool WriteUInt8(byte value) + { + return NativeMethods.BNWrite8(this.handle ,value); + } + + // 16 + public bool WriteInt16(short value) + { + return NativeMethods.BNWrite16(this.handle , (ushort)value); + } + + public bool WriteInt16BE(short value) + { + return NativeMethods.BNWriteBE16(this.handle , (ushort)value); + } + + public bool WriteInt16LE(short value) + { + return NativeMethods.BNWriteLE16(this.handle , (ushort)value); + } + + public bool WriteUInt16(ushort value) + { + return NativeMethods.BNWrite16(this.handle ,value); + } + + public bool WriteUInt16BE(ushort value) + { + return NativeMethods.BNWriteBE16(this.handle ,value); + } + + public bool WriteUInt16LE(ushort value) + { + return NativeMethods.BNWriteLE16(this.handle ,value); + } + + // 32 + public bool WriteInt32(int value) + { + return NativeMethods.BNWrite32(this.handle , (uint)value); + } + + public bool WriteInt32BE(int value) + { + return NativeMethods.BNWriteBE32(this.handle , (uint)value); + } + + public bool WriteInt32LE(int value) + { + return NativeMethods.BNWriteLE32(this.handle , (uint)value); + } + + public bool WriteUInt32(uint value) + { + return NativeMethods.BNWrite32(this.handle ,value); + } + + public bool WriteUInt32BE(uint value) + { + return NativeMethods.BNWriteBE32(this.handle ,value); + } + + public bool WriteUInt32LE(uint value) + { + return NativeMethods.BNWriteLE32(this.handle ,value); + } + + // 64 + public bool WriteInt64(long value) + { + return NativeMethods.BNWrite64(this.handle , (ulong)value); + } + + public bool WriteInt64BE(long value) + { + return NativeMethods.BNWriteBE64(this.handle , (ulong)value); + } + + public bool WriteInt64LE(long value) + { + return NativeMethods.BNWriteLE64(this.handle , (ulong)value); + } + + public bool WriteUInt64(ulong value) + { + return NativeMethods.BNWrite64(this.handle ,value); + } + + public bool WriteUInt64BE(ulong value) + { + return NativeMethods.BNWriteBE64(this.handle ,value); + } + + public bool WriteUInt64LE(ulong value) + { + return NativeMethods.BNWriteLE64(this.handle ,value); + } + + public bool WriteString(string text , Encoding? encoding = null) + { + if (null == encoding) + { + encoding = Encoding.UTF8; + } + + byte[] data = encoding.GetBytes(text); + + return NativeMethods.BNWriteData( + this.handle , + data , + (ulong)data.Length + ); + } + + } +} \ No newline at end of file diff --git a/Handle/BNCallingConvention.cs b/Handle/BNCallingConvention.cs new file mode 100644 index 0000000..9e943f4 --- /dev/null +++ b/Handle/BNCallingConvention.cs @@ -0,0 +1,89 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class CallingConvention : AbstractSafeHandle + { + internal CallingConvention(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static BinaryNinja.CallingConvention? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new BinaryNinja.CallingConvention( + NativeMethods.BNNewCallingConventionReference(handle) , + true + ); + } + + internal static BinaryNinja.CallingConvention MustNewFromHandle(IntPtr handle) + { + return new BinaryNinja.CallingConvention( + NativeMethods.BNNewCallingConventionReference(handle) , + true + ); + } + + + internal static BinaryNinja.CallingConvention? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new BinaryNinja.CallingConvention(handle, true); + } + + internal static BinaryNinja.CallingConvention MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new BinaryNinja.CallingConvention(handle, true); + } + + internal static BinaryNinja.CallingConvention? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new BinaryNinja.CallingConvention(handle, false); + } + + internal static BinaryNinja.CallingConvention MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new BinaryNinja.CallingConvention(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeCallingConvention(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + } +} \ No newline at end of file diff --git a/Handle/BNCollaborationChangeset.cs b/Handle/BNCollaborationChangeset.cs new file mode 100644 index 0000000..88d23bb --- /dev/null +++ b/Handle/BNCollaborationChangeset.cs @@ -0,0 +1,94 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class CollaborationChangeset : AbstractSafeHandle + { + internal CollaborationChangeset(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + + internal static CollaborationChangeset? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new CollaborationChangeset( + NativeMethods.BNNewCollaborationChangesetReference(handle) , + true + ); + } + + internal static CollaborationChangeset MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new CollaborationChangeset( + NativeMethods.BNNewCollaborationChangesetReference(handle) , + true + ); + } + + internal static CollaborationChangeset? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new CollaborationChangeset(handle, true); + } + + internal static CollaborationChangeset MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new CollaborationChangeset(handle, true); + } + + internal static CollaborationChangeset? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new CollaborationChangeset(handle, false); + } + + internal static CollaborationChangeset MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new CollaborationChangeset(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeCollaborationChangeset(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + } +} \ No newline at end of file diff --git a/Handle/BNCollaborationGroup.cs b/Handle/BNCollaborationGroup.cs new file mode 100644 index 0000000..90fb2a5 --- /dev/null +++ b/Handle/BNCollaborationGroup.cs @@ -0,0 +1,93 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class CollaborationGroup : AbstractSafeHandle + { + internal CollaborationGroup(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static CollaborationGroup? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new CollaborationGroup( + NativeMethods.BNNewCollaborationGroupReference(handle) , + true + ); + } + + internal static CollaborationGroup MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new CollaborationGroup( + NativeMethods.BNNewCollaborationGroupReference(handle) , + true + ); + } + + internal static CollaborationGroup? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new CollaborationGroup(handle, true); + } + + internal static CollaborationGroup MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new CollaborationGroup(handle, true); + } + + internal static CollaborationGroup? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new CollaborationGroup(handle, false); + } + + internal static CollaborationGroup MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new CollaborationGroup(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeCollaborationGroup(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + } +} \ No newline at end of file diff --git a/Handle/BNCollaborationLazyT.cs b/Handle/BNCollaborationLazyT.cs new file mode 100644 index 0000000..e0fa9c1 --- /dev/null +++ b/Handle/BNCollaborationLazyT.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class CollaborationLazyT : AbstractSafeHandle + { + public CollaborationLazyT(IntPtr handle) + :base(handle, false) + { + + } + + } +} \ No newline at end of file diff --git a/Handle/BNCollaborationPermission.cs b/Handle/BNCollaborationPermission.cs new file mode 100644 index 0000000..86d8387 --- /dev/null +++ b/Handle/BNCollaborationPermission.cs @@ -0,0 +1,94 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class CollaborationPermission : AbstractSafeHandle + { + public CollaborationPermission(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + + internal static CollaborationPermission? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new CollaborationPermission( + NativeMethods.BNNewCollaborationPermissionReference(handle) , + true + ); + } + + internal static CollaborationPermission MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new CollaborationPermission( + NativeMethods.BNNewCollaborationPermissionReference(handle) , + true + ); + } + + internal static CollaborationPermission? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new CollaborationPermission(handle, true); + } + + internal static CollaborationPermission MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new CollaborationPermission(handle, true); + } + + internal static CollaborationPermission? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new CollaborationPermission(handle, false); + } + + internal static CollaborationPermission MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new CollaborationPermission(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeCollaborationPermission(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + } +} \ No newline at end of file diff --git a/Handle/BNCollaborationSnapshot.cs b/Handle/BNCollaborationSnapshot.cs new file mode 100644 index 0000000..c4c7ad5 --- /dev/null +++ b/Handle/BNCollaborationSnapshot.cs @@ -0,0 +1,94 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class CollaborationSnapshot : AbstractSafeHandle + { + public CollaborationSnapshot(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + + internal static CollaborationSnapshot? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new CollaborationSnapshot( + NativeMethods.BNNewCollaborationSnapshotReference(handle) , + true + ); + } + + internal static CollaborationSnapshot MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new CollaborationSnapshot( + NativeMethods.BNNewCollaborationSnapshotReference(handle) , + true + ); + } + + internal static CollaborationSnapshot? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new CollaborationSnapshot(handle, true); + } + + internal static CollaborationSnapshot MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new CollaborationSnapshot(handle, true); + } + + internal static CollaborationSnapshot? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new CollaborationSnapshot(handle, false); + } + + internal static CollaborationSnapshot MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new CollaborationSnapshot(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeCollaborationSnapshot(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + } +} \ No newline at end of file diff --git a/Handle/BNCollaborationUndoEntry.cs b/Handle/BNCollaborationUndoEntry.cs new file mode 100644 index 0000000..12699e5 --- /dev/null +++ b/Handle/BNCollaborationUndoEntry.cs @@ -0,0 +1,93 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class CollaborationUndoEntry : AbstractSafeHandle + { + public CollaborationUndoEntry(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static CollaborationUndoEntry? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new CollaborationUndoEntry( + NativeMethods.BNNewCollaborationUndoEntryReference(handle) , + true + ); + } + + internal static CollaborationUndoEntry MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new CollaborationUndoEntry( + NativeMethods.BNNewCollaborationUndoEntryReference(handle) , + true + ); + } + + internal static CollaborationUndoEntry? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new CollaborationUndoEntry(handle, true); + } + + internal static CollaborationUndoEntry MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new CollaborationUndoEntry(handle, true); + } + + internal static CollaborationUndoEntry? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new CollaborationUndoEntry(handle, false); + } + + internal static CollaborationUndoEntry MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new CollaborationUndoEntry(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeCollaborationUndoEntry(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + } +} \ No newline at end of file diff --git a/Handle/BNCollaborationUser.cs b/Handle/BNCollaborationUser.cs new file mode 100644 index 0000000..7e5e5c3 --- /dev/null +++ b/Handle/BNCollaborationUser.cs @@ -0,0 +1,93 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class CollaborationUser : AbstractSafeHandle + { + internal CollaborationUser(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static CollaborationUser? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new CollaborationUser( + NativeMethods.BNNewCollaborationUserReference(handle) , + true + ); + } + + internal static CollaborationUser MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new CollaborationUser( + NativeMethods.BNNewCollaborationUserReference(handle) , + true + ); + } + + internal static CollaborationUser? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new CollaborationUser(handle, true); + } + + internal static CollaborationUser MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new CollaborationUser(handle, true); + } + + internal static CollaborationUser? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new CollaborationUser(handle, false); + } + + internal static CollaborationUser MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new CollaborationUser(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeCollaborationUser(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + } +} \ No newline at end of file diff --git a/Handle/BNComponent.cs b/Handle/BNComponent.cs new file mode 100644 index 0000000..ff214b4 --- /dev/null +++ b/Handle/BNComponent.cs @@ -0,0 +1,94 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class Component : AbstractSafeHandle + { + internal Component(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + + internal static Component? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new Component( + NativeMethods.BNNewComponentReference(handle) , + true + ); + } + + internal static Component MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new Component( + NativeMethods.BNNewComponentReference(handle) , + true + ); + } + + internal static Component? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new Component(handle, true); + } + + internal static Component MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new Component(handle, true); + } + + internal static Component? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new Component(handle, false); + } + + internal static Component MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new Component(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeComponent(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + } +} \ No newline at end of file diff --git a/Handle/BNDataBuffer.cs b/Handle/BNDataBuffer.cs new file mode 100644 index 0000000..019a93f --- /dev/null +++ b/Handle/BNDataBuffer.cs @@ -0,0 +1,172 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class DataBuffer : AbstractSafeHandle , IEnumerable + { + public DataBuffer() + :this( Array.Empty() ) + { + + } + + public DataBuffer(byte[] data) + :this( NativeMethods.BNCreateDataBuffer(data , (ulong)data.Length) , true) + { + + } + + internal DataBuffer(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static DataBuffer MustNewFromHandle(IntPtr handle) + { + return new DataBuffer( + NativeMethods.BNDuplicateDataBuffer(handle) , + true + ); + } + + internal static DataBuffer? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new DataBuffer(handle, true); + } + + internal static DataBuffer MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new DataBuffer(handle, true); + } + + internal static DataBuffer? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new DataBuffer(handle , false); + } + + internal static DataBuffer MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new DataBuffer(handle , false); + } + + public static DataBuffer FromBytes(byte[] data) + { + return DataBuffer.MustTakeHandle( + NativeMethods.BNCreateDataBuffer(data , (ulong)data.Length) + ); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeDataBuffer(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + + public byte this[int index] + { + get + { + return NativeMethods.BNGetDataBufferByte(this.handle, (ulong)index); + } + + set + { + NativeMethods.BNSetDataBufferByte(this.handle , (ulong)index, value); + } + } + + public IEnumerator GetEnumerator() + { + List data = new List(); + + data.AddRange(this.Contents); + + return data.GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return this.GetEnumerator(); + } + + public byte[] Contents + { + get + { + IntPtr raw = NativeMethods.BNGetDataBufferContents(this.handle); + + if (IntPtr.Zero == raw) + { + return Array.Empty(); + } + + return UnsafeUtils.ReadNumberArray(raw , this.Length); + } + + set + { + NativeMethods.BNSetDataBufferContents(this.handle, value, (ulong)value.Length); + } + } + + public ulong Length + { + get + { + return NativeMethods.BNGetDataBufferLength(this.handle); + } + + set + { + NativeMethods.BNSetDataBufferLength( this.handle , value); + } + } + + public byte[] GetContentsAt(ulong offset) + { + IntPtr raw = NativeMethods.BNGetDataBufferContentsAt(this.handle , offset); + + if (IntPtr.Zero == raw) + { + return Array.Empty(); + } + + return UnsafeUtils.ReadNumberArray(raw , this.Length - offset); + } + + public void Clear() + { + NativeMethods.BNClearDataBuffer(this.handle); + } + } +} \ No newline at end of file diff --git a/Handle/BNDataRenderer.cs b/Handle/BNDataRenderer.cs new file mode 100644 index 0000000..463174a --- /dev/null +++ b/Handle/BNDataRenderer.cs @@ -0,0 +1,93 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class DataRenderer : AbstractSafeHandle + { + public DataRenderer(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static DataRenderer? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new DataRenderer( + NativeMethods.BNNewDataRendererReference(handle) , + true + ); + } + + internal static DataRenderer MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new DataRenderer( + NativeMethods.BNNewDataRendererReference(handle) , + true + ); + } + + internal static DataRenderer? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new DataRenderer(handle, true); + } + + internal static DataRenderer MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new DataRenderer(handle, true); + } + + internal static DataRenderer? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new DataRenderer(handle, false); + } + + internal static DataRenderer MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new DataRenderer(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeDataRenderer(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + } +} \ No newline at end of file diff --git a/Handle/BNDataRendererContainer.cs b/Handle/BNDataRendererContainer.cs new file mode 100644 index 0000000..5b12f35 --- /dev/null +++ b/Handle/BNDataRendererContainer.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class DataRendererContainer : AbstractSafeHandle + { + internal DataRendererContainer(IntPtr handle) + :base(handle , false) + { + + } + } +} \ No newline at end of file diff --git a/Handle/BNDatabase.cs b/Handle/BNDatabase.cs new file mode 100644 index 0000000..be29262 --- /dev/null +++ b/Handle/BNDatabase.cs @@ -0,0 +1,93 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class Database : AbstractSafeHandle + { + internal Database(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static Database? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new Database( + NativeMethods.BNNewDatabaseReference(handle) , + true + ); + } + + internal static Database MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new Database( + NativeMethods.BNNewDatabaseReference(handle) , + true + ); + } + + internal static Database? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new Database(handle, true); + } + + internal static Database MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new Database(handle, true); + } + + internal static Database? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new Database(handle, false); + } + + internal static Database MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new Database(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeDatabase(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + } +} \ No newline at end of file diff --git a/Handle/BNDebugInfo.cs b/Handle/BNDebugInfo.cs new file mode 100644 index 0000000..218ae5e --- /dev/null +++ b/Handle/BNDebugInfo.cs @@ -0,0 +1,93 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class DebugInfo : AbstractSafeHandle + { + internal DebugInfo(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static DebugInfo? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new DebugInfo( + NativeMethods.BNNewDebugInfoReference(handle) , + true + ); + } + + internal static DebugInfo MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new DebugInfo( + NativeMethods.BNNewDebugInfoReference(handle) , + true + ); + } + + internal static DebugInfo? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new DebugInfo(handle, true); + } + + internal static DebugInfo MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new DebugInfo(handle, true); + } + + internal static DebugInfo? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new DebugInfo(handle, false); + } + + internal static DebugInfo MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new DebugInfo(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeDebugInfoReference(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + } +} \ No newline at end of file diff --git a/Handle/BNDebugInfoParser.cs b/Handle/BNDebugInfoParser.cs new file mode 100644 index 0000000..e7f42cc --- /dev/null +++ b/Handle/BNDebugInfoParser.cs @@ -0,0 +1,93 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class DebugInfoParser : AbstractSafeHandle + { + internal DebugInfoParser(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static DebugInfoParser? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new DebugInfoParser( + NativeMethods.BNNewDebugInfoParserReference(handle) , + true + ); + } + + internal static DebugInfoParser MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new DebugInfoParser( + NativeMethods.BNNewDebugInfoParserReference(handle) , + true + ); + } + + internal static DebugInfoParser? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new DebugInfoParser(handle, true); + } + + internal static DebugInfoParser MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new DebugInfoParser(handle, true); + } + + internal static DebugInfoParser? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new DebugInfoParser(handle, false); + } + + internal static DebugInfoParser MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new DebugInfoParser(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeDebugInfoParserReference(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + } +} \ No newline at end of file diff --git a/Handle/BNDemangler.cs b/Handle/BNDemangler.cs new file mode 100644 index 0000000..ba485eb --- /dev/null +++ b/Handle/BNDemangler.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class Demangler : AbstractSafeHandle + { + internal Demangler(IntPtr handle) + :base(handle, false) + { + + } + } +} \ No newline at end of file diff --git a/Handle/BNDisassemblySettings.cs b/Handle/BNDisassemblySettings.cs new file mode 100644 index 0000000..65ad847 --- /dev/null +++ b/Handle/BNDisassemblySettings.cs @@ -0,0 +1,199 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class DisassemblySettings : AbstractSafeHandle + { + public DisassemblySettings() + : this( NativeMethods.BNDefaultDisassemblySettings() , true) + { + + } + + internal DisassemblySettings(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + + internal static DisassemblySettings? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new DisassemblySettings( + NativeMethods.BNNewDisassemblySettingsReference(handle) , + true + ); + } + + internal static DisassemblySettings MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new DisassemblySettings( + NativeMethods.BNNewDisassemblySettingsReference(handle) , + true + ); + } + + internal static DisassemblySettings? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new DisassemblySettings(handle, true); + } + + internal static DisassemblySettings MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new DisassemblySettings(handle, true); + } + + internal static DisassemblySettings? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new DisassemblySettings(handle, false); + } + + internal static DisassemblySettings MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new DisassemblySettings(handle, false); + } + + public static DisassemblySettings Default() + { + return DisassemblySettings.MustTakeHandle( + NativeMethods.BNDefaultDisassemblySettings() + ); + } + + public static DisassemblySettings DefaultGraph() + { + return DisassemblySettings.MustTakeHandle( + NativeMethods.BNDefaultGraphDisassemblySettings() + ); + } + + public static DisassemblySettings DefaultLinear() + { + return DisassemblySettings.MustTakeHandle( + NativeMethods.BNDefaultLinearDisassemblySettings() + ); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeDisassemblySettings(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + + public bool IsOptionSet(DisassemblyOption option) + { + return NativeMethods.BNIsDisassemblySettingsOptionSet(this.handle , option); + } + + public void SetOption(DisassemblyOption option , bool state) + { + NativeMethods.BNSetDisassemblySettingsOption(this.handle , option , state); + } + + public ulong Width + { + get + { + return NativeMethods.BNGetDisassemblyWidth(this.handle); + } + + set + { + NativeMethods.BNSetDisassemblyWidth(this.handle, value); + } + } + + public ulong MaximumSymbolWidth + { + get + { + return NativeMethods.BNGetDisassemblyMaximumSymbolWidth(this.handle); + } + + set + { + NativeMethods.BNSetDisassemblyMaximumSymbolWidth(this.handle, value); + } + } + + public ulong GutterWidth + { + get + { + return NativeMethods.BNGetDisassemblyGutterWidth(this.handle); + } + + set + { + NativeMethods.BNSetDisassemblyGutterWidth(this.handle, value); + } + } + + + public DisassemblyAddressMode AddressMode + { + get + { + return NativeMethods.BNGetDisassemblyAddressMode(this.handle); + } + + set + { + NativeMethods.BNSetDisassemblyAddressMode(this.handle, value); + } + } + + public ulong AddressBaseOffset + { + get + { + return NativeMethods.BNGetDisassemblyAddressBaseOffset(this.handle); + } + + set + { + NativeMethods.BNSetDisassemblyAddressBaseOffset(this.handle, value); + } + } + + + } +} \ No newline at end of file diff --git a/Handle/BNDisassemblyTextRenderer.cs b/Handle/BNDisassemblyTextRenderer.cs new file mode 100644 index 0000000..6f7e562 --- /dev/null +++ b/Handle/BNDisassemblyTextRenderer.cs @@ -0,0 +1,93 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class DisassemblyTextRenderer : AbstractSafeHandle + { + internal DisassemblyTextRenderer(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static DisassemblyTextRenderer? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new DisassemblyTextRenderer( + NativeMethods.BNNewDisassemblyTextRendererReference(handle) , + true + ); + } + + internal static DisassemblyTextRenderer MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new DisassemblyTextRenderer( + NativeMethods.BNNewDisassemblyTextRendererReference(handle) , + true + ); + } + + internal static DisassemblyTextRenderer? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new DisassemblyTextRenderer(handle, true); + } + + internal static DisassemblyTextRenderer MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new DisassemblyTextRenderer(handle, true); + } + + internal static DisassemblyTextRenderer? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new DisassemblyTextRenderer(handle, false); + } + + internal static DisassemblyTextRenderer MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new DisassemblyTextRenderer(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeDisassemblyTextRenderer(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + } +} \ No newline at end of file diff --git a/Handle/BNDownloadInstance.cs b/Handle/BNDownloadInstance.cs new file mode 100644 index 0000000..cb5d4ea --- /dev/null +++ b/Handle/BNDownloadInstance.cs @@ -0,0 +1,93 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class DownloadInstance : AbstractSafeHandle + { + internal DownloadInstance(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static DownloadInstance? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new DownloadInstance( + NativeMethods.BNNewDownloadInstanceReference(handle) , + true + ); + } + + internal static DownloadInstance MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new DownloadInstance( + NativeMethods.BNNewDownloadInstanceReference(handle) , + true + ); + } + + internal static DownloadInstance? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new DownloadInstance(handle, true); + } + + internal static DownloadInstance MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new DownloadInstance(handle, true); + } + + internal static DownloadInstance? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new DownloadInstance(handle, false); + } + + internal static DownloadInstance MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new DownloadInstance(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeDownloadInstance(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + } +} \ No newline at end of file diff --git a/Handle/BNDownloadProvider.cs b/Handle/BNDownloadProvider.cs new file mode 100644 index 0000000..5495ec4 --- /dev/null +++ b/Handle/BNDownloadProvider.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class DownloadProvider : AbstractSafeHandle + { + internal DownloadProvider(IntPtr handle) + :base(handle , false) + { + + } + } +} \ No newline at end of file diff --git a/Handle/BNEnumeration.cs b/Handle/BNEnumeration.cs new file mode 100644 index 0000000..a2a742f --- /dev/null +++ b/Handle/BNEnumeration.cs @@ -0,0 +1,200 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class Enumeration : AbstractSafeHandle + { + public Enumeration(EnumerationType type) + : base( NativeMethods.BNGetTypeEnumeration(type.DangerousGetHandle()) , true) + { + + } + + internal Enumeration(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static Enumeration? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new Enumeration( + NativeMethods.BNNewEnumerationReference(handle) , + true + ); + } + + internal static Enumeration MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new Enumeration( + NativeMethods.BNNewEnumerationReference(handle) , + true + ); + } + + internal static Enumeration? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new Enumeration(handle, true); + } + + internal static Enumeration MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new Enumeration(handle, true); + } + + internal static Enumeration? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new Enumeration(handle, false); + } + + internal static Enumeration MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new Enumeration(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeEnumeration(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + + public override string ToString() + { + StringBuilder builder = new StringBuilder(); + + foreach (EnumerationMember member in Members) + { + builder.AppendLine( member.ToString() + ";"); + } + + return builder.ToString(); + } + + public EnumerationMember[] Members + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetEnumerationMembers( + this.handle, + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + EnumerationMember.FromNative , + NativeMethods.BNFreeEnumerationMemberList + ); + } + } + + public EnumerationType CreateType(ulong width , BoolWithConfidence signed) + { + IntPtr raw = NativeMethods.BNCreateEnumerationTypeOfWidth( + this.handle , + width , + signed.ToNative() + ); + + if (IntPtr.Zero == raw) + { + throw new Exception("Could not create an enumeration type"); + } + + return new EnumerationType(raw , true ); + } + + public EnumerationBuilder CreateBuilder() + { + return new EnumerationBuilder( + NativeMethods.BNCreateEnumerationBuilderFromEnumeration(this.handle) , + true + ); + } + + /// + /// + /// + /// + /// 1,2,4,8 + /// + /// + public InstructionTextToken[] GetTokensForValue( + uint value, + ulong width, + BinaryNinja.Type? type = null + ) + { + BinaryNinja.Type autoType; + + if (type == null) + { + autoType = BinaryNinja.Type.MustTakeHandle( + NativeMethods.BNCreateEnumerationTypeOfWidth( + this.handle , + width , + new BoolWithConfidence().ToNative() + ) + ); + } + else + { + autoType = type; + } + + IntPtr arrayPointer = NativeMethods.BNGetEnumerationTokensForValue( + this.handle , + value , + width , + out ulong arrayLength , + autoType.DangerousGetHandle() + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + InstructionTextToken.FromNative , + NativeMethods.BNFreeInstructionText + ); + } + } +} \ No newline at end of file diff --git a/Handle/BNEnumerationBuilder.cs b/Handle/BNEnumerationBuilder.cs new file mode 100644 index 0000000..9b3f663 --- /dev/null +++ b/Handle/BNEnumerationBuilder.cs @@ -0,0 +1,168 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class EnumerationBuilder : AbstractSafeHandle + { + public EnumerationBuilder() + : this(NativeMethods.BNCreateEnumerationBuilder() , true) + { + + } + + public EnumerationBuilder(Enumeration enumeration) + : this( + NativeMethods.BNCreateEnumerationBuilderFromEnumeration( + enumeration.DangerousGetHandle() + ) , true) + { + + } + + internal EnumerationBuilder(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static EnumerationBuilder? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new EnumerationBuilder(handle, true); + } + + internal static EnumerationBuilder MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new EnumerationBuilder(handle, true); + } + + internal static EnumerationBuilder? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new EnumerationBuilder(handle, false); + } + + internal static EnumerationBuilder MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new EnumerationBuilder(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeEnumerationBuilder(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + + public EnumerationBuilder Duplicate() + { + return new EnumerationBuilder( + NativeMethods.BNDuplicateEnumerationBuilder(this.handle), + true + ); + } + + public EnumerationMember[] Members + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetEnumerationBuilderMembers( + this.handle , + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + EnumerationMember.FromNative, + NativeMethods.BNFreeEnumerationMemberList + ); + } + + set + { + if (this.Members.Length > 0) + { + for (int index = this.Members.Length - 1; index >= 0; index--) + { + this.RemoveMember(index); + } + } + + foreach (EnumerationMember member in value) + { + NativeMethods.BNAddEnumerationBuilderMemberWithValue( + this.handle, + member.Name , + member.Value + ); + } + } + } + + public void AddMember(string name) + { + NativeMethods.BNAddEnumerationBuilderMember(this.handle , name); + } + + public void AddMemberWithValue(string name , ulong value) + { + NativeMethods.BNAddEnumerationBuilderMemberWithValue( + this.handle , + name, + value + ); + } + + public void RemoveMember(int index) + { + NativeMethods.BNRemoveEnumerationBuilderMember(this.handle , (ulong)index); + } + + public void ReplaceMember(int index , string name , ulong value) + { + NativeMethods.BNReplaceEnumerationBuilderMember( + this.handle , + (ulong)index, + name, + value + ); + } + + public Enumeration Build() + { + return new Enumeration( + NativeMethods.BNFinalizeEnumerationBuilder(this.handle), + true + ); + } + + } + + +} \ No newline at end of file diff --git a/Handle/BNExternalLibrary.cs b/Handle/BNExternalLibrary.cs new file mode 100644 index 0000000..9e0a8f3 --- /dev/null +++ b/Handle/BNExternalLibrary.cs @@ -0,0 +1,106 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class ExternalLibrary : AbstractSafeHandle + { + internal ExternalLibrary(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static ExternalLibrary? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new ExternalLibrary( + NativeMethods.BNNewExternalLibraryReference(handle) , + true + ); + } + + internal static ExternalLibrary MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new ExternalLibrary( + NativeMethods.BNNewExternalLibraryReference(handle) , + true + ); + } + + internal static ExternalLibrary? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new ExternalLibrary(handle, true); + } + + internal static ExternalLibrary MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new ExternalLibrary(handle, true); + } + + internal static ExternalLibrary? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new ExternalLibrary(handle, false); + } + + internal static ExternalLibrary MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new ExternalLibrary(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeExternalLibrary(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + + public string Name + { + get + { + return UnsafeUtils.TakeAnsiString( + NativeMethods.BNExternalLibraryGetName(this.handle) + ); + } + } + + + + } +} \ No newline at end of file diff --git a/Handle/BNExternalLocation.cs b/Handle/BNExternalLocation.cs new file mode 100644 index 0000000..2cd7654 --- /dev/null +++ b/Handle/BNExternalLocation.cs @@ -0,0 +1,93 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class ExternalLocation : AbstractSafeHandle + { + internal ExternalLocation(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static ExternalLocation? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new ExternalLocation( + NativeMethods.BNNewExternalLocationReference(handle) , + true + ); + } + + internal static ExternalLocation MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new ExternalLocation( + NativeMethods.BNNewExternalLocationReference(handle) , + true + ); + } + + internal static ExternalLocation? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new ExternalLocation(handle, true); + } + + internal static ExternalLocation MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new ExternalLocation(handle, true); + } + + internal static ExternalLocation? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new ExternalLocation(handle, false); + } + + internal static ExternalLocation MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new ExternalLocation(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeExternalLocation(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + } +} \ No newline at end of file diff --git a/Handle/BNFieldResolutionInfo.cs b/Handle/BNFieldResolutionInfo.cs new file mode 100644 index 0000000..8090c3e --- /dev/null +++ b/Handle/BNFieldResolutionInfo.cs @@ -0,0 +1,93 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class FieldResolutionInfo : AbstractSafeHandle + { + public FieldResolutionInfo(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static FieldResolutionInfo? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new FieldResolutionInfo( + NativeMethods.BNNewFieldResolutionInfoReference(handle) , + true + ); + } + + internal static FieldResolutionInfo MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new FieldResolutionInfo( + NativeMethods.BNNewFieldResolutionInfoReference(handle) , + true + ); + } + + internal static FieldResolutionInfo? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new FieldResolutionInfo(handle, true); + } + + internal static FieldResolutionInfo MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new FieldResolutionInfo(handle, true); + } + + internal static FieldResolutionInfo? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new FieldResolutionInfo(handle, false); + } + + internal static FieldResolutionInfo MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new FieldResolutionInfo(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeFieldResolutionInfo(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + } +} \ No newline at end of file diff --git a/Handle/BNFileMetadata.cs b/Handle/BNFileMetadata.cs new file mode 100644 index 0000000..8ef8e75 --- /dev/null +++ b/Handle/BNFileMetadata.cs @@ -0,0 +1,424 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class FileMetadata : AbstractSafeHandle + { + public FileMetadata() + : this(NativeMethods.BNCreateFileMetadata() , true) + { + + } + + public FileMetadata(string filename) + : this(NativeMethods.BNCreateFileMetadata() , true) + { + this.Filename = filename; + } + + internal FileMetadata(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static FileMetadata? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new FileMetadata(handle, true); + } + + internal static FileMetadata MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new FileMetadata(handle, true); + } + + internal static FileMetadata? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new FileMetadata(handle, false); + } + + internal static FileMetadata MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new FileMetadata(handle, false); + } + + + public static FileMetadata FromFile(string filename) + { + FileMetadata file = new FileMetadata(); + + file.Filename = filename; + + return file; + } + + protected override bool ReleaseHandle() + { + if (!this.IsInvalid) + { + NativeMethods.BNCloseFile(this.handle); + NativeMethods.BNFreeFileMetadata(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + + + public ulong SessionId + { + get + { + return NativeMethods.BNFileMetadataGetSessionId(this.handle); + } + } + + public string Filename + { + get + { + return UnsafeUtils.TakeUtf8String( + NativeMethods.BNGetFilename(this.handle) + ); + } + + set + { + NativeMethods.BNSetFilename(this.handle , value); + } + } + + public string OriginalFilename + { + get + { + return UnsafeUtils.TakeUtf8String( + NativeMethods.BNGetOriginalFilename(this.handle) + ); + } + + set + { + NativeMethods.BNSetOriginalFilename(this.handle , value); + } + } + + public string GetVirtualPath() + { + return UnsafeUtils.TakeUtf8String( + NativeMethods.BNGetVirtualPath(this.handle) + ); + } + + public void SetVirtualPath(string value) + { + NativeMethods.BNSetVirtualPath(this.handle , value); + } + + + public bool Modified + { + get + { + return NativeMethods.BNIsFileModified(this.handle); + } + + set + { + if (value) + { + NativeMethods.BNMarkFileModified(this.handle); + } + else + { + NativeMethods.BNMarkFileSaved(this.handle); + } + } + } + + public bool AnalysisChanged + { + get + { + return NativeMethods.BNIsAnalysisChanged(this.handle); + } + } + + public bool IsBackedByDatabase(string binaryViewType = "") + { + return NativeMethods.BNIsBackedByDatabase(this.handle , binaryViewType); + } + + public string View + { + get + { + return UnsafeUtils.TakeAnsiString(NativeMethods.BNGetCurrentView(this.handle)); + } + + set + { + this.Navigate(value , this.Offset); + } + } + + public ulong Offset + { + get + { + return NativeMethods.BNGetCurrentOffset(this.handle); + } + + set + { + this.Navigate(this.View , value); + } + } + + public bool Navigate(string binaryViewType , ulong offset) + { + return NativeMethods.BNNavigate( + this.handle , + binaryViewType , + offset + ); + } + + public BinaryView? GetFileViewOfType(string binaryViewType) + { + return BinaryView.TakeHandle( + NativeMethods.BNGetFileViewOfType(this.handle , binaryViewType) + ); + } + + public BinaryView? RawBinaryView + { + get + { + return this.GetFileViewOfType("Raw"); + } + } + + public Database? Database + { + get + { + return Database.TakeHandle( + NativeMethods.BNGetFileMetadataDatabase(this.handle) + ); + } + } + + public bool SnapshotDataAppliedWithoutError + { + get + { + return NativeMethods.BNIsSnapshotDataAppliedWithoutError(this.handle); + } + } + + + public ProjectFile? ProjectFile + { + get + { + return ProjectFile.TakeHandle( + NativeMethods.BNGetProjectFile(this.handle) + ); + } + + set + { + NativeMethods.BNSetProjectFile( + this.handle , + null == value ? IntPtr.Zero : value.DangerousGetHandle() + ); + } + } + + public void CloseFile() + { + NativeMethods.BNCloseFile(this.handle); + } + + public string BeginUndoActions(bool anonymousAllowed ) + { + return UnsafeUtils.TakeUtf8String( + NativeMethods.BNBeginUndoActions(this.handle , anonymousAllowed) + ); + } + + public void CommitUndoActions(string id) + { + NativeMethods.BNCommitUndoActions(this.handle , id); + } + + public void ForgetUndoActions(string id) + { + NativeMethods.BNForgetUndoActions(this.handle , id); + } + + public void RevertUndoActions(string id) + { + NativeMethods.BNRevertUndoActions(this.handle , id); + } + + public bool CanUndo + { + get + { + return NativeMethods.BNCanUndo(this.handle); + } + } + + public bool Undo() + { + return NativeMethods.BNUndo(this.handle); + } + + public bool CanRedo + { + get + { + return NativeMethods.BNCanRedo(this.handle); + } + } + + public bool Redo() + { + return NativeMethods.BNRedo(this.handle); + } + + public UndoEntry[] UndoEntries + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetUndoEntries( + this.handle , + out ulong arrayLength + ); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer , + arrayLength , + UndoEntry.MustNewFromHandle , + NativeMethods.BNFreeUndoEntryList + ); + } + } + + public UndoEntry[] RedoEntrie + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetRedoEntries( + this.handle , + out ulong arrayLength + ); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer , + arrayLength , + UndoEntry.MustNewFromHandle , + NativeMethods.BNFreeUndoEntryList + ); + } + } + + public string[] ExistingViews + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetExistingViews( + this.handle , + out ulong arrayLength + ); + + return UnsafeUtils.TakeAnsiStringArray( + arrayPointer, + arrayLength , + NativeMethods.BNFreeStringList + ); + } + } + + + public void UnregisterViewOfType(string viewType , BinaryView view) + { + NativeMethods.BNUnregisterViewOfType( + this.handle , + viewType , + view.DangerousGetHandle() + ); + } + + public Logger? GetLogger(string name) + { + return Logger.GetLogger(name , this.SessionId); + } + + public Logger CreateLogger(string name) + { + return Logger.CreateLogger(name , this.SessionId); + } + + public Logger GetOrCreateLogger(string name) + { + return Logger.GetOrCreateLogger(name , this.SessionId); + } + + public BinaryView? OpenExistingDatabase(string filename , ProgressDelegate? progress = null) + { + if (null == progress) + { + return BinaryView.TakeHandle( + NativeMethods.BNOpenExistingDatabase(this.handle , filename) + ); + } + else + { + return BinaryView.TakeHandle( + NativeMethods.BNOpenExistingDatabaseWithProgress( + this.handle , + filename, + IntPtr.Zero, + Marshal.GetFunctionPointerForDelegate( + UnsafeUtils.WrapProgressDelegate(progress) + ) + ) + ); + } + } + + public BinaryView? OpenDatabaseForConfiguration(string filename ) + { + return BinaryView.TakeHandle( + NativeMethods.BNOpenDatabaseForConfiguration(this.handle , filename) + ); + } + + } +} \ No newline at end of file diff --git a/Handle/BNFirmwareNinja.cs b/Handle/BNFirmwareNinja.cs new file mode 100644 index 0000000..082f369 --- /dev/null +++ b/Handle/BNFirmwareNinja.cs @@ -0,0 +1,67 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class FirmwareNinja : AbstractSafeHandle + { + public FirmwareNinja(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static FirmwareNinja? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new FirmwareNinja(handle, true); + } + + internal static FirmwareNinja MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new FirmwareNinja(handle, true); + } + + internal static FirmwareNinja? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new FirmwareNinja(handle, false); + } + + internal static FirmwareNinja MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new FirmwareNinja(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeFirmwareNinja(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + } +} \ No newline at end of file diff --git a/Handle/BNFirmwareNinjaReferenceNode.cs b/Handle/BNFirmwareNinjaReferenceNode.cs new file mode 100644 index 0000000..6b3b710 --- /dev/null +++ b/Handle/BNFirmwareNinjaReferenceNode.cs @@ -0,0 +1,93 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class FirmwareNinjaReferenceNode : AbstractSafeHandle + { + internal FirmwareNinjaReferenceNode(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static FirmwareNinjaReferenceNode? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new FirmwareNinjaReferenceNode( + NativeMethods.BNNewFirmwareNinjaReferenceNodeReference(handle) , + true + ); + } + + internal static FirmwareNinjaReferenceNode MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new FirmwareNinjaReferenceNode( + NativeMethods.BNNewFirmwareNinjaReferenceNodeReference(handle) , + true + ); + } + + internal static FirmwareNinjaReferenceNode? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new FirmwareNinjaReferenceNode(handle, true); + } + + internal static FirmwareNinjaReferenceNode MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new FirmwareNinjaReferenceNode(handle, true); + } + + internal static FirmwareNinjaReferenceNode? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new FirmwareNinjaReferenceNode(handle, false); + } + + internal static FirmwareNinjaReferenceNode MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new FirmwareNinjaReferenceNode(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeFirmwareNinjaReferenceNode(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + } +} \ No newline at end of file diff --git a/Handle/BNFirmwareNinjaRelationship.cs b/Handle/BNFirmwareNinjaRelationship.cs new file mode 100644 index 0000000..f1f9a79 --- /dev/null +++ b/Handle/BNFirmwareNinjaRelationship.cs @@ -0,0 +1,93 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class FirmwareNinjaRelationship : AbstractSafeHandle + { + internal FirmwareNinjaRelationship(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static FirmwareNinjaRelationship? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new FirmwareNinjaRelationship( + NativeMethods.BNNewFirmwareNinjaRelationshipReference(handle) , + true + ); + } + + internal static FirmwareNinjaRelationship MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new FirmwareNinjaRelationship( + NativeMethods.BNNewFirmwareNinjaRelationshipReference(handle) , + true + ); + } + + internal static FirmwareNinjaRelationship? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new FirmwareNinjaRelationship(handle, true); + } + + internal static FirmwareNinjaRelationship MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new FirmwareNinjaRelationship(handle, true); + } + + internal static FirmwareNinjaRelationship? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new FirmwareNinjaRelationship(handle, false); + } + + internal static FirmwareNinjaRelationship MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new FirmwareNinjaRelationship(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeFirmwareNinjaRelationship(handle); + this.SetHandleAsInvalid(); + } + + return true; + } + } +} \ No newline at end of file diff --git a/Handle/BNFlowGraph.cs b/Handle/BNFlowGraph.cs new file mode 100644 index 0000000..2578539 --- /dev/null +++ b/Handle/BNFlowGraph.cs @@ -0,0 +1,503 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public abstract class AbstractFlowGraph : AbstractSafeHandle + where T_SELF: AbstractFlowGraph + { + internal AbstractFlowGraph(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeFlowGraph(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + + + public Function? Function + { + get + { + return Function.TakeHandle(NativeMethods.BNGetFunctionForFlowGraph(this.handle)); + } + + set + { + NativeMethods.BNSetFunctionForFlowGraph( + this.handle, + null == value ? IntPtr.Zero : value.DangerousGetHandle() + ); + } + } + + public BinaryView? BinaryView + { + get + { + return BinaryView.TakeHandle(NativeMethods.BNGetViewForFlowGraph(this.handle)); + } + + set + { + NativeMethods.BNSetViewForFlowGraph( + this.handle, + null == value ? IntPtr.Zero : value.DangerousGetHandle() + ); + } + } + + public bool LayoutComplete + { + get + { + return NativeMethods.BNIsFlowGraphLayoutComplete(this.handle); + } + } + + + public ulong NodeCount + { + get + { + return NativeMethods.BNGetFlowGraphNodeCount(this.handle); + } + } + + public bool HasNodes + { + get + { + return NativeMethods.BNFlowGraphHasNodes(this.handle); + } + } + + public int Width + { + get + { + return NativeMethods.BNGetFlowGraphWidth(this.handle); + } + + set + { + NativeMethods.BNFlowGraphSetWidth(this.handle, value); + } + } + + public int Height + { + get + { + return NativeMethods.BNGetFlowGraphHeight(this.handle); + } + + set + { + NativeMethods.BNFlowGraphSetHeight(this.handle, value); + } + } + + + public int HorizontalMargin + { + get + { + return NativeMethods.BNGetHorizontalFlowGraphNodeMargin(this.handle); + } + + set + { + NativeMethods.BNSetFlowGraphNodeMargins( + this.handle, + value, + this.VerticalMargin + ); + } + } + + + public int VerticalMargin + { + get + { + return NativeMethods.BNGetVerticalFlowGraphNodeMargin(this.handle); + } + + set + { + NativeMethods.BNSetFlowGraphNodeMargins( + this.handle, + this.HorizontalMargin, + value + ); + } + } + + public bool IsIL + { + get + { + return NativeMethods.BNIsILFlowGraph(this.handle); + } + } + + public bool IsLowLevelIL + { + get + { + return NativeMethods.BNIsLowLevelILFlowGraph(this.handle); + } + } + + public bool IsMediumLevelIL + { + get + { + return NativeMethods.BNIsMediumLevelILFlowGraph(this.handle); + } + } + + public bool IsHighLevelIL + { + get + { + return NativeMethods.BNIsHighLevelILFlowGraph(this.handle); + } + } + + public LowLevelILFunction? LowLevelILFunction + { + get + { + return LowLevelILFunction.TakeHandle( + NativeMethods.BNGetFlowGraphLowLevelILFunction(this.handle) + ); + } + + set + { + NativeMethods.BNSetFlowGraphLowLevelILFunction( + this.handle , + null == value ? IntPtr.Zero : value.DangerousGetHandle() + ); + } + } + + public MediumLevelILFunction? MediumLevelILFunction + { + get + { + return MediumLevelILFunction.TakeHandle( + NativeMethods.BNGetFlowGraphMediumLevelILFunction(this.handle) + ); + } + + set + { + NativeMethods.BNSetFlowGraphMediumLevelILFunction( + this.handle , + null == value ? IntPtr.Zero : value.DangerousGetHandle() + ); + } + } + + public HighLevelILFunction? HighLevelILFunction + { + get + { + return HighLevelILFunction.TakeHandle( + NativeMethods.BNGetFlowGraphHighLevelILFunction(this.handle) + ); + } + + set + { + NativeMethods.BNSetFlowGraphHighLevelILFunction( + this.handle , + null == value ? IntPtr.Zero : value.DangerousGetHandle() + ); + } + } + + public bool IsOptionSet(FlowGraphOption option ) + { + return NativeMethods.BNIsFlowGraphOptionSet(this.handle , option ); + } + + public void SetOption(FlowGraphOption option , bool value) + { + NativeMethods.BNSetFlowGraphOption(this.handle , option , value); + } + + public bool UsesBlockHighlights + { + get + { + return this.IsOptionSet(FlowGraphOption.FlowGraphUsesBlockHighlights); + } + + set + { + this.SetOption(FlowGraphOption.FlowGraphUsesBlockHighlights, value); + } + } + + public bool UsesInstructionHighlights + { + get + { + return this.IsOptionSet(FlowGraphOption.FlowGraphUsesInstructionHighlights); + } + + set + { + this.SetOption(FlowGraphOption.FlowGraphUsesInstructionHighlights, value); + } + } + + public bool IncludesUserComments + { + get + { + return this.IsOptionSet(FlowGraphOption.FlowGraphIncludesUserComments); + } + + set + { + this.SetOption(FlowGraphOption.FlowGraphIncludesUserComments, value); + } + } + + public bool AllowsPatching + { + get + { + return this.IsOptionSet(FlowGraphOption.FlowGraphAllowsPatching); + } + + set + { + this.SetOption(FlowGraphOption.FlowGraphAllowsPatching, value); + } + } + + public bool AllowsInlineInstructionEditing + { + get + { + return this.IsOptionSet(FlowGraphOption.FlowGraphAllowsInlineInstructionEditing); + } + + set + { + this.SetOption(FlowGraphOption.FlowGraphAllowsInlineInstructionEditing, value); + } + } + + public bool ShowsSecondaryRegisterHighlighting + { + get + { + return this.IsOptionSet(FlowGraphOption.FlowGraphShowsSecondaryRegisterHighlighting); + } + + set + { + this.SetOption(FlowGraphOption.FlowGraphShowsSecondaryRegisterHighlighting, value); + } + } + + public bool Addressable + { + get + { + return this.IsOptionSet(FlowGraphOption.FlowGraphIsAddressable); + } + + set + { + this.SetOption(FlowGraphOption.FlowGraphIsAddressable, value); + } + } + + public bool WorkflowGraph + { + get + { + return this.IsOptionSet(FlowGraphOption.FlowGraphIsWorkflowGraph); + } + + set + { + this.SetOption(FlowGraphOption.FlowGraphIsWorkflowGraph, value); + } + } + + + + public ulong AddNode(FlowGraphNode node) + { + return NativeMethods.BNAddFlowGraphNode(this.handle, node.DangerousGetHandle()); + } + + public void ReplaceNode(ulong index , FlowGraphNode node) + { + NativeMethods.BNReplaceFlowGraphNode(this.handle, index ,node.DangerousGetHandle()); + } + + public void ClearNodes() + { + NativeMethods.BNClearFlowGraphNodes(this.handle); + } + + public void ShowReport(string title , BinaryView? view = null) + { + NativeMethods.BNShowGraphReport( + null == view ? IntPtr.Zero : view.DangerousGetHandle(), + title , + this.handle + ); + } + + public RenderLayer[] RenderLayers + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetFlowGraphRenderLayers( + this.handle , + out ulong arrayLength + ); + + return UnsafeUtils.TakeHandleArray( + arrayPointer , + arrayLength , + RenderLayer.FromHandle , + NativeMethods.BNFreeRenderLayerList + ); + } + + set + { + foreach (RenderLayer layer in this.RenderLayers) + { + this.RemoveRenderLayer(layer); + } + + foreach (RenderLayer layer in value) + { + this.AddRenderLayer(layer); + } + } + } + + public void AddRenderLayer(RenderLayer layer) + { + NativeMethods.BNAddFlowGraphRenderLayer(this.handle , layer.DangerousGetHandle()); + } + + public void RemoveRenderLayer(RenderLayer layer) + { + NativeMethods.BNRemoveFlowGraphRenderLayer(this.handle , layer.DangerousGetHandle()); + } + + + public FlowGraphLayoutRequest StartLayout(Action? callback) + { + IntPtr argCallback = IntPtr.Zero; + + if (null != callback) + { + Action callbackAdapter = ( _ctx => { callback(); } ); + + argCallback = Marshal.GetFunctionPointerForDelegate>( + callbackAdapter + ); + } + + return new FlowGraphLayoutRequest( + NativeMethods.BNStartFlowGraphLayout( + this.handle , + IntPtr.Zero , + argCallback + ) , + true + ); + } + + public bool IsNodeValid(FlowGraphNode node) + { + return NativeMethods.BNIsNodeValidForFlowGraph(this.handle, node.DangerousGetHandle()); + } + } + + // x + public sealed class FlowGraph : AbstractFlowGraph + { + public FlowGraph() + :this( NativeMethods.BNCreateFlowGraph() , true) + { + + } + + internal FlowGraph(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + + internal static FlowGraph? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new FlowGraph(handle, true); + } + + internal static FlowGraph MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new FlowGraph(handle, true); + } + + internal static FlowGraph? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new FlowGraph(handle, false); + } + + internal static FlowGraph MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new FlowGraph(handle, false); + } + } +} \ No newline at end of file diff --git a/Handle/BNFlowGraphLayout.cs b/Handle/BNFlowGraphLayout.cs new file mode 100644 index 0000000..33280d3 --- /dev/null +++ b/Handle/BNFlowGraphLayout.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class FlowGraphLayout : AbstractSafeHandle + { + internal FlowGraphLayout(IntPtr handle) + :base(handle , false) + { + + } + } +} \ No newline at end of file diff --git a/Handle/BNFlowGraphLayoutRequest.cs b/Handle/BNFlowGraphLayoutRequest.cs new file mode 100644 index 0000000..0047dd1 --- /dev/null +++ b/Handle/BNFlowGraphLayoutRequest.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public class FlowGraphLayoutRequest : AbstractSafeHandle + { + internal FlowGraphLayoutRequest(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeFlowGraphLayoutRequest(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + + public bool Complete + { + get + { + return NativeMethods.BNIsFlowGraphLayoutRequestComplete(this.handle); + } + } + + public void Abort() + { + NativeMethods.BNAbortFlowGraphLayoutRequest(handle); + } + } +} \ No newline at end of file diff --git a/Handle/BNFlowGraphNode.cs b/Handle/BNFlowGraphNode.cs new file mode 100644 index 0000000..bda2106 --- /dev/null +++ b/Handle/BNFlowGraphNode.cs @@ -0,0 +1,162 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public class FlowGraphNode : AbstractSafeHandle + { + internal FlowGraphNode(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeFlowGraphNode(this.handle); + this.SetHandleAsInvalid(); + } + return true; + } + + public int X + { + get + { + return NativeMethods.BNGetFlowGraphNodeX(this.handle); + } + + set + { + NativeMethods.BNFlowGraphNodeSetX(this.handle, value); + } + } + + public int Y + { + get + { + return NativeMethods.BNGetFlowGraphNodeY(this.handle); + } + + set + { + NativeMethods.BNFlowGraphNodeSetY(this.handle, value); + } + } + + public int Width + { + get + { + return NativeMethods.BNGetFlowGraphNodeWidth(this.handle); + } + } + + public int Height + { + get + { + return NativeMethods.BNGetFlowGraphNodeHeight(this.handle); + } + } + + public DisassemblyTextLine[] Lines + { + get + { + ulong arrayLength = 0; + + IntPtr arrayPointer = NativeMethods.BNGetFlowGraphNodeLines( + this.handle, + out arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer, + arrayLength, + DisassemblyTextLine.FromNative, + NativeMethods.BNFreeDisassemblyTextLines + ); + } + + set + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + NativeMethods.BNSetFlowGraphNodeLines( + this.handle , + allocator.ConvertToNativeArrayEx( + value + ) , + (ulong)value.Length + ); + } + } + } + + + public void AddOutgoingEdge( + BranchType kind , + FlowGraphNode target , + EdgeStyle style + ) + { + NativeMethods.BNAddFlowGraphNodeOutgoingEdge( + this.handle , + kind , + target.DangerousGetHandle() , + style + ); + } + + public HighlightColor Highlight + { + get + { + return HighlightColor.FromNative( + NativeMethods.BNGetFlowGraphNodeHighlight(this.handle) + ); + } + + set + { + NativeMethods.BNSetFlowGraphNodeHighlight(this.handle, value); + } + } + + + public void SetVisibilityRegion( + int x , + int y , + int width , + int height + ) + { + NativeMethods.BNFlowGraphNodeSetVisibilityRegion( + this.handle, + x, + y, + width, + height + ); + } + + public void SetOutgoingEdgePoints(ulong edgeNum, Point[] points) + { + NativeMethods.BNFlowGraphNodeSetOutgoingEdgePoints( + this.handle, + edgeNum, + UnsafeUtils.ConvertToNativeArray(points), + (ulong)points.Length + ); + } + + + + } +} \ No newline at end of file diff --git a/Handle/BNFunction.cs b/Handle/BNFunction.cs new file mode 100644 index 0000000..6e46051 --- /dev/null +++ b/Handle/BNFunction.cs @@ -0,0 +1,1638 @@ +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Runtime.InteropServices; +using System.Runtime.InteropServices.JavaScript; +using System.Text; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class Function : AbstractSafeHandle + { + internal Function(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static Function? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new Function( + NativeMethods.BNNewFunctionReference(handle) , + true + ); + } + + internal static Function MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new Function( + NativeMethods.BNNewFunctionReference(handle) , + true + ); + } + + internal static Function? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new Function(handle, true); + } + + internal static Function MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new Function(handle, true); + } + + internal static Function? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new Function(handle, false); + } + + internal static Function MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new Function(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeFunction(this.handle); + this.SetHandleAsInvalid(); + } + return true; + } + + + /// + /// BinaryView that contains this function ? + /// + public BinaryView View + { + get + { + return BinaryView.MustTakeHandle( + NativeMethods.BNGetFunctionData(this.handle) + ); + } + } + + public Architecture Architecture + { + get + { + IntPtr raw = NativeMethods.BNGetFunctionArchitecture(this.handle); + + if (IntPtr.Zero == raw) + { + throw new NoNullAllowedException("function must have a architecture"); + } + + return new Architecture(raw); + } + } + + public Platform? Platform + { + get + { + IntPtr raw = NativeMethods.BNGetFunctionPlatform(this.handle); + + if (IntPtr.Zero == raw) + { + return null; + } + + return new Platform(raw, true); + } + } + + public ulong Start + { + get + { + return NativeMethods.BNGetFunctionStart(this.handle); + } + } + + public ulong HighestAddress + { + get + { + return NativeMethods.BNGetFunctionHighestAddress(this.handle); + } + } + + public ulong LowestAddress + { + get + { + return NativeMethods.BNGetFunctionLowestAddress(this.handle); + } + } + + public AddressRange[] AddressRanges + { + get + { + ulong arrayLength = 0; + + IntPtr arrayPointer = NativeMethods.BNGetFunctionAddressRanges(this.handle , out arrayLength); + + return UnsafeUtils.TakeStructArray( + arrayPointer , + arrayLength , + AddressRange.FromNative , + NativeMethods.BNFreeAddressRanges + ); + } + } + + public Symbol Symbol + { + get + { + IntPtr raw = NativeMethods.BNGetFunctionSymbol(this.handle); + + if (IntPtr.Zero == raw) + { + throw new NoNullAllowedException("function must have a symbol"); + } + + return new Symbol(raw , true); + } + } + + public ulong Address + { + get + { + return this.Symbol.Address; + } + } + + public string ShortName + { + get + { + return this.Symbol.ShortName; + } + } + + public string FullName + { + get + { + return this.Symbol.FullName; + } + } + + public string RawName + { + get + { + return this.Symbol.RawName; + } + } + + public bool WasAutomaticallyDiscovered + { + get + { + return NativeMethods.BNWasFunctionAutomaticallyDiscovered(this.handle); + } + } + + public bool HasUserAnnotations + { + get + { + return NativeMethods.BNFunctionHasUserAnnotations(this.handle); + } + } + + public BoolWithConfidence CanFunctionReturn + { + get + { + return BoolWithConfidence.FromNative( NativeMethods.BNCanFunctionReturn(this.handle) ); + } + + set + { + NativeMethods.BNSetUserFunctionCanReturn(this.handle, value.ToNative() ); + } + } + + public BoolWithConfidence IsPure + { + get + { + return BoolWithConfidence.FromNative( NativeMethods.BNIsFunctionPure(this.handle)); + } + + set + { + NativeMethods.BNSetUserFunctionPure(this.handle, value.ToNative() ); + } + } + + public void SetAutoType(BinaryNinja.Type type) + { + NativeMethods.BNSetFunctionAutoType(this.handle , type.DangerousGetHandle()); + } + + public void SetUserType(BinaryNinja.Type type) + { + NativeMethods.BNSetFunctionUserType(this.handle , type.DangerousGetHandle()); + } + + public bool HasUserType + { + get + { + return NativeMethods.BNFunctionHasUserType(this.handle); + } + } + + public bool HasExplicitlyDefinedType + { + get + { + return NativeMethods.BNFunctionHasExplicitlyDefinedType(this.handle); + } + } + + public bool UpdateNeeded + { + get + { + return NativeMethods.BNIsFunctionUpdateNeeded(this.handle); + } + } + + public BasicBlock[] BasicBlocks + { + get + { + ulong arrayLength = 0; + + IntPtr arrayPointer = NativeMethods.BNGetFunctionBasicBlockList(this.handle, out arrayLength); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer , + arrayLength , + BasicBlock.MustNewFromHandle , + NativeMethods.BNFreeBasicBlockList + ); + } + } + + public IReadOnlyDictionary Comments + { + get + { + ulong addressCount = 0; + + IntPtr addressArrayPointer = NativeMethods.BNGetCommentedAddresses(this.handle , out addressCount); + + ulong[] addresses = UnsafeUtils.TakeNumberArray( + addressArrayPointer , + addressCount , + NativeMethods.BNFreeAddressList + ); + + Dictionary comments = new Dictionary(); + + foreach (ulong address in addresses) + { + comments[address] = GetCommentForAddress(address); + } + + return comments; + } + } + + public Tag[] GetAddressTags(Architecture arch , ulong address) + { + ulong arrayLength = 0; + + IntPtr arrayPointer = NativeMethods.BNGetAddressTags( + this.handle, + arch.DangerousGetHandle(), + address, + out arrayLength + ); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer , + arrayLength , + Tag.MustNewFromHandle , + NativeMethods.BNFreeTagList + ); + } + + public Tag[] GetAutoAddressTags(Architecture arch , ulong address) + { + ulong arrayLength = 0; + + IntPtr arrayPointer = NativeMethods.BNGetAutoAddressTags( + this.handle, + arch.DangerousGetHandle(), + address, + out arrayLength + ); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer , + arrayLength , + Tag.MustNewFromHandle, + NativeMethods.BNFreeTagList + ); + } + + public Tag[] GetUserAddressTags(Architecture arch , ulong address) + { + ulong arrayLength = 0; + + IntPtr arrayPointer = NativeMethods.BNGetUserAddressTags( + this.handle, + arch.DangerousGetHandle(), + address, + out arrayLength + ); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer , + arrayLength , + Tag.MustNewFromHandle , + NativeMethods.BNFreeTagList + ); + } + + public Tag[] GetAddressTagsInRange(Architecture arch , ulong start , ulong end) + { + ulong arrayLength = 0; + + IntPtr arrayPointer = NativeMethods.BNGetAddressTagsInRange( + this.handle, + arch.DangerousGetHandle(), + start, + end, + out arrayLength + ); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer , + arrayLength , + Tag.MustNewFromHandle , + NativeMethods.BNFreeTagList + ); + } + + public Tag[] GetAutoAddressTagsInRange(Architecture arch , ulong start , ulong end) + { + ulong arrayLength = 0; + + IntPtr arrayPointer = NativeMethods.BNGetAutoAddressTagsInRange( + this.handle, + arch.DangerousGetHandle(), + start, + end, + out arrayLength + ); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer , + arrayLength , + Tag.MustNewFromHandle , + NativeMethods.BNFreeTagList + ); + } + + public Tag[] GetUserAddressTagsInRange(Architecture arch , ulong start , ulong end) + { + ulong arrayLength = 0; + + IntPtr arrayPointer = NativeMethods.BNGetUserAddressTagsInRange( + this.handle, + arch.DangerousGetHandle(), + start, + end, + out arrayLength + ); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer , + arrayLength , + Tag.MustNewFromHandle , + NativeMethods.BNFreeTagList + ); + } + + public Tag[] GetFunctionTags() + { + ulong arrayLength = 0; + + IntPtr arrayPointer = NativeMethods.BNGetFunctionTags( + this.handle, + out arrayLength + ); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer , + arrayLength , + Tag.MustNewFromHandle , + NativeMethods.BNFreeTagList + ); + } + + public Tag[] GetAutoFunctionTags() + { + ulong arrayLength = 0; + + IntPtr arrayPointer = NativeMethods.BNGetAutoFunctionTags( + this.handle, + out arrayLength + ); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer , + arrayLength , + Tag.MustNewFromHandle , + NativeMethods.BNFreeTagList + ); + } + + public Tag[] GetUserFunctionTags() + { + ulong arrayLength = 0; + + IntPtr arrayPointer = NativeMethods.BNGetUserFunctionTags( + this.handle, + out arrayLength + ); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer , + arrayLength , + Tag.MustNewFromHandle , + NativeMethods.BNFreeTagList + ); + } + + public Tag[] GetFunctionTagsOfType(TagType kind) + { + ulong arrayLength = 0; + + IntPtr arrayPointer = NativeMethods.BNGetFunctionTagsOfType( + this.handle, + kind.DangerousGetHandle(), + out arrayLength + ); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer , + arrayLength , + Tag.MustNewFromHandle , + NativeMethods.BNFreeTagList + ); + } + + public Tag[] GetAutoFunctionTagsOfType(TagType kind) + { + ulong arrayLength = 0; + + IntPtr arrayPointer = NativeMethods.BNGetAutoFunctionTagsOfType( + this.handle, + kind.DangerousGetHandle(), + out arrayLength + ); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer , + arrayLength , + Tag.MustNewFromHandle, + NativeMethods.BNFreeTagList + ); + } + + public Tag[] GetUserFunctionTagsOfType(TagType kind) + { + ulong arrayLength = 0; + + IntPtr arrayPointer = NativeMethods.BNGetUserFunctionTagsOfType( + this.handle, + kind.DangerousGetHandle(), + out arrayLength + ); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer , + arrayLength , + Tag.MustNewFromHandle, + NativeMethods.BNFreeTagList + ); + } + + + public void AddAutoFunctionTag(Tag tag) + { + NativeMethods.BNAddAutoFunctionTag(this.handle, tag.DangerousGetHandle()); + } + + public void AddUserFunctionTag(Tag tag) + { + NativeMethods.BNAddUserFunctionTag(this.handle, tag.DangerousGetHandle()); + } + + public void AddAutoAddressTag(Architecture arch ,ulong address , Tag tag) + { + NativeMethods.BNAddAutoAddressTag( + this.handle, + arch.DangerousGetHandle(), + address, + tag.DangerousGetHandle() + ); + } + + public void AddUserAddressTag(Architecture arch ,ulong address , Tag tag) + { + NativeMethods.BNAddUserAddressTag( + this.handle, + arch.DangerousGetHandle(), + address, + tag.DangerousGetHandle() + ); + } + + public void RemoveAutoAddressTag(Architecture arch , ulong address , Tag tag) + { + NativeMethods.BNRemoveAutoAddressTag( + this.handle, + arch.DangerousGetHandle(), + address , + tag.DangerousGetHandle() + ); + } + + public void RemoveAutoAddressTagsOfType(Architecture arch , ulong address , TagType kind) + { + NativeMethods.BNRemoveAutoAddressTagsOfType( + this.handle, + arch.DangerousGetHandle(), + address , + kind.DangerousGetHandle() + ); + } + + public void RemoveUserAddressTag(Architecture arch , ulong address , Tag tag) + { + NativeMethods.BNRemoveUserAddressTag( + this.handle, + arch.DangerousGetHandle(), + address , + tag.DangerousGetHandle() + ); + } + + public void RemoveUserAddressTagsOfType(Architecture arch , ulong address , TagType kind) + { + NativeMethods.BNRemoveUserAddressTagsOfType( + this.handle, + arch.DangerousGetHandle(), + address , + kind.DangerousGetHandle() + ); + } + + public void RemoveUserFunctionTag( Tag tag) + { + NativeMethods.BNRemoveUserFunctionTag( + this.handle, + tag.DangerousGetHandle() + ); + } + + public void RemoveUserFunctionTagsOfType( TagType kind) + { + NativeMethods.BNRemoveAutoFunctionTagsOfType( + this.handle, + kind.DangerousGetHandle() + ); + } + + public LowLevelILFunction LowLevelIL + { + get + { + return LowLevelILFunction.MustTakeHandle( + NativeMethods.BNGetFunctionLowLevelIL(this.handle) + ); + } + } + + public LowLevelILFunction? GetLowLevelIL() + { + + return LowLevelILFunction.TakeHandle( + NativeMethods.BNGetFunctionLowLevelIL( + this.handle + ) + ); + } + + public LowLevelILFunction? GetLowLevelILIfAvailable() + { + + return LowLevelILFunction.TakeHandle( + NativeMethods.BNGetFunctionLowLevelILIfAvailable( + this.handle + ) + ); + } + + public LowLevelILFunction LiftedIL + { + get + { + return LowLevelILFunction.MustTakeHandle( + NativeMethods.BNGetFunctionLiftedIL(this.handle) + ); + } + } + + public LowLevelILFunction? GetLiftedILIfAvailable() + { + IntPtr raw = NativeMethods.BNGetFunctionLiftedILIfAvailable(this.handle); + + if (IntPtr.Zero == raw) + { + return null; + } + + return new LowLevelILFunction(raw , true); + } + + public MediumLevelILFunction MediumLevelIL + { + get + { + return MediumLevelILFunction.MustTakeHandle( + NativeMethods.BNGetFunctionMediumLevelIL(this.handle) + ); + } + } + + public MediumLevelILFunction? GetMediumLevelIL() + { + return MediumLevelILFunction.TakeHandle( + NativeMethods.BNGetFunctionMediumLevelIL(this.handle) + ); + } + + public MediumLevelILFunction? GetMediumLevelILIfAvailable() + { + return MediumLevelILFunction.TakeHandle( + NativeMethods.BNGetFunctionMediumLevelILIfAvailable(this.handle) + ); + } + + public MediumLevelILFunction MappedMediumLevelIL + { + get + { + return MediumLevelILFunction.MustTakeHandle( + NativeMethods.BNGetFunctionMappedMediumLevelIL(this.handle) + ); + } + } + + public MediumLevelILFunction? GetMappedMediumLevelILIfAvailable() + { + IntPtr raw = NativeMethods.BNGetFunctionMappedMediumLevelILIfAvailable(this.handle); + + if (IntPtr.Zero == raw) + { + return null; + } + + return new MediumLevelILFunction(raw , true); + } + + + public HighLevelILFunction HighLevelIL + { + get + { + return HighLevelILFunction.MustTakeHandle( + NativeMethods.BNGetFunctionHighLevelIL(this.handle) + ); + } + } + + public HighLevelILFunction? GetHighLevelIL() + { + return HighLevelILFunction.TakeHandle( + NativeMethods.BNGetFunctionHighLevelIL(this.handle) + ); + } + + public HighLevelILFunction? GetHighLevelILIfAvailable() + { + IntPtr raw = NativeMethods.BNGetFunctionHighLevelILIfAvailable(this.handle); + + if (IntPtr.Zero == raw) + { + return null; + } + + return new HighLevelILFunction(raw , true); + } + + public LanguageRepresentationFunction? GetLanguageRepresentation(string language = "Pseudo C") + { + return LanguageRepresentationFunction.TakeHandle( + NativeMethods.BNGetFunctionLanguageRepresentation(this.handle , language) + ); + } + + public LanguageRepresentationFunction? GetLanguageRepresentationIfAvailable(string language = "Pseudo C") + { + IntPtr raw = NativeMethods.BNGetFunctionLanguageRepresentationIfAvailable(this.handle , language); + + if (IntPtr.Zero == raw) + { + return null; + } + + return new LanguageRepresentationFunction(raw , true); + } + + public FunctionType Type + { + get + { + return BinaryNinja.FunctionType.MustTakeHandle( + NativeMethods.BNGetFunctionType(this.handle) + ); + } + } + + public VariableNameAndType[] StackLayout + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetStackLayout( + this.handle , + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + VariableNameAndType.FromNative , + NativeMethods.BNFreeVariableNameAndTypeList + ); + } + } + + public VariableNameAndType[] Variables + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetFunctionVariables( + this.handle , + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + VariableNameAndType.FromNative, + NativeMethods.BNFreeVariableNameAndTypeList + ); + } + } + + public VariableNameAndType? GetVariableByName(string name) + { + foreach (VariableNameAndType variable in Variables) + { + if (variable.Name == name) + { + return variable; + } + } + + return null; + } + + public IndirectBranchInfo[] IndirectBranchs + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetIndirectBranches( + this.handle , + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArray( + arrayPointer , + arrayLength , + IndirectBranchInfo.FromNative , + NativeMethods.BNFreeIndirectBranchList + ); + } + } + + public ArchitectureAndAddress[] UnresolvedIndirectBranches + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetUnresolvedIndirectBranches( + this.handle , + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArray( + arrayPointer , + arrayLength , + ArchitectureAndAddress.FromNative , + NativeMethods.BNFreeArchitectureAndAddressList + ); + } + } + + public bool HasUnresolvedIndirectBranches + { + get + { + return NativeMethods.BNHasUnresolvedIndirectBranches(this.handle); + } + } + + public TypeWithConfidence ReturnType + { + get + { + return TypeWithConfidence.FromNative( + NativeMethods.BNGetFunctionReturnType(this.handle) + ); + } + + set + { + NativeMethods.BNSetUserFunctionReturnType( + this.handle, + value.ToNative() + ); + } + } + + public CallingConventionWithConfidence CallingConvention + { + get + { + return CallingConventionWithConfidence.FromNative( + NativeMethods.BNGetFunctionCallingConvention(this.handle) + ); + } + + set + { + NativeMethods.BNSetUserFunctionCallingConvention( + this.handle, + value.ToNative() + ); + } + } + + public ParameterVariablesWithConfidence ParameterVariables + { + get + { + return new ParameterVariablesWithConfidence( + this, + NativeMethods.BNGetFunctionParameterVariables(this.handle) + ); + } + + set + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + NativeMethods.BNSetUserFunctionParameterVariables( + this.handle, + value.ToNativeEx(allocator) + ); + } + } + } + + public BoolWithConfidence HasVariableArguments + { + get + { + return BoolWithConfidence.FromNative( + NativeMethods.BNFunctionHasVariableArguments(this.handle) + ); + } + + set + { + NativeMethods.BNSetUserFunctionHasVariableArguments( + this.handle, + value.ToNative() + ); + } + } + + public string Comment + { + get + { + return UnsafeUtils.TakeAnsiString( + NativeMethods.BNGetFunctionComment(this.handle) + ); + } + + set + { + NativeMethods.BNSetFunctionComment(this.handle, value); + } + } + + public bool TooLarge + { + get + { + return NativeMethods.BNIsFunctionTooLarge(this.handle); + } + } + + public bool AnalysisSkipped + { + get + { + return NativeMethods.BNIsFunctionAnalysisSkipped(this.handle); + } + } + + public string GetCommentForAddress(ulong address) + { + return UnsafeUtils.TakeAnsiString( + NativeMethods.BNGetCommentForAddress(this.handle , address) + ); + } + + public void SetCommentForAddress(ulong address , string comment) + { + NativeMethods.BNSetCommentForAddress(this.handle , address, comment); + } + + public void AddUserCodeReference( + ulong fromAddress , + ulong toAddress, + Architecture? arch = null + ) + { + NativeMethods.BNAddUserCodeReference( + this.handle , + null == arch ? IntPtr.Zero : arch.DangerousGetHandle() , + fromAddress , + toAddress + ); + } + + public void RemoveUserCodeReference( + ulong fromAddress , + ulong toAddress, + Architecture? arch = null + ) + { + NativeMethods.BNRemoveUserCodeReference( + this.handle , + null == arch ? IntPtr.Zero : arch.DangerousGetHandle() , + fromAddress , + toAddress + ); + } + + public RegisterValue GetRegisterValueAtInstruction( + ulong address, + RegisterIndex reg, + Architecture? arch = null + ) + { + return RegisterValue.FromNative( + NativeMethods.BNGetRegisterValueAtInstruction( + this.handle , + null == arch ? IntPtr.Zero : arch.DangerousGetHandle() , + address , + reg + ) + ); + } + + public RegisterValue GetRegisterValueAfterInstruction( + ulong address, + RegisterIndex reg, + Architecture? arch = null + ) + { + return RegisterValue.FromNative( + NativeMethods.BNGetRegisterValueAfterInstruction( + this.handle , + null == arch ? IntPtr.Zero : arch.DangerousGetHandle() , + address , + reg + ) + ); + } + + + public RegisterValue GetStackContentsAtInstruction( + ulong address, + long offset, + ulong size, + Architecture? arch = null + ) + { + return RegisterValue.FromNative( + NativeMethods.BNGetStackContentsAtInstruction( + this.handle , + null == arch ? IntPtr.Zero : arch.DangerousGetHandle() , + address , + offset, + size + ) + ); + } + + public RegisterValue GetStackContentsAfterInstruction( + ulong address, + long offset, + ulong size, + Architecture? arch = null + ) + { + return RegisterValue.FromNative( + NativeMethods.BNGetStackContentsAfterInstruction( + this.handle , + null == arch ? IntPtr.Zero : arch.DangerousGetHandle() , + address , + offset, + size + ) + ); + } + + + public RegisterValue GetParameterValueAtInstruction( + ulong address, + ulong index, + BinaryNinja.Type? type, + Architecture? arch = null + ) + { + return RegisterValue.FromNative( + NativeMethods.BNGetParameterValueAtInstruction( + this.handle , + null == arch ? IntPtr.Zero : arch.DangerousGetHandle() , + address , + null == type ? IntPtr.Zero : type.DangerousGetHandle() , + index + ) + ); + } + + public RegisterValue GetParameterValueAtLowLevelILInstruction( + ulong instructionIndex, + ulong index, + BinaryNinja.Type? type + ) + { + return RegisterValue.FromNative( + NativeMethods.BNGetParameterValueAtLowLevelILInstruction( + this.handle , + instructionIndex, + null == type ? IntPtr.Zero : type.DangerousGetHandle() , + index + ) + ); + } + + + + public void Analyze() + { + NativeMethods.BNAnalyzeFunction(this.handle); + } + + public void Reanalyze(FunctionUpdateType type = FunctionUpdateType.FullAutoFunctionUpdate) + { + NativeMethods.BNReanalyzeFunction(this.handle , type); + } + + public BasicBlock? GetBasicBlockAtAddress(ulong address , Architecture? arch = null) + { + return BasicBlock.TakeHandle( + NativeMethods.BNGetFunctionBasicBlockAtAddress( + this.handle, + null == arch ? IntPtr.Zero : arch.DangerousGetHandle(), + address) + ); + } + + public ReferenceSource[] CallSites + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetFunctionCallSites( + this.handle, + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + ReferenceSource.FromNative , + NativeMethods.BNFreeCodeReferences + ); + } + } + + public Function[] Callers + { + get + { + Dictionary functions = new Dictionary(); + + foreach (ReferenceSource callSite in this.CallSites) + { + if (null != callSite.Function) + { + functions[callSite.Function.Address] = callSite.Function; + } + } + + return functions.Values.ToArray(); + } + } + + public Function[] Callees + { + get + { + Dictionary functions = new Dictionary(); + + foreach (ReferenceSource callSite in this.CallSites) + { + Function? function = this.View.GetFunctionByAddress(callSite.Address); + + if (null != function) + { + functions[callSite.Address] = function; + } + } + + return functions.Values.ToArray(); + } + } + + public ulong[] CalleeAddresses + { + get + { + HashSet addresses = new HashSet(); + + foreach (ReferenceSource callSite in this.CallSites) + { + addresses.Add(callSite.Address); + } + + return addresses.ToArray(); + } + } + + public Workflow? Workflow + { + get + { + return Workflow.TakeHandle( + NativeMethods.BNGetWorkflowForFunction(this.handle) + ); + } + } + + public ILReferenceSource[] GetMediumLevelILVariableReferences(Variable variable) + { + IntPtr arrayPointer = NativeMethods.BNGetMediumLevelILVariableReferences( + this.handle, + variable.ToNative(), + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + ILReferenceSource.FromNative, + NativeMethods.BNFreeVariableReferenceSourceList + ); + } + + public ILReferenceSource[] GetMediumLevelILVariableReferencesFrom( + ulong address, + Architecture? arch = null + ) + { + IntPtr arrayPointer = NativeMethods.BNGetMediumLevelILVariableReferencesFrom( + this.handle, + null == arch? IntPtr.Zero : arch.DangerousGetHandle(), + address, + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + ILReferenceSource.FromNative, + NativeMethods.BNFreeVariableReferenceSourceList + ); + } + + public ILReferenceSource[] GetHighLevelILVariableReferencesFrom( + ulong address, + Architecture? arch = null + ) + { + IntPtr arrayPointer = NativeMethods.BNGetHighLevelILVariableReferencesFrom( + this.handle, + null == arch? IntPtr.Zero : arch.DangerousGetHandle(), + address, + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + ILReferenceSource.FromNative, + NativeMethods.BNFreeVariableReferenceSourceList + ); + } + + public ulong? GetInstructionContainingAddress(ulong address , Architecture? arch = null) + { + bool ok = NativeMethods.BNGetInstructionContainingAddress( + this.handle, + null == arch ? IntPtr.Zero : arch.DangerousGetHandle(), + address, + out ulong start + ); + + if (!ok) + { + return null; + } + + return start; + } + + public LinearViewObject Disassembly( DisassemblySettings? settings = null) + { + return this.CreateLinearViewDisassembly(settings); + } + + public LinearViewObject CreateLinearViewDisassembly( DisassemblySettings? settings = null) + { + if (null == settings) + { + settings = DisassemblySettings.DefaultLinear(); + } + + return LinearViewObject.MustTakeHandle( + NativeMethods.BNCreateLinearViewSingleFunctionDisassembly( + this.handle , + null == settings ? IntPtr.Zero : settings.DangerousGetHandle() + ) + ); + } + + public LinearViewObject CreateLinearViewLiftedIL( DisassemblySettings? settings = null) + { + if (null == settings) + { + settings = DisassemblySettings.DefaultLinear(); + } + + return LinearViewObject.MustTakeHandle( + NativeMethods.BNCreateLinearViewSingleFunctionLiftedIL( + this.handle , + null == settings ? IntPtr.Zero : settings.DangerousGetHandle() + ) + ); + } + + public LinearViewObject CreateLinearViewLowLevelIL( DisassemblySettings? settings = null) + { + if (null == settings) + { + settings = DisassemblySettings.DefaultLinear(); + } + + return LinearViewObject.MustTakeHandle( + NativeMethods.BNCreateLinearViewSingleFunctionLowLevelIL( + this.handle , + null == settings ? IntPtr.Zero : settings.DangerousGetHandle() + ) + ); + } + + public LinearViewObject CreateLinearViewLowLevelILSSAForm( DisassemblySettings? settings = null) + { + if (null == settings) + { + settings = DisassemblySettings.DefaultLinear(); + } + + return LinearViewObject.MustTakeHandle( + NativeMethods.BNCreateLinearViewSingleFunctionLowLevelILSSAForm( + this.handle , + null == settings ? IntPtr.Zero : settings.DangerousGetHandle() + ) + ); + } + + public LinearViewObject CreateLinearViewMediumLevelIL( DisassemblySettings? settings = null) + { + if (null == settings) + { + settings = DisassemblySettings.DefaultLinear(); + } + + return LinearViewObject.MustTakeHandle( + NativeMethods.BNCreateLinearViewSingleFunctionMediumLevelIL( + this.handle , + null == settings ? IntPtr.Zero : settings.DangerousGetHandle() + ) + ); + } + + public LinearViewObject CreateLinearViewMediumLevelILSSAForm( DisassemblySettings? settings = null) + { + if (null == settings) + { + settings = DisassemblySettings.DefaultLinear(); + } + + return LinearViewObject.MustTakeHandle( + NativeMethods.BNCreateLinearViewSingleFunctionMediumLevelILSSAForm( + this.handle , + null == settings ? IntPtr.Zero : settings.DangerousGetHandle() + ) + ); + } + + public LinearViewObject CreateLinearViewMappedMediumLevelIL( DisassemblySettings? settings = null) + { + if (null == settings) + { + settings = DisassemblySettings.DefaultLinear(); + } + + return LinearViewObject.MustTakeHandle( + NativeMethods.BNCreateLinearViewSingleFunctionMappedMediumLevelIL( + this.handle , + null == settings ? IntPtr.Zero : settings.DangerousGetHandle() + ) + ); + } + + public LinearViewObject CreateLinearViewMappedMediumLevelILSSAForm( DisassemblySettings? settings = null) + { + if (null == settings) + { + settings = DisassemblySettings.DefaultLinear(); + } + + return LinearViewObject.MustTakeHandle( + NativeMethods.BNCreateLinearViewSingleFunctionMappedMediumLevelILSSAForm( + this.handle , + null == settings ? IntPtr.Zero : settings.DangerousGetHandle() + ) + ); + } + + public LinearViewObject CreateLinearViewHighLevelIL( DisassemblySettings? settings = null) + { + if (null == settings) + { + settings = DisassemblySettings.DefaultLinear(); + } + + return LinearViewObject.MustTakeHandle( + NativeMethods.BNCreateLinearViewSingleFunctionHighLevelIL( + this.handle , + null == settings ? IntPtr.Zero : settings.DangerousGetHandle() + ) + ); + } + + public LinearViewObject CreateLinearViewHighLevelILSSAForm( DisassemblySettings? settings = null) + { + if (null == settings) + { + settings = DisassemblySettings.DefaultLinear(); + } + + return LinearViewObject.MustTakeHandle( + NativeMethods.BNCreateLinearViewSingleFunctionHighLevelILSSAForm( + this.handle , + null == settings ? IntPtr.Zero : settings.DangerousGetHandle() + ) + ); + } + + public LinearViewObject? CreateLinearViewLanguageRepresentation( + DisassemblySettings? settings = null, + string language = "Pseudo C" + ) + { + if (null == settings) + { + settings = DisassemblySettings.DefaultLinear(); + } + + LanguageRepresentationFunction? pseudo = this.GetLanguageRepresentation(language); + + if (null == pseudo) + { + return null; + } + + return LinearViewObject.TakeHandle( + NativeMethods.BNCreateLinearViewSingleFunctionLanguageRepresentation( + pseudo.OwnerFunction.DangerousGetHandle() , + null == settings ? IntPtr.Zero : settings.DangerousGetHandle() , + language + ) + ); + } + + // disassembly + public LinearDisassemblyLine[] GetLinearDisassemblyLines(DisassemblySettings? settings = null) + { + LinearViewObject linear = this.CreateLinearViewDisassembly(settings); + + LinearViewCursor cursor = linear.CreateCursor(); + + List targets = new List(); + + cursor.SeekToAddress(this.LowestAddress); + foreach (LinearDisassemblyLine line in cursor.PreviousLines) + { + if (!targets.Contains(line)) + { + targets.Add(line); + } + } + + cursor.SeekToAddress(this.HighestAddress); + foreach (LinearDisassemblyLine line in cursor.NextLines) + { + if (!targets.Contains(line)) + { + targets.Add(line); + } + } + + return targets.ToArray(); + } + + public IEnumerable LinearDisassemblyLines + { + get + { + return this.GetLinearDisassemblyLines(); + } + } + + public string GetLinearDisassemblyText(DisassemblySettings? settings = null) + { + StringBuilder builder = new StringBuilder(); + + foreach (LinearDisassemblyLine line in this.GetLinearDisassemblyLines(settings)) + { + builder.AppendLine(line.ToString()); + } + + return builder.ToString(); + } + + public string LinearDisassemblyText + { + get + { + return this.GetLinearDisassemblyText(); + } + } + + + public PluginCommand[] ValidPluginCommands + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetValidPluginCommandsForFunction( + this.View.DangerousGetHandle(), + this.handle, + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArray( + arrayPointer , + arrayLength , + PluginCommand.FromNative , + NativeMethods.BNFreePluginCommandList + ); + } + } + + public string GetVariableNameOrDefault(CoreVariable variable) + { + return UnsafeUtils.TakeAnsiString( + NativeMethods.BNGetVariableNameOrDefault( + this.handle , + variable.ToNative() + ) + ); + } + + public string GetLastSeenVariableNameOrDefault(CoreVariable variable) + { + return UnsafeUtils.TakeAnsiString( + NativeMethods.BNGetLastSeenVariableNameOrDefault( + this.handle , + variable.ToNative() + ) + ); + } + + public DisassemblyTextLine[] GetTypeTokens(DisassemblySettings? settings = null) + { + ulong arrayLength = 0; + + IntPtr arrayPointer = NativeMethods.BNGetFunctionTypeTokens( + this.handle , + null == settings ? IntPtr.Zero : settings.DangerousGetHandle() , + out arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + DisassemblyTextLine.FromNative , + NativeMethods.BNFreeDisassemblyTextLines + ); + } + + public DisassemblyTextLine[] TypeTokens + { + get + { + return this.GetTypeTokens(); + } + } + + } +} \ No newline at end of file diff --git a/Handle/BNHighLevelILFunction.cs b/Handle/BNHighLevelILFunction.cs new file mode 100644 index 0000000..0ef632a --- /dev/null +++ b/Handle/BNHighLevelILFunction.cs @@ -0,0 +1,1238 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class HighLevelILFunction : AbstractSafeHandle + { + public bool IsSSAForm { get; } = false; + + internal HighLevelILFunction( + IntPtr handle , + bool owner , + bool ssa = false + ) : base(handle , owner) + { + this.IsSSAForm = ssa; + } + + internal static HighLevelILFunction? NewFromHandle(IntPtr handle , bool ssa = false) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new HighLevelILFunction( + NativeMethods.BNNewHighLevelILFunctionReference(handle) , + true, + ssa + ); + } + + internal static HighLevelILFunction MustNewFromHandle(IntPtr handle, bool ssa = false) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new HighLevelILFunction( + NativeMethods.BNNewHighLevelILFunctionReference(handle) , + true, + ssa + ); + } + + internal static HighLevelILFunction? TakeHandle(IntPtr handle, bool ssa = false) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new HighLevelILFunction(handle, true , ssa); + } + + internal static HighLevelILFunction MustTakeHandle(IntPtr handle, bool ssa = false) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new HighLevelILFunction(handle, true , ssa); + } + + internal static HighLevelILFunction? BorrowHandle(IntPtr handle, bool ssa = false) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new HighLevelILFunction(handle, false , ssa); + } + + internal static HighLevelILFunction MustBorrowHandle(IntPtr handle , bool ssa = false) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new HighLevelILFunction(handle, false , ssa); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeHighLevelILFunction(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + + public Function OwnerFunction + { + get + { + return Function.MustTakeHandle( + NativeMethods.BNGetHighLevelILOwnerFunction(this.handle) + ); + } + } + + public ulong ExpressionCount + { + get + { + return NativeMethods.BNGetHighLevelILExprCount(this.handle); + } + } + + public ulong InstructionCount + { + get + { + return NativeMethods.BNGetHighLevelILInstructionCount(this.handle); + } + } + + public HighLevelILInstruction? GetExpression( + HighLevelILExpressionIndex index , + bool asFullAst = false + ) + { + if ((ulong)index >= this.ExpressionCount) + { + return null; + } + + return HighLevelILInstruction.FromExpressionIndex( + this, + index , + asFullAst + ); + } + + public HighLevelILInstruction MustGetExpression( + HighLevelILExpressionIndex index , + bool asFullAst = false + ) + { + if ((ulong)index >= this.ExpressionCount) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + + return HighLevelILInstruction.FromExpressionIndex( + this, + index , + asFullAst + ); + } + + public HighLevelILInstruction? GetInstruction( + HighLevelILInstructionIndex index , + bool asFullAst = false + ) + { + if ((ulong)index >= this.InstructionCount) + { + return null; + } + + return HighLevelILInstruction.FromExpressionIndex( + this, + NativeMethods.BNGetHighLevelILIndexForInstruction(this.handle , index) , + asFullAst + ); + } + + public HighLevelILInstruction MustGetInstruction( + HighLevelILInstructionIndex index , + bool asFullAst = false + ) + { + if ((ulong)index >= this.InstructionCount) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + + return HighLevelILInstruction.FromExpressionIndex( + this, + NativeMethods.BNGetHighLevelILIndexForInstruction(this.handle , index) , + asFullAst + ); + } + + public HighLevelILInstruction[] MustGetExpressions(HighLevelILExpressionIndex[] indexes) + { + List instructions = new List(); + + foreach (HighLevelILExpressionIndex index in indexes) + { + instructions.Add( this.MustGetExpression(index) ); + } + + return instructions.ToArray(); + } + + public HighLevelILInstruction[] MustGetInstructions(HighLevelILInstructionIndex[] indexes) + { + List instructions = new List(); + + foreach (HighLevelILInstructionIndex index in indexes) + { + instructions.Add( this.MustGetInstruction(index) ); + } + + return instructions.ToArray(); + } + + public HighLevelILBasicBlock[] BasicBlocks + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetHighLevelILBasicBlockList( + this.handle , + out ulong arrayLength + ); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer , + arrayLength , + (_native) => HighLevelILBasicBlock.MustNewFromHandleEx( + this, + _native + ) , + NativeMethods.BNFreeBasicBlockList + ); + } + } + + public ulong CurrentAddress + { + get + { + return NativeMethods.BNHighLevelILGetCurrentAddress(this.handle); + } + + set + { + this.SetCurrentAddress(value); + } + } + + public void SetCurrentAddress(ulong address , Architecture? arch = null) + { + NativeMethods.BNHighLevelILSetCurrentAddress( + this.handle, + null == arch ? IntPtr.Zero : arch.DangerousGetHandle(), + address + ); + } + + public HighLevelILInstruction? RootExpression + { + get + { + return this.GetExpression( + NativeMethods.BNGetHighLevelILRootExpr(this.handle) + ); + } + + set + { + if (null != value) + { + NativeMethods.BNSetHighLevelILRootExpr(this.handle , value!.ExpressionIndex); + } + } + } + + public HighLevelILBasicBlock? GetBasicBlockForInstruction(HighLevelILInstructionIndex instruction) + { + return HighLevelILBasicBlock.TakeHandleEx( + this, + NativeMethods.BNGetHighLevelILBasicBlockForInstruction( + this.handle , + instruction + ) + ); + } + + public IEnumerable Instructions + { + get + { + for (ulong index = 0; index < this.InstructionCount; index++) + { + yield return this.MustGetInstruction( (HighLevelILInstructionIndex)index); + } + } + } + + public HighLevelILFunction SSAForm + { + get + { + if (this.IsSSAForm) + { + return this; + } + + return HighLevelILFunction.MustTakeHandle( + NativeMethods.BNGetHighLevelILSSAForm(this.handle), + true + ); + } + } + + public HighLevelILFunction? NonSSAForm + { + get + { + if (!this.IsSSAForm) + { + return this; + } + + return HighLevelILFunction.TakeHandle( + NativeMethods.BNGetHighLevelILNonSSAForm(this.handle), + false + ); + } + } + + public MediumLevelILFunction? MediumLevelIL + { + get + { + return MediumLevelILFunction.TakeHandle( + NativeMethods.BNGetMediumLevelILForHighLevelILFunction(this.handle), + this.IsSSAForm + ); + } + } + + public MediumLevelILFunction? MediumLevelILSSAForm + { + get + { + return this.MediumLevelIL?.SSAForm; + } + } + + public MediumLevelILFunction? MediumLevelILNonSSAForm + { + get + { + return this.MediumLevelIL?.NonSSAForm; + } + } + + public LowLevelILFunction? LowLevelIL + { + get + { + return this.MediumLevelIL?.LowLevelIL; + } + } + + public LanguageRepresentationFunction? PseudoC + { + get + { + return this.GetLanguageRepresentation("Pseudo C"); + } + } + + public LanguageRepresentationFunction? GetLanguageRepresentation(string language = "Pseudo C") + { + return LanguageRepresentationFunction.TakeHandle( + NativeMethods.BNGetFunctionLanguageRepresentation( + this.OwnerFunction.DangerousGetHandle() , + language + ) + ); + } + + public LanguageRepresentationFunction? GetLanguageRepresentationIfAvailable(string language = "Pseudo C") + { + return LanguageRepresentationFunction.TakeHandle( + NativeMethods.BNGetFunctionLanguageRepresentationIfAvailable( + this.OwnerFunction.DangerousGetHandle(), + language + ) + ); + } + + public HighLevelILInstructionIndex? GetSSAInstructionIndex(HighLevelILInstructionIndex instruction) + { + HighLevelILInstructionIndex index = NativeMethods.BNGetHighLevelILSSAInstructionIndex( + this.handle , + instruction + ); + + if ((ulong)index >= this.ExpressionCount) + { + return null; + } + + return index; + } + + public HighLevelILInstructionIndex? GetNonSSAInstructionIndex(HighLevelILInstructionIndex instruction) + { + HighLevelILInstructionIndex index = NativeMethods.BNGetHighLevelILNonSSAInstructionIndex( + this.handle , + instruction + ); + + if ((ulong)index >= this.ExpressionCount) + { + return null; + } + + return index; + } + + public HighLevelILInstruction? GetSSAVariableDefinition(Variable variable , ulong version) + { + return this.GetExpression( + NativeMethods.BNGetHighLevelILSSAVarDefinition( + this.handle , + variable.ToNative() , + version + ) + ); + } + + public HighLevelILInstruction[] GetSSAVariableUses(Variable variable , ulong version) + { + IntPtr arrayPointer = NativeMethods.BNGetHighLevelILSSAVarUses( + this.handle , + variable.ToNative() , + version , + out ulong arrayLength + ); + + ulong[] indexes = UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNFreeILInstructionList + ); + + List instructions = new List(); + + foreach (HighLevelILExpressionIndex index in indexes) + { + instructions.Add( + this.MustGetExpression(index) + ); + } + + return instructions.ToArray(); + } + + public HighLevelILInstruction? GetSSAMemoryDefinition(ulong version) + { + return this.GetExpression( + NativeMethods.BNGetHighLevelILSSAMemoryDefinition( + this.handle , + version + ) + ); + } + + public HighLevelILInstruction[] GetSSAMemoryUses( ulong version) + { + IntPtr arrayPointer = NativeMethods.BNGetHighLevelILSSAMemoryUses( + this.handle , + version , + out ulong arrayLength + ); + + ulong[] indexes = UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNFreeILInstructionList + ); + + List instructions = new List(); + + foreach (HighLevelILExpressionIndex index in indexes) + { + instructions.Add( + this.MustGetExpression(index) + ); + } + + return instructions.ToArray(); + } + + public bool IsSSAVariableLive(Variable variable , ulong version) + { + return NativeMethods.BNIsHighLevelILSSAVarLive( + this.handle , + variable.ToNative() , + version + ); + } + + public bool IsVariableLiveAt(Variable variable , HighLevelILInstructionIndex instruction) + { + return NativeMethods.BNIsHighLevelILVarLiveAt( + this.handle , + variable.ToNative() , + instruction + ); + } + + public bool IsSSAVariableLiveAt(Variable variable ,ulong version, HighLevelILInstructionIndex instruction) + { + return NativeMethods.BNIsHighLevelILSSAVarLiveAt( + this.handle , + variable.ToNative() , + version, + instruction + ); + } + + + public void ReplaceExpression(HighLevelILExpressionIndex oldExpr , HighLevelILExpressionIndex newExpr) + { + NativeMethods.BNReplaceHighLevelILExpr( + this.handle , + oldExpr , + newExpr + ); + } + + public void SetExpressionAttributes(HighLevelILExpressionIndex expression , uint attributes) + { + NativeMethods.BNSetHighLevelILExprAttributes( + this.handle , + expression , + attributes + ); + } + + public LinearViewObject CreateLinearView( DisassemblySettings? settings = null) + { + if (null == settings) + { + settings = DisassemblySettings.DefaultLinear(); + } + + if (this.IsSSAForm) + { + return LinearViewObject.MustTakeHandle( + NativeMethods.BNCreateLinearViewSingleFunctionHighLevelILSSAForm( + this.handle , + null == settings ? IntPtr.Zero : settings.DangerousGetHandle() + ) + ); + } + else + { + return LinearViewObject.MustTakeHandle( + NativeMethods.BNCreateLinearViewSingleFunctionHighLevelIL( + this.handle , + null == settings ? IntPtr.Zero : settings.DangerousGetHandle() + ) + ); + } + } + + public PluginCommand[] ValidPluginCommands + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetValidPluginCommandsForHighLevelILFunction( + this.OwnerFunction.View.DangerousGetHandle(), + this.handle, + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArray( + arrayPointer , + arrayLength , + PluginCommand.FromNative , + NativeMethods.BNFreePluginCommandList + ); + } + } + + public HighLevelILExpressionIndex AddOperandList(ulong[] operands) + { + return NativeMethods.BNHighLevelILAddOperandList( + this.handle , + operands , + (ulong)operands.Length + ); + } + + public HighLevelILExpressionIndex AddOperandList(HighLevelILExpressionIndex[] operands) + { + List targets = new List(); + + foreach (HighLevelILExpressionIndex operand in operands) + { + targets.Add( (ulong)operand); + } + + return NativeMethods.BNHighLevelILAddOperandList( + this.handle , + targets.ToArray() , + (ulong)operands.Length + ); + } + + public HighLevelILExpressionIndex AddVariableList(Variable[] variables) + { + List operands = new List(); + + foreach (Variable variable in variables) + { + operands.Add( (HighLevelILExpressionIndex)variable.Identifier); + } + + return this.AddOperandList(operands.ToArray()); + } + + public HighLevelILPossibleValueSetCacheIndex CachePossibleValueSet(PossibleValueSet pvs) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + return NativeMethods.BNCacheHighLevelILPossibleValueSet( + this.handle, + pvs.ToNativeEx(allocator) + ); + } + } + + public void FinalizeILFunction() + { + NativeMethods.BNFinalizeHighLevelILFunction(this.handle); + } + + public void GenerateSSAForm(Variable[] aliases) + { + NativeMethods.BNGenerateHighLevelILSSAForm( + this.handle, + UnsafeUtils.ConvertToNativeArray(aliases), + (ulong)aliases.Length + ); + } + + public HighLevelILFlowGraph CreateGraph(DisassemblySettings? settings = null) + { + if (null == settings) + { + settings = DisassemblySettings.DefaultGraph(); + } + + return HighLevelILFlowGraph.MustTakeHandleEx( + this, + NativeMethods.BNCreateHighLevelILFunctionGraph( + this.handle , + null == settings ? IntPtr.Zero : settings.DangerousGetHandle() + ) + ); + } + + public HighLevelILFlowGraph CreateImmediateGraph(DisassemblySettings? settings = null) + { + if (null == settings) + { + settings = DisassemblySettings.DefaultGraph(); + } + + return HighLevelILFlowGraph.MustTakeHandleEx( + this, + NativeMethods.BNCreateHighLevelILImmediateFunctionGraph( + this.handle , + null == settings ? IntPtr.Zero : settings.DangerousGetHandle() + ) + ); + } + + public FunctionGraphType FunctionGraphType + { + get + { + if (this.BasicBlocks.Length < 1) + { + return FunctionGraphType.InvalidILViewType; + } + + return NativeMethods.BNGetBasicBlockFunctionGraphType( + this.BasicBlocks[0].DangerousGetHandle() + ); + } + } + + public HighLevelILVariable[] Variables + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetHighLevelILVariables( + this.handle , + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArray( + arrayPointer , + arrayLength , + (_native) => HighLevelILVariable.FromNativeEx(this , _native) , + NativeMethods.BNFreeVariableList + ); + } + } + + public HighLevelILVariable[] AliasedVariables + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetHighLevelILAliasedVariables( + this.handle , + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArray( + arrayPointer , + arrayLength , + (_native) => HighLevelILVariable.FromNativeEx(this , _native) , + NativeMethods.BNFreeVariableList + ); + } + } + + public HighLevelILSSAVariable[] SSAVariables + { + get + { + List targets = new List(); + + foreach (HighLevelILVariable variable in this.Variables) + { + IntPtr arrayPointer = NativeMethods.BNGetHighLevelILVariableSSAVersions( + this.handle , + variable.ToNative(), + out ulong arrayLength + ); + + ulong[] versions = UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNFreeILInstructionList + ); + + foreach (ulong version in versions) + { + targets.Add( new HighLevelILSSAVariable(variable, version) ); + } + } + + return targets.ToArray(); + } + } + + public HighLevelILInstructionIndex? GetInstructionIndexForExpressionIndex( + HighLevelILExpressionIndex expression) + { + HighLevelILInstructionIndex index = NativeMethods.BNGetHighLevelILInstructionForExpr( + this.handle, + expression); + + if ((ulong)index >= this.InstructionCount) + { + return null; + } + + return index; + } + + public HighLevelILExpressionIndex? GetExpressionIndexByInstructionIndex( + HighLevelILInstructionIndex instruction) + { + HighLevelILExpressionIndex index = NativeMethods.BNGetHighLevelILIndexForInstruction( + this.handle, + instruction); + + if ((ulong)index >= this.ExpressionCount) + { + return null; + } + + return index; + } + + + public PluginCommand[] GetValidPluginCommandsForInstruction(ulong instruction) + { + IntPtr arrayPointer = NativeMethods.BNGetValidPluginCommandsForHighLevelILInstruction( + this.OwnerFunction.View.DangerousGetHandle(), + this.handle, + instruction, + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArray( + arrayPointer , + arrayLength , + PluginCommand.FromNative , + NativeMethods.BNFreePluginCommandList + ); + } + + + public HighLevelILExpressionIndex AddExpression( + HighLevelILOperation operation, + SourceLocation? location = null, + ulong size = 0, + params ulong[] operands + ) + { + ulong a = 0; + ulong b = 0; + ulong c = 0; + ulong d = 0; + ulong e = 0; + + if (operands.Length > 0) + { + a = operands[0]; + } + + if (operands.Length > 1) + { + b = operands[1]; + } + + if (operands.Length > 2) + { + c = operands[2]; + } + + if (operands.Length > 3) + { + d = operands[3]; + } + + if (operands.Length > 4) + { + e = operands[4]; + } + + if (null == location) + { + return NativeMethods.BNHighLevelILAddExpr( + this.handle , + operation, + size , + a, + b , + c , + d , + e + ); + } + else + { + return NativeMethods.BNHighLevelILAddExprWithLocation( + this.handle , + operation, + location.Address, + (uint)location.Operand, + size , + a, + b , + c , + d , + e + ); + } + + } + + public HighLevelILExpressionIndex EmitNop(SourceLocation? location = null) + { + return this.AddExpression( + HighLevelILOperation.HLIL_NOP , + location + ); + } + + public HighLevelILExpressionIndex EmitBlock( + HighLevelILExpressionIndex[] expressions, + SourceLocation? location = null) + { + return this.AddExpression( + HighLevelILOperation.HLIL_BLOCK , + location, + 0, + (ulong)expressions.Length, + (ulong)this.AddOperandList(expressions) + ); + } + + public HighLevelILExpressionIndex EmitIf( + HighLevelILExpressionIndex condition, + HighLevelILExpressionIndex trueBranch, + HighLevelILExpressionIndex falseBranch, + SourceLocation? location = null) + { + return this.AddExpression( + HighLevelILOperation.HLIL_IF , + location, + 0, + (ulong)condition, + (ulong)trueBranch, + (ulong)falseBranch + ); + } + + public HighLevelILExpressionIndex EmitWhile( + HighLevelILExpressionIndex condition, + HighLevelILExpressionIndex loop, + SourceLocation? location = null) + { + return this.AddExpression( + HighLevelILOperation.HLIL_WHILE , + location, + 0, + (ulong)condition, + (ulong)loop + ); + } + + public HighLevelILExpressionIndex EmitDoWhile( + HighLevelILExpressionIndex condition, + HighLevelILExpressionIndex loop, + SourceLocation? location = null) + { + return this.AddExpression( + HighLevelILOperation.HLIL_DO_WHILE , + location, + 0, + (ulong)condition, + (ulong)loop + ); + } + + public HighLevelILExpressionIndex EmitFor( + HighLevelILExpressionIndex init , + HighLevelILExpressionIndex condition, + HighLevelILExpressionIndex update, + HighLevelILExpressionIndex loop, + SourceLocation? location = null) + { + return this.AddExpression( + HighLevelILOperation.HLIL_FOR , + location, + 0, + (ulong)init, + (ulong)condition, + (ulong)update, + (ulong)loop + ); + } + + public HighLevelILExpressionIndex EmitSwtich( + HighLevelILExpressionIndex condition, + HighLevelILExpressionIndex defaultExpr, + HighLevelILExpressionIndex[] cases, + SourceLocation? location = null) + { + return this.AddExpression( + HighLevelILOperation.HLIL_SWITCH , + location, + 0, + (ulong)condition, + (ulong)defaultExpr, + (ulong)cases.Length, + (ulong)this.AddOperandList(cases) + ); + } + + public HighLevelILExpressionIndex EmitCase( + HighLevelILExpressionIndex[] values, + HighLevelILExpressionIndex expression, + SourceLocation? location = null) + { + return this.AddExpression( + HighLevelILOperation.HLIL_CASE , + location, + 0, + (ulong)values.Length, + (ulong)this.AddOperandList(values), + (ulong)expression + ); + } + + public HighLevelILExpressionIndex EmitBreak( + SourceLocation? location = null) + { + return this.AddExpression( + HighLevelILOperation.HLIL_BREAK , + location, + 0 + ); + } + + public HighLevelILExpressionIndex EmitContinue( + SourceLocation? location = null) + { + return this.AddExpression( + HighLevelILOperation.HLIL_CONTINUE , + location, + 0 + ); + } + + public HighLevelILExpressionIndex EmitJump( + HighLevelILExpressionIndex target, + SourceLocation? location = null) + { + return this.AddExpression( + HighLevelILOperation.HLIL_JUMP , + location, + 0, + (ulong)target + ); + } + + public HighLevelILExpressionIndex EmitRet( + HighLevelILExpressionIndex[] sources, + SourceLocation? location = null) + { + return this.AddExpression( + HighLevelILOperation.HLIL_RET , + location, + 0, + (ulong)sources.Length, + (ulong)this.AddOperandList(sources) + ); + } + + public HighLevelILExpressionIndex EmitNoRet( + SourceLocation? location = null) + { + return this.AddExpression( + HighLevelILOperation.HLIL_NORET , + location, + 0 + ); + } + + public HighLevelILExpressionIndex EmitUnreachable( + SourceLocation? location = null) + { + return this.AddExpression( + HighLevelILOperation.HLIL_UNREACHABLE , + location, + 0 + ); + } + + public HighLevelILExpressionIndex EmitGoto( + ulong target, + SourceLocation? location = null) + { + return this.AddExpression( + HighLevelILOperation.HLIL_GOTO , + location, + 0, + target + ); + } + + public HighLevelILExpressionIndex EmitLabel( + ulong target, + SourceLocation? location = null) + { + return this.AddExpression( + HighLevelILOperation.HLIL_LABEL , + location, + 0, + target + ); + } + + public HighLevelILExpressionIndex EmitVariableDeclare( + Variable variable, + SourceLocation? location = null) + { + return this.AddExpression( + HighLevelILOperation.HLIL_VAR_DECLARE , + location, + 0, + variable.Identifier + ); + } + + public HighLevelILExpressionIndex EmitVariableInit( + ulong size, + Variable dest, + HighLevelILExpressionIndex src, + SourceLocation? location = null) + { + return this.AddExpression( + HighLevelILOperation.HLIL_VAR_INIT , + location, + size, + dest.Identifier, + (ulong)src + ); + } + + public HighLevelILExpressionIndex EmitAssign( + ulong size, + HighLevelILExpressionIndex dest, + HighLevelILExpressionIndex src, + SourceLocation? location = null) + { + return this.AddExpression( + HighLevelILOperation.HLIL_ASSIGN , + location, + size, + (ulong)dest, + (ulong)src + ); + } + + public HighLevelILExpressionIndex EmitAssignUnpack( + ulong size, + HighLevelILExpressionIndex[] output, + HighLevelILExpressionIndex src, + SourceLocation? location = null) + { + return this.AddExpression( + HighLevelILOperation.HLIL_ASSIGN_UNPACK , + location, + size, + (ulong)output.Length, + (ulong)this.AddOperandList(output), + (ulong)src + ); + } + + public HighLevelILExpressionIndex EmitVariable( + ulong size, + Variable src, + SourceLocation? location = null) + { + return this.AddExpression( + HighLevelILOperation.HLIL_VAR , + location, + size, + (ulong)src.Identifier + ); + } + + public HighLevelILExpressionIndex EmitStructField( + ulong size, + HighLevelILExpressionIndex src, + long offset, + ulong memberIndex, + SourceLocation? location = null) + { + return this.AddExpression( + HighLevelILOperation.HLIL_STRUCT_FIELD , + location, + size, + (ulong)src, + (ulong)offset, + (ulong)memberIndex + ); + } + + public HighLevelILExpressionIndex EmitSplit( + ulong size, + HighLevelILExpressionIndex high, + HighLevelILExpressionIndex low, + SourceLocation? location = null) + { + return this.AddExpression( + HighLevelILOperation.HLIL_SPLIT , + location, + size, + (ulong)high, + (ulong)low + ); + } + + public HighLevelILExpressionIndex EmitArrayIndex( + ulong size, + HighLevelILExpressionIndex source, + HighLevelILExpressionIndex index, + SourceLocation? location = null) + { + return this.AddExpression( + HighLevelILOperation.HLIL_SPLIT , + location, + size, + (ulong)source, + (ulong)index + ); + } + + public HighLevelILExpressionIndex EmitDeref( + ulong size, + HighLevelILExpressionIndex source, + SourceLocation? location = null) + { + return this.AddExpression( + HighLevelILOperation.HLIL_DEREF , + location, + size, + (ulong)source + ); + } + + public HighLevelILExpressionIndex EmitDerefField( + ulong size, + HighLevelILExpressionIndex source, + long offset , + ulong memberIndex, + SourceLocation? location = null) + { + return this.AddExpression( + HighLevelILOperation.HLIL_DEREF_FIELD , + location, + size, + (ulong)source, + (ulong)offset, + memberIndex + ); + } + } +} \ No newline at end of file diff --git a/Handle/BNHighLevelILTokenEmitter.cs b/Handle/BNHighLevelILTokenEmitter.cs new file mode 100644 index 0000000..da318d2 --- /dev/null +++ b/Handle/BNHighLevelILTokenEmitter.cs @@ -0,0 +1,277 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class HighLevelILTokenEmitter : AbstractSafeHandle + { + internal HighLevelILTokenEmitter(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static HighLevelILTokenEmitter? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new HighLevelILTokenEmitter( + NativeMethods.BNNewHighLevelILTokenEmitterReference(handle) , + true + ); + } + + internal static HighLevelILTokenEmitter MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new HighLevelILTokenEmitter( + NativeMethods.BNNewHighLevelILTokenEmitterReference(handle) , + true + ); + } + + internal static HighLevelILTokenEmitter? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new HighLevelILTokenEmitter(handle, true); + } + + internal static HighLevelILTokenEmitter MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new HighLevelILTokenEmitter(handle, true); + } + + internal static HighLevelILTokenEmitter? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new HighLevelILTokenEmitter(handle, false); + } + + internal static HighLevelILTokenEmitter MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new HighLevelILTokenEmitter(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeHighLevelILTokenEmitter(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + + public void InitLine() + { + NativeMethods.BNHighLevelILTokenEmitterInitLine(this.handle); + } + + public void NewLine() + { + NativeMethods.BNHighLevelILTokenEmitterNewLine(this.handle); + } + + public void IncreaseIndent() + { + NativeMethods.BNHighLevelILTokenEmitterIncreaseIndent(this.handle); + } + + public void DecreaseIndent() + { + NativeMethods.BNHighLevelILTokenEmitterDecreaseIndent(this.handle); + } + + public void ScopeSeparator() + { + NativeMethods.BNHighLevelILTokenEmitterScopeSeparator(this.handle); + } + + public void BeginScope(ScopeType type) + { + NativeMethods.BNHighLevelILTokenEmitterBeginScope(this.handle , type); + } + + public void EndScope(ScopeType type) + { + NativeMethods.BNHighLevelILTokenEmitterEndScope(this.handle , type); + } + + public void ScopeContinuation(bool forceSameLine) + { + NativeMethods.BNHighLevelILTokenEmitterScopeContinuation(this.handle , forceSameLine); + } + + public void FinalizeScope() + { + NativeMethods.BNHighLevelILTokenEmitterFinalizeScope(this.handle); + } + + public void NoIndentForThisLine() + { + NativeMethods.BNHighLevelILTokenEmitterNoIndentForThisLine(this.handle); + } + + public void PrependCollapseBlankIndicator() + { + NativeMethods.BNHighLevelILTokenPrependCollapseBlankIndicator(this.handle); + } + + public void PrependCollapseIndicator(InstructionTextTokenContext context , ulong hash ) + { + NativeMethods.BNHighLevelILTokenPrependCollapseIndicator( + this.handle, + context, + hash + ); + } + + public bool HasCollapsableRegions + { + get + { + return NativeMethods.BNHighLevelILTokenEmitterHasCollapsableRegions(this.handle); + } + + set + { + NativeMethods.BNHighLevelILTokenEmitterSetHasCollapsableRegions(this.handle, value); + } + } + + public void BeginForceZeroConfidence() + { + NativeMethods.BNHighLevelILTokenEmitterBeginForceZeroConfidence( + this.handle + ); + } + + public void EndForceZeroConfidence() + { + NativeMethods.BNHighLevelILTokenEmitterEndForceZeroConfidence( + this.handle + ); + } + + public void SetCurrentExpr(TokenEmitterExpression expr) + { + NativeMethods.BNHighLevelILTokenEmitterSetCurrentExpr( + this.handle , + expr.ToNative() + ); + } + + public void RestoreCurrentExpr(TokenEmitterExpression expr) + { + NativeMethods.BNHighLevelILTokenEmitterRestoreCurrentExpr( + this.handle, + expr.ToNative() + ); + } + + public void FinalizeEmit() + { + NativeMethods.BNHighLevelILTokenEmitterFinalize( + this.handle + ); + } + + public void Append(InstructionTextToken token) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + NativeMethods.BNHighLevelILTokenEmitterAppend( + this.handle, + token.ToNativeEx(allocator) + ); + } + } + + public void AppendOpenParen() + { + NativeMethods.BNHighLevelILTokenEmitterAppendOpenParen( + this.handle + ); + } + + public void AppendCloseParen() + { + NativeMethods.BNHighLevelILTokenEmitterAppendCloseParen( + this.handle + ); + } + + public void AppendOpenBracket() + { + NativeMethods.BNHighLevelILTokenEmitterAppendOpenBracket( + this.handle + ); + } + + public void AppendCloseBracket() + { + NativeMethods.BNHighLevelILTokenEmitterAppendCloseBracket( + this.handle + ); + } + + public void AppendOpenBrace() + { + NativeMethods.BNHighLevelILTokenEmitterAppendOpenBrace( + this.handle + ); + } + + public void AppendCloseBrace() + { + NativeMethods.BNHighLevelILTokenEmitterAppendCloseBrace( + this.handle + ); + } + + public void AppendSemicolon() + { + NativeMethods.BNHighLevelILTokenEmitterAppendSemicolon( + this.handle + ); + } + + public BraceRequirement BraceRequirement + { + get + { + return NativeMethods.BNHighLevelILTokenEmitterGetBraceRequirement( + this.handle + ); + } + } + } +} \ No newline at end of file diff --git a/Handle/BNKeyValueStore.cs b/Handle/BNKeyValueStore.cs new file mode 100644 index 0000000..89ce8e8 --- /dev/null +++ b/Handle/BNKeyValueStore.cs @@ -0,0 +1,204 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class KeyValueStore : AbstractSafeHandle + { + public KeyValueStore() + : this( NativeMethods.BNCreateKeyValueStore() , true ) + { + + } + + public KeyValueStore(byte[] data) + : this( new DataBuffer(data) ) + { + + } + + public KeyValueStore(DataBuffer buffer) + : this( NativeMethods.BNCreateKeyValueStoreFromDataBuffer(buffer.DangerousGetHandle()) , true ) + { + + } + + internal KeyValueStore(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static KeyValueStore? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new KeyValueStore( + NativeMethods.BNNewKeyValueStoreReference(handle) , + true + ); + } + + internal static KeyValueStore MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new KeyValueStore( + NativeMethods.BNNewKeyValueStoreReference(handle) , + true + ); + } + + internal static KeyValueStore? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new KeyValueStore(handle, true); + } + + internal static KeyValueStore MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new KeyValueStore(handle, true); + } + + internal static KeyValueStore? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new KeyValueStore(handle, false); + } + + internal static KeyValueStore MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new KeyValueStore(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeKeyValueStore(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + + public string[] Keys + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetKeyValueStoreKeys( + this.handle , + out ulong arrayLength + ); + + return UnsafeUtils.TakeAnsiStringArray( + arrayPointer, + arrayLength, + NativeMethods.BNFreeStringList + ); + } + } + + public bool ContainsKey(string key) + { + return NativeMethods.BNKeyValueStoreHasValue(this.handle, key); + } + + public string GetValue(string key) + { + return UnsafeUtils.TakeUtf8String( + NativeMethods.BNGetKeyValueStoreValue(this.handle , key) + ); + } + + public bool SetValue(string key , string value) + { + return NativeMethods.BNSetKeyValueStoreValue(this.handle , key , value); + } + + public DataBuffer? GetValueBuffer(string key) + { + return DataBuffer.TakeHandle( + NativeMethods.BNGetKeyValueStoreBuffer(this.handle , key) + ); + } + + public bool SetValueBuffer(string key , DataBuffer buffer) + { + return NativeMethods.BNSetKeyValueStoreBuffer(this.handle , key , buffer.DangerousGetHandle()); + } + + public void BeginNamespace(string ns) + { + NativeMethods.BNBeginKeyValueStoreNamespace(this.handle, ns); + } + + public void EndNamespace() + { + NativeMethods.BNEndKeyValueStoreNamespace(this.handle); + } + + public bool IsEmpty() + { + return NativeMethods.BNIsKeyValueStoreEmpty(this.handle); + } + + public ulong ValueSize + { + get + { + return NativeMethods.BNGetKeyValueStoreValueSize(this.handle); + } + } + + public ulong DataSize + { + get + { + return NativeMethods.BNGetKeyValueStoreDataSize(this.handle); + } + } + + public ulong StorageSize + { + get + { + return NativeMethods.BNGetKeyValueStoreValueStorageSize(this.handle); + } + } + + public ulong NamespaceSize + { + get + { + return NativeMethods.BNGetKeyValueStoreNamespaceSize(this.handle); + } + } + } +} \ No newline at end of file diff --git a/Handle/BNLanguageRepresentationFunction.cs b/Handle/BNLanguageRepresentationFunction.cs new file mode 100644 index 0000000..ae458ea --- /dev/null +++ b/Handle/BNLanguageRepresentationFunction.cs @@ -0,0 +1,300 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class LanguageRepresentationFunction : AbstractSafeHandle + { + internal LanguageRepresentationFunction(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static LanguageRepresentationFunction? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new LanguageRepresentationFunction( + NativeMethods.BNNewLanguageRepresentationFunctionReference(handle) , + true + ); + } + + internal static LanguageRepresentationFunction MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new LanguageRepresentationFunction( + NativeMethods.BNNewLanguageRepresentationFunctionReference(handle) , + true + ); + } + + internal static LanguageRepresentationFunction? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new LanguageRepresentationFunction(handle, true); + } + + internal static LanguageRepresentationFunction MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new LanguageRepresentationFunction(handle, true); + } + + internal static LanguageRepresentationFunction? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new LanguageRepresentationFunction(handle, false); + } + + internal static LanguageRepresentationFunction MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new LanguageRepresentationFunction(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeLanguageRepresentationFunction(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + + public override string ToString() + { + return this.GetLinearDisassemblyText(); + } + + public Architecture Architecture + { + get + { + return Architecture.MustFromHandle( + NativeMethods.BNGetLanguageRepresentationArchitecture(this.handle) + ); + } + } + + public Function OwnerFunction + { + get + { + return Function.MustTakeHandle( + NativeMethods.BNGetLanguageRepresentationOwnerFunction(this.handle) + ); + } + } + + // forward + public ulong HighestAddress + { + get + { + return this.OwnerFunction.HighestAddress; + } + } + + public ulong LowestAddress + { + get + { + return this.OwnerFunction.LowestAddress; + } + } + + public Symbol Symbol + { + get + { + return this.OwnerFunction.Symbol; + } + } + + public string ShortName + { + get + { + return this.Symbol.ShortName; + } + } + + public string FullName + { + get + { + return this.Symbol.FullName; + } + } + + public string RawName + { + get + { + return this.Symbol.RawName; + } + } + + public HighLevelILFunction HighLevelIL + { + get + { + return HighLevelILFunction.MustTakeHandle( + NativeMethods.BNGetLanguageRepresentationILFunction(this.handle) + ); + } + } + + public MediumLevelILFunction? MediumLevelIL + { + get + { + return this.HighLevelIL.MediumLevelIL; + } + } + + public MediumLevelILFunction? MediumLevelILSSAForm + { + get + { + return this.HighLevelIL.MediumLevelILSSAForm; + } + } + + public MediumLevelILFunction? MediumLevelILNonSSAForm + { + get + { + return this.HighLevelIL.MediumLevelILNonSSAForm; + } + } + + public LowLevelILFunction? LowLevelIL + { + get + { + return this.HighLevelIL.LowLevelIL; + } + } + + public LinearViewObject CreateLinearView( + DisassemblySettings? settings = null, + string language = "Pseudo C" + ) + { + if (null == settings) + { + settings = DisassemblySettings.DefaultLinear(); + settings.SetOption(DisassemblyOption.WaitForIL , true); + } + + return LinearViewObject.MustTakeHandle( + NativeMethods.BNCreateLinearViewSingleFunctionLanguageRepresentation( + this.OwnerFunction.DangerousGetHandle() , + null == settings ? IntPtr.Zero : settings.DangerousGetHandle() , + language + ) + ); + } + + public LinearDisassemblyLine[] GetLinearDisassemblyLines( + DisassemblySettings? settings = null, + string language = "Pseudo C" + ) + { + LinearViewObject linear = this.CreateLinearView(settings); + + LinearViewCursor cursor = linear.CreateCursor(); + + List targets = new List(); + + cursor.SeekToAddress(this.LowestAddress); + foreach (LinearDisassemblyLine line in cursor.PreviousLines) + { + if (!targets.Contains(line)) + { + targets.Add(line); + } + } + + cursor.SeekToAddress(this.HighestAddress); + foreach (LinearDisassemblyLine line in cursor.NextLines) + { + if (!targets.Contains(line)) + { + targets.Add(line); + } + } + + return targets.ToArray(); + } + + public IEnumerable LinearDisassemblyLines + { + get + { + return this.GetLinearDisassemblyLines(); + } + } + + public string GetLinearDisassemblyText( + DisassemblySettings? settings = null, + string language = "Pseudo C" + ) + { + StringBuilder builder = new StringBuilder(); + + foreach (LinearDisassemblyLine line in this.GetLinearDisassemblyLines( + settings , + language + ) + ) + { + builder.AppendLine(line.ToString()); + } + + return builder.ToString(); + } + + public string LinearDisassemblyText + { + get + { + return this.GetLinearDisassemblyText(); + } + } + + + + } +} \ No newline at end of file diff --git a/Handle/BNLanguageRepresentationFunctionType.cs b/Handle/BNLanguageRepresentationFunctionType.cs new file mode 100644 index 0000000..9cebdf2 --- /dev/null +++ b/Handle/BNLanguageRepresentationFunctionType.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class LanguageRepresentationFunctionType : AbstractSafeHandle + { + internal LanguageRepresentationFunctionType(IntPtr handle) + :base(handle, false) + { + + } + + } +} \ No newline at end of file diff --git a/Handle/BNLineFormatter.cs b/Handle/BNLineFormatter.cs new file mode 100644 index 0000000..b25e80f --- /dev/null +++ b/Handle/BNLineFormatter.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class LineFormatter : AbstractSafeHandle + { + internal LineFormatter(IntPtr handle) + :base(handle , false) + { + + } + } +} \ No newline at end of file diff --git a/Handle/BNLinearViewCursor.cs b/Handle/BNLinearViewCursor.cs new file mode 100644 index 0000000..5bd9c0a --- /dev/null +++ b/Handle/BNLinearViewCursor.cs @@ -0,0 +1,420 @@ +using System; +using System.Collections.Generic; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class LinearViewCursor : AbstractSafeHandle + { + public LinearViewCursor(LinearViewObject root) + : this( + NativeMethods.BNCreateLinearViewCursor(root.DangerousGetHandle()), + true + ) + { + + } + + internal LinearViewCursor(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static LinearViewCursor? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new LinearViewCursor( + NativeMethods.BNNewLinearViewCursorReference(handle) , + true + ); + } + + internal static LinearViewCursor MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new LinearViewCursor( + NativeMethods.BNNewLinearViewCursorReference(handle) , + true + ); + } + + internal static LinearViewCursor? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new LinearViewCursor(handle, true); + } + + internal static LinearViewCursor MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new LinearViewCursor(handle, true); + } + + internal static LinearViewCursor? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new LinearViewCursor(handle, false); + } + + internal static LinearViewCursor MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new LinearViewCursor(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeLinearViewCursor(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + + public bool BeforeBegin + { + get + { + return NativeMethods.BNIsLinearViewCursorBeforeBegin(this.handle); + } + } + + public bool AfterEnd + { + get + { + return NativeMethods.BNIsLinearViewCursorAfterEnd(this.handle); + } + } + + public bool IsValid + { + get + { + if (this.BeforeBegin) + { + return false; + } + + if (this.AfterEnd) + { + return false; + } + + return true; + } + } + + public LinearViewObjectIdentifier[] Path + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetLinearViewCursorPath( + this.handle, + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx + ( + arrayPointer, + arrayLength, + LinearViewObjectIdentifier.FromNative, + NativeMethods.BNFreeLinearViewCursorPath + ); + } + } + + public AddressRange OrderingIndex + { + get + { + return AddressRange.FromNative( + NativeMethods.BNGetLinearViewCursorOrderingIndex(this.handle) + ); + } + } + + public ulong OrderingIndexTotal + { + get + { + return NativeMethods.BNGetLinearViewCursorOrderingIndexTotal(this.handle); + } + } + + public void SeekToBegin() + { + NativeMethods.BNSeekLinearViewCursorToBegin(this.handle); + } + + public void SeekToEnd() + { + NativeMethods.BNSeekLinearViewCursorToEnd(this.handle); + } + + public void SeekToAddress(ulong address) + { + NativeMethods.BNSeekLinearViewCursorToAddress(this.handle , address); + } + + public bool SeekToPath(LinearViewObjectIdentifier[] path) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + return NativeMethods.BNSeekLinearViewCursorToPath( + this.handle , + allocator.ConvertToNativeArrayEx( + path + ), + (ulong)path.Length + ); + } + } + + public void SeekToOrderingIndex(ulong index) + { + NativeMethods.BNSeekLinearViewCursorToOrderingIndex(this.handle , index); + } + + public bool Previous() + { + return NativeMethods.BNLinearViewCursorPrevious(this.handle); + } + + public bool Next() + { + return NativeMethods.BNLinearViewCursorNext(this.handle); + } + + public static int Compare(LinearViewCursor a, LinearViewCursor b) + { + return NativeMethods.BNCompareLinearViewCursors( + a.DangerousGetHandle() , + b.DangerousGetHandle() + ); + } + + public void AddRenderLayer(RenderLayer layer) + { + NativeMethods.BNAddLinearViewCursorRenderLayer(this.handle , layer.DangerousGetHandle()); + } + + public void RemoveRenderLayer(RenderLayer layer) + { + NativeMethods.BNRemoveLinearViewCursorRenderLayer(this.handle , layer.DangerousGetHandle()); + } + + public LinearViewObject? CurrentObject + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetLinearViewCursorPathObjects( + this.handle, + out ulong arrayLength + ); + + LinearViewObject? view = null; + + if (( IntPtr.Zero != arrayPointer ) && ( 0 != arrayLength )) + { + for (ulong i = 0; i < arrayLength; i++) + { + int offset = checked((int)(i * (ulong)IntPtr.Size)); + + IntPtr addressOfElement = IntPtr.Add(arrayPointer, offset); + + IntPtr element = Marshal.ReadIntPtr(addressOfElement); + + if (element != IntPtr.Zero) + { + // object chain + view = LinearViewObject.MustNewFromHandle(element, view); + } + } + } + + if (arrayPointer != IntPtr.Zero ) + { + NativeMethods.BNFreeLinearViewCursorPathObjects(arrayPointer ,arrayLength); + } + + return view; + } + } + + public LinearViewObject[] PathObjects + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetLinearViewCursorPathObjects( + this.handle, + out ulong arrayLength + ); + + LinearViewObject? parent = null; + + List targets = new List(); + + if (( IntPtr.Zero != arrayPointer ) && ( 0 != arrayLength )) + { + for (ulong i = 0; i < arrayLength; i++) + { + int offset = checked((int)(i * (ulong)IntPtr.Size)); + + IntPtr addressOfElement = IntPtr.Add(arrayPointer, offset); + + IntPtr element = Marshal.ReadIntPtr(addressOfElement); + + if (element != IntPtr.Zero) + { + // object chain + LinearViewObject item = LinearViewObject.MustNewFromHandle(element, parent); + + targets.Add(item); + + parent = item; + } + } + } + + if (arrayPointer != IntPtr.Zero ) + { + NativeMethods.BNFreeLinearViewCursorPathObjects(arrayPointer ,arrayLength); + } + + return targets.ToArray(); + } + } + + public LinearDisassemblyLine[] Lines + { + get + { + return this.GetLines(); + } + } + + public LinearDisassemblyLine[] GetLines() + { + IntPtr arrayPointer = NativeMethods.BNGetLinearViewCursorLines( + this.handle , + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + LinearDisassemblyLine.FromNative , + NativeMethods.BNFreeLinearDisassemblyLines + ); + } + + public LinearDisassemblyLine[] PreviousLines + { + get + { + LinearDisassemblyLine[] items = Array.Empty(); + + while (0 == items.Length) + { + items = this.Lines; + + if (!this.Previous()) + { + return items; + } + } + + return items; + } + } + + public LinearDisassemblyLine[] NextLines + { + get + { + LinearDisassemblyLine[] items = Array.Empty(); + + while (0 == items.Length) + { + items = this.Lines; + + if (!this.Next()) + { + return items; + } + } + + return items; + } + } + + public LinearViewCursor Duplicate() + { + return new LinearViewCursor( + NativeMethods.BNDuplicateLinearViewCursor(this.handle), + true + ); + } + + public RenderLayer[] RenderLayers + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetLinearViewCursorRenderLayers( + this.handle , + out ulong arrayLength + ); + + return UnsafeUtils.TakeHandleArray( + arrayPointer , + arrayLength , + RenderLayer.FromHandle , + NativeMethods.BNFreeRenderLayerList + ); + } + + set + { + foreach (RenderLayer layer in this.RenderLayers) + { + this.RemoveRenderLayer(layer); + } + + foreach (RenderLayer layer in value) + { + this.AddRenderLayer(layer); + } + } + } + } +} \ No newline at end of file diff --git a/Handle/BNLinearViewObject.cs b/Handle/BNLinearViewObject.cs new file mode 100644 index 0000000..d7da7a4 --- /dev/null +++ b/Handle/BNLinearViewObject.cs @@ -0,0 +1,667 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class LinearViewObject : AbstractSafeHandle + { + public LinearViewObject? Parent { get; } = null; + + internal LinearViewObject( + IntPtr handle , + bool owner , + LinearViewObject? parent = null + ) : base(handle , owner) + { + this.Parent = parent; + } + + internal LinearViewObject(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static LinearViewObject? NewFromHandle(IntPtr handle , LinearViewObject? parent = null) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new LinearViewObject( + NativeMethods.BNNewLinearViewObjectReference(handle) , + true + ); + } + + internal static LinearViewObject MustNewFromHandle(IntPtr handle , LinearViewObject? parent = null) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new LinearViewObject( + NativeMethods.BNNewLinearViewObjectReference(handle) , + true + ); + } + + internal static LinearViewObject? TakeHandle(IntPtr handle , LinearViewObject? parent = null) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new LinearViewObject(handle, true); + } + + internal static LinearViewObject MustTakeHandle(IntPtr handle , LinearViewObject? parent = null) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new LinearViewObject(handle, true); + } + + internal static LinearViewObject? BorrowHandle(IntPtr handle , LinearViewObject? parent = null) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new LinearViewObject(handle, false); + } + + internal static LinearViewObject MustBorrowHandle(IntPtr handle , LinearViewObject? parent = null) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new LinearViewObject(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeLinearViewObject(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + + + public ulong Start + { + get + { + return NativeMethods.BNGetLinearViewObjectStart(this.handle); + } + } + + public ulong End + { + get + { + return NativeMethods.BNGetLinearViewObjectEnd(this.handle); + } + } + + public LinearViewObjectIdentifier Identifier + { + get + { + return LinearViewObjectIdentifier.TakeNativeStruct( + NativeMethods.BNGetLinearViewObjectIdentifier(this.handle) + ); + } + } + + public ulong OrderingIndexTotal + { + get + { + return NativeMethods.BNGetLinearViewObjectOrderingIndexTotal(this.handle); + } + } + + public int CompareChildren(LinearViewObject child1, LinearViewObject child2) + { + return NativeMethods.BNCompareLinearViewObjectChildren( + this.handle , + child1.DangerousGetHandle(), + child2.DangerousGetHandle() + ); + } + + public ulong GetOrderingIndexForChild(LinearViewObject child) + { + return NativeMethods.BNGetLinearViewObjectOrderingIndexForChild( + this.handle , + child.DangerousGetHandle() + ); + } + + public LinearDisassemblyLine[] GetLines( + LinearViewObject? prev , + LinearViewObject? next) + { + IntPtr arrayPointer = NativeMethods.BNGetLinearViewObjectLines( + this.handle, + null == prev ? IntPtr.Zero : prev.DangerousGetHandle(), + null == next ? IntPtr.Zero : next.DangerousGetHandle(), + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer, + arrayLength, + LinearDisassemblyLine.FromNative, + NativeMethods.BNFreeLinearDisassemblyLines + ); + } + + + + public LinearViewObject? FirstChild + { + get + { + return LinearViewObject.TakeHandle( + NativeMethods.BNGetFirstLinearViewObjectChild(this.handle) , + this + ); + } + } + + public LinearViewObject? LastChild + { + get + { + return LinearViewObject.TakeHandle( + NativeMethods.BNGetLastLinearViewObjectChild(this.handle) , + this + ); + } + } + + public LinearViewObject? GetPreviousChild(LinearViewObject child) + { + return LinearViewObject.TakeHandle( + NativeMethods.BNGetPreviousLinearViewObjectChild( + this.handle , + child.DangerousGetHandle() + ) , + this + ); + } + + public LinearViewObject? Previous + { + get + { + if (null == this.Parent) + { + return null; + } + + return LinearViewObject.TakeHandle( + NativeMethods.BNGetPreviousLinearViewObjectChild( + this.Parent.DangerousGetHandle() , + this.DangerousGetHandle() + ) , + this.Parent + ); + } + } + + public LinearViewObject? GetNextChild(LinearViewObject child) + { + return LinearViewObject.TakeHandle( + NativeMethods.BNGetNextLinearViewObjectChild( + this.handle , + child.DangerousGetHandle() + ) , + this + ); + } + + public LinearViewObject? Next + { + get + { + if (null == this.Parent) + { + return null; + } + + return LinearViewObject.TakeHandle( + NativeMethods.BNGetNextLinearViewObjectChild( + this.Parent.DangerousGetHandle() , + this.DangerousGetHandle() + ) , + this.Parent + ); + } + } + + public ulong? OrderingIndex + { + get + { + if (null == this.Parent) + { + return null; + } + + return NativeMethods.BNGetLinearViewObjectOrderingIndexForChild( + this.Parent.DangerousGetHandle() , + this.DangerousGetHandle() + ); + } + } + + public LinearViewObject? GetChildForAddress(ulong address) + { + return LinearViewObject.TakeHandle( + NativeMethods.BNGetLinearViewObjectChildForAddress( + this.handle , + address + ), + this + ); + } + + public LinearViewObject? GetChildForIdentifier(LinearViewObjectIdentifier id) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + return LinearViewObject.TakeHandle( + NativeMethods.BNGetLinearViewObjectChildForIdentifier( + this.handle , + id.ToNativeEx(allocator) + ), + this + ); + } + } + + public LinearViewObject? GetChildForOrderingIndex(ulong index) + { + return LinearViewObject.TakeHandle( + NativeMethods.BNGetLinearViewObjectChildForOrderingIndex( + this.handle , + index + ), + this + ); + } + + + public LinearViewCursor CreateCursor() + { + return new LinearViewCursor( + NativeMethods.BNCreateLinearViewCursor(this.handle) , + true + ); + } + + public static LinearViewObject Disassembly( + BinaryView view, + DisassemblySettings? settings = null + ) + { + if (null == settings) + { + settings = DisassemblySettings.DefaultLinear(); + } + + return LinearViewObject.MustTakeHandle( + NativeMethods.BNCreateLinearViewDisassembly( + view.DangerousGetHandle() , + null == settings ? IntPtr.Zero : settings.DangerousGetHandle() + ) + ); + } + + public static LinearViewObject LowLevelIL( + BinaryView view, + DisassemblySettings? settings = null + ) + { + if (null == settings) + { + settings = DisassemblySettings.DefaultLinear(); + } + + return LinearViewObject.MustTakeHandle( + NativeMethods.BNCreateLinearViewLowLevelIL( + view.DangerousGetHandle() , + null == settings ? IntPtr.Zero : settings.DangerousGetHandle() + ) + ); + } + + public static LinearViewObject LowLevelILSSAForm( + BinaryView view, + DisassemblySettings? settings = null + ) + { + if (null == settings) + { + settings = DisassemblySettings.DefaultLinear(); + } + + return LinearViewObject.MustTakeHandle( + NativeMethods.BNCreateLinearViewLowLevelILSSAForm( + view.DangerousGetHandle() , + null == settings ? IntPtr.Zero : settings.DangerousGetHandle() + ) + ); + } + + public static LinearViewObject MediumLevelIL( + BinaryView view, + DisassemblySettings? settings = null + ) + { + if (null == settings) + { + settings = DisassemblySettings.DefaultLinear(); + } + + return LinearViewObject.MustTakeHandle( + NativeMethods.BNCreateLinearViewMediumLevelIL( + view.DangerousGetHandle() , + null == settings ? IntPtr.Zero : settings.DangerousGetHandle() + ) + ); + } + + public static LinearViewObject MediumLevelILSSAForm( + BinaryView view, + DisassemblySettings? settings = null + ) + { + if (null == settings) + { + settings = DisassemblySettings.DefaultLinear(); + } + + return LinearViewObject.MustTakeHandle( + NativeMethods.BNCreateLinearViewMediumLevelILSSAForm( + view.DangerousGetHandle() , + null == settings ? IntPtr.Zero : settings.DangerousGetHandle() + ) + ); + } + + public static LinearViewObject MappedMediumLevelILSSAForm( + BinaryView view, + DisassemblySettings? settings = null + ) + { + if (null == settings) + { + settings = DisassemblySettings.DefaultLinear(); + } + + return LinearViewObject.MustTakeHandle( + NativeMethods.BNCreateLinearViewMappedMediumLevelILSSAForm( + view.DangerousGetHandle() , + null == settings ? IntPtr.Zero : settings.DangerousGetHandle() + ) + ); + } + + public static LinearViewObject HighLevelIL( + BinaryView view, + DisassemblySettings? settings = null + ) + { + if (null == settings) + { + settings = DisassemblySettings.DefaultLinear(); + } + + return LinearViewObject.MustTakeHandle( + NativeMethods.BNCreateLinearViewHighLevelIL( + view.DangerousGetHandle() , + null == settings ? IntPtr.Zero : settings.DangerousGetHandle() + ) + ); + } + + public static LinearViewObject HighLevelILSSAForm( + BinaryView view, + DisassemblySettings? settings = null + ) + { + if (null == settings) + { + settings = DisassemblySettings.DefaultLinear(); + } + + return LinearViewObject.MustTakeHandle( + NativeMethods.BNCreateLinearViewHighLevelILSSAForm( + view.DangerousGetHandle() , + null == settings ? IntPtr.Zero : settings.DangerousGetHandle() + ) + ); + } + + public static LinearViewObject LanguageRepresentation( + BinaryView view, + DisassemblySettings? settings = null , + string language = "Pseudo C" + ) + { + if (null == settings) + { + settings = DisassemblySettings.DefaultLinear(); + } + + return LinearViewObject.MustTakeHandle( + NativeMethods.BNCreateLinearViewLanguageRepresentation( + view.DangerousGetHandle() , + null == settings ? IntPtr.Zero : settings.DangerousGetHandle(), + language + ) + ); + } + + public static LinearViewObject DataOnly( + BinaryView view, + DisassemblySettings? settings = null + ) + { + if (null == settings) + { + settings = DisassemblySettings.Default(); + } + + return LinearViewObject.MustTakeHandle( + NativeMethods.BNCreateLinearViewDataOnly( + view.DangerousGetHandle() , + null == settings ? IntPtr.Zero : settings.DangerousGetHandle() + ) + ); + } + + public static LinearViewObject SingleFunctionDisassembly( + Function function, + DisassemblySettings? settings = null + ) + { + if (null == settings) + { + settings = DisassemblySettings.DefaultLinear(); + } + + return LinearViewObject.MustTakeHandle( + NativeMethods.BNCreateLinearViewSingleFunctionDisassembly( + function.DangerousGetHandle() , + null == settings ? IntPtr.Zero : settings.DangerousGetHandle() + ) + ); + } + + public static LinearViewObject SingleFunctionLiftedIL( + Function function, + DisassemblySettings? settings = null + ) + { + if (null == settings) + { + settings = DisassemblySettings.DefaultLinear(); + } + + return LinearViewObject.MustTakeHandle( + NativeMethods.BNCreateLinearViewSingleFunctionLiftedIL( + function.DangerousGetHandle() , + null == settings ? IntPtr.Zero : settings.DangerousGetHandle() + ) + ); + } + + public static LinearViewObject SingleFunctionLowLevelILSSAForm( + Function function, + DisassemblySettings? settings = null + ) + { + if (null == settings) + { + settings = DisassemblySettings.DefaultLinear(); + } + + return LinearViewObject.MustTakeHandle( + NativeMethods.BNCreateLinearViewSingleFunctionLowLevelILSSAForm( + function.DangerousGetHandle() , + null == settings ? IntPtr.Zero : settings.DangerousGetHandle() + ) + ); + } + + public static LinearViewObject SingleFunctionMediumLevelIL( + Function function, + DisassemblySettings? settings = null + ) + { + if (null == settings) + { + settings = DisassemblySettings.DefaultLinear(); + } + + return LinearViewObject.MustTakeHandle( + NativeMethods.BNCreateLinearViewSingleFunctionMediumLevelIL( + function.DangerousGetHandle() , + null == settings ? IntPtr.Zero : settings.DangerousGetHandle() + ) + ); + } + + public static LinearViewObject SingleFunctionMediumLevelILSSAForm( + Function function, + DisassemblySettings? settings = null + ) + { + if (null == settings) + { + settings = DisassemblySettings.DefaultLinear(); + } + + return LinearViewObject.MustTakeHandle( + NativeMethods.BNCreateLinearViewSingleFunctionMediumLevelILSSAForm( + function.DangerousGetHandle() , + null == settings ? IntPtr.Zero : settings.DangerousGetHandle() + ) + ); + } + + public static LinearViewObject SingleFunctionMappedMediumLevelILSSAFor( + Function function, + DisassemblySettings? settings = null + ) + { + if (null == settings) + { + settings = DisassemblySettings.DefaultLinear(); + } + + return LinearViewObject.MustTakeHandle( + NativeMethods.BNCreateLinearViewSingleFunctionMappedMediumLevelILSSAForm( + function.DangerousGetHandle() , + null == settings ? IntPtr.Zero : settings.DangerousGetHandle() + ) + ); + } + + public static LinearViewObject SingleFunctionHighLevelIL( + Function function, + DisassemblySettings? settings = null + ) + { + if (null == settings) + { + settings = DisassemblySettings.DefaultLinear(); + } + + return LinearViewObject.MustTakeHandle( + NativeMethods.BNCreateLinearViewSingleFunctionHighLevelIL( + function.DangerousGetHandle() , + null == settings ? IntPtr.Zero : settings.DangerousGetHandle() + ) + ); + } + + public static LinearViewObject SingleFunctionHighLevelILSSAForm( + Function function, + DisassemblySettings? settings = null + ) + { + if (null == settings) + { + settings = DisassemblySettings.DefaultLinear(); + } + + return LinearViewObject.MustTakeHandle( + NativeMethods.BNCreateLinearViewSingleFunctionHighLevelILSSAForm( + function.DangerousGetHandle() , + null == settings ? IntPtr.Zero : settings.DangerousGetHandle() + ) + ); + } + + public static LinearViewObject SingleFunctionLanguageRepresentation( + Function function, + DisassemblySettings? settings = null , + string language = "Pseudo C" + ) + { + if (null == settings) + { + settings = DisassemblySettings.DefaultLinear(); + } + + return LinearViewObject.MustTakeHandle( + NativeMethods.BNCreateLinearViewSingleFunctionLanguageRepresentation( + function.DangerousGetHandle() , + null == settings ? IntPtr.Zero : settings.DangerousGetHandle(), + language + ) + ); + } + + } +} \ No newline at end of file diff --git a/Handle/BNLogger.cs b/Handle/BNLogger.cs new file mode 100644 index 0000000..10eeab7 --- /dev/null +++ b/Handle/BNLogger.cs @@ -0,0 +1,189 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class Logger : AbstractSafeHandle + { + public Logger( string name , ulong sessionId = 0 ) + :this ( Logger.rawGetOrCreateLogger(name , sessionId) , true) + { + + } + + internal Logger(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static Logger? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new Logger(handle, true); + } + + internal static Logger MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new Logger(handle, true); + } + + public static Logger? GetLogger(string name , ulong sessionId = 0) + { + return Logger.TakeHandle( + NativeMethods.BNLogGetLogger( + name , + sessionId + ) + ); + } + + public static Logger CreateLogger(string name , ulong sessionId = 0) + { + return Logger.MustTakeHandle( + NativeMethods.BNLogCreateLogger( + name , + sessionId + ) + ); + } + + private static IntPtr rawGetOrCreateLogger(string name , ulong sessionId = 0) + { + IntPtr loggerHandle = NativeMethods.BNLogGetLogger(name , sessionId); + + if (IntPtr.Zero != loggerHandle) + { + return loggerHandle; + } + + return NativeMethods.BNLogCreateLogger( + name , + sessionId + ); + } + + public static Logger GetOrCreateLogger(string name , ulong sessionId = 0) + { + return Logger.MustTakeHandle( + Logger.rawGetOrCreateLogger(name , sessionId) + ); + } + + public static string[] GetLoggerNames() + { + IntPtr arrayPointer = NativeMethods.BNLogGetLoggerNames(out ulong arrayLength); + + return UnsafeUtils.TakeAnsiStringArray( + arrayPointer, + arrayLength, + NativeMethods.BNFreeStringList + ); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeLogger(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + + public string Name + { + get + { + return UnsafeUtils.TakeUtf8String( + NativeMethods.BNLoggerGetName(this.handle) + ); + } + } + + public ulong SessionId + { + get + { + return NativeMethods.BNLoggerGetSessionId(this.handle); + } + } + + public void Indent() + { + NativeMethods.BNLoggerIndent(this.handle); + } + + public void Dedent() + { + NativeMethods.BNLoggerDedent(this.handle); + } + + public void ResetIndent() + { + NativeMethods.BNLoggerResetIndent(this.handle); + } + + public string IndentText + { + get + { + return UnsafeUtils.TakeAnsiString( + NativeMethods.BNGetLoggerIndent(this.handle) + ); + } + } + + public void LogString(LogLevel level , string text) + { + NativeMethods.BNLoggerLogString(this.handle , level , text); + } + + public void LogDebug(string format , params object[] args) + { + string text = string.Format(format, args); + + this.LogString( LogLevel.DebugLog , text ); + } + + public void LogInfo(string format , params object[] args) + { + string text = string.Format(format, args); + + this.LogString( LogLevel.InfoLog , text ); + } + + public void LogWarn(string format , params object[] args) + { + string text = string.Format(format, args); + + this.LogString( LogLevel.WarningLog , text ); + } + + public void LogError(string format , params object[] args) + { + string text = string.Format(format, args); + + this.LogString( LogLevel.ErrorLog , text ); + } + + public void LogAlert(string format , params object[] args) + { + string text = string.Format(format, args); + + this.LogString( LogLevel.AlertLog , text ); + } + } +} \ No newline at end of file diff --git a/Handle/BNLowLevelILFunction.cs b/Handle/BNLowLevelILFunction.cs new file mode 100644 index 0000000..d0c5f5f --- /dev/null +++ b/Handle/BNLowLevelILFunction.cs @@ -0,0 +1,3269 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class LowLevelILFunction : AbstractSafeHandle + { + public bool IsSSAForm { get; } = false; + + internal LowLevelILFunction( + IntPtr handle , + bool owner , + bool ssa = false + ) : base(handle , owner) + { + this.IsSSAForm = ssa; + } + + internal static LowLevelILFunction? NewFromHandle( + IntPtr handle, + bool ssa = false + ) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new LowLevelILFunction( + NativeMethods.BNNewLowLevelILFunctionReference(handle) , + true, + ssa + ); + } + + internal static LowLevelILFunction MustNewFromHandle( + IntPtr handle, + bool ssa = false + ) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new LowLevelILFunction( + NativeMethods.BNNewLowLevelILFunctionReference(handle) , + true, + ssa + ); + } + + internal static LowLevelILFunction? TakeHandle( + IntPtr handle, + bool ssa = false + ) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new LowLevelILFunction(handle, true, ssa); + } + + internal static LowLevelILFunction MustTakeHandle( + IntPtr handle, + bool ssa = false + ) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new LowLevelILFunction(handle, true, ssa); + } + + internal static LowLevelILFunction? BorrowHandle( + IntPtr handle, + bool ssa = false + ) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new LowLevelILFunction(handle, false, ssa); + } + + internal static LowLevelILFunction MustBorrowHandle( + IntPtr handle, + bool ssa = false + ) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new LowLevelILFunction(handle, false , ssa); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeLowLevelILFunction(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + + public Function OwnerFunction + { + get + { + return Function.MustTakeHandle( + NativeMethods.BNGetLowLevelILOwnerFunction(this.handle) + ); + } + } + + public Architecture Architecture + { + get + { + return this.OwnerFunction.Architecture; + } + } + + public ulong InstructionCount + { + get + { + return NativeMethods.BNGetLowLevelILInstructionCount(this.handle); + } + } + + public LowLevelILInstruction? GetExpression(LowLevelILExpressionIndex expr) + { + if ( (ulong)expr >= this.ExpressionCount) + { + return null; + } + + return LowLevelILInstruction.FromExpressionIndex( + this, + expr + ); + } + + public LowLevelILInstruction MustGetExpression(LowLevelILExpressionIndex expr) + { + if ( (ulong)expr >= this.ExpressionCount) + { + throw new IndexOutOfRangeException(nameof(expr)); + } + + return LowLevelILInstruction.FromExpressionIndex( + this, + expr + ); + } + + public LowLevelILInstruction? GetInstruction(LowLevelILInstructionIndex instr) + { + if ( (ulong)instr >= this.InstructionCount) + { + return null; + } + + LowLevelILExpressionIndex expr = NativeMethods.BNGetLowLevelILIndexForInstruction( + this.handle, + instr + ); + + return this.GetExpression(expr); + } + + public LowLevelILInstruction MustGetInstruction(LowLevelILInstructionIndex instr) + { + if ( (ulong)instr >= this.InstructionCount) + { + throw new IndexOutOfRangeException(nameof(instr)); + } + + LowLevelILExpressionIndex expr = NativeMethods.BNGetLowLevelILIndexForInstruction( + this.handle, + instr + ); + + return this.MustGetExpression(expr); + } + + public LowLevelILInstruction[] MustGetExpressions(LowLevelILExpressionIndex[] indexes) + { + List instructions = new List(); + + foreach (LowLevelILExpressionIndex index in indexes) + { + instructions.Add( this.MustGetExpression(index) ); + } + + return instructions.ToArray(); + } + + public LowLevelILInstruction[] MustGetInstructions(LowLevelILInstructionIndex[] indexes) + { + List instructions = new List(); + + foreach (LowLevelILInstructionIndex index in indexes) + { + instructions.Add( this.MustGetInstruction(index) ); + } + + return instructions.ToArray(); + } + + + public LowLevelILInstruction this[LowLevelILInstructionIndex index] + { + get + { + return this.MustGetInstruction(index); + } + } + + public IEnumerable Instructions + { + get + { + foreach (LowLevelILBasicBlock basicBlock in BasicBlocks) + { + foreach (LowLevelILInstruction instruction in basicBlock.Instructions) + { + yield return instruction; + } + } + } + } + + public ulong ExpressionCount + { + get + { + return NativeMethods.BNGetLowLevelILExprCount(this.handle); + } + } + + public LowLevelILBasicBlock[] BasicBlocks + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetLowLevelILBasicBlockList( + this.handle, + out ulong arrayLength + ); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer , + arrayLength , + (_native) => LowLevelILBasicBlock.MustNewFromHandleEx(this, _native) , + NativeMethods.BNFreeBasicBlockList + ); + } + } + + public ulong CurrentAddress + { + get + { + return NativeMethods.BNLowLevelILGetCurrentAddress(this.handle); + } + + set + { + this.SetCurrentAddress(value); + } + } + + public void SetCurrentAddress(ulong address, Architecture? arch = null) + { + if (null == arch) + { + arch = this.OwnerFunction.Architecture; + } + + NativeMethods.BNLowLevelILSetCurrentAddress( + this.handle, + null == arch ? IntPtr.Zero : arch.DangerousGetHandle(), + address + ); + } + + public void SetCurrentSourceBlock(LowLevelILBasicBlock block) + { + NativeMethods.BNLowLevelILSetCurrentSourceBlock( + this.handle , + block.DangerousGetHandle() + ); + } + + public uint TemporaryRegisterCount + { + get + { + return NativeMethods.BNGetLowLevelILTemporaryRegisterCount(this.handle); + } + } + + public uint TemporaryFlagCount + { + get + { + return NativeMethods.BNGetLowLevelILTemporaryFlagCount(this.handle); + } + } + + public LowLevelILBasicBlock? GetBasicBlockForInstruction(LowLevelILInstructionIndex instruction) + { + return LowLevelILBasicBlock.TakeHandleEx( + this, + NativeMethods.BNGetLowLevelILBasicBlockForInstruction(this.handle , instruction) + ); + } + + public LowLevelILFunction SSAForm + { + get + { + if (this.IsSSAForm) + { + return this; + } + + return LowLevelILFunction.MustTakeHandle( + NativeMethods.BNGetLowLevelILSSAForm(this.handle), + true + ); + } + } + + public LowLevelILFunction NonSSAForm + { + get + { + if (this.IsSSAForm) + { + return LowLevelILFunction.MustTakeHandle( + NativeMethods.BNGetLowLevelILNonSSAForm(this.handle), + false + ); + } + else + { + return this; + } + } + } + + public MediumLevelILFunction? MediumLevelIL + { + get + { + return MediumLevelILFunction.TakeHandle( + NativeMethods.BNGetMediumLevelILForLowLevelIL(this.handle), + this.IsSSAForm + ); + } + } + + public MediumLevelILFunction? MappedMediumLevelIL + { + get + { + return MediumLevelILFunction.TakeHandle( + NativeMethods.BNGetMappedMediumLevelIL(this.handle), + this.IsSSAForm + ); + } + } + + public MediumLevelILFunction CreateMediumLevelIL(Architecture? arch = null) + { + if (null == arch) + { + arch = this.OwnerFunction.Architecture; + } + + return MediumLevelILFunction.MustTakeHandle( + + NativeMethods.BNCreateMediumLevelILFunction( + null == arch ? IntPtr.Zero : arch.DangerousGetHandle() , + this.OwnerFunction.DangerousGetHandle() , + this.handle + ) + ); + } + + public BinaryView View + { + get + { + return this.OwnerFunction.View; + } + } + + public FunctionGraphType GraphType + { + get + { + if (this.BasicBlocks.Length < 1) + { + return FunctionGraphType.InvalidILViewType; + } + + return NativeMethods.BNGetBasicBlockFunctionGraphType( + this.BasicBlocks[0].DangerousGetHandle() + ); + } + } + + public ILRegister[] Registers + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetLowLevelRegisters( + this.handle , + out ulong arrayLength + ); + + uint[] indexes = UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNFreeLLILVariablesList + ); + + List targets = new List(); + + foreach (RegisterIndex index in indexes) + { + targets.Add( new ILRegister(this.OwnerFunction.Architecture, index) ); + } + + return targets.ToArray(); + } + } + + public LowLevelILSSARegister[] SSARegisters + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetLowLevelSSARegistersWithoutVersions( + this.handle , + out ulong arrayLength + ); + + uint[] indexes = UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNFreeLLILVariablesList + ); + + List targets = new List(); + + foreach (RegisterIndex index in indexes) + { + ulong[] versions = this.GetRegisterSSAVersions(index); + + foreach (ulong version in versions) + { + ILRegister register = new ILRegister(this.OwnerFunction.Architecture, index); + + targets.Add( + new LowLevelILSSARegister(this, register, version) + ); + } + } + + return targets.ToArray(); + } + } + + public RegisterStack[] RegisterStacks + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetLowLevelRegisterStacks( + this.handle , + out ulong arrayLength + ); + + uint[] indexes = UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNFreeLLILVariablesList + ); + + List targets = new List(); + + foreach (RegisterStackIndex index in indexes) + { + targets.Add( new RegisterStack(this.OwnerFunction.Architecture, index) ); + } + + return targets.ToArray(); + } + } + + public SSARegisterStack[] SSARegisterStacks + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetLowLevelSSARegisterStacksWithoutVersions( + this.handle , + out ulong arrayLength + ); + + uint[] indexes = UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNFreeLLILVariablesList + ); + + List targets = new List(); + + foreach (RegisterStackIndex index in indexes) + { + ulong[] versions = this.GetRegisterStackSSAVersions(index); + + foreach (ulong version in versions) + { + RegisterStack registerStack = new RegisterStack(this.OwnerFunction.Architecture, index); + + targets.Add( + new SSARegisterStack(registerStack, version) + ); + } + } + + return targets.ToArray(); + } + } + + public ILFlag[] Flags + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetLowLevelFlags( + this.handle , + out ulong arrayLength + ); + + uint[] indexes = UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNFreeLLILVariablesList + ); + + List targets = new List(); + + foreach (FlagIndex index in indexes) + { + targets.Add( new ILFlag(this.OwnerFunction.Architecture, index) ); + } + + return targets.ToArray(); + } + } + + public LowLevelILSSAFlag[] SSAFlags + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetLowLevelSSAFlagsWithoutVersions( + this.handle , + out ulong arrayLength + ); + + uint[] indexes = UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNFreeLLILVariablesList + ); + + List targets = new List(); + + foreach (FlagIndex index in indexes) + { + ulong[] versions = this.GetFlagSSAVersions(index); + + foreach (ulong version in versions) + { + ILFlag flag = new ILFlag(this.OwnerFunction.Architecture, index); + + targets.Add( + new LowLevelILSSAFlag(this , flag, version) + ); + } + } + + return targets.ToArray(); + } + } + + public ulong[] GetRegisterSSAVersions(RegisterIndex register) + { + IntPtr arrayPointer = NativeMethods.BNGetLowLevelRegisterSSAVersions( + this.handle , + register, + out ulong arrayLength + ); + + return UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNFreeLLILVariableVersionList + ); + } + + public ulong[] GetRegisterStackSSAVersions(RegisterStackIndex registerStack) + { + IntPtr arrayPointer = NativeMethods.BNGetLowLevelRegisterStackSSAVersions( + this.handle , + registerStack, + out ulong arrayLength + ); + + return UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNFreeLLILVariableVersionList + ); + } + + public ulong[] GetFlagSSAVersions(FlagIndex flag) + { + IntPtr arrayPointer = NativeMethods.BNGetLowLevelFlagSSAVersions( + this.handle , + flag, + out ulong arrayLength + ); + + return UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNFreeLLILVariableVersionList + ); + } + + public ulong[] MemoryVersions + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetLowLevelMemoryVersions( + this.handle , + out ulong arrayLength + ); + + return UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNFreeLLILVariableVersionList + ); + } + } + + public LowLevelILInstruction? GetInstructionStart(ulong address, Architecture? arch = null) + { + if (null == arch) + { + arch = this.Architecture; + } + + LowLevelILInstructionIndex index = NativeMethods.BNLowLevelILGetInstructionStart( + this.handle , + null == arch ? IntPtr.Zero : arch.DangerousGetHandle(), + address + ); + + if ( (ulong)index >= this.InstructionCount) + { + return null; + } + + return this.MustGetInstruction(index); + } + + public LowLevelILInstruction[] GetInstructionsAt(ulong address, Architecture? arch = null) + { + if (null == arch) + { + arch = this.Architecture; + } + + IntPtr arrayPointer = NativeMethods.BNLowLevelILGetInstructionsAt( + this.handle , + null == arch ? IntPtr.Zero : arch.DangerousGetHandle(), + address, + out ulong arrayLength + ); + + LowLevelILInstructionIndex[] indexes = UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNFreeILInstructionList + ); + + return this.MustGetInstructions(indexes); + } + + public LowLevelILInstruction? CurrentInstruction + { + get + { + return this.GetInstructionStart(this.CurrentAddress); + } + } + + public void ClearIndirectBranches() + { + NativeMethods.BNLowLevelILClearIndirectBranches(this.handle); + } + + public void SetIndirectBranches(ArchitectureAndAddress[] branches) + { + NativeMethods.BNLowLevelILSetIndirectBranches( + this.handle , + UnsafeUtils.ConvertToNativeArray( + branches + ), + (ulong)branches.Length + ); + } + + public LowLevelILExpressionIndex CopyExpression(LowLevelILInstruction original) + { + return this.AddExpression( + original.Operation , + new SourceLocation(original.Address , original.SourceOperand) , + original.Size , + original.Flags , + original.RawOperands + ); + } + + public void UpdateExpression( + LowLevelILInstructionIndex instruction, + OperandIndex operand, + ulong value + ) + { + NativeMethods.BNUpdateLowLevelILOperand( + this.handle , + instruction , + operand, + value + ); + } + + public void ReplaceExpression(LowLevelILExpressionIndex oldExpr , LowLevelILExpressionIndex newExpr) + { + NativeMethods.BNReplaceLowLevelILExpr(this.handle , oldExpr , newExpr); + } + + public void ReplaceExpression(LowLevelILInstruction oldExpr , LowLevelILInstruction newExpr) + { + NativeMethods.BNReplaceLowLevelILExpr( + this.handle , + oldExpr.ExpressionIndex , + newExpr.ExpressionIndex + ); + } + + public void ReplaceExpression(LowLevelILExpressionIndex oldExpr , LowLevelILInstruction newExpr) + { + NativeMethods.BNReplaceLowLevelILExpr( + this.handle , + oldExpr , + newExpr.ExpressionIndex + ); + } + + public void ReplaceExpression(LowLevelILInstruction oldExpr , LowLevelILExpressionIndex newExpr) + { + NativeMethods.BNReplaceLowLevelILExpr( + this.handle , + oldExpr.ExpressionIndex , + newExpr + ); + } + + + + public void SetExpressionAttributes(LowLevelILExpressionIndex expression , uint attributes ) + { + NativeMethods.BNSetLowLevelILExprAttributes( + this.handle, + expression, + attributes + ); + } + + public LowLevelILInstructionIndex AddInstruction(LowLevelILExpressionIndex expression ) + { + return NativeMethods.BNLowLevelILAddInstruction( + this.handle, + expression + ); + } + + public void MarkLabel(LowLevelILLabel label) + { + NativeMethods.BNLowLevelILMarkLabel(this.handle, label.ToNative()); + } + + public LowLevelILExpressionIndex AddLabelMap(IDictionary labelMap) + { + return NativeMethods.BNLowLevelILAddLabelMap( + this.handle , + labelMap.Keys.ToArray(), + UnsafeUtils.ConvertToNativeArray( + labelMap.Values.ToArray() + ) , + (ulong)labelMap.Count + ); + } + + public LowLevelILExpressionIndex AddOperandList(ulong[] operands) + { + return NativeMethods.BNLowLevelILAddOperandList( + this.handle , + operands , + (ulong)operands.Length + ); + } + + public LowLevelILExpressionIndex AddOperandList(LowLevelILExpressionIndex[] operands) + { + List targets = new List(); + + foreach (LowLevelILExpressionIndex operand in operands) + { + targets.Add( (ulong)operand); + } + + return NativeMethods.BNLowLevelILAddOperandList( + this.handle , + targets.ToArray() , + (ulong)targets.Count + ); + } + + public LowLevelILPossibleValueSetCacheIndex CachePossibleValueSet(PossibleValueSet pvs) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + return NativeMethods.BNCacheLowLevelILPossibleValueSet( + this.handle , + pvs.ToNativeEx(allocator) + ); + } + } + + public PossibleValueSet GetCachedPossibleValueSet(LowLevelILPossibleValueSetCacheIndex index) + { + return PossibleValueSet.TakeNative( + NativeMethods.BNGetCachedLowLevelILPossibleValueSet( + this.DangerousGetHandle() , + index + ) + ); + } + + public void SetExpressionSourceOperand(LowLevelILExpressionIndex expression , uint operand) + { + NativeMethods.BNLowLevelILSetExprSourceOperand( + this.handle, + expression, + operand + ); + } + + public void FinalizeLowLevelILFunction() + { + NativeMethods.BNFinalizeLowLevelILFunction(this.handle); + } + + public void GenerateSSAForm() + { + NativeMethods.BNGenerateLowLevelILSSAForm(this.handle); + } + + public InstructionTextToken[] GetExpressionText( + LowLevelILExpressionIndex expression, + Architecture? arch = null, + DisassemblySettings? settings = null + ) + { + NativeMethods.BNGetLowLevelILExprText( + this.handle, + null == arch ? IntPtr.Zero : arch.DangerousGetHandle(), + expression, + null == settings ? IntPtr.Zero : settings.DangerousGetHandle(), + out IntPtr arrayPointer, + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + InstructionTextToken.FromNative , + NativeMethods.BNFreeInstructionText + ); + } + + public InstructionTextToken[] GetInstructionText( + LowLevelILInstructionIndex instruction, + Architecture? arch = null, + DisassemblySettings? settings = null + ) + { + NativeMethods.BNGetLowLevelILInstructionText( + this.handle, + this.OwnerFunction.DangerousGetHandle(), + null == arch ? IntPtr.Zero : arch.DangerousGetHandle(), + instruction, + null == settings ? IntPtr.Zero : settings.DangerousGetHandle(), + out IntPtr arrayPointer, + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + InstructionTextToken.FromNative , + NativeMethods.BNFreeInstructionText + ); + } + + public void PrepareToCopyFunction(LowLevelILFunction il) + { + NativeMethods.BNPrepareToCopyLowLevelILFunction( + this.handle, + il.DangerousGetHandle() + ); + } + + public void PrepareToCopyBasicBlock(LowLevelILBasicBlock basicBlock) + { + NativeMethods.BNPrepareToCopyLowLevelILBasicBlock( + this.handle, + basicBlock.DangerousGetHandle() + ); + } + + public LowLevelILLabel? GetLabelForSourceInstruction(LowLevelILInstructionIndex instr) + { + return LowLevelILLabel.FromNativePointer( + NativeMethods.BNGetLabelForLowLevelILSourceInstruction( + this.DangerousGetHandle() , + instr + ) + ); + } + + public void AddLabelForAddress(ulong address , Architecture? arch = null) + { + if (null == arch) + { + arch = this.Architecture; + } + + NativeMethods.BNAddLowLevelILLabelForAddress( + this.DangerousGetHandle() , + null == arch ? IntPtr.Zero : arch.DangerousGetHandle() , + address + ); + } + + public LowLevelILLabel? GetLabelForAddress(ulong address , Architecture? arch = null) + { + if (null == arch) + { + arch = this.Architecture; + } + + return LowLevelILLabel.FromNativePointer( + + NativeMethods.BNGetLowLevelILLabelForAddress( + this.DangerousGetHandle() , + null == arch ? IntPtr.Zero : arch.DangerousGetHandle() , + address + ) + ); + } + + public LowLevelILInstructionIndex GetSSAInstructionIndex(LowLevelILInstructionIndex instr ) + { + return NativeMethods.BNGetLowLevelILSSAInstructionIndex( + this.handle , + instr + ); + } + + public LowLevelILInstructionIndex GetNonSSAInstructionIndex(LowLevelILInstructionIndex instr ) + { + return NativeMethods.BNGetLowLevelILNonSSAInstructionIndex( + this.handle , + instr + ); + } + + public LowLevelILExpressionIndex GetSSAExpressionIndex(LowLevelILExpressionIndex expression ) + { + return NativeMethods.BNGetLowLevelILSSAExprIndex( + this.handle , + expression + ); + } + + public LowLevelILExpressionIndex GetNonSSAExpressionIndex(LowLevelILExpressionIndex expression ) + { + return NativeMethods.BNGetLowLevelILNonSSAExprIndex( + this.handle , + expression + ); + } + + public LowLevelILInstruction? GetSSARegisterDefinition(RegisterIndex register , ulong vesion ) + { + LowLevelILInstructionIndex index = NativeMethods.BNGetLowLevelILSSARegisterDefinition( + this.handle , + register , + vesion + ); + + if ((ulong)index >= this.InstructionCount) + { + return null; + } + + return this.MustGetInstruction(index); + } + + public LowLevelILInstruction? GetSSAFlagDefinition(FlagIndex flag , ulong vesion ) + { + LowLevelILInstructionIndex index = NativeMethods.BNGetLowLevelILSSAFlagDefinition( + this.handle , + flag , + vesion + ); + + if ((ulong)index >= this.InstructionCount) + { + return null; + } + + return this.MustGetInstruction(index); + } + + public LowLevelILInstruction? GetSSAMemoryDefinition(ulong vesion ) + { + LowLevelILInstructionIndex index = NativeMethods.BNGetLowLevelILSSAMemoryDefinition( + this.handle , + vesion + ); + + if ((ulong)index >= this.InstructionCount) + { + return null; + } + + return this.MustGetInstruction(index); + } + + public LowLevelILInstruction[] GetSSARegisterUses(RegisterIndex register , ulong vesion ) + { + IntPtr arrayPointer = NativeMethods.BNGetLowLevelILSSARegisterUses( + this.handle , + register , + vesion, + out ulong arrayLength + ); + + if (0 == arrayLength) + { + return Array.Empty(); + } + + ulong[] indices = UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNFreeILInstructionList + ); + + List instructions = new List(); + + foreach (LowLevelILInstructionIndex index in indices) + { + instructions.Add( this.MustGetInstruction( index ) ); + } + + return instructions.ToArray(); + } + + public LowLevelILInstruction[] GetSSAFlagUses(FlagIndex flag , ulong vesion ) + { + IntPtr arrayPointer = NativeMethods.BNGetLowLevelILSSAFlagUses( + this.handle , + flag , + vesion, + out ulong arrayLength + ); + + if (0 == arrayLength) + { + return Array.Empty(); + } + + ulong[] indices = UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNFreeILInstructionList + ); + + List instructions = new List(); + + foreach (LowLevelILInstructionIndex index in indices) + { + instructions.Add( this.MustGetInstruction( index ) ); + } + + return instructions.ToArray(); + } + + public LowLevelILInstruction[] GetSSAMemoryUses(ulong vesion ) + { + IntPtr arrayPointer = NativeMethods.BNGetLowLevelILSSAMemoryUses( + this.handle , + vesion, + out ulong arrayLength + ); + + if (0 == arrayLength) + { + return Array.Empty(); + } + + ulong[] indices = UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNFreeILInstructionList + ); + + List instructions = new List(); + + foreach (LowLevelILInstructionIndex index in indices) + { + instructions.Add( this.MustGetInstruction( index ) ); + } + + return instructions.ToArray(); + } + + public RegisterValue GetSSARegisterValue(RegisterIndex register , ulong vesion) + { + return RegisterValue.FromNative( + NativeMethods.BNGetLowLevelILSSARegisterValue( + this.handle , + register, + vesion + ) + ); + } + + public RegisterValue GetSSAFlagValue(FlagIndex flag , ulong vesion) + { + return RegisterValue.FromNative( + NativeMethods.BNGetLowLevelILSSAFlagValue( + this.handle , + flag, + vesion + ) + ); + } + + public RegisterValue GetExpressionValue(LowLevelILExpressionIndex expressionIndex) + { + return RegisterValue.FromNative( + NativeMethods.BNGetLowLevelILExprValue(this.handle , expressionIndex) + ); + } + + public RegisterValue GetRegisterValueAtInstruction( + RegisterIndex register, + LowLevelILInstructionIndex instruction + ) + { + return RegisterValue.FromNative( + NativeMethods.BNGetLowLevelILRegisterValueAtInstruction( + this.handle , + register, + instruction + ) + ); + } + + public RegisterValue GetRegisterValueAfteInstruction( + uint registerIndex, + LowLevelILInstructionIndex instruction + ) + { + return RegisterValue.FromNative( + NativeMethods.BNGetLowLevelILRegisterValueAfterInstruction( + this.handle , + registerIndex, + instruction + ) + ); + } + + public LowLevelILInstructionIndex? GetInstructionIndexForExpressionIndex(LowLevelILExpressionIndex expressionIndex) + { + LowLevelILInstructionIndex index = NativeMethods.BNGetLowLevelILInstructionForExpr(this.handle , expressionIndex); + + if ((ulong)index >= this.InstructionCount) + { + return null; + } + + return index; + } + + public LowLevelILExpressionIndex? GetExpressionIndexForInstructionIndex(LowLevelILInstructionIndex instructionIndex) + { + LowLevelILExpressionIndex index = NativeMethods.BNGetLowLevelILIndexForInstruction(this.handle , instructionIndex); + + if ((ulong)index >= this.ExpressionCount) + { + return null; + } + + return index; + } + + // medium + public MediumLevelILInstruction? GetMediumLevelILExpression( + LowLevelILExpressionIndex lowExpr + ) + { + MediumLevelILFunction? mlil = this.MediumLevelIL; + + if (null == mlil) + { + return null; + } + + MediumLevelILExpressionIndex mediumExpr = NativeMethods.BNGetMediumLevelILExprIndex( + this.handle , + lowExpr + ); + + if ((ulong)mediumExpr >= mlil.ExpressionCount) + { + return null; + } + + return mlil.GetExpression(mediumExpr); + } + + public MediumLevelILInstruction? GetMediumLevelILInstruction( + LowLevelILInstructionIndex lowInstr + ) + { + MediumLevelILFunction? mlil = this.MediumLevelIL; + + if (null == mlil) + { + return null; + } + + MediumLevelILInstructionIndex mediumInstr = NativeMethods.BNGetMediumLevelILInstructionIndex( + this.handle , + lowInstr + ); + + if ((ulong)mediumInstr >= mlil.InstructionCount) + { + return null; + } + + return mlil.GetInstruction(mediumInstr); + } + + public MediumLevelILInstruction[] GetMediumLevelILExpressions( + LowLevelILExpressionIndex lowExpr) + { + MediumLevelILFunction? mlil = this.MediumLevelIL; + + if (null == mlil) + { + return Array.Empty(); + } + + IntPtr arrayPointer = NativeMethods.BNGetMediumLevelILExprIndexes( + this.handle , + lowExpr, + out ulong arrayLength + ); + + MediumLevelILExpressionIndex[] mediumExprs = UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNFreeILInstructionList + ); + + return mlil.MustGetExpressions(mediumExprs); + } + + // mapped + public MediumLevelILInstruction? GetMappedMediumLevelILExpression( + LowLevelILExpressionIndex lowExpr + ) + { + MediumLevelILFunction? mlil = this.MappedMediumLevelIL; + + if (null == mlil) + { + return null; + } + + MediumLevelILExpressionIndex mediumExpr = NativeMethods.BNGetMappedMediumLevelILExprIndex( + this.handle , + lowExpr + ); + + if ((ulong)mediumExpr >= mlil.ExpressionCount) + { + return null; + } + + return mlil.GetExpression(mediumExpr); + } + + public MediumLevelILInstruction? GetMappedMediumLevelILInstruction( + LowLevelILInstructionIndex lowInstr + ) + { + MediumLevelILFunction? mlil = this.MappedMediumLevelIL; + + if (null == mlil) + { + return null; + } + + MediumLevelILInstructionIndex mediumInstr = NativeMethods.BNGetMappedMediumLevelILInstructionIndex( + this.handle , + lowInstr + ); + + if ((ulong)mediumInstr >= mlil.InstructionCount) + { + return null; + } + + return mlil.GetInstruction(mediumInstr); + } + + // high + public HighLevelILInstruction? GetHighLevelILExpression( + LowLevelILExpressionIndex lowExpr + ) + { + MediumLevelILFunction? mlil = this.MediumLevelIL; + + if (null == mlil) + { + return null; + } + + MediumLevelILExpressionIndex mediumExpr = NativeMethods.BNGetMediumLevelILExprIndex( + this.handle , + lowExpr + ); + + if ((ulong)mediumExpr >= mlil.ExpressionCount) + { + return null; + } + + return mlil.GetHighLevelILExpression(mediumExpr); + } + + public HighLevelILInstruction[] GetHighLevelILExpressions( + LowLevelILExpressionIndex lowExpr + ) + { + MediumLevelILFunction? mlil = this.MediumLevelIL; + + if (null == mlil) + { + return Array.Empty(); + } + + HashSet highExprs = new HashSet(); + + MediumLevelILInstruction[] mediumExprs = this.GetMediumLevelILExpressions(lowExpr); + + foreach (MediumLevelILInstruction mediumExpr in mediumExprs) + { + foreach (HighLevelILInstruction highExpr in mediumExpr.HighLevelILExpressions) + { + highExprs.Add(highExpr); + } + } + + return highExprs.ToArray(); + } + + public HighLevelILInstruction? GetHighLevelILInstruction( + LowLevelILInstructionIndex lowInst + ) + { + MediumLevelILFunction? mlil = this.MediumLevelIL; + + if (null == mlil) + { + return null; + } + + MediumLevelILInstructionIndex mediumInst = NativeMethods.BNGetMediumLevelILInstructionIndex( + this.handle , + lowInst + ); + + if ((ulong)mediumInst >= mlil.InstructionCount) + { + return null; + } + + return mlil.GetHighLevelILInstruction(mediumInst); + } + + public LowLevelILFlowGraph? CreateGraph(DisassemblySettings? settings = null) + { + return LowLevelILFlowGraph.TakeHandleEx( + this, + NativeMethods.BNCreateLowLevelILFunctionGraph( + this.handle , + null == settings ? IntPtr.Zero : settings.DangerousGetHandle() + ) + ); + } + + public LowLevelILFlowGraph? CreateImmediateGraph(DisassemblySettings? settings = null) + { + return LowLevelILFlowGraph.TakeHandleEx( + this, + NativeMethods.BNCreateLowLevelILImmediateFunctionGraph( + this.handle , + null == settings ? IntPtr.Zero : settings.DangerousGetHandle() + ) + ); + } + + + public LowLevelILExpressionIndex AddExpression( + LowLevelILOperation operation , + SourceLocation? location = null, + ulong size = 0 , + uint flags = 0, + params ulong[] operands + ) + { + ulong a = 0; + ulong b = 0; + ulong c = 0; + ulong d = 0; + + if (operands.Length > 0) + { + a = operands[0]; + } + + if (operands.Length > 1) + { + b = operands[1]; + } + + if (operands.Length > 2) + { + c = operands[2]; + } + + if (operands.Length > 3) + { + d = operands[3]; + } + + if (null == location) + { + return NativeMethods.BNLowLevelILAddExpr( + this.handle , + operation, + size , + flags, + a, + b , + c , + d + ); + } + else + { + return NativeMethods.BNLowLevelILAddExprWithLocation( + this.handle , + location.Address, + location.Operand, + operation, + size , + flags, + a, + b , + c , + d + ); + } + } + + public LowLevelILExpressionIndex EmitNop(SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_NOP , + location + ); + } + + public LowLevelILExpressionIndex EmitSetRegister( + ulong size , + RegisterIndex register, + LowLevelILExpressionIndex value , + FlagIndex? flag = null, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_SET_REG , + location, + size, + null == flag ? 0 : (uint)flag, + (ulong)register + ); + } + + public LowLevelILExpressionIndex EmitSetRegisterSplit( + ulong size , + RegisterIndex high, + RegisterIndex low, + LowLevelILExpressionIndex value , + FlagIndex? flag = null, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_SET_REG_SPLIT , + location, + size, + null == flag ? 0 : (uint)flag, + (ulong)high, + (ulong)low + ); + } + + public LowLevelILExpressionIndex EmitSetRegisterStackRelative( + ulong size , + RegisterStackIndex registerStack, + LowLevelILExpressionIndex entry , + LowLevelILExpressionIndex value , + FlagIndex? flag = null, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_SET_REG_STACK_REL , + location, + size, + null == flag ? 0 : (uint)flag, + (ulong)registerStack, + (ulong)entry, + (ulong)value + ); + } + + public LowLevelILExpressionIndex EmitSetRegisterStackPush( + ulong size , + RegisterStackIndex registerStack, + LowLevelILExpressionIndex value , + FlagIndex? flag = null, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_REG_STACK_PUSH , + location, + size, + null == flag ? 0 : (uint)flag, + (ulong)registerStack, + (ulong)value + ); + } + + public LowLevelILExpressionIndex EmitSetFlag( + ulong size , + FlagIndex flag, + LowLevelILExpressionIndex value , + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_SET_FLAG , + location, + size, + (uint)flag, + (ulong)value + ); + } + + public LowLevelILExpressionIndex EmitAssert( + ulong size , + RegisterIndex source, + PossibleValueSet constraint, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_ASSERT , + location, + size, + 0, + (ulong)source, + (ulong)this.CachePossibleValueSet(constraint) + ); + } + + public LowLevelILExpressionIndex EmitForceVersion( + ulong size , + RegisterIndex destination, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_FORCE_VER , + location, + size, + (uint)0, + (ulong)destination + ); + } + + public LowLevelILExpressionIndex EmitLoad( + ulong size , + LowLevelILExpressionIndex address, + FlagIndex? flag = null, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_LOAD , + location, + size, + null == flag ? 0 : (uint)flag, + (ulong)address + ); + } + + public LowLevelILExpressionIndex EmitStore( + ulong size , + LowLevelILExpressionIndex address, + LowLevelILExpressionIndex value, + FlagIndex? flag = null, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_STORE , + location, + size, + null == flag ? 0 : (uint)flag, + (ulong)address, + (ulong)value + ); + } + + public LowLevelILExpressionIndex EmitPush( + ulong size , + LowLevelILExpressionIndex value, + FlagIndex? flag = null, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_PUSH , + location, + size, + null == flag ? 0 : (uint)flag, + (ulong)value + ); + } + + public LowLevelILExpressionIndex EmitPop( + ulong size , + FlagIndex? flag = null, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_POP , + location, + size, + null == flag ? 0 : (uint)flag + ); + } + + public LowLevelILExpressionIndex EmitRegister( + ulong size , + RegisterIndex register, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_REG , + location, + size, + 0, + (ulong)register + ); + } + + public LowLevelILExpressionIndex EmitRegisterSplit( + ulong size , + RegisterIndex high, + RegisterIndex low, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_REG_SPLIT , + location, + size, + 0, + (ulong)high, + (ulong)low + ); + } + + public LowLevelILExpressionIndex EmitRegisterStackRelative( + ulong size , + RegisterStackIndex registerStack, + LowLevelILInstructionIndex entry, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_REG_STACK_REL , + location, + size, + 0, + (ulong)registerStack, + (ulong)entry + ); + } + + public LowLevelILExpressionIndex EmitRegisterStackPop( + ulong size , + RegisterStackIndex registerStack, + FlagIndex? flag = null, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_REG_STACK_POP , + location, + size, + null == flag ? 0 : (uint)flag, + (ulong)registerStack + ); + } + + public LowLevelILExpressionIndex EmitRegisterStackFreeRegister( + ulong size , + RegisterIndex register, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_REG_STACK_FREE_REG , + location, + size, + 0, + (ulong)register + ); + } + + public LowLevelILExpressionIndex EmitRegisterStackFreeRelative( + ulong size , + RegisterStackIndex registerStack, + LowLevelILInstructionIndex entry, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_REG_STACK_FREE_REL , + location, + size, + 0, + (ulong)registerStack, + (ulong)entry + ); + } + + + public LowLevelILExpressionIndex EmitConst( + ulong size , + ulong value, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_CONST , + location, + size, + 0, + value + ); + } + + public LowLevelILExpressionIndex EmitConstPointer( + ulong size , + ulong value, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_CONST_PTR , + location, + size, + 0, + value + ); + } + + public LowLevelILExpressionIndex EmitExternPointer( + ulong size , + ulong value, + ulong offset, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_EXTERN_PTR , + location, + size, + 0, + value, + offset + ); + } + + public LowLevelILExpressionIndex EmitRawConstFloat( + ulong size , + ulong value, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_FLOAT_CONST , + location, + size, + 0, + value + ); + } + + public LowLevelILExpressionIndex EmitConstFloat( + ulong size , + float value, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_FLOAT_CONST , + location, + size, + 0, + (ulong)BitConverter.SingleToUInt32Bits(value) + ); + } + + public LowLevelILExpressionIndex EmitConstDouble( + ulong size , + double value, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_FLOAT_CONST , + location, + size, + 0, + (ulong)BitConverter.DoubleToUInt64Bits(value) + ); + } + + public LowLevelILExpressionIndex EmitFlag( + ulong size , + FlagIndex flag, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_FLAG , + location, + size, + 0, + (ulong)flag + ); + } + + public LowLevelILExpressionIndex EmitFlagBit( + ulong size , + FlagIndex flag, + ulong bit, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_FLAG_BIT , + location, + size, + 0, + (ulong)flag, + bit + ); + } + + public LowLevelILExpressionIndex EmitAdd( + ulong size , + LowLevelILExpressionIndex a, + LowLevelILExpressionIndex b, + ILFlag? flag = null, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_ADD , + location, + size, + null == flag ? 0 : (uint)flag.Index, + (ulong)a, + (ulong)b + ); + } + + public LowLevelILExpressionIndex EmitAddCarray( + ulong size , + LowLevelILExpressionIndex a, + LowLevelILExpressionIndex b, + LowLevelILExpressionIndex carray, + ILFlag? flag = null, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_ADC , + location, + size, + null == flag ? 0 : (uint)flag.Index, + (ulong)a, + (ulong)b, + (ulong)carray + ); + } + + public LowLevelILExpressionIndex EmitSub( + ulong size , + LowLevelILExpressionIndex a, + LowLevelILExpressionIndex b, + ILFlag? flag = null, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_SUB , + location, + size, + null == flag ? 0 : (uint)flag.Index, + (ulong)a, + (ulong)b + ); + } + + public LowLevelILExpressionIndex EmitSubBorrow( + ulong size , + LowLevelILExpressionIndex a, + LowLevelILExpressionIndex b, + LowLevelILExpressionIndex carray, + ILFlag? flag = null, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_SBB , + location, + size, + null == flag ? 0 : (uint)flag.Index, + (ulong)a, + (ulong)b, + (ulong)carray + ); + } + + + public LowLevelILExpressionIndex EmitAnd( + ulong size , + LowLevelILExpressionIndex a, + LowLevelILExpressionIndex b, + ILFlag? flag = null, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_AND , + location, + size, + null == flag ? 0 : (uint)flag.Index, + (ulong)a, + (ulong)b + ); + } + + public LowLevelILExpressionIndex EmitOr( + ulong size , + LowLevelILExpressionIndex a, + LowLevelILExpressionIndex b, + ILFlag? flag = null, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_OR , + location, + size, + null == flag ? 0 : (uint)flag.Index, + (ulong)a, + (ulong)b + ); + } + + public LowLevelILExpressionIndex EmitXor( + ulong size , + LowLevelILExpressionIndex a, + LowLevelILExpressionIndex b, + ILFlag? flag = null, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_XOR , + location, + size, + null == flag ? 0 : (uint)flag.Index, + (ulong)a, + (ulong)b + ); + } + + public LowLevelILExpressionIndex EmitLogicalShiftLeft( + ulong size , + LowLevelILExpressionIndex a, + LowLevelILExpressionIndex b, + ILFlag? flag = null, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_LSL , + location, + size, + null == flag ? 0 : (uint)flag.Index, + (ulong)a, + (ulong)b + ); + } + + public LowLevelILExpressionIndex EmitLogicalShiftRight( + ulong size , + LowLevelILExpressionIndex a, + LowLevelILExpressionIndex b, + ILFlag? flag = null, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_LSR , + location, + size, + null == flag ? 0 : (uint)flag.Index, + (ulong)a, + (ulong)b + ); + } + + public LowLevelILExpressionIndex EmitArithmeticShiftRight( + ulong size , + LowLevelILExpressionIndex a, + LowLevelILExpressionIndex b, + ILFlag? flag = null, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_ASR , + location, + size, + null == flag ? 0 : (uint)flag.Index, + (ulong)a, + (ulong)b + ); + } + + public LowLevelILExpressionIndex EmitRotateLeft( + ulong size , + LowLevelILExpressionIndex a, + LowLevelILExpressionIndex b, + ILFlag? flag = null, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_ROL , + location, + size, + null == flag ? 0 : (uint)flag.Index, + (ulong)a, + (ulong)b + ); + } + + public LowLevelILExpressionIndex EmitRotateLeftCarray( + ulong size , + LowLevelILExpressionIndex a, + LowLevelILExpressionIndex b, + LowLevelILExpressionIndex carray, + ILFlag? flag = null, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_RLC , + location, + size, + null == flag ? 0 : (uint)flag.Index, + (ulong)a, + (ulong)b, + (ulong)carray + ); + } + + public LowLevelILExpressionIndex EmitRotateRight( + ulong size , + LowLevelILExpressionIndex a, + LowLevelILExpressionIndex b, + ILFlag? flag = null, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_ROR , + location, + size, + null == flag ? 0 : (uint)flag.Index, + (ulong)a, + (ulong)b + ); + } + + public LowLevelILExpressionIndex EmitRotateRightCarray( + ulong size , + LowLevelILExpressionIndex a, + LowLevelILExpressionIndex b, + LowLevelILExpressionIndex carray, + ILFlag? flag = null, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_RRC , + location, + size, + null == flag ? 0 : (uint)flag.Index, + (ulong)a, + (ulong)b, + (ulong)carray + ); + } + + public LowLevelILExpressionIndex EmitMul( + ulong size , + LowLevelILExpressionIndex a, + LowLevelILExpressionIndex b, + ILFlag? flag = null, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_MUL , + location, + size, + null == flag ? 0 : (uint)flag.Index, + (ulong)a, + (ulong)b + ); + } + + public LowLevelILExpressionIndex EmitMulSignedDoublePrecision( + ulong size , + LowLevelILExpressionIndex a, + LowLevelILExpressionIndex b, + ILFlag? flag = null, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_MULS_DP , + location, + size, + null == flag ? 0 : (uint)flag.Index, + (ulong)a, + (ulong)b + ); + } + + public LowLevelILExpressionIndex EmitMulUnsignedDoublePrecision( + ulong size , + LowLevelILExpressionIndex a, + LowLevelILExpressionIndex b, + ILFlag? flag = null, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_MULU_DP , + location, + size, + null == flag ? 0 : (uint)flag.Index, + (ulong)a, + (ulong)b + ); + } + + public LowLevelILExpressionIndex EmitDivSigned( + ulong size , + LowLevelILExpressionIndex a, + LowLevelILExpressionIndex b, + ILFlag? flag = null, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_DIVS , + location, + size, + null == flag ? 0 : (uint)flag.Index, + (ulong)a, + (ulong)b + ); + } + + public LowLevelILExpressionIndex EmitDivSignedDoublePrecision( + ulong size , + LowLevelILExpressionIndex a, + LowLevelILExpressionIndex b, + ILFlag? flag = null, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_DIVS_DP , + location, + size, + null == flag ? 0 : (uint)flag.Index, + (ulong)a, + (ulong)b + ); + } + + public LowLevelILExpressionIndex EmitDivUnsigned( + ulong size , + LowLevelILExpressionIndex a, + LowLevelILExpressionIndex b, + ILFlag? flag = null, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_DIVU , + location, + size, + null == flag ? 0 : (uint)flag.Index, + (ulong)a, + (ulong)b + ); + } + + public LowLevelILExpressionIndex EmitDivUnsignedDoublePrecision( + ulong size , + LowLevelILExpressionIndex a, + LowLevelILExpressionIndex b, + ILFlag? flag = null, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_DIVU_DP , + location, + size, + null == flag ? 0 : (uint)flag.Index, + (ulong)a, + (ulong)b + ); + } + + + + public LowLevelILExpressionIndex EmitModSigned( + ulong size , + LowLevelILExpressionIndex a, + LowLevelILExpressionIndex b, + ILFlag? flag = null, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_MODS , + location, + size, + null == flag ? 0 : (uint)flag.Index, + (ulong)a, + (ulong)b + ); + } + + public LowLevelILExpressionIndex EmitModSignedDoublePrecision( + ulong size , + LowLevelILExpressionIndex a, + LowLevelILExpressionIndex b, + ILFlag? flag = null, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_MODS_DP , + location, + size, + null == flag ? 0 : (uint)flag.Index, + (ulong)a, + (ulong)b + ); + } + + public LowLevelILExpressionIndex EmitModUnsigned( + ulong size , + LowLevelILExpressionIndex a, + LowLevelILExpressionIndex b, + ILFlag? flag = null, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_MODU , + location, + size, + null == flag ? 0 : (uint)flag.Index, + (ulong)a, + (ulong)b + ); + } + + public LowLevelILExpressionIndex EmitModUnsignedDoublePrecision( + ulong size , + LowLevelILExpressionIndex a, + LowLevelILExpressionIndex b, + ILFlag? flag = null, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_MODU_DP , + location, + size, + null == flag ? 0 : (uint)flag.Index, + (ulong)a, + (ulong)b + ); + } + + public LowLevelILExpressionIndex EmitNeg( + ulong size , + LowLevelILExpressionIndex value, + ILFlag? flag = null, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_NEG , + location, + size, + null == flag ? 0 : (uint)flag.Index, + (ulong)value + ); + } + + public LowLevelILExpressionIndex EmitNot( + ulong size , + LowLevelILExpressionIndex value, + ILFlag? flag = null, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_NOT , + location, + size, + null == flag ? 0 : (uint)flag.Index, + (ulong)value + ); + } + + public LowLevelILExpressionIndex EmitSignExtend( + ulong size , + LowLevelILExpressionIndex value, + ILFlag? flag = null, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_SX , + location, + size, + null == flag ? 0 : (uint)flag.Index, + (ulong)value + ); + } + + public LowLevelILExpressionIndex EmitZeroExtend( + ulong size , + LowLevelILExpressionIndex value, + ILFlag? flag = null, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_ZX , + location, + size, + null == flag ? 0 : (uint)flag.Index, + (ulong)value + ); + } + + public LowLevelILExpressionIndex EmitLowPart( + ulong size , + LowLevelILExpressionIndex value, + ILFlag? flag = null, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_LOW_PART , + location, + size, + null == flag ? 0 : (uint)flag.Index, + (ulong)value + ); + } + + public LowLevelILExpressionIndex EmitJump( + LowLevelILExpressionIndex dest, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_JUMP , + location, + 0, + 0, + (ulong)dest + ); + } + + public LowLevelILExpressionIndex EmitJumpTo( + LowLevelILExpressionIndex dest, + IDictionary targets, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_JUMP_TO , + location, + 0, + 0, + (ulong)dest, + (ulong) targets.Count * 2, + (ulong)this.AddLabelMap(targets) + ); + } + + public LowLevelILExpressionIndex EmitCall( + LowLevelILExpressionIndex dest, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_CALL , + location, + 0, + 0, + (ulong)dest + ); + } + + public LowLevelILExpressionIndex EmitCallStackAdjust( + LowLevelILExpressionIndex dest, + long stackAdjust, + IDictionary? registerStackAdjustments = null, + SourceLocation? location = null) + { + List pairs = new List(); + + if (null != registerStackAdjustments) + { + foreach (KeyValuePair item in registerStackAdjustments) + { + pairs.Add( (ulong)item.Key ); + pairs.Add( (ulong)item.Value ); + } + } + + return this.AddExpression( + LowLevelILOperation.LLIL_CALL_STACK_ADJUST , + location, + 0, + 0, + (ulong)dest, + (ulong)stackAdjust, + (ulong)pairs.Count, + (ulong)this.AddOperandList(pairs.ToArray()) + ); + } + + public LowLevelILExpressionIndex EmitTailCall( + LowLevelILExpressionIndex dest, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_TAILCALL , + location, + 0, + 0, + (ulong)dest + ); + } + + public LowLevelILExpressionIndex EmitRet( + LowLevelILExpressionIndex dest, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_RET , + location, + 0, + 0, + (ulong)dest + ); + } + + public LowLevelILExpressionIndex EmitNoRet( + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_NORET , + location, + 0, + 0 + ); + } + + public LowLevelILExpressionIndex EmitFlagCondition( + LowLevelILFlagCondition condition, + SemanticFlagClassIndex semanticFlagClass = 0, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_FLAG_COND , + location, + 0, + 0, + (ulong)condition, + (ulong)semanticFlagClass + ); + } + + public LowLevelILExpressionIndex EmitFlagGroup( + SemanticFlagGroupIndex semanticFlagGroup, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_FLAG_GROUP , + location, + 0, + 0, + (ulong)semanticFlagGroup + ); + } + + public LowLevelILExpressionIndex EmitEqual( + ulong size, + LowLevelILExpressionIndex left, + LowLevelILExpressionIndex right, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_CMP_E , + location, + size, + 0, + (ulong)left, + (ulong)right + ); + } + + public LowLevelILExpressionIndex EmitNotEqual( + ulong size, + LowLevelILExpressionIndex left, + LowLevelILExpressionIndex right, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_CMP_NE , + location, + size, + 0, + (ulong)left, + (ulong)right + ); + } + + public LowLevelILExpressionIndex EmitSignedLessThan( + ulong size, + LowLevelILExpressionIndex left, + LowLevelILExpressionIndex right, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_CMP_SLT , + location, + size, + 0, + (ulong)left, + (ulong)right + ); + } + + public LowLevelILExpressionIndex EmitUnsignedLessThan( + ulong size, + LowLevelILExpressionIndex left, + LowLevelILExpressionIndex right, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_CMP_ULT , + location, + size, + 0, + (ulong)left, + (ulong)right + ); + } + + public LowLevelILExpressionIndex EmitSignedLessEqual( + ulong size, + LowLevelILExpressionIndex left, + LowLevelILExpressionIndex right, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_CMP_SLE , + location, + size, + 0, + (ulong)left, + (ulong)right + ); + } + + public LowLevelILExpressionIndex EmitUnsignedLessEqual( + ulong size, + LowLevelILExpressionIndex left, + LowLevelILExpressionIndex right, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_CMP_ULE , + location, + size, + 0, + (ulong)left, + (ulong)right + ); + } + + public LowLevelILExpressionIndex EmitSignedGreaterEqual( + ulong size, + LowLevelILExpressionIndex left, + LowLevelILExpressionIndex right, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_CMP_SGE , + location, + size, + 0, + (ulong)left, + (ulong)right + ); + } + + public LowLevelILExpressionIndex EmitUnsignedGreaterEqual( + ulong size, + LowLevelILExpressionIndex left, + LowLevelILExpressionIndex right, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_CMP_UGE , + location, + size, + 0, + (ulong)left, + (ulong)right + ); + } + + public LowLevelILExpressionIndex EmitSignedGreaterThan( + ulong size, + LowLevelILExpressionIndex left, + LowLevelILExpressionIndex right, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_CMP_SGT , + location, + size, + 0, + (ulong)left, + (ulong)right + ); + } + + public LowLevelILExpressionIndex EmitUnsignedGreaterThan( + ulong size, + LowLevelILExpressionIndex left, + LowLevelILExpressionIndex right, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_CMP_UGT , + location, + size, + 0, + (ulong)left, + (ulong)right + ); + } + + public LowLevelILExpressionIndex EmitTestBit( + ulong size, + LowLevelILExpressionIndex a, + LowLevelILExpressionIndex bit, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_TEST_BIT , + location, + size, + 0, + (ulong)a, + (ulong)bit + ); + } + + public LowLevelILExpressionIndex EmitBoolToInt( + ulong size, + LowLevelILExpressionIndex operand, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_BOOL_TO_INT , + location, + size, + 0, + (ulong)operand + ); + } + + public LowLevelILExpressionIndex EmitSysCall( + ulong size, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_SYSCALL , + location, + size, + 0 + ); + } + + public LowLevelILExpressionIndex EmitIntrinsic( + ulong size, + ulong[] outputFlagOrRegisters, + IntrinsicIndex index, + LowLevelILExpressionIndex[] parameters, + FlagIndex? flag = null, + SourceLocation? location = null) + { + LowLevelILExpressionIndex callParam = this.AddExpression( + LowLevelILOperation.LLIL_CALL_PARAM , + location, + size, + 0, + (ulong)parameters.Length, + (ulong)this.AddOperandList(parameters) + ); + + return this.AddExpression( + LowLevelILOperation.LLIL_INTRINSIC , + location, + size, + null == flag ? 0 : (uint)flag, + (ulong)outputFlagOrRegisters.Length, + (ulong)this.AddOperandList(outputFlagOrRegisters), + (ulong)index, + (ulong)callParam + ); + } + + public LowLevelILExpressionIndex EmitBreakPoint( + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_BP , + location, + 0, + 0 + ); + } + + public LowLevelILExpressionIndex EmitTrap( + ulong value, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_TRAP , + location, + 0, + 0, + value + ); + } + + public LowLevelILExpressionIndex EmitUndefined( + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_UNDEF , + location, + 0, + 0 + ); + } + + public LowLevelILExpressionIndex EmitUnimplemented( + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_UNIMPL , + location, + 0, + 0 + ); + } + + public LowLevelILExpressionIndex EmitUnimplementedMemeory( + ulong size, + LowLevelILExpressionIndex address, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_UNIMPL_MEM , + location, + size, + 0, + (ulong)address + ); + } + + public LowLevelILExpressionIndex EmitFloatAdd( + ulong size, + LowLevelILExpressionIndex left, + LowLevelILExpressionIndex right, + FlagIndex? flag = null, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_FADD , + location, + size, + null == flag ? 0 : (uint)flag, + (ulong)left, + (ulong)right + ); + } + + public LowLevelILExpressionIndex EmitFloatSub( + ulong size, + LowLevelILExpressionIndex left, + LowLevelILExpressionIndex right, + FlagIndex? flag = null, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_FSUB , + location, + size, + null == flag ? 0 : (uint)flag, + (ulong)left, + (ulong)right + ); + } + + public LowLevelILExpressionIndex EmitFloatMul( + ulong size, + LowLevelILExpressionIndex left, + LowLevelILExpressionIndex right, + FlagIndex? flag = null, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_FMUL , + location, + size, + null == flag ? 0 : (uint)flag, + (ulong)left, + (ulong)right + ); + } + + public LowLevelILExpressionIndex EmitFloatDiv( + ulong size, + LowLevelILExpressionIndex left, + LowLevelILExpressionIndex right, + FlagIndex? flag = null, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_FDIV , + location, + size, + null == flag ? 0 : (uint)flag, + (ulong)left, + (ulong)right + ); + } + + public LowLevelILExpressionIndex EmitFloatSquareRoot( + ulong size, + LowLevelILExpressionIndex operand, + FlagIndex? flag = null, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_FSQRT , + location, + size, + null == flag ? 0 : (uint)flag, + (ulong)operand + ); + } + + public LowLevelILExpressionIndex EmitFloatNeg( + ulong size, + LowLevelILExpressionIndex operand, + FlagIndex? flag = null, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_FNEG , + location, + size, + null == flag ? 0 : (uint)flag, + (ulong)operand + ); + } + + public LowLevelILExpressionIndex EmitFloatAbs( + ulong size, + LowLevelILExpressionIndex operand, + FlagIndex? flag = null, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_FABS , + location, + size, + null == flag ? 0 : (uint)flag, + (ulong)operand + ); + } + + public LowLevelILExpressionIndex EmitFloatToInt( + ulong size, + LowLevelILExpressionIndex operand, + FlagIndex? flag = null, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_FLOAT_TO_INT , + location, + size, + null == flag ? 0 : (uint)flag, + (ulong)operand + ); + } + + public LowLevelILExpressionIndex EmitIntToFloat( + ulong size, + LowLevelILExpressionIndex operand, + FlagIndex? flag = null, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_INT_TO_FLOAT , + location, + size, + null == flag ? 0 : (uint)flag, + (ulong)operand + ); + } + + public LowLevelILExpressionIndex EmitFloatConvert( + ulong size, + LowLevelILExpressionIndex operand, + FlagIndex? flag = null, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_FLOAT_CONV , + location, + size, + null == flag ? 0 : (uint)flag, + (ulong)operand + ); + } + + public LowLevelILExpressionIndex EmitRoundToInt( + ulong size, + LowLevelILExpressionIndex operand, + FlagIndex? flag = null, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_ROUND_TO_INT , + location, + size, + null == flag ? 0 : (uint)flag, + (ulong)operand + ); + } + + public LowLevelILExpressionIndex EmitFloor( + ulong size, + LowLevelILExpressionIndex operand, + FlagIndex? flag = null, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_FLOOR , + location, + size, + null == flag ? 0 : (uint)flag, + (ulong)operand + ); + } + + public LowLevelILExpressionIndex EmitCeil( + ulong size, + LowLevelILExpressionIndex operand, + FlagIndex? flag = null, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_CEIL , + location, + size, + null == flag ? 0 : (uint)flag, + (ulong)operand + ); + } + + public LowLevelILExpressionIndex EmitFloatTrunc( + ulong size, + LowLevelILExpressionIndex operand, + FlagIndex? flag = null, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_FTRUNC , + location, + size, + null == flag ? 0 : (uint)flag, + (ulong)operand + ); + } + + public LowLevelILExpressionIndex EmitFloatEqual( + ulong size, + LowLevelILExpressionIndex left, + LowLevelILExpressionIndex right, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_FCMP_E , + location, + size, + 0, + (ulong)left, + (ulong)right + ); + } + + public LowLevelILExpressionIndex EmitFloatNotEqual( + ulong size, + LowLevelILExpressionIndex left, + LowLevelILExpressionIndex right, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_FCMP_NE , + location, + size, + 0, + (ulong)left, + (ulong)right + ); + } + + public LowLevelILExpressionIndex EmitFloatLessThan( + ulong size, + LowLevelILExpressionIndex left, + LowLevelILExpressionIndex right, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_FCMP_LT , + location, + size, + 0, + (ulong)left, + (ulong)right + ); + } + + public LowLevelILExpressionIndex EmitFloatLessEqual( + ulong size, + LowLevelILExpressionIndex left, + LowLevelILExpressionIndex right, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_FCMP_LE , + location, + size, + 0, + (ulong)left, + (ulong)right + ); + } + + public LowLevelILExpressionIndex EmitFloatGreaterEqual( + ulong size, + LowLevelILExpressionIndex left, + LowLevelILExpressionIndex right, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_FCMP_GE , + location, + size, + 0, + (ulong)left, + (ulong)right + ); + } + + public LowLevelILExpressionIndex EmitFloatGreaterThan( + ulong size, + LowLevelILExpressionIndex left, + LowLevelILExpressionIndex right, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_FCMP_GT , + location, + size, + 0, + (ulong)left, + (ulong)right + ); + } + + public LowLevelILExpressionIndex EmitFloatCompareOrder( + ulong size, + LowLevelILExpressionIndex left, + LowLevelILExpressionIndex right, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_FCMP_O , + location, + size, + 0, + (ulong)left, + (ulong)right + ); + } + + public LowLevelILExpressionIndex EmitFloatCompareUnorder( + ulong size, + LowLevelILExpressionIndex left, + LowLevelILExpressionIndex right, + SourceLocation? location = null) + { + return this.AddExpression( + LowLevelILOperation.LLIL_FCMP_UO , + location, + size, + 0, + (ulong)left, + (ulong)right + ); + } + + public LowLevelILExpressionIndex EmitGoto( + ulong size, + LowLevelILLabel label, + SourceLocation? location = null) + { + if (null == location) + { + return NativeMethods.BNLowLevelILGoto( + this.handle , + label.ToNative() + ); + } + else + { + return NativeMethods.BNLowLevelILGotoWithLocation( + this.handle , + label.ToNative(), + location.Address, + (uint)location.Operand + ); + } + } + + public LowLevelILExpressionIndex EmitIf( + ulong size, + LowLevelILExpressionIndex condition, + LowLevelILLabel trueBranch, + LowLevelILLabel falseBranch, + SourceLocation? location = null) + { + + if (null == location) + { + return NativeMethods.BNLowLevelILIf( + this.handle , + condition, + trueBranch.ToNative(), + falseBranch.ToNative() + ); + } + else + { + return NativeMethods.BNLowLevelILIfWithLocation( + this.handle , + condition, + trueBranch.ToNative(), + falseBranch.ToNative(), + location.Address, + (uint)location.Operand + ); + } + } + + + } + + +} \ No newline at end of file diff --git a/Handle/BNMainThreadAction.cs b/Handle/BNMainThreadAction.cs new file mode 100644 index 0000000..cec3f8d --- /dev/null +++ b/Handle/BNMainThreadAction.cs @@ -0,0 +1,93 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class MainThreadAction : AbstractSafeHandle + { + internal MainThreadAction(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static MainThreadAction? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new MainThreadAction( + NativeMethods.BNNewMainThreadActionReference(handle) , + true + ); + } + + internal static MainThreadAction MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new MainThreadAction( + NativeMethods.BNNewMainThreadActionReference(handle) , + true + ); + } + + internal static MainThreadAction? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new MainThreadAction(handle, true); + } + + internal static MainThreadAction MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new MainThreadAction(handle, true); + } + + internal static MainThreadAction? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new MainThreadAction(handle, false); + } + + internal static MainThreadAction MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new MainThreadAction(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeMainThreadAction(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + } +} \ No newline at end of file diff --git a/Handle/BNMediumLevelILFunction.cs b/Handle/BNMediumLevelILFunction.cs new file mode 100644 index 0000000..8eb9e58 --- /dev/null +++ b/Handle/BNMediumLevelILFunction.cs @@ -0,0 +1,3212 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Reflection.Emit; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + + +namespace BinaryNinja +{ + public sealed class MediumLevelILFunction : AbstractSafeHandle + { + public bool IsSSAForm { get; } = false; + + internal MediumLevelILFunction( + IntPtr handle , + bool owner , + bool ssa = false + ) : base(handle , owner) + { + this.IsSSAForm = ssa; + } + + internal static MediumLevelILFunction? NewFromHandle( + IntPtr handle , + bool ssa = false + ) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new MediumLevelILFunction( + NativeMethods.BNNewMediumLevelILFunctionReference(handle) , + true, + ssa + ); + } + + internal static MediumLevelILFunction MustNewFromHandle( + IntPtr handle, + bool ssa = false + ) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new MediumLevelILFunction( + NativeMethods.BNNewMediumLevelILFunctionReference(handle) , + true, + ssa + ); + } + + internal static MediumLevelILFunction? TakeHandle( + IntPtr handle, + bool ssa = false + ) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new MediumLevelILFunction(handle, true , ssa); + } + + internal static MediumLevelILFunction MustTakeHandle( + IntPtr handle, + bool ssa = false + ) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new MediumLevelILFunction(handle, true , ssa); + } + + internal static MediumLevelILFunction? BorrowHandle( + IntPtr handle, + bool ssa = false + ) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new MediumLevelILFunction(handle, false , ssa); + } + + internal static MediumLevelILFunction MustBorrowHandle( + IntPtr handle, + bool ssa = false + ) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new MediumLevelILFunction(handle, false , ssa); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeMediumLevelILFunction(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + + public Function OwnerFunction + { + get + { + return Function.MustTakeHandle( + NativeMethods.BNGetMediumLevelILOwnerFunction(this.handle) + ); + } + } + + public Architecture Architecture + { + get + { + return this.OwnerFunction.Architecture; + } + } + + public ulong ExpressionCount + { + get + { + return NativeMethods.BNGetMediumLevelILExprCount(this.handle); + } + } + + public ulong InstructionCount + { + get + { + return NativeMethods.BNGetMediumLevelILInstructionCount(this.handle); + } + } + + public MediumLevelILInstruction? GetExpression( + MediumLevelILExpressionIndex expression + ) + { + if ( (ulong)expression >= this.ExpressionCount) + { + return null; + } + + return MediumLevelILInstruction.FromExpressionIndex( + this, + expression + ); + } + + public MediumLevelILInstruction MustGetExpression( + MediumLevelILExpressionIndex expression + ) + { + if ( (ulong)expression >= this.ExpressionCount) + { + throw new IndexOutOfRangeException(nameof(expression)); + } + + return MediumLevelILInstruction.FromExpressionIndex( + this, + expression + ); + } + + + public MediumLevelILInstruction this[MediumLevelILInstructionIndex index] + { + get + { + return this.MustGetInstruction(index); + } + } + + public IEnumerable Instructions + { + get + { + for (ulong index = 0; index < this.InstructionCount; index++) + { + yield return this.MustGetInstruction( (MediumLevelILInstructionIndex)index); + } + } + } + + public MediumLevelILInstruction? GetInstruction(MediumLevelILInstructionIndex instruction) + { + if ( (ulong)instruction >= this.InstructionCount) + { + return null; + } + + return this.MustGetInstruction(instruction); + } + + public MediumLevelILInstruction MustGetInstruction(MediumLevelILInstructionIndex instruction) + { + if ( (ulong)instruction >= this.InstructionCount) + { + throw new IndexOutOfRangeException(nameof(instruction)); + } + + MediumLevelILExpressionIndex expressionIndex = NativeMethods.BNGetMediumLevelILIndexForInstruction( + this.handle, + instruction + ); + + return this.MustGetExpression(expressionIndex); + } + + + public MediumLevelILInstruction[] MustGetExpressions(MediumLevelILExpressionIndex[] indexes) + { + List instructions = new List(); + + foreach (MediumLevelILExpressionIndex index in indexes) + { + instructions.Add( this.MustGetExpression(index) ); + } + + return instructions.ToArray(); + } + + public MediumLevelILInstruction[] MustGetInstructions(MediumLevelILInstructionIndex[] indexes) + { + List instructions = new List(); + + foreach (MediumLevelILInstructionIndex index in indexes) + { + instructions.Add( this.MustGetInstruction(index) ); + } + + return instructions.ToArray(); + } + + public ulong CurrentAddress + { + get + { + return NativeMethods.BNMediumLevelILGetCurrentAddress(this.handle); + } + + set + { + NativeMethods.BNMediumLevelILSetCurrentAddress( + this.handle, + this.OwnerFunction.Architecture.DangerousGetHandle(), + value + ); + } + } + + public MediumLevelILInstruction? CurrentInstruction + { + get + { + return this.GetInstructionStart(this.CurrentAddress); + } + } + + public void SetCurrentAddress(ulong address , Architecture? arch = null) + { + NativeMethods.BNMediumLevelILSetCurrentAddress( + this.handle, + null == arch ? this.OwnerFunction.Architecture.DangerousGetHandle() : arch.DangerousGetHandle(), + address + ); + } + + public MediumLevelILBasicBlock[] BasicBlocks + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetMediumLevelILBasicBlockList( + this.handle , + out ulong arrayLength + ); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer, + arrayLength, + (native) => { return MediumLevelILBasicBlock.MustNewFromHandleEx(this , native);}, + NativeMethods.BNFreeBasicBlockList + ); + } + } + + public MediumLevelILBasicBlock? GetBasicBlockForInstruction(MediumLevelILInstructionIndex index) + { + return MediumLevelILBasicBlock.TakeHandleEx( + this, + NativeMethods.BNGetMediumLevelILBasicBlockForInstruction( + this.handle , + index) + ); + } + + public MediumLevelILFunction SSAForm + { + get + { + if (this.IsSSAForm) + { + return this; + } + else + { + return MediumLevelILFunction.MustTakeHandle( + NativeMethods.BNGetMediumLevelILSSAForm(this.handle), + true + ); + } + } + } + + public MediumLevelILFunction NonSSAForm + { + get + { + if (this.IsSSAForm) + { + return MediumLevelILFunction.MustTakeHandle( + NativeMethods.BNGetMediumLevelILNonSSAForm(this.handle), + false + ); + } + else + { + return this; + } + } + } + + public LowLevelILFunction? LowLevelIL + { + get + { + return LowLevelILFunction.TakeHandle( + NativeMethods.BNGetLowLevelILForMediumLevelIL(this.handle), + this.IsSSAForm + ); + } + } + + public HighLevelILFunction? HighLevelIL + { + get + { + return HighLevelILFunction.TakeHandle( + NativeMethods.BNGetHighLevelILForMediumLevelIL(this.handle), + this.IsSSAForm + ); + } + } + + public MediumLevelILInstruction? GetInstructionStart( ulong address , Architecture? arch = null ) + { + if (null == arch) + { + arch = this.Architecture; + } + + return this.GetInstruction( + NativeMethods.BNMediumLevelILGetInstructionStart( + this.handle, + null == arch ? this.OwnerFunction.Architecture.DangerousGetHandle() : arch.DangerousGetHandle(), + address + ) + ); + } + + public void MarkLabel(MediumLevelILLabel label) + { + NativeMethods.BNMediumLevelILMarkLabel(this.handle, label.ToNative()); + } + + public MediumLevelILExpressionIndex AddLabelMap(IDictionary labelMap) + { + return NativeMethods.BNMediumLevelILAddLabelMap( + this.handle , + labelMap.Keys.ToArray(), + UnsafeUtils.ConvertToNativeArray( + labelMap.Values.ToArray() + ) , + (ulong)labelMap.Count + ); + } + + public MediumLevelILExpressionIndex AddOperandList(ulong[] operands) + { + return NativeMethods.BNMediumLevelILAddOperandList( + this.handle , + operands , + (ulong)operands.Length + ); + } + + public MediumLevelILExpressionIndex AddOperandList(MediumLevelILExpressionIndex[] operands) + { + List targets = new List(); + + foreach (HighLevelILExpressionIndex operand in operands) + { + targets.Add( (ulong)operand); + } + + return NativeMethods.BNMediumLevelILAddOperandList( + this.handle , + targets.ToArray() , + (ulong)operands.Length + ); + } + + public MediumLevelILExpressionIndex AddVariableList(Variable[] variables) + { + List operands = new List(); + + foreach (Variable variable in variables) + { + operands.Add( (MediumLevelILExpressionIndex)variable.Identifier); + } + + return this.AddOperandList(operands.ToArray()); + } + + public MediumLevelILPossibleValueSetCacheIndex CachePossibleValueSet(PossibleValueSet pvs) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + return NativeMethods.BNCacheMediumLevelILPossibleValueSet( + this.handle, + pvs.ToNativeEx(allocator) + ); + } + } + + public void FinalizeILFunction() + { + NativeMethods.BNFinalizeMediumLevelILFunction(this.handle); + } + + public void GenerateSSAForm( + bool analyzeConditionals, + bool handleAliases , + Variable[] knownNotAliases, + Variable[] knownAliases + ) + { + NativeMethods.BNGenerateMediumLevelILSSAForm( + this.handle, + analyzeConditionals, + handleAliases, + UnsafeUtils.ConvertToNativeArray( + knownNotAliases + ), + (ulong)knownNotAliases.Length, + UnsafeUtils.ConvertToNativeArray( + knownAliases + ), + (ulong)knownAliases.Length + ); + } + + public void PrepareToCopyFunction(MediumLevelILFunction source) + { + NativeMethods.BNPrepareToCopyMediumLevelILFunction(this.handle , source.DangerousGetHandle()); + } + + public void PrepareToCopyBasicBlock(MediumLevelILBasicBlock block) + { + NativeMethods.BNPrepareToCopyMediumLevelILBasicBlock(this.handle , block.DangerousGetHandle()); + } + + public MediumLevelILLabel? GetLabelForSourceInstruction(MediumLevelILInstructionIndex index) + { + return MediumLevelILLabel.FromNativePointer( + NativeMethods.BNGetLabelForMediumLevelILSourceInstruction(this.handle , index) + ); + } + + public MediumLevelILInstructionIndex GetSSAInstructionIndex(MediumLevelILInstructionIndex instr) + { + return NativeMethods.BNGetMediumLevelILSSAInstructionIndex(this.handle , instr); + } + + public MediumLevelILInstructionIndex GetNonSSAInstructionIndex(MediumLevelILInstructionIndex instr) + { + return NativeMethods.BNGetMediumLevelILNonSSAInstructionIndex(this.handle , instr); + } + + public MediumLevelILInstruction? GetSSAVariableDefinition(Variable variable , ulong version) + { + return this.GetExpression( + NativeMethods.BNGetMediumLevelILSSAVarDefinition( + this.handle , + variable.ToNative() , + version + ) + ); + } + + public MediumLevelILInstruction? GetSSAMemoryDefinition(ulong version) + { + return this.GetInstruction( + NativeMethods.BNGetMediumLevelILSSAMemoryDefinition( + this.handle , + version + )); + } + + public MediumLevelILInstruction[] GetSSAVariableUses(Variable variable , ulong version) + { + IntPtr arrayPointer = NativeMethods.BNGetMediumLevelILSSAVarUses( + this.handle , + variable.ToNative() , + version, + out ulong arrayLength + ); + + MediumLevelILInstructionIndex[] indexs = UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNFreeILInstructionList + ); + + return this.MustGetInstructions(indexs); + } + + public MediumLevelILInstruction[] GetSSAMemoryUses( ulong version) + { + IntPtr arrayPointer = NativeMethods.BNGetMediumLevelILSSAMemoryUses( + this.handle , + version, + out ulong arrayLength + ); + + MediumLevelILInstructionIndex[] indexs = UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNFreeILInstructionList + ); + + return this.MustGetInstructions(indexs); + } + + public bool IsSSAVariableLive(Variable variable , ulong version) + { + return NativeMethods.BNIsMediumLevelILSSAVarLive( + this.handle , + variable.ToNative() , + version + ); + } + + public bool IsSSAVariableLiveAt(Variable variable , ulong version , MediumLevelILInstructionIndex instr) + { + return NativeMethods.BNIsMediumLevelILSSAVarLiveAt( + this.handle , + variable.ToNative() , + version, + instr + ); + } + + public bool IsVariableLiveAt(Variable variable , MediumLevelILInstructionIndex instr) + { + return NativeMethods.BNIsMediumLevelILVarLiveAt( + this.handle , + variable.ToNative() , + instr + ); + } + + public MediumLevelILInstruction[] GetVariableDefinitions(Variable variable ) + { + IntPtr arrayPointer = NativeMethods.BNGetMediumLevelILVariableDefinitions( + this.handle , + variable.ToNative(), + out ulong arrayLength + ); + + MediumLevelILInstructionIndex[] indexs = UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNFreeILInstructionList + ); + + return this.MustGetInstructions(indexs); + } + + public MediumLevelILInstruction[] GetVariableUses(Variable variable ) + { + IntPtr arrayPointer = NativeMethods.BNGetMediumLevelILVariableUses( + this.handle , + variable.ToNative(), + out ulong arrayLength + ); + + MediumLevelILInstructionIndex[] indexs = UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNFreeILInstructionList + ); + + return this.MustGetInstructions(indexs); + } + + public MediumLevelILInstruction[] GetLiveInstructionsForVariable( + Variable variable , + bool includeLastUse = true + ) + { + IntPtr arrayPointer = NativeMethods.BNGetMediumLevelILLiveInstructionsForVariable( + this.handle , + variable.ToNative(), + includeLastUse, + out ulong arrayLength + ); + + MediumLevelILInstructionIndex[] indexs = UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNFreeILInstructionList + ); + + return this.MustGetInstructions(indexs); + } + + public RegisterValue GetSSAVariableValue(Variable variable , ulong version) + { + return RegisterValue.FromNative( + NativeMethods.BNGetMediumLevelILSSAVarValue( + this.handle , + variable.ToNative() , + version + ) + ); + } + + public MediumLevelILInstructionIndex? GetInstructionIndexForExpressionIndex( + MediumLevelILExpressionIndex expressionIndex + ) + { + MediumLevelILInstructionIndex index = NativeMethods.BNGetMediumLevelILInstructionForExpr( + this.handle, + expressionIndex + ); + + if ((ulong)index >= this.InstructionCount) + { + return null; + } + + return index; + } + + public MediumLevelILExpressionIndex? GetExpressionIndexForInstructionIndex( + MediumLevelILInstructionIndex instruction + ) + { + MediumLevelILExpressionIndex index = NativeMethods.BNGetMediumLevelILIndexForInstruction( + this.handle, + instruction + ); + + if ((ulong)index >= this.ExpressionCount) + { + return null; + } + + return index; + } + + public LowLevelILInstruction? GetLowLevelILExpression( + MediumLevelILExpressionIndex mediumExpr + ) + { + LowLevelILFunction? llil = this.LowLevelIL; + + if (null == llil) + { + return null; + } + + LowLevelILExpressionIndex lowExpr = NativeMethods.BNGetLowLevelILExprIndex( + this.handle, + mediumExpr + ); + + if ((ulong)lowExpr >= llil.ExpressionCount) + { + return null; + } + + return llil.GetExpression(lowExpr); + } + + public LowLevelILInstruction? GetLowLevelILInstruction( + MediumLevelILInstructionIndex mediumInstr + ) + { + LowLevelILFunction? llil = this.LowLevelIL; + + if (null == llil) + { + return null; + } + + LowLevelILInstructionIndex lowInstr = NativeMethods.BNGetLowLevelILInstructionIndex( + this.handle, + mediumInstr + ); + + if ((ulong)lowInstr >= llil.InstructionCount) + { + return null; + } + + return llil.GetInstruction(lowInstr); + } + + public LowLevelILInstruction[] GetLowLevelILExpressions( + MediumLevelILExpressionIndex mediumExpr + ) + { + LowLevelILFunction? llil = this.LowLevelIL; + + if (null == llil) + { + return Array.Empty(); + } + + IntPtr arrayPointer = NativeMethods.BNGetLowLevelILExprIndexes( + this.handle, + mediumExpr , + out ulong arrayLength + ); + + ulong[] lowExprs = UnsafeUtils.TakeNumberArray( + arrayPointer, + arrayLength , + NativeMethods.BNFreeILInstructionList + ); + + List expressions = new List(); + + foreach (LowLevelILExpressionIndex lowExpr in lowExprs) + { + expressions.Add( + llil.MustGetExpression(lowExpr) + ); + } + + return expressions.ToArray(); + } + + // high + public HighLevelILInstruction? GetHighLevelILExpression( + MediumLevelILExpressionIndex mediumExpr + ) + { + HighLevelILFunction? hlil = this.HighLevelIL; + + if (null == hlil) + { + return null; + } + + HighLevelILExpressionIndex highExpr = NativeMethods.BNGetHighLevelILExprIndex( + this.handle, + mediumExpr + ); + + if ((ulong)highExpr >= hlil.ExpressionCount) + { + return null; + } + + return hlil.GetExpression(highExpr); + } + + public HighLevelILInstruction[] GetHighLevelILExpressions( + MediumLevelILExpressionIndex mediumExpr + ) + { + HighLevelILFunction? hlil = this.HighLevelIL; + + if (null == hlil) + { + return Array.Empty(); + } + + IntPtr arrayPointer = NativeMethods.BNGetHighLevelILExprIndexes( + this.handle, + mediumExpr , + out ulong arrayLength + ); + + ulong[] highExprs = UnsafeUtils.TakeNumberArray( + arrayPointer, + arrayLength , + NativeMethods.BNFreeILInstructionList + ); + + List instructions = new List(); + + foreach (HighLevelILExpressionIndex index in highExprs) + { + instructions.Add( + hlil.MustGetExpression(index) + ); + } + + return instructions.ToArray(); + } + + public HighLevelILInstruction? GetHighLevelILInstruction( + MediumLevelILInstructionIndex mediumInstr , + bool asFullAST = false + ) + { + HighLevelILFunction? hlil = this.HighLevelIL; + + if (null == hlil) + { + return null; + } + + HighLevelILInstructionIndex highInstr = NativeMethods.BNGetHighLevelILInstructionIndex( + this.handle, + mediumInstr + ); + + if ((ulong)highInstr >= hlil.InstructionCount) + { + return null; + } + + return hlil.GetInstruction(highInstr , asFullAST); + } + + + + public MediumLevelILExpressionIndex GetSSAExpressionIndex(MediumLevelILExpressionIndex expression) + { + return NativeMethods.BNGetMediumLevelILSSAExprIndex(this.handle , expression); + } + + public MediumLevelILExpressionIndex GetNonSSAExpressionIndex(MediumLevelILExpressionIndex expression) + { + return NativeMethods.BNGetMediumLevelILNonSSAExprIndex(this.handle , expression); + } + + public ulong GetSSAMemoryVersionAtInstruction(MediumLevelILInstructionIndex instruction) + { + return NativeMethods.BNGetMediumLevelILSSAMemoryVersionAtILInstruction(this.handle , instruction); + } + + public ulong GetSSAMemoryVersionAfterILInstruction(MediumLevelILInstructionIndex instruction) + { + return NativeMethods.BNGetMediumLevelILSSAMemoryVersionAfterILInstruction(this.handle , instruction); + } + + public MediumLevelILFlowGraph CreateGraph(DisassemblySettings? settings = null) + { + return MediumLevelILFlowGraph.MustTakeHandleEx( + this, + NativeMethods.BNCreateMediumLevelILFunctionGraph( + this.handle , + null == settings ? IntPtr.Zero : settings.DangerousGetHandle() + ) + ); + } + + public MediumLevelILFlowGraph CreateImmediateGraph(DisassemblySettings? settings = null) + { + return MediumLevelILFlowGraph.MustTakeHandleEx( + this, + NativeMethods.BNCreateMediumLevelILImmediateFunctionGraph( + this.handle , + null == settings ? IntPtr.Zero : settings.DangerousGetHandle() + ) + ); + } + + public MediumLevelILVariable[] Variables + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetMediumLevelILVariables( + this.handle , + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArray( + arrayPointer, + arrayLength, + (native) => { return new MediumLevelILVariable(this , native);}, + NativeMethods.BNFreeVariableList + ); + } + } + + public MediumLevelILVariable[] AliasedVariables + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetMediumLevelILAliasedVariables( + this.handle , + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArray( + arrayPointer, + arrayLength, + (native) => { return new MediumLevelILVariable(this , native);}, + NativeMethods.BNFreeVariableList + ); + } + } + + public MediumLevelILSSAVariable[] SSAVariables + { + get + { + List targets = new List(); + + foreach (MediumLevelILVariable variable in this.Variables) + { + ulong[] versions = this.GetVariableSSAVersions(variable); + + foreach (ulong version in versions) + { + targets.Add(new MediumLevelILSSAVariable(variable, version)); + } + } + + return targets.ToArray(); + } + } + + public ulong[] GetVariableSSAVersions(MediumLevelILVariable variable) + { + IntPtr arrayPointer = NativeMethods.BNGetMediumLevelILVariableSSAVersions( + this.handle , + variable.ToNative() , + out ulong arrayLength + ); + + return UnsafeUtils.TakeNumberArray( + arrayPointer, + arrayLength, + NativeMethods.BNFreeILInstructionList + ); + } + + public TypeWithConfidence GetExpressionType(MediumLevelILExpressionIndex expression) + { + return TypeWithConfidence.FromNative( + NativeMethods.BNGetMediumLevelILExprType(this.handle , expression) + ); + } + + public RegisterValue GetExpressionValue(MediumLevelILExpressionIndex expression) + { + return RegisterValue.FromNative( + NativeMethods.BNGetMediumLevelILExprValue(this.handle , expression) + ); + } + + public PossibleValueSet GetExpressionPossibleValues(MediumLevelILExpressionIndex expression , DataFlowQueryOption[] options) + { + return PossibleValueSet.TakeNative( + NativeMethods.BNGetMediumLevelILPossibleExprValues( + this.handle , + expression, + options, + (ulong)options.Length + ) + ); + } + + + public InstructionTextToken[] GetExpressionTokens( + MediumLevelILExpressionIndex expression , + Architecture? arch = null, + DisassemblySettings? settings = null + ) + { + bool ok = NativeMethods.BNGetMediumLevelILExprText( + this.handle , + null == arch ? this.OwnerFunction.Architecture.DangerousGetHandle() : arch.DangerousGetHandle(), + expression, + out IntPtr arrayPointer, + out ulong arrayLength, + null == settings ? IntPtr.Zero : settings.DangerousGetHandle() + ); + + if (!ok) + { + return Array.Empty(); + } + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength, + InstructionTextToken.FromNative, + NativeMethods.BNFreeInstructionText + ); + } + + public void SetExpressionType(MediumLevelILExpressionIndex expr , TypeWithConfidence type) + { + NativeMethods.BNSetMediumLevelILExprType(this.handle , expr , type.ToNative()); + } + + public void ReplaceExpression(MediumLevelILExpressionIndex oldExpr , MediumLevelILExpressionIndex newExpr) + { + NativeMethods.BNReplaceMediumLevelILExpr(this.handle , oldExpr , newExpr); + } + + public void SetExpressionAttributes(MediumLevelILExpressionIndex expr , uint attributes) + { + NativeMethods.BNSetMediumLevelILExprAttributes(this.handle , expr , attributes); + } + + public MediumLevelILInstructionIndex AddInstruction(MediumLevelILExpressionIndex expr) + { + return NativeMethods.BNMediumLevelILAddInstruction(this.handle , expr); + } + + public PossibleValueSet GetSSAVariablePossibleValues( + Variable variable , + ulong version , + MediumLevelILInstructionIndex instruction , + DataFlowQueryOption[] options + ) + { + return PossibleValueSet.TakeNative( + NativeMethods.BNGetMediumLevelILPossibleSSAVarValues( + this.handle , + variable.ToNative(), + version , + instruction, + options, + (ulong)options.Length + ) + ); + } + + public ulong GetSSAVariableVersionAtInstruction( + Variable variable, + MediumLevelILInstructionIndex instruction + ) + { + return NativeMethods.BNGetMediumLevelILSSAVarVersionAtILInstruction( + this.handle , + variable.ToNative() , + instruction + ); + } + + public ulong GetSSAVariableVersionAfterInstruction( + Variable variable, + MediumLevelILInstructionIndex instruction + ) + { + return NativeMethods.BNGetMediumLevelILSSAVarVersionAfterILInstruction( + this.handle , + variable.ToNative() , + instruction + ); + } + + public MediumLevelILVariable GetVariableForRegisterAtInstruction( + uint reg, + MediumLevelILInstructionIndex instruction + ) + { + return new MediumLevelILVariable( + this, + NativeMethods.BNGetMediumLevelILVariableForRegisterAtInstruction( + this.handle , + reg, + instruction + ) + ); + } + + public MediumLevelILVariable GetVariableForRegisterAfterInstruction( + RegisterIndex reg, + MediumLevelILInstructionIndex instruction + ) + { + return new MediumLevelILVariable( + this, + NativeMethods.BNGetMediumLevelILVariableForRegisterAfterInstruction( + this.handle , + reg, + instruction + ) + ); + } + + public MediumLevelILVariable GetVariableForFlagAtInstruction( + FlagIndex flag, + MediumLevelILInstructionIndex instruction + ) + { + return new MediumLevelILVariable( + this, + NativeMethods.BNGetMediumLevelILVariableForFlagAtInstruction( + this.handle , + flag, + instruction + ) + ); + } + + public MediumLevelILVariable GetVariableForFlagAfterInstruction( + FlagIndex flag, + MediumLevelILInstructionIndex instruction + ) + { + return new MediumLevelILVariable( + this, + NativeMethods.BNGetMediumLevelILVariableForFlagAfterInstruction( + this.handle , + flag, + instruction + ) + ); + } + + public MediumLevelILVariable GetVariableForStackLocationAtInstruction( + long offset, + MediumLevelILInstructionIndex instruction + ) + { + return new MediumLevelILVariable( + this, + NativeMethods.BNGetMediumLevelILVariableForStackLocationAtInstruction( + this.handle , + offset, + instruction + ) + ); + } + + public MediumLevelILVariable GetVariableForStackLocationAfterInstruction( + long offset, + MediumLevelILInstructionIndex instruction + ) + { + return new MediumLevelILVariable( + this, + NativeMethods.BNGetMediumLevelILVariableForStackLocationAfterInstruction( + this.handle , + offset, + instruction + ) + ); + } + + public RegisterValue GetRegisterValueAtInstruction( + uint reg, + MediumLevelILInstructionIndex instruction + ) + { + return RegisterValue.FromNative( + NativeMethods.BNGetMediumLevelILRegisterValueAtInstruction( + this.handle , + reg, + instruction + ) + ); + } + + public RegisterValue GetRegisterValueAfterInstruction( + RegisterIndex reg, + MediumLevelILInstructionIndex instruction + ) + { + return RegisterValue.FromNative( + NativeMethods.BNGetMediumLevelILRegisterValueAfterInstruction( + this.handle , + reg, + instruction + ) + ); + } + + public PossibleValueSet GetRegisterPossibleValuesAtInstruction( + RegisterIndex reg , + MediumLevelILInstructionIndex instruction , + DataFlowQueryOption[] options + ) + { + return PossibleValueSet.TakeNative( + NativeMethods.BNGetMediumLevelILPossibleRegisterValuesAtInstruction( + this.handle , + reg, + instruction, + options, + (ulong)options.Length + ) + ); + } + + public PossibleValueSet GetRegisterPossibleValuesAfterInstruction( + RegisterIndex reg , + MediumLevelILInstructionIndex instruction , + DataFlowQueryOption[] options + ) + { + return PossibleValueSet.TakeNative( + NativeMethods.BNGetMediumLevelILPossibleRegisterValuesAfterInstruction( + this.handle , + reg, + instruction, + options, + (ulong)options.Length + ) + ); + } + + public RegisterValue GetFlagValueAtInstruction( + FlagIndex flag, + MediumLevelILInstructionIndex instruction + ) + { + return RegisterValue.FromNative( + NativeMethods.BNGetMediumLevelILFlagValueAtInstruction( + this.handle , + flag, + instruction + ) + ); + } + + public RegisterValue GetFlagValueAfterInstruction( + FlagIndex flag, + MediumLevelILInstructionIndex instruction + ) + { + return RegisterValue.FromNative( + NativeMethods.BNGetMediumLevelILFlagValueAfterInstruction( + this.handle , + flag, + instruction + ) + ); + } + + public PossibleValueSet GetFlagPossibleValuesAtInstruction( + FlagIndex flag , + MediumLevelILInstructionIndex instruction , + DataFlowQueryOption[] options + ) + { + return PossibleValueSet.TakeNative( + NativeMethods.BNGetMediumLevelILPossibleFlagValuesAtInstruction( + this.handle , + flag, + instruction, + options, + (ulong)options.Length + ) + ); + } + + public PossibleValueSet GetFlagPossibleValuesAfterInstruction( + FlagIndex flag , + MediumLevelILInstructionIndex instruction , + DataFlowQueryOption[] options + ) + { + return PossibleValueSet.TakeNative( + NativeMethods.BNGetMediumLevelILPossibleFlagValuesAfterInstruction( + this.handle , + flag, + instruction, + options, + (ulong)options.Length + ) + ); + } + + public RegisterValue StackContentsAtInstruction( + long offset, + ulong length, + MediumLevelILInstructionIndex instruction + ) + { + return RegisterValue.FromNative( + NativeMethods.BNGetMediumLevelILStackContentsAtInstruction( + this.handle , + offset, + length, + instruction + ) + ); + } + + public RegisterValue GetStackContentsAfterInstruction( + long offset, + ulong length, + MediumLevelILInstructionIndex instruction + ) + { + return RegisterValue.FromNative( + NativeMethods.BNGetMediumLevelILStackContentsAfterInstruction( + this.handle , + offset, + length, + instruction + ) + ); + } + + public PossibleValueSet GetStackContentsPossibleValuesAtInstruction( + long offset, + ulong length, + MediumLevelILInstructionIndex instruction , + DataFlowQueryOption[] options + ) + { + return PossibleValueSet.TakeNative( + NativeMethods.BNGetMediumLevelILPossibleStackContentsAtInstruction( + this.handle , + offset, + length, + instruction, + options, + (ulong)options.Length + ) + ); + } + + public PossibleValueSet GetStackContentsPossibleValuesAfterInstruction( + long offset, + ulong length, + MediumLevelILInstructionIndex instruction , + DataFlowQueryOption[] options + ) + { + return PossibleValueSet.TakeNative( + NativeMethods.BNGetMediumLevelILPossibleStackContentsAfterInstruction( + this.handle , + offset, + length, + instruction, + options, + (ulong)options.Length + ) + ); + } + + public ILBranchInstructionAndDependence[] GetAllBranchDependence(MediumLevelILInstructionIndex instruction) + { + IntPtr arrayPointer = NativeMethods.BNGetAllMediumLevelILBranchDependence( + this.handle , + instruction , + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArray( + arrayPointer, + arrayLength , + ILBranchInstructionAndDependence.FromNative, + NativeMethods.BNFreeILBranchDependenceList + ); + } + + public ILBranchDependence GetBranchDependence( + MediumLevelILInstructionIndex instruction, + MediumLevelILInstructionIndex branch + ) + { + return NativeMethods.BNGetMediumLevelILBranchDependence( + this.handle , + instruction , + branch + ); + } + + public uint GetDefaultIndexForVariableDefinition( + Variable variable, + MediumLevelILInstructionIndex instruction + ) + { + return NativeMethods.BNGetDefaultIndexForMediumLevelILVariableDefinition( + this.handle , + variable.ToNative() , + instruction + ); + } + + public ulong[] GetExpressionOperands( + MediumLevelILExpressionIndex expression, + ulong operand + ) + { + IntPtr arrayPointer = NativeMethods.BNMediumLevelILGetOperandList( + this.handle , + expression , + operand , + out ulong arrayLength + ); + + return UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNMediumLevelILFreeOperandList + ); + } + + public MediumLevelILVariable[] GetExpressionVariables( + MediumLevelILExpressionIndex expression , + ulong operand + ) + { + List variables = new List(); + + ulong[] identifiers = this.GetExpressionOperands(expression, operand); + + foreach (ulong identifier in identifiers) + { + variables.Add( + MediumLevelILVariable.FromIdentifier(this , identifier) + ); + } + + return variables.ToArray(); + } + + public PluginCommand[] ValidPluginCommands + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetValidPluginCommandsForMediumLevelILFunction( + this.OwnerFunction.View.DangerousGetHandle(), + this.DangerousGetHandle(), + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArray( + arrayPointer , + arrayLength , + PluginCommand.FromNative , + NativeMethods.BNFreePluginCommandList + ); + } + } + + public PluginCommand[] GetValidPluginCommandsForInstruction(ulong instruction) + { + IntPtr arrayPointer = NativeMethods.BNGetValidPluginCommandsForMediumLevelILInstruction( + this.OwnerFunction.View.DangerousGetHandle(), + this.DangerousGetHandle(), + instruction, + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArray( + arrayPointer , + arrayLength , + PluginCommand.FromNative , + NativeMethods.BNFreePluginCommandList + ); + } + + public MediumLevelILExpressionIndex AddExpression( + MediumLevelILOperation operation, + SourceLocation? location = null, + ulong size = 0, + params ulong[] operands + ) + { + ulong a = 0; + ulong b = 0; + ulong c = 0; + ulong d = 0; + ulong e = 0; + + if (operands.Length > 0) + { + a = operands[0]; + } + + if (operands.Length > 1) + { + b = operands[1]; + } + + if (operands.Length > 2) + { + c = operands[2]; + } + + if (operands.Length > 3) + { + d = operands[3]; + } + + if (operands.Length > 4) + { + e = operands[4]; + } + + if (null == location) + { + return NativeMethods.BNMediumLevelILAddExpr( + this.handle , + operation, + size , + a, + b , + c , + d , + e + ); + } + else + { + return NativeMethods.BNMediumLevelILAddExprWithLocation( + this.handle , + operation, + location.Address, + location.Operand, + size , + a, + b , + c , + d , + e + ); + } + + } + + public MediumLevelILExpressionIndex EmitNop(SourceLocation? location = null) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_NOP , + location + ); + } + + public MediumLevelILExpressionIndex EmitSetVar( + ulong size, + Variable dest, + MediumLevelILExpressionIndex source, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_SET_VAR, + location, + size, + dest.Identifier, + (ulong)source + ); + } + + public MediumLevelILExpressionIndex EmitSetVarField( + ulong size, + Variable dest, + ulong offset, + MediumLevelILExpressionIndex source, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_SET_VAR_FIELD, + location, + size, + dest.Identifier, + offset, + (ulong)source + ); + } + + + public MediumLevelILExpressionIndex EmitSetVarSplit( + ulong size, + Variable destHigh, + Variable destLow, + MediumLevelILExpressionIndex source, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_SET_VAR_SPLIT, + location, + size, + destHigh.Identifier, + destLow.Identifier, + (ulong)source + ); + } + + public MediumLevelILExpressionIndex EmitAssert( + ulong size, + Variable source, + PossibleValueSet constraint, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_ASSERT, + location, + size, + source.Identifier, + (ulong)this.CachePossibleValueSet(constraint) + ); + } + + public MediumLevelILExpressionIndex EmitForceVer( + ulong size, + Variable dest, + Variable source, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_FORCE_VER, + location, + size, + dest.Identifier, + source.Identifier + ); + } + + public MediumLevelILExpressionIndex EmitLoad( + ulong size, + MediumLevelILExpressionIndex source, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_LOAD, + location, + size, + (ulong)source + ); + } + + public MediumLevelILExpressionIndex EmitLoadStruct( + ulong size, + MediumLevelILExpressionIndex source, + ulong offset, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_LOAD_STRUCT, + location, + size, + (ulong)source, + offset + ); + } + + public MediumLevelILExpressionIndex EmitStore( + ulong size, + MediumLevelILExpressionIndex dest, + MediumLevelILExpressionIndex source, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_STORE, + location, + size, + (ulong)dest, + (ulong)source + ); + } + + public MediumLevelILExpressionIndex EmitStoreStruct( + ulong size, + MediumLevelILExpressionIndex dest, + ulong offset, + MediumLevelILExpressionIndex source, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_STORE_STRUCT, + location, + size, + (ulong)dest, + (ulong)offset, + (ulong)source + ); + } + + public MediumLevelILExpressionIndex EmitVar( + ulong size, + Variable source, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_VAR, + location, + size, + (ulong)source.Identifier + ); + } + + public MediumLevelILExpressionIndex EmitVarField( + ulong size, + Variable source, + ulong offset, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_VAR_FIELD, + location, + size, + (ulong)source.Identifier, + offset + ); + } + + public MediumLevelILExpressionIndex EmitVarSplit( + ulong size, + Variable high, + Variable low, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_VAR_SPLIT, + location, + size, + (ulong)high.Identifier, + (ulong)low.Identifier + ); + } + + + public MediumLevelILExpressionIndex EmitAddressOf( + Variable variable, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_ADDRESS_OF, + location, + 0, + (ulong)variable.Identifier + ); + } + + public MediumLevelILExpressionIndex EmitConst( + ulong size, + ulong value , + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_CONST, + location, + size, + value + ); + } + + public MediumLevelILExpressionIndex EmitConstData( + ulong size, + RegisterValue data, // state must ConstantDataValue + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_CONST_DATA, + location, + size, + (ulong)data.State, + (ulong)data.Value + ); + } + + public MediumLevelILExpressionIndex EmitConstPointer( + ulong size, + ulong value, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_CONST_PTR, + location, + size, + value + ); + } + + public MediumLevelILExpressionIndex EmitExternPointer( + ulong size, + ulong value, + ulong offset, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_EXTERN_PTR, + location, + size, + value, + offset + ); + } + + public MediumLevelILExpressionIndex EmitFloatConst( + ulong size, + ulong value, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_FLOAT_CONST, + location, + size, + value + ); + } + + public MediumLevelILExpressionIndex EmitImport( + ulong size, + ulong value, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_IMPORT, + location, + size, + value + ); + } + + public MediumLevelILExpressionIndex EmitAdd( + ulong size, + MediumLevelILExpressionIndex a, + MediumLevelILExpressionIndex b, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_ADD, + location, + size, + (ulong)a, + (ulong)b + ); + } + + public MediumLevelILExpressionIndex EmitAddCarry( + ulong size, + MediumLevelILExpressionIndex a, + MediumLevelILExpressionIndex b, + MediumLevelILExpressionIndex carry, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_ADC, + location, + size, + (ulong)a, + (ulong)b, + (ulong) carry + ); + } + + public MediumLevelILExpressionIndex EmitSub( + ulong size, + MediumLevelILExpressionIndex a, + MediumLevelILExpressionIndex b, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_SUB, + location, + size, + (ulong)a, + (ulong) b + ); + } + + public MediumLevelILExpressionIndex EmitSubBorrow( + ulong size, + MediumLevelILExpressionIndex a, + MediumLevelILExpressionIndex b, + MediumLevelILExpressionIndex carry, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_SBB, + location, + size, + (ulong)a, + (ulong)b, + (ulong)carry + ); + } + + public MediumLevelILExpressionIndex EmitAnd( + ulong size, + MediumLevelILExpressionIndex a, + MediumLevelILExpressionIndex b, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_AND, + location, + size, + (ulong)a, + (ulong)b + ); + } + + public MediumLevelILExpressionIndex EmitOr( + ulong size, + MediumLevelILExpressionIndex a, + MediumLevelILExpressionIndex b, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_OR, + location, + size, + (ulong)a, + (ulong) b + ); + } + + public MediumLevelILExpressionIndex EmitXor( + ulong size, + MediumLevelILExpressionIndex a, + MediumLevelILExpressionIndex b, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_XOR, + location, + size, + (ulong)a, + (ulong)b + ); + } + + public MediumLevelILExpressionIndex EmitShiftLeft( + ulong size, + MediumLevelILExpressionIndex left, + MediumLevelILExpressionIndex right, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_LSL, + location, + size, + (ulong)left, + (ulong) right + ); + } + + public MediumLevelILExpressionIndex EmitLogicalShiftRight( + ulong size, + MediumLevelILExpressionIndex left, + MediumLevelILExpressionIndex right, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_LSR, + location, + size, + (ulong)left, + (ulong)right + ); + } + + public MediumLevelILExpressionIndex EmitArithShiftRight( + ulong size, + MediumLevelILExpressionIndex left, + MediumLevelILExpressionIndex right, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_ASR, + location, + size, + (ulong)left, + (ulong)right + ); + } + + public MediumLevelILExpressionIndex EmitRotateLeft( + ulong size, + MediumLevelILExpressionIndex left, + MediumLevelILExpressionIndex right, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_ROL, + location, + size, + (ulong)left, + (ulong)right + ); + } + + public MediumLevelILExpressionIndex EmitRotateLeftCarry( + ulong size, + MediumLevelILExpressionIndex left, + MediumLevelILExpressionIndex right, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_RLC, + location, + size, + (ulong)left, + (ulong)right + ); + } + + public MediumLevelILExpressionIndex EmitRorateRight( + ulong size, + MediumLevelILExpressionIndex left, + MediumLevelILExpressionIndex right, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_ROR, + location, + size, + (ulong)left, + (ulong) right + ); + } + + public MediumLevelILExpressionIndex EmitRotateRightCarry( + ulong size, + MediumLevelILExpressionIndex left, + MediumLevelILExpressionIndex right, + MediumLevelILExpressionIndex carry, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_RRC, + location, + size, + (ulong)left, + (ulong)right, + (ulong) carry + ); + } + + public MediumLevelILExpressionIndex EmitMUL( + ulong size, + MediumLevelILExpressionIndex left, + MediumLevelILExpressionIndex right, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_MUL, + location, + size, + (ulong)left, + (ulong)right + ); + } + + public MediumLevelILExpressionIndex EmitMulDoublePrecUnsigned( + ulong size, + MediumLevelILExpressionIndex left, + MediumLevelILExpressionIndex right, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_MULU_DP, + location, + size, + (ulong)left, + (ulong) right + ); + } + + public MediumLevelILExpressionIndex EmitMulDoublePrecSigned( + ulong size, + MediumLevelILExpressionIndex left, + MediumLevelILExpressionIndex right, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_MULS_DP, + location, + size, + (ulong)left, + (ulong)right + ); + } + + public MediumLevelILExpressionIndex EmitDivUnsigned( + ulong size, + MediumLevelILExpressionIndex left, + MediumLevelILExpressionIndex right, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_DIVU, + location, + size, + (ulong)left, + (ulong)right + ); + } + + public MediumLevelILExpressionIndex EmitDivDoublePrecUnsigned( + ulong size, + MediumLevelILExpressionIndex left, + MediumLevelILExpressionIndex right, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_DIVU_DP, + location, + size, + (ulong)left, + (ulong)right + ); + } + + public MediumLevelILExpressionIndex EmitDivSigned( + ulong size, + MediumLevelILExpressionIndex left, + MediumLevelILExpressionIndex right, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_DIVS, + location, + size, + (ulong)left, + (ulong)right + ); + } + + public MediumLevelILExpressionIndex EmitDivDoublePrecSigned( + ulong size, + MediumLevelILExpressionIndex left, + MediumLevelILExpressionIndex right, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_DIVS_DP, + location, + size, + (ulong)left, + (ulong)right + ); + } + + + public MediumLevelILExpressionIndex EmitModUnsigned( + ulong size, + MediumLevelILExpressionIndex left, + MediumLevelILExpressionIndex right, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_MODU, + location, + size, + (ulong)left, + (ulong)right + ); + } + + public MediumLevelILExpressionIndex EmitModDoublePrecUnsigned( + ulong size, + MediumLevelILExpressionIndex left, + MediumLevelILExpressionIndex right, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_MODU_DP, + location, + size, + (ulong)left, + (ulong) right + ); + } + + + public MediumLevelILExpressionIndex EmitModSigned( + ulong size, + MediumLevelILExpressionIndex left, + MediumLevelILExpressionIndex right, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_MODS, + location, + size, + (ulong)left, + (ulong)right + ); + } + + + public MediumLevelILExpressionIndex EmitModDoublePrecSigned( + ulong size, + MediumLevelILExpressionIndex left, + MediumLevelILExpressionIndex right, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_MODS_DP, + location, + size, + (ulong)left, + (ulong)right + ); + } + + public MediumLevelILExpressionIndex EmitNeg( + ulong size, + MediumLevelILExpressionIndex value, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_NEG, + location, + size, + (ulong)value + ); + } + + public MediumLevelILExpressionIndex EmitNot( + ulong size, + MediumLevelILExpressionIndex value, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_NOT, + location, + size, + (ulong)value + ); + } + + public MediumLevelILExpressionIndex EmitSignExtend( + ulong size, + MediumLevelILExpressionIndex value, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_SX, + location, + size, + (ulong)value + ); + } + + public MediumLevelILExpressionIndex EmitZeroExtend( + ulong size, + MediumLevelILExpressionIndex value, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_ZX, + location, + size, + (ulong)value + ); + } + + public MediumLevelILExpressionIndex EmitLowPart( + ulong size, + MediumLevelILExpressionIndex value, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_LOW_PART, + location, + size, + (ulong)value + ); + } + + public MediumLevelILExpressionIndex EmitJUMP( + ulong size, + MediumLevelILExpressionIndex dest, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_JUMP, + location, + size, + (ulong)dest + ); + } + + public MediumLevelILExpressionIndex EmitJumpTo( + MediumLevelILExpressionIndex dest, + IDictionary targets, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_JUMP_TO, + location, + 0, + (ulong)dest, + (ulong)targets.Count * 2, + (ulong)this.AddLabelMap(targets) + ); + } + + public MediumLevelILExpressionIndex EmitCall( + Variable[] outputs, + MediumLevelILExpressionIndex dest, + MediumLevelILExpressionIndex[] parameters, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_CALL, + location, + 0, + (ulong)outputs.Length, + (ulong)this.AddVariableList(outputs), + (ulong)parameters.Length, + (ulong)this.AddOperandList(parameters) + ); + } + + public MediumLevelILExpressionIndex EmitCALL_UNTYPED( + Variable[] outputs, + MediumLevelILExpressionIndex dest, + MediumLevelILExpressionIndex[] parameters, + MediumLevelILExpressionIndex stack, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_CALL_UNTYPED, + location, + 0, + (ulong)this.EmitCallOutput(outputs, location), + (ulong)dest, + (ulong)this.EmitCallParam(parameters, location), + (ulong)stack + ); + } + + public MediumLevelILExpressionIndex EmitCallOutput( + Variable[] outputs, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_CALL_OUTPUT, + location, + 0, + (ulong)outputs.Length, + (ulong)this.AddVariableList(outputs) + ); + } + + + public MediumLevelILExpressionIndex EmitCallParam( + MediumLevelILExpressionIndex[] parameters, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_CALL_PARAM, + location, + 0, + (ulong)parameters.Length, + (ulong)this.AddOperandList(parameters) + ); + } + + + public MediumLevelILExpressionIndex EmitRet( + MediumLevelILExpressionIndex[] sources, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_RET, + location, + 0, + (ulong)sources.Length, + (ulong)this.AddOperandList(sources) + ); + } + + public MediumLevelILExpressionIndex EmitNoRet( + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_NORET, + location, + 0 + ); + } + + public MediumLevelILExpressionIndex EmitIf( + MediumLevelILExpressionIndex condition, + MediumLevelILLabel tureLabel, + MediumLevelILLabel falseLabel, + SourceLocation? location = null + ) + { + if (null == location) + { + return NativeMethods.BNMediumLevelILIf( + this.handle , + condition , + tureLabel.ToNative() , + falseLabel.ToNative() + ); + } + else + { + return NativeMethods.BNMediumLevelILIfWithLocation( + this.handle , + condition , + tureLabel.ToNative() , + falseLabel.ToNative() , + location.Address , + (uint)location.Operand + ); + } + } + + public MediumLevelILExpressionIndex EmitGoto( + MediumLevelILLabel label, + SourceLocation? location = null + ) + { + if (null == location) + { + return NativeMethods.BNMediumLevelILGoto( + this.handle, + label.ToNative() + ); + } + else + { + return NativeMethods.BNMediumLevelILGotoWithLocation( + this.handle, + label.ToNative(), + location.Address, + location.Operand + ); + } + } + + public MediumLevelILExpressionIndex EmitEqual( + ulong size, + MediumLevelILExpressionIndex left, + MediumLevelILExpressionIndex right, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_CMP_E, + location, + size, + (ulong)left, + (ulong)right + ); + } + + public MediumLevelILExpressionIndex EmitNotEqual( + ulong size, + MediumLevelILExpressionIndex left, + MediumLevelILExpressionIndex right, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_CMP_NE, + location, + size, + (ulong)left, + (ulong)right + ); + } + + public MediumLevelILExpressionIndex EmitSignedLessThan( + ulong size, + MediumLevelILExpressionIndex left, + MediumLevelILExpressionIndex right, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_CMP_SLT, + location, + size, + (ulong)left, + (ulong)right + ); + } + + public MediumLevelILExpressionIndex EmitUnsignedLessThan( + ulong size, + MediumLevelILExpressionIndex left, + MediumLevelILExpressionIndex right, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_CMP_ULT, + location, + size, + (ulong)left, + (ulong)right + ); + } + + public MediumLevelILExpressionIndex EmitSignedLessThanOrEqual( + ulong size, + MediumLevelILExpressionIndex left, + MediumLevelILExpressionIndex right, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_CMP_SLE, + location, + size, + (ulong)left, + (ulong)right + ); + } + + public MediumLevelILExpressionIndex EmitUnsignedLessThanOrEqual( + ulong size, + MediumLevelILExpressionIndex left, + MediumLevelILExpressionIndex right, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_CMP_ULE, + location, + size, + (ulong)left, + (ulong)right + ); + } + + public MediumLevelILExpressionIndex EmitSignedGreaterThanOrEqual( + ulong size, + MediumLevelILExpressionIndex left, + MediumLevelILExpressionIndex right, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_CMP_SGE, + location, + size, + (ulong)left, + (ulong)right + ); + } + + public MediumLevelILExpressionIndex EmitUnsignedGreaterThanOrEqual( + ulong size, + MediumLevelILExpressionIndex left, + MediumLevelILExpressionIndex right, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_CMP_UGE, + location, + size, + (ulong)left, + (ulong)right + ); + } + + public MediumLevelILExpressionIndex EmitSignedGreaterThan( + ulong size, + MediumLevelILExpressionIndex left, + MediumLevelILExpressionIndex right, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_CMP_SGT, + location, + size, + (ulong)left, + (ulong)right + ); + } + + public MediumLevelILExpressionIndex EmitUnsignedGreaterThan( + ulong size, + MediumLevelILExpressionIndex left, + MediumLevelILExpressionIndex right, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_CMP_UGT, + location, + size, + (ulong)left, + (ulong)right + ); + } + + public MediumLevelILExpressionIndex EmitTestBit( + ulong size, + MediumLevelILExpressionIndex a, + MediumLevelILExpressionIndex b, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_TEST_BIT, + location, + size, + (ulong)a, + (ulong) b + ); + } + + public MediumLevelILExpressionIndex EmitBoolToInt( + ulong size, + MediumLevelILExpressionIndex a, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_BOOL_TO_INT, + location, + size, + (ulong)a + ); + } + + public MediumLevelILExpressionIndex EmitSysCall( + Variable[] outputs, + MediumLevelILExpressionIndex[] parameters, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_SYSCALL, + location, + 0, + (ulong)outputs.Length, + (ulong)this.AddVariableList(outputs), + (ulong)parameters.Length, + (ulong)this.AddOperandList(parameters) + ); + } + + + public MediumLevelILExpressionIndex EmitSysCallUntyped( + Variable[] outputs, + MediumLevelILExpressionIndex[] parameters, + MediumLevelILExpressionIndex stack, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_SYSCALL_UNTYPED, + location, + 0, + (ulong)this.EmitCallOutput(outputs, location), + (ulong)this.EmitCallParam(parameters , location), + (ulong)stack + ); + } + + public MediumLevelILExpressionIndex EmitTailCall( + Variable[] outputs, + MediumLevelILExpressionIndex dest, + MediumLevelILExpressionIndex[] parameters, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_TAILCALL, + location, + 0, + (ulong)outputs.Length, + (ulong)this.AddVariableList(outputs), + (ulong)dest, + (ulong)parameters.Length, + (ulong)this.AddOperandList(parameters) + ); + } + + public MediumLevelILExpressionIndex EmitTailCallUntyped( + Variable[] outputs, + MediumLevelILExpressionIndex dest, + MediumLevelILExpressionIndex[] parameters, + MediumLevelILExpressionIndex stack, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_TAILCALL_UNTYPED, + location, + 0, + (ulong)this.EmitCallOutput(outputs, location), + (ulong)this.EmitCallParam(parameters , location), + (ulong) stack + ); + } + + public MediumLevelILExpressionIndex EmitIntrinsic( + Variable[] outputs, + IntrinsicIndex intrinsic, + MediumLevelILExpressionIndex[] parameters, + MediumLevelILExpressionIndex stack, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_INTRINSIC, + location, + 0, + (ulong)outputs.Length, + (ulong)this.AddVariableList(outputs), + (ulong)intrinsic, + (ulong)parameters.Length, + (ulong)this.AddOperandList(parameters) + ); + } + + public MediumLevelILExpressionIndex EmitFreeVarSlot( + ulong size, + Variable variable, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_FREE_VAR_SLOT, + location, + size, + variable.Identifier + ); + } + + public MediumLevelILExpressionIndex EmitBreakpoint( + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_BP, + location, + 0 + ); + } + + public MediumLevelILExpressionIndex EmitTrap( + ulong value, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_TRAP, + location, + 0, + value + ); + } + + public MediumLevelILExpressionIndex EmitUndefined( + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_UNDEF, + location, + 0 + ); + } + + public MediumLevelILExpressionIndex EmitUnimplemented( + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_UNIMPL, + location, + 0 + ); + } + + public MediumLevelILExpressionIndex EmitUnimplementedMemoryRef( + ulong size, + MediumLevelILExpressionIndex source, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_UNIMPL_MEM, + location, + size, + (ulong)source + ); + } + + public MediumLevelILExpressionIndex EmitFloatAdd( + ulong size, + MediumLevelILExpressionIndex left, + MediumLevelILExpressionIndex right, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_FADD, + location, + size, + (ulong)left, + (ulong)right + ); + } + + public MediumLevelILExpressionIndex EmitFloatSub( + ulong size, + MediumLevelILExpressionIndex left, + MediumLevelILExpressionIndex right, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_FSUB, + location, + size, + (ulong)left, + (ulong)right + ); + } + + public MediumLevelILExpressionIndex EmitFloatMul( + ulong size, + MediumLevelILExpressionIndex left, + MediumLevelILExpressionIndex right, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_FMUL, + location, + size, + (ulong)left, + (ulong)right + ); + } + + public MediumLevelILExpressionIndex EmitFloatDiv( + ulong size, + MediumLevelILExpressionIndex left, + MediumLevelILExpressionIndex right, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_FDIV, + location, + size, + (ulong)left, + (ulong)right + ); + } + + public MediumLevelILExpressionIndex EmitFloatSquareRoot( + ulong size, + MediumLevelILExpressionIndex operand, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_FSQRT, + location, + size, + (ulong)operand + ); + } + + + public MediumLevelILExpressionIndex EmitFloatNeg( + ulong size, + MediumLevelILExpressionIndex operand, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_FNEG, + location, + size, + (ulong)operand + ); + } + + public MediumLevelILExpressionIndex EmitFloatAbs( + ulong size, + MediumLevelILExpressionIndex operand, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_FABS, + location, + size, + (ulong)operand + ); + } + + public MediumLevelILExpressionIndex EmitFloatToInt( + ulong size, + MediumLevelILExpressionIndex operand, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_FLOAT_TO_INT, + location, + size, + (ulong)operand + ); + } + + public MediumLevelILExpressionIndex EmitIntToFloat( + ulong size, + MediumLevelILExpressionIndex operand, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_INT_TO_FLOAT, + location, + size, + (ulong)operand + ); + } + + public MediumLevelILExpressionIndex EmitFloatConvert( + ulong size, + MediumLevelILExpressionIndex operand, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_FLOAT_CONV, + location, + size, + (ulong)operand + ); + } + + public MediumLevelILExpressionIndex EmitRoundToInt( + ulong size, + MediumLevelILExpressionIndex operand, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_ROUND_TO_INT, + location, + size, + (ulong)operand + ); + } + + public MediumLevelILExpressionIndex EmitFloor( + ulong size, + MediumLevelILExpressionIndex operand, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_FLOOR, + location, + size, + (ulong)operand + ); + } + + public MediumLevelILExpressionIndex EmitCeil( + ulong size, + MediumLevelILExpressionIndex operand, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_CEIL, + location, + size, + (ulong)operand + ); + } + + + public MediumLevelILExpressionIndex EmitFloatTrunc( + ulong size, + MediumLevelILExpressionIndex operand, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_FTRUNC, + location, + size, + (ulong)operand + ); + } + + + public MediumLevelILExpressionIndex EmitFloatEqual( + ulong size, + MediumLevelILExpressionIndex left, + MediumLevelILExpressionIndex right, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_FCMP_E, + location, + size, + (ulong)left, + (ulong)right + ); + } + + public MediumLevelILExpressionIndex EmitFloatNotEqual( + ulong size, + MediumLevelILExpressionIndex left, + MediumLevelILExpressionIndex right, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_FCMP_NE, + location, + size, + (ulong)left, + (ulong)right + ); + } + + public MediumLevelILExpressionIndex EmitFloatLessThan( + ulong size, + MediumLevelILExpressionIndex left, + MediumLevelILExpressionIndex right, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_FCMP_LT, + location, + size, + (ulong)left, + (ulong)right + ); + } + + public MediumLevelILExpressionIndex EmitFloatLessThanOrEqual( + ulong size, + MediumLevelILExpressionIndex left, + MediumLevelILExpressionIndex right, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_FCMP_LE, + location, + size, + (ulong)left, + (ulong)right + ); + } + + + public MediumLevelILExpressionIndex EmitFloatGreaterThanOrEqual( + ulong size, + MediumLevelILExpressionIndex left, + MediumLevelILExpressionIndex right, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_FCMP_GE, + location, + size, + (ulong)left, + (ulong)right + ); + } + + public MediumLevelILExpressionIndex EmitFloatGreaterThan( + ulong size, + MediumLevelILExpressionIndex left, + MediumLevelILExpressionIndex right, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_FCMP_GT, + location, + size, + (ulong)left, + (ulong)right + ); + } + + public MediumLevelILExpressionIndex EmitFloatOrdered( + ulong size, + MediumLevelILExpressionIndex left, + MediumLevelILExpressionIndex right, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_FCMP_O, + location, + size, + (ulong)left, + (ulong)right + ); + } + + public MediumLevelILExpressionIndex EmitFloatUnordered( + ulong size, + MediumLevelILExpressionIndex left, + MediumLevelILExpressionIndex right, + SourceLocation? location = null + ) + { + return this.AddExpression( + MediumLevelILOperation.MLIL_FCMP_UO, + location, + size, + (ulong)left, + (ulong)right + ); + } + } + +} \ No newline at end of file diff --git a/Handle/BNMetadata.cs b/Handle/BNMetadata.cs new file mode 100644 index 0000000..befdd9d --- /dev/null +++ b/Handle/BNMetadata.cs @@ -0,0 +1,764 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class Metadata : AbstractSafeHandle + { + public Metadata() + : this(Metadata.rawCreateMetadataDict( new Dictionary()) , true) + { + + } + + public Metadata(bool value) + : this(NativeMethods.BNCreateMetadataBooleanData(value) , true) + { + + } + + public Metadata(string value) + : this(NativeMethods.BNCreateMetadataStringData(value) , true) + { + + } + + public Metadata(sbyte value) + : this(NativeMethods.BNCreateMetadataSignedIntegerData(value) , true) + { + + } + + public Metadata(byte value) + : this(NativeMethods.BNCreateMetadataUnsignedIntegerData(value) , true) + { + + } + + public Metadata(short value) + : this(NativeMethods.BNCreateMetadataSignedIntegerData(value) , true) + { + + } + + public Metadata(ushort value) + : this(NativeMethods.BNCreateMetadataUnsignedIntegerData(value) , true) + { + + } + + public Metadata(int value) + : this(NativeMethods.BNCreateMetadataSignedIntegerData(value) , true) + { + + } + + public Metadata(uint value) + : this(NativeMethods.BNCreateMetadataUnsignedIntegerData(value) , true) + { + + } + + public Metadata(long value) + : this(NativeMethods.BNCreateMetadataSignedIntegerData(value) , true) + { + + } + + public Metadata(ulong value) + : this(NativeMethods.BNCreateMetadataUnsignedIntegerData(value) , true) + { + + } + + + public Metadata(float value) + : this(NativeMethods.BNCreateMetadataDoubleData(value) , true) + { + + } + + public Metadata(double value) + : this(NativeMethods.BNCreateMetadataDoubleData(value) , true) + { + + } + + public Metadata(MetadataType value) + : this(NativeMethods.BNCreateMetadataOfType(value) , true) + { + + } + + public Metadata(byte[] value) + : this(NativeMethods.BNCreateMetadataRawData(value , (ulong)value.Length) , true) + { + + } + + public Metadata(bool[] value) + : this(NativeMethods.BNCreateMetadataBooleanListData(value , (ulong)value.Length) , true) + { + + } + + public Metadata(long[] value) + : this(NativeMethods.BNCreateMetadataSignedIntegerListData(value , (ulong)value.Length) , true) + { + + } + + public Metadata(ulong[] value) + : this(NativeMethods.BNCreateMetadataUnsignedIntegerListData(value , (ulong)value.Length) , true) + { + + } + + public Metadata(double[] value) + : this(NativeMethods.BNCreateMetadataDoubleListData(value , (ulong)value.Length) , true) + { + + } + + public Metadata(string[] value) + : this(NativeMethods.BNCreateMetadataStringListData(value , (ulong)value.Length) , true) + { + + } + + public Metadata(Metadata[] value) + : this(rawCreateMetadataArray(value) , true) + { + + } + + public Metadata(IDictionary value) + : this(Metadata.rawCreateMetadataDict(value) , true) + { + + } + + public Metadata(IntPtr handle , bool owner) : base(owner) + { + this.SetHandle(handle); + } + + public static Metadata FromBool(bool value) + { + return Metadata.MustTakeHandle( + NativeMethods.BNCreateMetadataBooleanData(value) + ); + } + + public static Metadata FromString(string value) + { + return Metadata.MustTakeHandle( + NativeMethods.BNCreateMetadataStringData(value) + ); + } + + public static Metadata FromUnsignedInteger(ulong value) + { + return Metadata.MustTakeHandle( + NativeMethods.BNCreateMetadataUnsignedIntegerData(value) + ); + } + + public static Metadata FromSignedInteger(long value) + { + return Metadata.MustTakeHandle( + NativeMethods.BNCreateMetadataSignedIntegerData(value) + ); + } + + public static Metadata FromDouble(double value) + { + return Metadata.MustTakeHandle( + NativeMethods.BNCreateMetadataDoubleData(value) + ); + } + + public static Metadata FromBytes(byte[] data) + { + return Metadata.MustTakeHandle( + NativeMethods.BNCreateMetadataRawData(data , (ulong)data.Length) + ); + } + + public static Metadata FromArray(Metadata[] values) + { + return Metadata.MustTakeHandle( + Metadata.rawCreateMetadataArray(values) + ); + } + + private static IntPtr rawCreateMetadataArray(Metadata[] values) + { + List handles = new List(); + + foreach (Metadata item in values) + { + handles.Add(item.DangerousGetHandle()); + } + + return NativeMethods.BNCreateMetadataArray( + handles.ToArray() , + (ulong)handles.Count + ); + } + + public static Metadata FromDict(IDictionary dict) + { + return Metadata.MustTakeHandle( + Metadata.rawCreateMetadataDict(dict) + ); + } + + private static IntPtr rawCreateMetadataDict(IDictionary dict) + { + List handles = new List(); + + foreach (Metadata item in dict.Values) + { + handles.Add(item.DangerousGetHandle()); + } + + return NativeMethods.BNCreateMetadataValueStore( + dict.Keys.ToArray() , + handles.ToArray(), + (ulong)handles.Count + ); + } + + public static Metadata FromBoolArray(bool[] values) + { + return Metadata.MustTakeHandle( + NativeMethods.BNCreateMetadataBooleanListData(values , (ulong)values.Length) + ); + } + + public static Metadata FromUnsignedIntegeArray(ulong[] values) + { + return Metadata.MustTakeHandle( + NativeMethods.BNCreateMetadataUnsignedIntegerListData(values , (ulong)values.Length) + ); + } + + public static Metadata FromSignedIntegerArray(long[] values) + { + return Metadata.MustTakeHandle( + NativeMethods.BNCreateMetadataSignedIntegerListData(values , (ulong)values.Length) + ); + } + + public static Metadata FromDoubleArray(double[] values) + { + return Metadata.MustTakeHandle( + NativeMethods.BNCreateMetadataDoubleListData(values , (ulong)values.Length) + ); + } + + public static Metadata FromStringArray(string[] values) + { + return Metadata.MustTakeHandle( + NativeMethods.BNCreateMetadataStringListData(values , (ulong)values.Length) + ); + } + + internal static Metadata? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new Metadata( + NativeMethods.BNNewMetadataReference(handle) , + true + ); + } + + internal static Metadata MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new Metadata( + NativeMethods.BNNewMetadataReference(handle) , + true + ); + } + + internal static Metadata? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new Metadata(handle, true); + } + + internal static Metadata MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new Metadata(handle, true); + } + + + internal static Metadata? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new Metadata(handle , false); + } + + internal static Metadata MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new Metadata(handle , false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeMetadata(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + + public MetadataType Type + { + get + { + return NativeMethods.BNMetadataGetType(this.handle); + } + } + + public bool IsEquals(Metadata other) + { + return NativeMethods.BNMetadataIsEqual( + this.DangerousGetHandle(), + other.DangerousGetHandle() + ); + } + + public bool ToBoolean() + { + return NativeMethods.BNMetadataGetBoolean(this.handle); + } + + public string AsString() + { + return UnsafeUtils.TakeUtf8String( + NativeMethods.BNMetadataGetString(this.handle) + ); + } + + public string ToJsonString() + { + return UnsafeUtils.TakeUtf8String( + NativeMethods.BNMetadataGetJsonString(this.handle) + ); + } + + public override string ToString() + { + return this.ToJsonString(); + } + + public long ToSignedInteger() + { + return NativeMethods.BNMetadataGetSignedInteger(this.handle); + } + + public ulong ToUnsignedIntege() + { + return NativeMethods.BNMetadataGetUnsignedInteger(this.handle); + } + + public double ToDouble() + { + return NativeMethods.BNMetadataGetDouble(this.handle); + } + + public bool[] ToBooleanList() + { + IntPtr arrayPointer = NativeMethods.BNMetadataGetBooleanList( + this.handle , + out ulong arrayLength + ); + + bool[] values = UnsafeUtils.ReadBoolArray(arrayPointer , arrayLength); + + if (arrayPointer != IntPtr.Zero ) + { + NativeMethods.BNFreeMetadataBooleanList(arrayPointer , arrayLength); + } + + return values; + } + + public string[] ToStringList() + { + IntPtr arrayPointer = NativeMethods.BNMetadataGetStringList( + this.handle , + out ulong arrayLength + ); + + string[] values = UnsafeUtils.ReadAnsiStringArray(arrayPointer , arrayLength); + + if (arrayPointer != IntPtr.Zero ) + { + NativeMethods.BNFreeMetadataStringList(arrayPointer , arrayLength); + } + + return values; + } + + + public long[] ToSignedIntegerList() + { + IntPtr arrayPointer = NativeMethods.BNMetadataGetSignedIntegerList( + this.handle , + out ulong arrayLength + ); + + long[] values = UnsafeUtils.ReadNumberArray(arrayPointer , arrayLength); + + if (arrayPointer != IntPtr.Zero ) + { + NativeMethods.BNFreeMetadataSignedIntegerList(arrayPointer , arrayLength); + } + + return values; + } + + public ulong[] ToUnsignedIntegerList() + { + IntPtr arrayPointer = NativeMethods.BNMetadataGetUnsignedIntegerList( + this.handle , + out ulong arrayLength + ); + + ulong[] values = UnsafeUtils.ReadNumberArray(arrayPointer , arrayLength); + + if (arrayPointer != IntPtr.Zero ) + { + NativeMethods.BNFreeMetadataUnsignedIntegerList(arrayPointer , arrayLength); + } + + return values; + } + + public double[] ToDoubleList() + { + IntPtr arrayPointer = NativeMethods.BNMetadataGetDoubleList( + this.handle , + out ulong arrayLength + ); + + double[] values = UnsafeUtils.ReadNumberArray(arrayPointer , arrayLength); + + if (arrayPointer != IntPtr.Zero ) + { + NativeMethods.BNFreeMetadataDoubleList(arrayPointer , arrayLength); + } + + return values; + } + + public Metadata[] ToArray() + { + IntPtr arrayPointer = NativeMethods.BNMetadataGetArray( + this.handle , + out ulong arrayLength + ); + + return UnsafeUtils.TakeHandleArray( + arrayPointer, + arrayLength, + Metadata.MustNewFromHandle, + NativeMethods.BNFreeMetadataArray + ); + } + + public byte[] ToBytes() + { + IntPtr arrayPointer = NativeMethods.BNMetadataGetRaw( + this.handle , + out ulong arrayLength + ); + + byte[] values = UnsafeUtils.ReadNumberArray(arrayPointer , arrayLength); + + if (arrayPointer != IntPtr.Zero ) + { + NativeMethods.BNFreeMetadataRaw(arrayPointer); + } + + return values; + } + + public IDictionary ToDictionary() + { + Dictionary target = new Dictionary(); + + IntPtr pointer = NativeMethods.BNMetadataGetValueStore( + this.handle + ); + + if (IntPtr.Zero == pointer) + { + return target; + } + + target = MetadataValueStore.MustFromNativePointer(pointer).ToDictionary(); + + NativeMethods.BNFreeMetadataValueStore(pointer); + + return target; + } + + public bool IsBoolean() + { + return NativeMethods.BNMetadataIsBoolean(this.handle); + } + + public bool IsString() + { + return NativeMethods.BNMetadataIsString(this.handle); + } + + public bool IsUnsignedInteger() + { + return NativeMethods.BNMetadataIsUnsignedInteger(this.handle); + } + + public bool IsSignedInteger() + { + return NativeMethods.BNMetadataIsSignedInteger(this.handle); + } + + public bool IsDouble() + { + return NativeMethods.BNMetadataIsDouble(this.handle); + } + + public bool IsBooleanList() + { + return NativeMethods.BNMetadataIsBooleanList(this.handle); + } + + public bool IsStringList() + { + return NativeMethods.BNMetadataIsStringList(this.handle); + } + + public bool IsUnsignedIntegerList() + { + return NativeMethods.BNMetadataIsUnsignedIntegerList(this.handle); + } + + public bool IsSignedIntegerList() + { + return NativeMethods.BNMetadataIsSignedIntegerList(this.handle); + } + + public bool IsDoubleList() + { + return NativeMethods.BNMetadataIsDoubleList(this.handle); + } + + public bool IsRaw() + { + return NativeMethods.BNMetadataIsRaw(this.handle); + } + + public bool IsArray() + { + return NativeMethods.BNMetadataIsArray(this.handle); + } + + public bool IsKeyValueStore() + { + return NativeMethods.BNMetadataIsKeyValueStore(this.handle); + } + + public ulong GetLength() + { + return NativeMethods.BNMetadataSize(this.handle); + } + + + public bool SetValue(string key , Metadata data) + { + return NativeMethods.BNMetadataSetValueForKey( + this.handle, + key, + data.DangerousGetHandle() + ); + } + + public bool SetValue(string key , bool value) + { + return NativeMethods.BNMetadataSetValueForKey( + this.handle, + key, + NativeMethods.BNCreateMetadataBooleanData(value) + ); + } + + public bool SetValue(string key , string value) + { + return NativeMethods.BNMetadataSetValueForKey( + this.handle, + key, + NativeMethods.BNCreateMetadataStringData(value) + ); + } + + public bool SetValue(string key , long value) + { + return NativeMethods.BNMetadataSetValueForKey( + this.handle, + key, + NativeMethods.BNCreateMetadataSignedIntegerData(value) + ); + } + + public bool SetValue(string key , ulong value) + { + return NativeMethods.BNMetadataSetValueForKey( + this.handle, + key, + NativeMethods.BNCreateMetadataUnsignedIntegerData(value) + ); + } + + public bool SetValue(string key , double value) + { + return NativeMethods.BNMetadataSetValueForKey( + this.handle, + key, + NativeMethods.BNCreateMetadataDoubleData(value) + ); + } + + public bool SetValue(string key , byte[] data) + { + return NativeMethods.BNMetadataSetValueForKey( + this.handle, + key, + NativeMethods.BNCreateMetadataRawData(data , (ulong)data.Length) + ); + } + + public bool SetValue(string key , MetadataType value) + { + return NativeMethods.BNMetadataSetValueForKey( + this.handle, + key, + NativeMethods.BNCreateMetadataOfType(value) + ); + } + + public bool SetValue(string key , bool[] values) + { + return NativeMethods.BNMetadataSetValueForKey( + this.handle, + key, + NativeMethods.BNCreateMetadataBooleanListData(values , (ulong)values.Length) + ); + } + + public bool SetValue(string key , long[] values) + { + return NativeMethods.BNMetadataSetValueForKey( + this.handle, + key, + NativeMethods.BNCreateMetadataSignedIntegerListData(values , (ulong)values.Length) + ); + } + + public bool SetValue(string key , ulong[] values) + { + return NativeMethods.BNMetadataSetValueForKey( + this.handle, + key, + NativeMethods.BNCreateMetadataUnsignedIntegerListData(values , (ulong)values.Length) + ); + } + + public bool SetValue(string key , double[] values) + { + return NativeMethods.BNMetadataSetValueForKey( + this.handle, + key, + NativeMethods.BNCreateMetadataDoubleListData(values , (ulong)values.Length) + ); + } + + public bool SetValue(string key , string[] values) + { + return NativeMethods.BNMetadataSetValueForKey( + this.handle, + key, + NativeMethods.BNCreateMetadataStringListData(values , (ulong)values.Length) + ); + } + + public Metadata? GetValue(string key) + { + return Metadata.TakeHandle( + NativeMethods.BNMetadataGetForKey(this.handle , key) + ); + } + + public Metadata? GetValue(ulong index) + { + return Metadata.TakeHandle( + NativeMethods.BNMetadataGetForIndex(this.handle , index) + ); + } + + public bool Append(Metadata element) + { + return NativeMethods.BNMetadataArrayAppend( + this.handle , + element.DangerousGetHandle() + ); + } + + public void Remove(string key) + { + NativeMethods.BNMetadataRemoveKey(this.handle , key); + } + + public void Remove(ulong index) + { + NativeMethods.BNMetadataRemoveIndex(this.handle , index); + } + } + + +} \ No newline at end of file diff --git a/Handle/BNNamedTypeReference.cs b/Handle/BNNamedTypeReference.cs new file mode 100644 index 0000000..b99b1c6 --- /dev/null +++ b/Handle/BNNamedTypeReference.cs @@ -0,0 +1,121 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class NamedTypeReference : AbstractSafeHandle + { + public NamedTypeReference(NamedTypeReferenceClass cls , string id , QualifiedName name) + : this( NamedTypeReference.rawCreate(cls , id , name) , true ) + { + + } + + internal NamedTypeReference(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + private static IntPtr rawCreate(NamedTypeReferenceClass cls , string id , QualifiedName name) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + return NativeMethods.BNCreateNamedType( + cls, + id, + name.ToNativeEx(allocator) + ); + } + } + + internal static NamedTypeReference? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new NamedTypeReference( + NativeMethods.BNNewNamedTypeReference(handle) , + true + ); + } + + internal static NamedTypeReference MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new NamedTypeReference( + NativeMethods.BNNewNamedTypeReference(handle) , + true + ); + } + + internal static NamedTypeReference? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new NamedTypeReference(handle, true); + } + + internal static NamedTypeReference MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new NamedTypeReference(handle, true); + } + + internal static NamedTypeReference? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new NamedTypeReference(handle, false); + } + + internal static NamedTypeReference MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new NamedTypeReference(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeNamedTypeReference(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + + public QualifiedName Name + { + get + { + return QualifiedName.TakeNative( + NativeMethods.BNGetTypeReferenceName(this.handle) + ); + } + } + } +} \ No newline at end of file diff --git a/Handle/BNNamedTypeReferenceBuilder.cs b/Handle/BNNamedTypeReferenceBuilder.cs new file mode 100644 index 0000000..9fa1dfd --- /dev/null +++ b/Handle/BNNamedTypeReferenceBuilder.cs @@ -0,0 +1,67 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class NamedTypeReferenceBuilder : AbstractSafeHandle + { + internal NamedTypeReferenceBuilder(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static NamedTypeReferenceBuilder? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new NamedTypeReferenceBuilder(handle, true); + } + + internal static NamedTypeReferenceBuilder MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new NamedTypeReferenceBuilder(handle, true); + } + + internal static NamedTypeReferenceBuilder? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new NamedTypeReferenceBuilder(handle, false); + } + + internal static NamedTypeReferenceBuilder MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new NamedTypeReferenceBuilder(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeNamedTypeReferenceBuilder(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + } +} \ No newline at end of file diff --git a/Handle/BNPlatform.cs b/Handle/BNPlatform.cs new file mode 100644 index 0000000..b394c2f --- /dev/null +++ b/Handle/BNPlatform.cs @@ -0,0 +1,511 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class Platform : AbstractSafeHandle + { + public Platform(Architecture arch , string name) + :this( NativeMethods.BNCreatePlatform(arch.DangerousGetHandle() , name) , true) + { + + } + + internal Platform(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static Platform? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new Platform( + NativeMethods.BNNewPlatformReference(handle) , + true + ); + } + + internal static Platform MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new Platform( + NativeMethods.BNNewPlatformReference(handle) , + true + ); + } + + internal static Platform? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new Platform(handle, true); + } + + internal static Platform MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new Platform(handle, true); + } + + internal static Platform? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new Platform(handle, false); + } + + internal static Platform MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new Platform(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreePlatform(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + + public static Platform[] GetPlatforms() + { + IntPtr arrayPointer = NativeMethods.BNGetPlatformList(out ulong arrayLength); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer , + arrayLength , + Platform.MustNewFromHandle, + NativeMethods.BNFreePlatformList + ); + } + + public static Platform? FromName(string name) + { + return Platform.TakeHandle( + NativeMethods.BNGetPlatformByName(name) + ); + } + + public static Platform[] GetPlatformsByOS(string os) + { + IntPtr arrayPointer = NativeMethods.BNGetPlatformListByOS( + os, + out ulong arrayLength + ); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer , + arrayLength , + Platform.MustNewFromHandle, + NativeMethods.BNFreePlatformList + ); + } + + public static string[] GetOSList() + { + IntPtr arrayPointer = NativeMethods.BNGetPlatformOSList(out ulong arrayLength); + + return UnsafeUtils.TakeAnsiStringArray( + arrayPointer , + arrayLength, + NativeMethods.BNFreePlatformOSList + ); + } + + public void RegisterPlatform(string os) + { + NativeMethods.BNRegisterPlatform(os , this.handle); + } + + public string Name + { + get + { + return UnsafeUtils.TakeAnsiString( + NativeMethods.BNGetPlatformName(this.handle) + ); + } + } + + public Architecture Architecture + { + get + { + return Architecture.MustFromHandle( + NativeMethods.BNGetPlatformArchitecture(this.handle) + ); + } + } + + public BinaryNinja.CallingConvention DefaultCallingConvention + { + get + { + return BinaryNinja.CallingConvention.MustTakeHandle( + NativeMethods.BNGetPlatformDefaultCallingConvention(this.handle) + ); + } + } + + public BinaryNinja.CallingConvention CdeclCallingConvention + { + get + { + return BinaryNinja.CallingConvention.MustTakeHandle( + NativeMethods.BNGetPlatformCdeclCallingConvention(this.handle) + ); + } + } + + public BinaryNinja.CallingConvention StdcallCallingConvention + { + get + { + return BinaryNinja.CallingConvention.MustTakeHandle( + NativeMethods.BNGetPlatformStdcallCallingConvention(this.handle) + ); + } + } + + public BinaryNinja.CallingConvention FastcallCallingConvention + { + get + { + return BinaryNinja.CallingConvention.MustTakeHandle( + NativeMethods.BNGetPlatformFastcallCallingConvention(this.handle) + ); + } + } + + public BinaryNinja.CallingConvention SystemCallConvention + { + get + { + return BinaryNinja.CallingConvention.MustTakeHandle( + NativeMethods.BNGetPlatformSystemCallConvention(this.handle) + ); + } + } + + + public BinaryNinja.CallingConvention[] CallingConventions() + { + IntPtr arrayPointer = NativeMethods.BNGetPlatformCallingConventions( + this.handle, + out ulong arrayLength + ); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer , + arrayLength , + BinaryNinja.CallingConvention.MustNewFromHandle, + NativeMethods.BNFreeCallingConventionList + ); + } + + public void RegisterCallingConvention(BinaryNinja.CallingConvention callConvention) + { + NativeMethods.BNRegisterPlatformCallingConvention( + this.handle, + callConvention.DangerousGetHandle() + ); + } + + public void RegisterDefaultCallingConvention(BinaryNinja.CallingConvention callConvention) + { + NativeMethods.BNRegisterPlatformDefaultCallingConvention( + this.handle, + callConvention.DangerousGetHandle() + ); + } + + public void RegisterCdeclCallingConvention(BinaryNinja.CallingConvention callConvention) + { + NativeMethods.BNRegisterPlatformCdeclCallingConvention( + this.handle, + callConvention.DangerousGetHandle() + ); + } + + public void RegisterStdcallCallingConvention(BinaryNinja.CallingConvention callConvention) + { + NativeMethods.BNRegisterPlatformStdcallCallingConvention( + this.handle, + callConvention.DangerousGetHandle() + ); + } + + public void RegisterFastcallCallingConvention(BinaryNinja.CallingConvention callConvention) + { + NativeMethods.BNRegisterPlatformFastcallCallingConvention( + this.handle, + callConvention.DangerousGetHandle() + ); + } + + public void SetSystemCallConvention(BinaryNinja.CallingConvention callConvention) + { + NativeMethods.BNSetPlatformSystemCallConvention( + this.handle, + callConvention.DangerousGetHandle() + ); + } + + public uint[] GlobalRegisters + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetPlatformGlobalRegisters( + this.handle, + out ulong arrayLength + ); + + return UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength, + NativeMethods.BNFreeRegisterList + ); + } + } + + public ulong AddressSize + { + get + { + return NativeMethods.BNGetPlatformAddressSize(this.handle); + } + } + + public Platform? GetRelatedPlatform(Architecture arch) + { + return Platform.TakeHandle( + NativeMethods.BNGetRelatedPlatform( + this.handle, + arch.DangerousGetHandle() + ) + ); + } + + public void AddRelatedPlatform(Architecture arch , Platform platform) + { + NativeMethods.BNAddRelatedPlatform( + this.handle , + arch.DangerousGetHandle() , + platform.DangerousGetHandle() + ); + } + + public Platform[] RelatedPlatforms + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetRelatedPlatforms( + this.handle , + out ulong arrayLength + ); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer , + arrayLength , + Platform.MustNewFromHandle , + NativeMethods.BNFreePlatformList + ); + } + } + + public Platform? GetAssociatedPlatformByAddress(ref ulong address) + { + return Platform.TakeHandle( + NativeMethods.BNGetAssociatedPlatformByAddress( + this.handle, + ref address + ) + ); + } + + + public TypeContainer TypeContainer + { + get + { + return TypeContainer.MustTakeHandle( + NativeMethods.BNGetPlatformTypeContainer(this.handle) + ); + } + } + + public QualifiedNameAndType[] Types + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetPlatformTypes( + this.handle, + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + QualifiedNameAndType.FromNative , + NativeMethods.BNFreeTypeAndNameList + ); + } + } + + public QualifiedNameAndType[] Variables + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetPlatformVariables( + this.handle, + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + QualifiedNameAndType.FromNative , + NativeMethods.BNFreeTypeAndNameList + ); + } + } + + public QualifiedNameAndType[] Functions + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetPlatformFunctions( + this.handle, + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + QualifiedNameAndType.FromNative , + NativeMethods.BNFreeTypeAndNameList + ); + } + } + + public SystemCallInfo[] SystemCalls + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetPlatformSystemCalls( + this.handle, + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + SystemCallInfo.FromNative , + NativeMethods.BNFreeSystemCallList + ); + } + } + + public BinaryNinja.Type? GetTypeByName(QualifiedName name) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + return BinaryNinja.Type.TakeHandle( + NativeMethods.BNGetPlatformTypeByName( + this.handle , + name.ToNativeEx(allocator) + ) + ); + } + } + + public BinaryNinja.Type? GetVariableByName(QualifiedName name) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + return BinaryNinja.Type.TakeHandle( + NativeMethods.BNGetPlatformVariableByName( + this.handle , + name.ToNativeEx(allocator) + ) + ); + } + } + + public BinaryNinja.Type? GetFunctionByName(QualifiedName name , bool exactMatch =false ) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + return BinaryNinja.Type.TakeHandle( + NativeMethods.BNGetPlatformFunctionByName( + this.handle , + name.ToNativeEx(allocator), + exactMatch + ) + ); + } + } + + public string GetSystemCallName(uint number) + { + return UnsafeUtils.TakeAnsiString( + NativeMethods.BNGetPlatformSystemCallName(this.handle , number) + ); + } + + public BinaryNinja.Type? GetSystemCallType(uint number) + { + return BinaryNinja.Type.TakeHandle( + NativeMethods.BNGetPlatformSystemCallType(this.handle , number) + ); + } + + public TypeLibrary[] TypeLibraries + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetPlatformTypeLibraries( + this.handle, + out ulong arrayLength + ); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer, + arrayLength, + TypeLibrary.MustNewFromHandle, + NativeMethods.BNFreeTypeLibraryList + ); + } + } + } + +} \ No newline at end of file diff --git a/Handle/BNProject.cs b/Handle/BNProject.cs new file mode 100644 index 0000000..df7418d --- /dev/null +++ b/Handle/BNProject.cs @@ -0,0 +1,111 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class Project : AbstractSafeHandle + { + internal Project(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static Project? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new Project( + NativeMethods.BNNewProjectReference(handle) , + true + ); + } + + internal static Project MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new Project( + NativeMethods.BNNewProjectReference(handle) , + true + ); + } + + internal static Project? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new Project(handle, true); + } + + internal static Project MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new Project(handle, true); + } + + internal static Project? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new Project(handle, false); + } + + internal static Project MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new Project(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeProject(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + + public PluginCommand[] ValidPluginCommands + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetValidPluginCommandsForProject( + this.handle, + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArray( + arrayPointer , + arrayLength , + PluginCommand.FromNative , + NativeMethods.BNFreePluginCommandList + ); + } + } + } +} \ No newline at end of file diff --git a/Handle/BNProjectFile.cs b/Handle/BNProjectFile.cs new file mode 100644 index 0000000..7ee4acc --- /dev/null +++ b/Handle/BNProjectFile.cs @@ -0,0 +1,93 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class ProjectFile : AbstractSafeHandle + { + internal ProjectFile(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static ProjectFile? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new ProjectFile( + NativeMethods.BNNewProjectFileReference(handle) , + true + ); + } + + internal static ProjectFile MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new ProjectFile( + NativeMethods.BNNewProjectFileReference(handle) , + true + ); + } + + internal static ProjectFile? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new ProjectFile(handle, true); + } + + internal static ProjectFile MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new ProjectFile(handle, true); + } + + internal static ProjectFile? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new ProjectFile(handle, false); + } + + internal static ProjectFile MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new ProjectFile(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeProjectFile(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + } +} \ No newline at end of file diff --git a/Handle/BNProjectFolder.cs b/Handle/BNProjectFolder.cs new file mode 100644 index 0000000..48598a6 --- /dev/null +++ b/Handle/BNProjectFolder.cs @@ -0,0 +1,93 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class ProjectFolder : AbstractSafeHandle + { + internal ProjectFolder(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static ProjectFolder? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new ProjectFolder( + NativeMethods.BNNewProjectFolderReference(handle) , + true + ); + } + + internal static ProjectFolder MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new ProjectFolder( + NativeMethods.BNNewProjectFolderReference(handle) , + true + ); + } + + internal static ProjectFolder? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new ProjectFolder(handle, true); + } + + internal static ProjectFolder MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new ProjectFolder(handle, true); + } + + internal static ProjectFolder? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new ProjectFolder(handle, false); + } + + internal static ProjectFolder MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new ProjectFolder(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeProjectFolder(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + } +} \ No newline at end of file diff --git a/Handle/BNRelocation.cs b/Handle/BNRelocation.cs new file mode 100644 index 0000000..e47ce6d --- /dev/null +++ b/Handle/BNRelocation.cs @@ -0,0 +1,93 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class Relocation : AbstractSafeHandle + { + public Relocation(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static Relocation? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new Relocation( + NativeMethods.BNNewRelocationReference(handle) , + true + ); + } + + internal static Relocation MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new Relocation( + NativeMethods.BNNewRelocationReference(handle) , + true + ); + } + + internal static Relocation? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new Relocation(handle, true); + } + + internal static Relocation MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new Relocation(handle, true); + } + + internal static Relocation? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new Relocation(handle, false); + } + + internal static Relocation MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new Relocation(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeRelocation(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + } +} \ No newline at end of file diff --git a/Handle/BNRelocationHandler.cs b/Handle/BNRelocationHandler.cs new file mode 100644 index 0000000..fe53c9a --- /dev/null +++ b/Handle/BNRelocationHandler.cs @@ -0,0 +1,93 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class RelocationHandler : AbstractSafeHandle + { + internal RelocationHandler(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static RelocationHandler? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new RelocationHandler( + NativeMethods.BNNewRelocationHandlerReference(handle) , + true + ); + } + + internal static RelocationHandler MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new RelocationHandler( + NativeMethods.BNNewRelocationHandlerReference(handle) , + true + ); + } + + internal static RelocationHandler? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new RelocationHandler(handle, true); + } + + internal static RelocationHandler MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new RelocationHandler(handle, true); + } + + internal static RelocationHandler? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new RelocationHandler(handle, false); + } + + internal static RelocationHandler MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new RelocationHandler(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeRelocationHandler(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + } +} \ No newline at end of file diff --git a/Handle/BNRemote.cs b/Handle/BNRemote.cs new file mode 100644 index 0000000..581ea76 --- /dev/null +++ b/Handle/BNRemote.cs @@ -0,0 +1,93 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class Remote : AbstractSafeHandle + { + internal Remote(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static Remote? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new Remote( + NativeMethods.BNNewRemoteReference(handle) , + true + ); + } + + internal static Remote MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new Remote( + NativeMethods.BNNewRemoteReference(handle) , + true + ); + } + + internal static Remote? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new Remote(handle, true); + } + + internal static Remote MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new Remote(handle, true); + } + + internal static Remote? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new Remote(handle, false); + } + + internal static Remote MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new Remote(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeRemote(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + } +} \ No newline at end of file diff --git a/Handle/BNRemoteFile.cs b/Handle/BNRemoteFile.cs new file mode 100644 index 0000000..4c8b84a --- /dev/null +++ b/Handle/BNRemoteFile.cs @@ -0,0 +1,93 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class RemoteFile : AbstractSafeHandle + { + internal RemoteFile(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static RemoteFile? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new RemoteFile( + NativeMethods.BNNewRemoteFileReference(handle) , + true + ); + } + + internal static RemoteFile MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new RemoteFile( + NativeMethods.BNNewRemoteFileReference(handle) , + true + ); + } + + internal static RemoteFile? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new RemoteFile(handle, true); + } + + internal static RemoteFile MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new RemoteFile(handle, true); + } + + internal static RemoteFile? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new RemoteFile(handle, false); + } + + internal static RemoteFile MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new RemoteFile(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeRemoteFile(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + } +} \ No newline at end of file diff --git a/Handle/BNRemoteFolder.cs b/Handle/BNRemoteFolder.cs new file mode 100644 index 0000000..f9d31bf --- /dev/null +++ b/Handle/BNRemoteFolder.cs @@ -0,0 +1,93 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class RemoteFolder : AbstractSafeHandle + { + internal RemoteFolder(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static RemoteFolder? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new RemoteFolder( + NativeMethods.BNNewRemoteFolderReference(handle) , + true + ); + } + + internal static RemoteFolder MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new RemoteFolder( + NativeMethods.BNNewRemoteFolderReference(handle) , + true + ); + } + + internal static RemoteFolder? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new RemoteFolder(handle, true); + } + + internal static RemoteFolder MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new RemoteFolder(handle, true); + } + + internal static RemoteFolder? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new RemoteFolder(handle, false); + } + + internal static RemoteFolder MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new RemoteFolder(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeRemoteFolder(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + } +} \ No newline at end of file diff --git a/Handle/BNRemoteProject.cs b/Handle/BNRemoteProject.cs new file mode 100644 index 0000000..9866a35 --- /dev/null +++ b/Handle/BNRemoteProject.cs @@ -0,0 +1,93 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class RemoteProject : AbstractSafeHandle + { + internal RemoteProject(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static RemoteProject? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new RemoteProject( + NativeMethods.BNNewRemoteProjectReference(handle) , + true + ); + } + + internal static RemoteProject MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new RemoteProject( + NativeMethods.BNNewRemoteProjectReference(handle) , + true + ); + } + + internal static RemoteProject? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new RemoteProject(handle, true); + } + + internal static RemoteProject MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new RemoteProject(handle, true); + } + + internal static RemoteProject? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new RemoteProject(handle, false); + } + + internal static RemoteProject MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new RemoteProject(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeRemoteProject(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + } +} \ No newline at end of file diff --git a/Handle/BNRenderLayer.cs b/Handle/BNRenderLayer.cs new file mode 100644 index 0000000..c0184e6 --- /dev/null +++ b/Handle/BNRenderLayer.cs @@ -0,0 +1,72 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class RenderLayer : AbstractSafeHandle + { + internal RenderLayer(IntPtr handle) + :base(handle, false) + { + + } + + internal static RenderLayer FromHandle(IntPtr handle) + { + return new RenderLayer(handle); + } + + public string Name + { + get + { + return UnsafeUtils.TakeAnsiString( + NativeMethods.BNGetRenderLayerName(this.handle) + ); + } + } + + public void ApplyToFlowGraph(FlowGraph graph) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + NativeMethods.BNApplyRenderLayerToFlowGraph( + this.handle, + graph.DangerousGetHandle() + ); + } + } + + + public LinearDisassemblyLine[] ApplyToLinearViewObject( + LinearViewObject linearView, + LinearViewObject? prev, + LinearViewObject? next, + LinearDisassemblyLine[] lines + ) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + NativeMethods.BNApplyRenderLayerToLinearViewObject( + this.handle, + linearView.DangerousGetHandle(), + null == prev ? IntPtr.Zero : prev.DangerousGetHandle(), + null == next ? IntPtr.Zero : next.DangerousGetHandle(), + allocator.ConvertToNativeArrayEx(lines), + (ulong)lines.Length, + out IntPtr outLines, + out ulong outLineCount + ); + + return UnsafeUtils.TakeStructArrayEx( + outLines , + outLineCount, + LinearDisassemblyLine.FromNative, + NativeMethods.BNFreeLinearDisassemblyLines + ); + } + } + } +} \ No newline at end of file diff --git a/Handle/BNRepoPlugin.cs b/Handle/BNRepoPlugin.cs new file mode 100644 index 0000000..70e5664 --- /dev/null +++ b/Handle/BNRepoPlugin.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class RepoPlugin : AbstractSafeHandle + { + internal RepoPlugin(IntPtr handle) + :base(handle , false) + { + + } + } +} \ No newline at end of file diff --git a/Handle/BNReportCollection.cs b/Handle/BNReportCollection.cs new file mode 100644 index 0000000..13e75b4 --- /dev/null +++ b/Handle/BNReportCollection.cs @@ -0,0 +1,206 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class ReportCollection : AbstractSafeHandle + { + public ReportCollection() + : this( NativeMethods.BNCreateReportCollection() , true) + { + + } + + internal ReportCollection(IntPtr handle , bool owner) : base(handle , owner) + { + + } + + internal static ReportCollection? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new ReportCollection( + NativeMethods.BNNewReportCollectionReference(handle) , + true + ); + } + + internal static ReportCollection MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new ReportCollection( + NativeMethods.BNNewReportCollectionReference(handle) , + true + ); + } + + internal static ReportCollection? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new ReportCollection(handle, true); + } + + internal static ReportCollection MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new ReportCollection(handle, true); + } + + internal static ReportCollection? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new ReportCollection(handle, false); + } + + internal static ReportCollection MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new ReportCollection(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeReportCollection(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + + public ulong Count + { + get + { + return NativeMethods.BNGetReportCollectionCount(this.handle); + } + } + + public IEnumerable Reports + { + get + { + for (ulong index = 0; index < this.Count; index++) + { + ReportType type = NativeMethods.BNGetReportType(this.handle, index); + + if (ReportType.PlainTextReportType == type) + { + yield return new PlainTextReport(this, index); + } + else if (ReportType.MarkdownReportType == type) + { + yield return new MarkdownReport(this, index); + } + else if (ReportType.HTMLReportType == type) + { + yield return new HTMLReport(this, index); + } + else if (ReportType.FlowGraphReportType == type) + { + yield return new FlowGraphReport(this, index); + } + else + { + throw new NotSupportedException(); + } + } + } + } + + public void AddPlainTextReport( + string title , + string contents , + BinaryView? view + ) + { + NativeMethods.BNAddPlainTextReportToCollection( + this.handle, + null == view ? IntPtr.Zero : view.DangerousGetHandle(), + title , + contents + ); + } + + public void AddMarkdownReport( + string title , + string contents , + string plaintext, + BinaryView? view + ) + { + NativeMethods.BNAddMarkdownReportToCollection( + this.handle, + null == view ? IntPtr.Zero : view.DangerousGetHandle(), + title , + contents , + plaintext + ); + } + + public void AddHTMLReport( + string title , + string contents , + string plaintext, + BinaryView? view + ) + { + NativeMethods.BNAddHTMLReportToCollection( + this.handle, + null == view ? IntPtr.Zero : view.DangerousGetHandle(), + title , + contents , + plaintext + ); + } + + public void AddGraphReport( + string title , + FlowGraph graph, + BinaryView? view + ) + { + NativeMethods.BNAddGraphReportToCollection( + this.handle, + null == view ? IntPtr.Zero : view.DangerousGetHandle(), + title , + graph.DangerousGetHandle() + ); + } + + public void Show(string title) + { + NativeMethods.BNShowReportCollection( + title, + this.handle + ); + } + } +} \ No newline at end of file diff --git a/Handle/BNRepository.cs b/Handle/BNRepository.cs new file mode 100644 index 0000000..f5dfa41 --- /dev/null +++ b/Handle/BNRepository.cs @@ -0,0 +1,93 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class Repository : AbstractSafeHandle + { + public Repository(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static Repository? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new Repository( + NativeMethods.BNNewRepositoryReference(handle) , + true + ); + } + + internal static Repository MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new Repository( + NativeMethods.BNNewRepositoryReference(handle) , + true + ); + } + + internal static Repository? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new Repository(handle, true); + } + + internal static Repository MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new Repository(handle, true); + } + + internal static Repository? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new Repository(handle, false); + } + + internal static Repository MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new Repository(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeRepository(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + } +} \ No newline at end of file diff --git a/Handle/BNRepositoryManager.cs b/Handle/BNRepositoryManager.cs new file mode 100644 index 0000000..f0ec423 --- /dev/null +++ b/Handle/BNRepositoryManager.cs @@ -0,0 +1,93 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class RepositoryManager : AbstractSafeHandle + { + internal RepositoryManager(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static RepositoryManager? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new RepositoryManager( + NativeMethods.BNNewRepositoryManagerReference(handle) , + true + ); + } + + internal static RepositoryManager MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new RepositoryManager( + NativeMethods.BNNewRepositoryManagerReference(handle) , + true + ); + } + + internal static RepositoryManager? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new RepositoryManager(handle, true); + } + + internal static RepositoryManager MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new RepositoryManager(handle, true); + } + + internal static RepositoryManager? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new RepositoryManager(handle, false); + } + + internal static RepositoryManager MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new RepositoryManager(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeRepositoryManager(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + } +} \ No newline at end of file diff --git a/Handle/BNSaveSettings.cs b/Handle/BNSaveSettings.cs new file mode 100644 index 0000000..9884d94 --- /dev/null +++ b/Handle/BNSaveSettings.cs @@ -0,0 +1,124 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class SaveSettings : AbstractSafeHandle + { + public SaveSettings() + : this( NativeMethods.BNCreateSaveSettings() , true) + { + + } + + internal SaveSettings(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static SaveSettings? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new SaveSettings( + NativeMethods.BNNewSaveSettingsReference(handle) , + true + ); + } + + internal static SaveSettings MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new SaveSettings( + NativeMethods.BNNewSaveSettingsReference(handle) , + true + ); + } + + internal static SaveSettings? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new SaveSettings(handle, true); + } + + internal static SaveSettings MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new SaveSettings(handle, true); + } + + internal static SaveSettings? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new SaveSettings(handle, false); + } + + internal static SaveSettings MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new SaveSettings(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeSaveSettings(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + + public string Name + { + get + { + return UnsafeUtils.TakeAnsiString( + NativeMethods.BNGetSaveSettingsName(this.handle) + ); + } + + set + { + NativeMethods.BNSetSaveSettingsName(this.handle, value); + } + } + + public bool IsOptionSet(SaveOption option) + { + return NativeMethods.BNIsSaveSettingsOptionSet(this.handle, option); + } + + public void SetOption(SaveOption option , bool value) + { + NativeMethods.BNSetSaveSettingsOption(this.handle, option, value); + } + } +} \ No newline at end of file diff --git a/Handle/BNScriptingInstance.cs b/Handle/BNScriptingInstance.cs new file mode 100644 index 0000000..f26fa16 --- /dev/null +++ b/Handle/BNScriptingInstance.cs @@ -0,0 +1,93 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class ScriptingInstance : AbstractSafeHandle + { + public ScriptingInstance(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static ScriptingInstance? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new ScriptingInstance( + NativeMethods.BNNewScriptingInstanceReference(handle) , + true + ); + } + + internal static ScriptingInstance MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new ScriptingInstance( + NativeMethods.BNNewScriptingInstanceReference(handle) , + true + ); + } + + internal static ScriptingInstance? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new ScriptingInstance(handle, true); + } + + internal static ScriptingInstance MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new ScriptingInstance(handle, true); + } + + internal static ScriptingInstance? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new ScriptingInstance(handle, false); + } + + internal static ScriptingInstance MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new ScriptingInstance(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeScriptingInstance(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + } +} \ No newline at end of file diff --git a/Handle/BNScriptingProvider.cs b/Handle/BNScriptingProvider.cs new file mode 100644 index 0000000..c80402e --- /dev/null +++ b/Handle/BNScriptingProvider.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class ScriptingProvider : AbstractSafeHandle + { + internal ScriptingProvider(IntPtr handle) + :base(handle , false) + { + + } + } +} \ No newline at end of file diff --git a/Handle/BNSecretsProvider.cs b/Handle/BNSecretsProvider.cs new file mode 100644 index 0000000..7ba59d6 --- /dev/null +++ b/Handle/BNSecretsProvider.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class SecretsProvider : AbstractSafeHandle + { + internal SecretsProvider(IntPtr handle) + :base(handle , false) + { + + } + } +} \ No newline at end of file diff --git a/Handle/BNSection.cs b/Handle/BNSection.cs new file mode 100644 index 0000000..60748c6 --- /dev/null +++ b/Handle/BNSection.cs @@ -0,0 +1,197 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class Section : AbstractSafeHandle
+ { + internal Section(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static Section? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new Section( + NativeMethods.BNNewSectionReference(handle) , + true + ); + } + + internal static Section MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new Section( + NativeMethods.BNNewSectionReference(handle) , + true + ); + } + + internal static Section? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new Section(handle, true); + } + + internal static Section MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new Section(handle, true); + } + + internal static Section? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new Section(handle, false); + } + + internal static Section MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new Section(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeSection(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + + public string Name + { + get + { + IntPtr raw = NativeMethods.BNSectionGetName(this.handle); + + return UnsafeUtils.TakeAnsiString(raw); + } + } + + public string Type + { + get + { + IntPtr raw = NativeMethods.BNSectionGetType(this.handle); + + return UnsafeUtils.TakeAnsiString(raw); + } + } + + public ulong Length + { + get + { + return NativeMethods.BNSectionGetLength(this.handle); + } + } + + public ulong Start + { + get + { + return NativeMethods.BNSectionGetStart(this.handle); + } + } + + public ulong End + { + get + { + return this.Start + this.Length; + } + } + + public string LinkedSection + { + get + { + IntPtr raw = NativeMethods.BNSectionGetLinkedSection(this.handle); + + return UnsafeUtils.TakeAnsiString(raw); + } + } + + public string InfoSection + { + get + { + IntPtr raw = NativeMethods.BNSectionGetInfoSection(this.handle); + + return UnsafeUtils.TakeAnsiString(raw); + } + } + + public ulong InfoData + { + get + { + return NativeMethods.BNSectionGetInfoData(this.handle);; + } + } + + public ulong Align + { + get + { + return NativeMethods.BNSectionGetAlign(this.handle);; + } + } + + public ulong EntrySize + { + get + { + return NativeMethods.BNSectionGetEntrySize(this.handle);; + } + } + + public SectionSemantics Semantics + { + get + { + return NativeMethods.BNSectionGetSemantics(this.handle);; + } + } + + public bool AutoDefined + { + get + { + return NativeMethods.BNSectionIsAutoDefined(this.handle);; + } + } + } +} \ No newline at end of file diff --git a/Handle/BNSegment.cs b/Handle/BNSegment.cs new file mode 100644 index 0000000..cba5598 --- /dev/null +++ b/Handle/BNSegment.cs @@ -0,0 +1,207 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class Segment : AbstractSafeHandle + { + internal Segment(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static Segment? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new Segment( + NativeMethods.BNNewSegmentReference(handle) , + true + ); + } + + internal static Segment MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new Segment( + NativeMethods.BNNewSegmentReference(handle) , + true + ); + } + + internal static Segment? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new Segment(handle, true); + } + + internal static Segment MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new Segment(handle, true); + } + + internal static Segment? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new Segment(handle, false); + } + + internal static Segment MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new Segment(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeSegment(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + + public ulong Length + { + get + { + return NativeMethods.BNSegmentGetLength(this.handle); + } + } + + public ulong Start + { + get + { + return NativeMethods.BNSegmentGetStart(this.handle); + } + } + + public ulong End + { + get + { + return NativeMethods.BNSegmentGetEnd(this.handle); + } + } + + public ulong DataLength + { + get + { + return NativeMethods.BNSegmentGetDataLength(this.handle); + } + } + + public ulong DataOffset + { + get + { + return NativeMethods.BNSegmentGetDataOffset(this.handle); + } + } + + public ulong DataEnd + { + get + { + return NativeMethods.BNSegmentGetDataEnd(this.handle); + } + } + + public bool AutoDefined + { + get + { + return NativeMethods.BNSegmentIsAutoDefined(this.handle); + } + } + + public SegmentFlag Flags + { + get + { + return (SegmentFlag)NativeMethods.BNSegmentGetFlags(this.handle); + } + } + + public bool Executable + { + get + { + return Utils.FlagOn( (uint)this.Flags, (uint)SegmentFlag.SegmentExecutable ); + } + } + + public bool Writable + { + get + { + return Utils.FlagOn((uint)this.Flags, (uint)SegmentFlag.SegmentWritable ); + } + } + + public bool Readable + { + get + { + return Utils.FlagOn((uint)this.Flags, (uint)SegmentFlag.SegmentReadable ); + } + } + + public bool ContainsData + { + get + { + return Utils.FlagOn((uint)this.Flags, (uint)SegmentFlag.SegmentContainsData ); + } + } + + public bool ContainsCode + { + get + { + return Utils.FlagOn((uint)this.Flags, (uint)SegmentFlag.SegmentContainsCode ); + } + } + + public bool DenyWrite + { + get + { + return Utils.FlagOn((uint)this.Flags, (uint)SegmentFlag.SegmentDenyWrite ); + } + } + + + } +} \ No newline at end of file diff --git a/Handle/BNSettings.cs b/Handle/BNSettings.cs new file mode 100644 index 0000000..f971dab --- /dev/null +++ b/Handle/BNSettings.cs @@ -0,0 +1,537 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class Settings : AbstractSafeHandle + { + public Settings(string schemaId = "default") + : this(NativeMethods.BNCreateSettings(schemaId) , true) + { + + } + + internal Settings(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static Settings? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new Settings( + NativeMethods.BNNewSettingsReference(handle) , + true + ); + } + + internal static Settings MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new Settings( + NativeMethods.BNNewSettingsReference(handle) , + true + ); + } + + internal static Settings? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new Settings(handle, true); + } + + internal static Settings MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new Settings(handle, true); + } + + internal static Settings? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new Settings(handle, false); + } + + internal static Settings MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new Settings(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeSettings(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + + public string ResourceId + { + set + { + NativeMethods.BNSettingsSetResourceId(this.handle, value); + } + } + + public bool RegisterGroup(string group , string title) + { + return NativeMethods.BNSettingsRegisterGroup(this.handle , group ,title); + } + + public bool RegisterSetting(string key , string properties) + { + return NativeMethods.BNSettingsRegisterSetting(this.handle , key ,properties); + } + + public bool Contains(string key) + { + return NativeMethods.BNSettingsContains(this.handle, key); + } + + public bool IsEmpty(BinaryView view , Function function, SettingsScope scope) + { + return NativeMethods.BNSettingsIsEmpty( + this.handle, + view.DangerousGetHandle(), + function.DangerousGetHandle(), + scope + ); + } + + public string[] Keys + { + get + { + IntPtr arrayPointer = NativeMethods.BNSettingsKeysList(this.handle , out ulong arrayLength); + + return UnsafeUtils.TakeAnsiStringArray( + arrayPointer , + arrayLength, + NativeMethods.BNFreeStringList + ); + } + } + + public string QueryPropertyString(string key , string property) + { + return UnsafeUtils.TakeAnsiString( + NativeMethods.BNSettingsQueryPropertyString(this.handle, key , property) + ); + } + + public string[] QueryPropertyStringList(string key , string property) + { + IntPtr arrayPointer = NativeMethods.BNSettingsQueryPropertyStringList( + this.handle , + key , + property , + out ulong arrayLength + ); + + return UnsafeUtils.TakeAnsiStringArray( + arrayPointer, + arrayLength, + NativeMethods.BNFreeStringList + ); + } + + public bool UpdateProperty(string key , string property) + { + return NativeMethods.BNSettingsUpdateProperty(this.handle , key , property); + } + + public bool DeserializeSchema(string schema , SettingsScope scope , bool merge) + { + return NativeMethods.BNSettingsDeserializeSchema(this.handle , schema , scope , merge); + } + + public string SerializeSchema() + { + return UnsafeUtils.TakeAnsiString( + NativeMethods.BNSettingsSerializeSchema(this.handle) + ); + } + + public bool DeserializeSettings( + string contents , + BinaryView view , + Function function , + SettingsScope scope) + { + return NativeMethods.BNDeserializeSettings( + this.handle , + contents , + view.DangerousGetHandle() , + function.DangerousGetHandle() , + scope + ); + } + + public string SerializeSettings( + BinaryView view , + Function function , + SettingsScope scope) + { + return UnsafeUtils.TakeAnsiString( + NativeMethods.BNSerializeSettings( + this.handle , + view.DangerousGetHandle() , + function.DangerousGetHandle() , + scope + ) + ); + } + + public bool Reset( + string key, + BinaryView view , + Function function , + SettingsScope scope) + { + return NativeMethods.BNSettingsReset( + this.handle , + key, + view.DangerousGetHandle() , + function.DangerousGetHandle() , + scope + ); + } + + public bool ResetAll( + BinaryView view , + Function function , + SettingsScope scope, + bool schemaOnly) + { + return NativeMethods.BNSettingsResetAll( + this.handle , + view.DangerousGetHandle() , + function.DangerousGetHandle() , + scope, + schemaOnly + ); + } + + public bool GetBool( + string key, + BinaryView? view, + Function? function, + out SettingsScope scope + ) + { + return NativeMethods.BNSettingsGetBool( + this.handle, + key , + null == view ? IntPtr.Zero : view.DangerousGetHandle() , + null == function ? IntPtr.Zero : function.DangerousGetHandle(), + out scope + ); + } + + public double GetDouble( + string key, + BinaryView? view, + Function? function, + out SettingsScope scope + ) + { + return NativeMethods.BNSettingsGetDouble( + this.handle, + key , + null == view ? IntPtr.Zero : view.DangerousGetHandle() , + null == function ? IntPtr.Zero : function.DangerousGetHandle(), + out scope + ); + } + + public T GetInteger( + string key, + BinaryView? view, + Function? function, + out SettingsScope scope + ) where T : unmanaged + { + ulong slug = NativeMethods.BNSettingsGetUInt64( + this.handle, + key , + null == view ? IntPtr.Zero : view.DangerousGetHandle() , + null == function ? IntPtr.Zero : function.DangerousGetHandle(), + out scope + ); + + if (typeof(T).UnderlyingSystemType == typeof(sbyte)) + { + return UnsafeUtils.ForceConvert( (sbyte)slug); + } + else if (typeof(T).UnderlyingSystemType == typeof(byte)) + { + return UnsafeUtils.ForceConvert( (byte)slug ); + } + else if (typeof(T).UnderlyingSystemType == typeof(short)) + { + return UnsafeUtils.ForceConvert( (short)slug); + } + else if (typeof(T).UnderlyingSystemType == typeof(ushort)) + { + return UnsafeUtils.ForceConvert( (ushort)slug); + } + else if (typeof(T).UnderlyingSystemType == typeof(int)) + { + return UnsafeUtils.ForceConvert( (int)slug); + } + else if (typeof(T).UnderlyingSystemType == typeof(uint)) + { + return UnsafeUtils.ForceConvert( (uint)slug); + } + else if (typeof(T).UnderlyingSystemType == typeof(long)) + { + return UnsafeUtils.ForceConvert((long)slug); + } + else if (typeof(T).UnderlyingSystemType == typeof(ulong)) + { + return UnsafeUtils.ForceConvert((ulong)slug); + } + + throw new NotSupportedException($"not supported type: {typeof(T).UnderlyingSystemType}"); + } + + public string GetString( + string key, + BinaryView? view, + Function? function, + out SettingsScope scope + ) + { + return UnsafeUtils.TakeAnsiString( + NativeMethods.BNSettingsGetString( + this.handle, + key , + null == view ? IntPtr.Zero : view.DangerousGetHandle() , + null == function ? IntPtr.Zero : function.DangerousGetHandle(), + out scope + ) + ); + } + + public string[] GetStringList( + string key, + BinaryView? view, + Function? function, + out SettingsScope scope + ) + { + IntPtr arrayPointer = NativeMethods.BNSettingsGetStringList( + this.handle, + key , + null == view ? IntPtr.Zero : view.DangerousGetHandle() , + null == function ? IntPtr.Zero : function.DangerousGetHandle(), + out scope, + out ulong arrayLength + ); + + return UnsafeUtils.TakeAnsiStringArray( + arrayPointer, + arrayLength, + NativeMethods.BNFreeStringList + ); + } + + public string GetJson( + string key, + BinaryView? view, + Function? function, + out SettingsScope scope + ) + { + return UnsafeUtils.TakeAnsiString( + NativeMethods.BNSettingsGetJson( + this.handle, + key , + null == view ? IntPtr.Zero : view.DangerousGetHandle() , + null == function ? IntPtr.Zero : function.DangerousGetHandle(), + out scope + ) + ); + } + + + public bool SetBool( + string key, + bool value, + BinaryView? view, + Function? function, + SettingsScope scope = SettingsScope.SettingsAutoScope + ) + { + return NativeMethods.BNSettingsSetBool( + this.handle, + null == view ? IntPtr.Zero : view.DangerousGetHandle() , + null == function ? IntPtr.Zero : function.DangerousGetHandle(), + scope , + key, + value + ); + } + + public bool SetDouble( + string key, + double value, + BinaryView? view, + Function? function, + SettingsScope scope = SettingsScope.SettingsAutoScope + ) + { + return NativeMethods.BNSettingsSetDouble( + this.handle, + null == view ? IntPtr.Zero : view.DangerousGetHandle() , + null == function ? IntPtr.Zero : function.DangerousGetHandle(), + scope , + key, + value + ); + } + + public bool SetInteger( + string key, + T value, + BinaryView? view, + Function? function, + SettingsScope scope = SettingsScope.SettingsAutoScope + ) where T : unmanaged + { + ulong slug = 0; + + if (typeof(T).UnderlyingSystemType == typeof(sbyte)) + { + slug = (ulong)UnsafeUtils.ForceConvert( value); + } + else if (typeof(T).UnderlyingSystemType == typeof(byte)) + { + slug = (ulong)UnsafeUtils.ForceConvert( value); + } + else if (typeof(T).UnderlyingSystemType == typeof(short)) + { + slug = (ulong)UnsafeUtils.ForceConvert( value); + } + else if (typeof(T).UnderlyingSystemType == typeof(ushort)) + { + slug = (ulong)UnsafeUtils.ForceConvert( value); + } + else if (typeof(T).UnderlyingSystemType == typeof(int)) + { + slug = (ulong)UnsafeUtils.ForceConvert( value); + } + else if (typeof(T).UnderlyingSystemType == typeof(uint)) + { + slug = (ulong)UnsafeUtils.ForceConvert( value); + } + else if (typeof(T).UnderlyingSystemType == typeof(long)) + { + slug = (ulong)UnsafeUtils.ForceConvert( value); + } + else if (typeof(T).UnderlyingSystemType == typeof(ulong)) + { + slug = (ulong)UnsafeUtils.ForceConvert( value); + } + else + { + throw new NotSupportedException($"not supported type: {typeof(T).UnderlyingSystemType}"); + } + + return NativeMethods.BNSettingsSetUInt64( + this.handle, + null == view ? IntPtr.Zero : view.DangerousGetHandle() , + null == function ? IntPtr.Zero : function.DangerousGetHandle(), + scope , + key, + slug + ); + } + + public bool SetString( + string key, + string value, + BinaryView? view, + Function? function, + SettingsScope scope = SettingsScope.SettingsAutoScope + ) + { + return NativeMethods.BNSettingsSetString( + this.handle, + null == view ? IntPtr.Zero : view.DangerousGetHandle() , + null == function ? IntPtr.Zero : function.DangerousGetHandle(), + scope , + key, + value + ); + } + + public bool SetStringList( + string key, + string[] value, + BinaryView? view, + Function? function, + SettingsScope scope = SettingsScope.SettingsAutoScope + ) + { + return NativeMethods.BNSettingsSetStringList( + this.handle, + null == view ? IntPtr.Zero : view.DangerousGetHandle() , + null == function ? IntPtr.Zero : function.DangerousGetHandle(), + scope , + key, + value, + (ulong)value.Length + ); + } + + public bool SetJson( + string key, + string value, + BinaryView? view, + Function? function, + SettingsScope scope = SettingsScope.SettingsAutoScope + ) + { + return NativeMethods.BNSettingsSetJson( + this.handle, + null == view ? IntPtr.Zero : view.DangerousGetHandle() , + null == function ? IntPtr.Zero : function.DangerousGetHandle(), + scope , + key, + value + ); + } + } +} \ No newline at end of file diff --git a/Handle/BNSnapshot.cs b/Handle/BNSnapshot.cs new file mode 100644 index 0000000..94934bf --- /dev/null +++ b/Handle/BNSnapshot.cs @@ -0,0 +1,93 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class Snapshot : AbstractSafeHandle + { + internal Snapshot(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static Snapshot? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new Snapshot( + NativeMethods.BNNewSnapshotReference(handle) , + true + ); + } + + internal static Snapshot MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new Snapshot( + NativeMethods.BNNewSnapshotReference(handle) , + true + ); + } + + internal static Snapshot? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new Snapshot(handle, true); + } + + internal static Snapshot MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new Snapshot(handle, true); + } + + internal static Snapshot? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new Snapshot(handle, false); + } + + internal static Snapshot MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new Snapshot(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeSnapshot(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + } +} \ No newline at end of file diff --git a/Handle/BNStringRef.cs b/Handle/BNStringRef.cs new file mode 100644 index 0000000..9c6bbac --- /dev/null +++ b/Handle/BNStringRef.cs @@ -0,0 +1,67 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class StringRef : AbstractSafeHandle + { + internal StringRef(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static StringRef? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new StringRef(handle, true); + } + + internal static StringRef MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new StringRef(handle, true); + } + + internal static StringRef? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new StringRef(handle, false); + } + + internal static StringRef MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new StringRef(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeStringRef(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + } +} \ No newline at end of file diff --git a/Handle/BNStructure.cs b/Handle/BNStructure.cs new file mode 100644 index 0000000..e194962 --- /dev/null +++ b/Handle/BNStructure.cs @@ -0,0 +1,338 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class Structure : AbstractSafeHandle + { + public Structure(StructureType type) + : base( NativeMethods.BNGetTypeStructure(type.DangerousGetHandle()) , true) + { + + } + + internal Structure(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static Structure? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new Structure( + NativeMethods.BNNewStructureReference(handle) , + true + ); + } + + internal static Structure MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new Structure( + NativeMethods.BNNewStructureReference(handle) , + true + ); + } + + internal static Structure? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new Structure(handle, true); + } + + internal static Structure MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new Structure(handle, true); + } + + internal static Structure? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new Structure(handle, false); + } + + internal static Structure MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new Structure(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeStructure(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + + public void TryGetMemberByOffset( + long offset , + out StructureMember? member , + out ulong index + ) + { + member = StructureMember.TakeNativePointer( + NativeMethods.BNGetStructureMemberAtOffset(this.handle , offset , out index ) + ); + } + + public StructureMember[] Members + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetStructureMembers(this.handle, out ulong arrayLength); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + StructureMember.FromNative , + NativeMethods.BNFreeStructureMemberList + ); + } + } + + public BaseStructure[] BaseStructures + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetBaseStructuresForStructure( + this.handle , + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer, + arrayLength, + BaseStructure.FromNative, + NativeMethods.BNFreeBaseStructureList + ); + } + } + + public bool Packed + { + get + { + return NativeMethods.BNIsStructurePacked(this.handle); + } + } + + public ulong Alignment + { + get + { + return NativeMethods.BNGetStructureAlignment(this.handle); + } + } + + public ulong Width + { + get + { + return NativeMethods.BNGetStructureWidth(this.handle); + } + } + + public long PointerOffset + { + get + { + return NativeMethods.BNGetStructurePointerOffset(this.handle); + } + } + + public bool IsUnion + { + get + { + return NativeMethods.BNIsStructureUnion(this.handle); + } + } + + public bool PropagatesDataVariableReferences + { + get + { + return NativeMethods.BNStructurePropagatesDataVariableReferences(this.handle); + } + } + + public StructureVariant Type + { + get + { + return NativeMethods.BNGetStructureType(this.handle); + } + } + + public StructureType CreateType() + { + return StructureType.MustNewFromHandle( + NativeMethods.BNCreateStructureType(this.handle) + ); + } + + public void TryGetMemberByName( + string name, + out StructureMember? member) + { + member = StructureMember.TakeNativePointer( + NativeMethods.BNGetStructureMemberByName(this.handle , name) + ); + } + + public StructureMember? GetMemberByName(string name) + { + this.TryGetMemberByName(name , out StructureMember? member); + + return member; + } + + public StructureMember this[string name] + { + get + { + this.TryGetMemberByName(name , out StructureMember? member); + + if (null == member) + { + throw new KeyNotFoundException(); + } + + return member; + } + } + + public StructureMember? GetMemberByOffset(ulong offset ) + { + foreach (StructureMember member in Members) + { + if (member.Offset == offset) + { + return member; + } + } + + return null; + } + + public ulong? GetOffsetByName(string name ) + { + foreach (StructureMember member in this.Members) + { + if (member.Name == name) + { + return member.Offset; + } + } + + return null; + } + + public int? GetIndexByName(string name ) + { + for (int i = 0; i < this.Members.Length; i++) + { + if (this.Members[i].Name == name) + { + return i; + } + } + + return null; + } + + public int? GetIndexByOffset(ulong offset ) + { + for (int i = 0; i < this.Members.Length; i++) + { + if (this.Members[i].Offset == offset) + { + return i; + } + } + + return null; + } + + + public override string ToString() + { + StringBuilder builder = new StringBuilder(); + + if (this.Packed) + { + builder.AppendLine("// Packed "); + } + + if (this.Alignment > 0) + { + builder.AppendLine($"// Alignment: ({Alignment})"); + } + + if (this.Width > 0) + { + builder.AppendLine($"// Width: ({Width})"); + } + + if (this.PointerOffset > 0) + { + builder.AppendLine($"// PointerOffset: ({PointerOffset}) "); + } + + if (this.IsUnion) + { + builder.AppendLine("union {"); + } + else + { + builder.AppendLine("struct {"); + } + + foreach (StructureMember member in Members) + { + builder.AppendLine( member.ToString()); + builder.AppendLine(); + } + + builder.AppendLine("}"); + + return builder.ToString(); + } + + } + + +} \ No newline at end of file diff --git a/Handle/BNStructureBuilder.cs b/Handle/BNStructureBuilder.cs new file mode 100644 index 0000000..8bb8e1a --- /dev/null +++ b/Handle/BNStructureBuilder.cs @@ -0,0 +1,350 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class StructureBuilder : AbstractSafeHandle + { + public StructureBuilder( + StructureVariant kind = StructureVariant.StructStructureType + , bool packed = false) + : this(NativeMethods.BNCreateStructureBuilderWithOptions(kind , packed) , true) + { + + } + + internal StructureBuilder(IntPtr handle, bool owner) + : base( handle , owner) + { + + } + + internal static StructureBuilder? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new StructureBuilder(handle, true); + } + + internal static StructureBuilder MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new StructureBuilder(handle, true); + } + + internal static StructureBuilder? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new StructureBuilder(handle, false); + } + + internal static StructureBuilder MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new StructureBuilder(handle, false); + } + + protected override bool ReleaseHandle() + { + if (!this.IsInvalid) + { + NativeMethods.BNFreeTypeBuilder(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + + public StructureMember[] Members + { + get + { + ulong arrayLength = 0; + + IntPtr arrayPointer = NativeMethods.BNGetStructureBuilderMembers(this.handle , out arrayLength); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer, + arrayLength, + StructureMember.FromNative, + NativeMethods.BNFreeStructureMemberList + ); + } + + set + { + if (this.Members.Length > 0) + { + for (int index = this.Members.Length - 1; index >= 0; index--) + { + this.RemoveMember(index); + } + } + + foreach (StructureMember member in value) + { + NativeMethods.BNAddStructureBuilderMemberAtOffset( + this.handle , + new TypeWithConfidence(member.Type , member.TypeConfidence).ToNative() , + member.Name , + member.Offset , + true , // overwriteExisting + member.Access , + member.Scope + ); + } + } + } + + public void AddMember( + TypeWithConfidence kind , + string name , + MemberAccess access = MemberAccess.PublicAccess, + MemberScope scope = MemberScope.NoScope + ) + { + NativeMethods.BNAddStructureBuilderMember( + this.handle , + kind.ToNative() , + name , + access , + scope + ); + } + + public void AddMemberAtOffset( + TypeWithConfidence kind , + string name , + ulong offset , + bool overwriteExisting = true, + MemberAccess access = MemberAccess.PublicAccess, + MemberScope scope = MemberScope.NoScope + ) + { + NativeMethods.BNAddStructureBuilderMemberAtOffset( + this.handle , + kind.ToNative() , + name , + offset , + overwriteExisting , + access , + scope + ); + } + + public BaseStructure[] BaseStructures + { + get + { + ulong arrayLength = 0; + + IntPtr arrayPointer = NativeMethods.BNGetBaseStructuresForStructureBuilder( + this.handle , + out arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer, + arrayLength, + BaseStructure.FromNative, + NativeMethods.BNFreeBaseStructureList + ); + } + + set + { + NativeMethods.BNSetBaseStructuresForStructureBuilder( + this.handle , + UnsafeUtils.ConvertToNativeArray( + value + ), + (ulong)value.Length + ); + } + } + + public bool Packed + { + get + { + return NativeMethods.BNIsStructureBuilderPacked(this.handle); + } + + set + { + NativeMethods.BNSetStructureBuilderPacked(this.handle, value); + } + } + + public ulong Alignment + { + get + { + return NativeMethods.BNGetStructureBuilderAlignment(this.handle); + } + + set + { + NativeMethods.BNSetStructureBuilderAlignment(this.handle, value); + } + } + + public ulong Width + { + get + { + return NativeMethods.BNGetStructureBuilderWidth(this.handle); + } + + set + { + NativeMethods.BNSetStructureBuilderWidth(this.handle, value); + } + } + + public long PointerOffset + { + get + { + return NativeMethods.BNGetStructureBuilderPointerOffset(this.handle); + } + + set + { + NativeMethods.BNSetStructureBuilderPointerOffset(this.handle, value); + } + } + + public bool IsUnion + { + get + { + return NativeMethods.BNIsStructureBuilderUnion(this.handle); + } + } + + public bool PropagatesDataVariableReferences + { + get + { + return NativeMethods.BNStructureBuilderPropagatesDataVariableReferences(this.handle); + } + + set + { + NativeMethods.BNSetStructureBuilderPropagatesDataVariableReferences(this.handle, value); + } + } + + public StructureVariant Type + { + get + { + return NativeMethods.BNGetStructureBuilderType(this.handle); + } + + set + { + NativeMethods.BNSetStructureBuilderType(this.handle, value); + } + } + + public void RemoveMember(int index) + { + NativeMethods.BNRemoveStructureBuilderMember(this.handle , (ulong)index); + } + + public void ReplaceMember( + ulong index , + TypeWithConfidence kind , + string name , + bool overwriteExisting) + { + NativeMethods.BNReplaceStructureBuilderMember( + this.handle , + index, + kind.ToNative() , + name , + overwriteExisting + ); + } + + public StructureMember? GetMemberByName(string name ) + { + IntPtr rawPtr = NativeMethods.BNGetStructureBuilderMemberByName(this.handle , name); + + if (rawPtr == IntPtr.Zero) + { + return null; + } + + return StructureMember.FromNativePointer(rawPtr); + } + + public StructureMember? GetMemberByOffset(ulong offset ) + { + foreach (StructureMember member in Members) + { + if (member.Offset == offset) + { + return member; + } + } + + return null; + } + + public int? GetIndexByName(string name ) + { + for (int i = 0; i < this.Members.Length; i++) + { + if (this.Members[i].Name == name) + { + return i; + } + } + + return null; + } + + public int? GetIndexByOffset(ulong offset ) + { + for (int i = 0; i < this.Members.Length; i++) + { + if (this.Members[i].Offset == offset) + { + return i; + } + } + + return null; + } + + public Structure Build() + { + return new Structure( + NativeMethods.BNFinalizeStructureBuilder(this.handle), + true + ); + } + } +} \ No newline at end of file diff --git a/Handle/BNSymbol.cs b/Handle/BNSymbol.cs new file mode 100644 index 0000000..274517a --- /dev/null +++ b/Handle/BNSymbol.cs @@ -0,0 +1,188 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class Symbol : AbstractSafeHandle + { + internal Symbol(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static Symbol? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new Symbol( + NativeMethods.BNNewSymbolReference(handle) , + true + ); + } + + internal static Symbol MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new Symbol( + NativeMethods.BNNewSymbolReference(handle) , + true + ); + } + + internal static Symbol? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new Symbol(handle, true); + } + + internal static Symbol MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new Symbol(handle, true); + } + + internal static Symbol? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new Symbol(handle, false); + } + + internal static Symbol MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new Symbol(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeSymbol(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + + public override string ToString() + { + return this.FullName; + } + + public SymbolType Type + { + get + { + return NativeMethods.BNGetSymbolType(handle); + } + } + + public SymbolBinding Binding + { + get + { + return NativeMethods.BNGetSymbolBinding(handle); + } + } + + public string ShortName + { + get + { + return UnsafeUtils.TakeAnsiString( + NativeMethods.BNGetSymbolShortName(this.handle) + ); + } + } + + public string FullName + { + get + { + return UnsafeUtils.TakeAnsiString( + NativeMethods.BNGetSymbolFullName(this.handle) + ); + } + } + + public string RawName + { + get + { + return UnsafeUtils.TakeAnsiString( + NativeMethods.BNGetSymbolRawName(this.handle) + ); + } + } + + public byte[] RawBytes + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetSymbolRawBytes( + this.handle , + out ulong arrayLength + ); + + + return UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength, + NativeMethods.BNFreeSymbolRawBytes + ); + } + } + + public ulong Address + { + get + { + return NativeMethods.BNGetSymbolAddress(this.handle); + } + } + + public ulong Ordinal + { + get + { + return NativeMethods.BNGetSymbolOrdinal(this.handle); + } + } + + public bool AutoDefined + { + get + { + return NativeMethods.BNIsSymbolAutoDefined(this.handle); + } + } + } + + +} \ No newline at end of file diff --git a/Handle/BNSymbolQueue.cs b/Handle/BNSymbolQueue.cs new file mode 100644 index 0000000..6fc38e3 --- /dev/null +++ b/Handle/BNSymbolQueue.cs @@ -0,0 +1,73 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class SymbolQueue : AbstractSafeHandle + { + public SymbolQueue() + : this( NativeMethods.BNCreateSymbolQueue() , true) + { + + } + + internal SymbolQueue(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static SymbolQueue? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new SymbolQueue(handle, true); + } + + internal static SymbolQueue MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new SymbolQueue(handle, true); + } + + internal static SymbolQueue? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new SymbolQueue(handle, false); + } + + internal static SymbolQueue MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new SymbolQueue(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNDestroySymbolQueue(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + } +} \ No newline at end of file diff --git a/Handle/BNTag.cs b/Handle/BNTag.cs new file mode 100644 index 0000000..4eccf7e --- /dev/null +++ b/Handle/BNTag.cs @@ -0,0 +1,134 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class Tag : AbstractSafeHandle + { + public Tag(TagType kind , string data) + :this( NativeMethods.BNCreateTag(kind.DangerousGetHandle() , data) ,true) + { + + } + + internal Tag(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static Tag? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new Tag( + NativeMethods.BNNewTagReference(handle) , + true + ); + } + + internal static Tag MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new Tag( + NativeMethods.BNNewTagReference(handle) , + true + ); + } + + internal static Tag? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new Tag(handle, true); + } + + internal static Tag MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new Tag(handle, true); + } + + internal static Tag? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new Tag(handle, false); + } + + internal static Tag MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new Tag(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeTag(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + + public string Id + { + get + { + return UnsafeUtils.TakeAnsiString( + NativeMethods.BNTagGetId(this.handle) + ); + } + } + + public TagType Type + { + get + { + return TagType.MustTakeHandle( + NativeMethods.BNTagGetType(this.handle) + ); + } + } + + public string Data + { + get + { + return UnsafeUtils.TakeAnsiString( + NativeMethods.BNTagGetData(this.handle) + ); + } + + set + { + NativeMethods.BNTagSetData(this.handle, value); + } + } + } +} \ No newline at end of file diff --git a/Handle/BNTagType.cs b/Handle/BNTagType.cs new file mode 100644 index 0000000..5422b2f --- /dev/null +++ b/Handle/BNTagType.cs @@ -0,0 +1,168 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class TagType : AbstractSafeHandle + { + internal TagType(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static TagType? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new TagType( + NativeMethods.BNNewTagTypeReference(handle) , + true + ); + } + + internal static TagType MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new TagType( + NativeMethods.BNNewTagTypeReference(handle) , + true + ); + } + + internal static TagType? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new TagType(handle, true); + } + + internal static TagType MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new TagType(handle, true); + } + + internal static TagType? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new TagType(handle, false); + } + + internal static TagType MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new TagType(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeTagType(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + + + public string Id + { + get + { + return UnsafeUtils.TakeAnsiString( + NativeMethods.BNTagTypeGetId(this.handle) + ); + } + } + + public string Name + { + get + { + return UnsafeUtils.TakeAnsiString( + NativeMethods.BNTagTypeGetName(this.handle) + ); + } + + set + { + NativeMethods.BNTagTypeSetName(this.handle, value); + } + } + + public string Icon + { + get + { + return UnsafeUtils.TakeAnsiString( + NativeMethods.BNTagTypeGetIcon(this.handle) + ); + } + + set + { + NativeMethods.BNTagTypeSetIcon(this.handle, value); + } + } + + public bool Visible + { + get + { + return NativeMethods.BNTagTypeGetVisible(this.handle); + } + + set + { + NativeMethods.BNTagTypeSetVisible(this.handle, value); + } + } + + public TagTypeType Type + { + get + { + return NativeMethods.BNTagTypeGetType(this.handle); + } + + set + { + NativeMethods.BNTagTypeSetType(this.handle, value); + } + } + + + public Tag CreateTag(string data) + { + return Tag.MustTakeHandle( + NativeMethods.BNCreateTag(this.handle , data) + ); + } + } +} \ No newline at end of file diff --git a/Handle/BNTemporaryFile.cs b/Handle/BNTemporaryFile.cs new file mode 100644 index 0000000..7fe6445 --- /dev/null +++ b/Handle/BNTemporaryFile.cs @@ -0,0 +1,131 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class TemporaryFile : AbstractSafeHandle + { + public TemporaryFile() + : this( NativeMethods.BNCreateTemporaryFile() , true) + { + + } + + public TemporaryFile(byte[] data) + : this(new DataBuffer(data)) + { + + } + + public TemporaryFile(DataBuffer buffer) + : this( NativeMethods.BNCreateTemporaryFileWithContents(buffer.DangerousGetHandle()) , true) + { + + } + + internal TemporaryFile(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static TemporaryFile? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new TemporaryFile( + NativeMethods.BNNewTemporaryFileReference(handle) , + true + ); + } + + internal static TemporaryFile MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new TemporaryFile( + NativeMethods.BNNewTemporaryFileReference(handle) , + true + ); + } + + internal static TemporaryFile? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new TemporaryFile(handle, true); + } + + internal static TemporaryFile MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new TemporaryFile(handle, true); + } + + internal static TemporaryFile? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new TemporaryFile(handle, false); + } + + internal static TemporaryFile MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new TemporaryFile(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeTemporaryFile(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + + public string FilePath + { + get + { + return UnsafeUtils.TakeUtf8String( + NativeMethods.BNGetTemporaryFilePath(this.handle) + ); + } + } + + public DataBuffer FileContents + { + get + { + return DataBuffer.MustTakeHandle( + NativeMethods.BNGetTemporaryFileContents(this.handle) + ); + } + } + } +} \ No newline at end of file diff --git a/Handle/BNTransform.cs b/Handle/BNTransform.cs new file mode 100644 index 0000000..94fa991 --- /dev/null +++ b/Handle/BNTransform.cs @@ -0,0 +1,242 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class Transform : AbstractSafeHandle + { + internal Transform(IntPtr handle) + :base(handle , false) + { + + } + + internal static Transform MustFromHandle(IntPtr handle) + { + if (IntPtr.Zero == handle) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new Transform(handle); + } + + internal static Transform? FromHandle(IntPtr handle) + { + if (IntPtr.Zero == handle) + { + return null; + } + + return new Transform(handle); + } + + public static Transform? FromName(string name) + { + return Transform.FromHandle( + NativeMethods.BNGetTransformByName(name) + ); + } + + public static Transform[] GetTransformTypes() + { + IntPtr arrayPointer = NativeMethods.BNGetTransformTypeList( + out ulong arrayLength + ); + + return UnsafeUtils.TakeHandleArray( + arrayPointer , + arrayLength , + Transform.MustFromHandle , + NativeMethods.BNFreeTransformTypeList + ); + } + + public static Transform? RegisterTransformType( + TransformType type, + string name, + string longname, + string group, + CustomTransform xform + ) + { + return Transform.FromHandle( + + NativeMethods.BNRegisterTransformType( + type, + name, + longname, + group, + xform.ToNative() + ) + ); + } + + public static Transform? RegisterTransformType( + TransformType type, + uint capabilities, + string name, + string longname, + string group, + CustomTransform xform + ) + { + return Transform.FromHandle( + + NativeMethods.BNRegisterTransformTypeWithCapabilities( + type, + capabilities, + name, + longname, + group, + xform.ToNative() + ) + ); + } + + public TransformType Type + { + get + { + return NativeMethods.BNGetTransformType(this.handle); + } + } + + public uint Capabilities + { + get + { + return NativeMethods.BNGetTransformCapabilities(this.handle); + } + } + + public bool SupportsDetection + { + get + { + return NativeMethods.BNTransformSupportsDetection(this.handle); + } + } + + public bool SupportsContext + { + get + { + return NativeMethods.BNTransformSupportsContext(this.handle); + } + } + + public string Name + { + get + { + return UnsafeUtils.TakeUtf8String( + NativeMethods.BNGetTransformName(this.handle) + ); + } + } + + public string LongName + { + get + { + return UnsafeUtils.TakeUtf8String( + NativeMethods.BNGetTransformLongName(this.handle) + ); + } + } + + public string Group + { + get + { + return UnsafeUtils.TakeUtf8String( + NativeMethods.BNGetTransformGroup(this.handle) + ); + } + } + + public bool CanDecode(BinaryView input) + { + return NativeMethods.BNCanDecode(this.handle, input.DangerousGetHandle()); + } + + public TransformParameterInfo[] Parameters + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetTransformParameterList( + this.handle , + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx ( + arrayPointer , + arrayLength , + TransformParameterInfo.FromNative , + NativeMethods.BNFreeTransformParameterList + ); + } + } + + public byte[] Decode(byte[] input , TransformParameter[] parameters) + { + DataBuffer output = new DataBuffer(); + + using (ScopedAllocator allocator = new ScopedAllocator()) + { + bool ok = NativeMethods.BNDecode( + this.handle , + DataBuffer.FromBytes(input).DangerousGetHandle() , + output.DangerousGetHandle() , + allocator.ConvertToNativeArrayEx( + parameters + ) , + (ulong)parameters.Length + ); + } + + return output.Contents; + } + + public byte[] Encode(byte[] input , TransformParameter[] parameters) + { + DataBuffer output = new DataBuffer(); + + using (ScopedAllocator allocator = new ScopedAllocator()) + { + bool ok = NativeMethods.BNEncode( + this.handle , + DataBuffer.FromBytes(input).DangerousGetHandle() , + output.DangerousGetHandle() , + allocator.ConvertToNativeArrayEx( + parameters + ) , + (ulong)parameters.Length + ); + } + + return output.Contents; + } + + public bool DecodeWithContext(TransformContext context , TransformParameter[] parameters) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + return NativeMethods.BNDecodeWithContext( + this.handle , + context.DangerousGetHandle() , + allocator.ConvertToNativeArrayEx( + parameters + ) , + (ulong)parameters.Length + ); + } + } + } + + + +} \ No newline at end of file diff --git a/Handle/BNTransformContext.cs b/Handle/BNTransformContext.cs new file mode 100644 index 0000000..cfc504e --- /dev/null +++ b/Handle/BNTransformContext.cs @@ -0,0 +1,256 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class TransformContext : AbstractSafeHandle + { + internal TransformContext(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static TransformContext? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new TransformContext( + NativeMethods.BNNewTransformContextReference(handle) , + true + ); + } + + internal static TransformContext MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new TransformContext( + NativeMethods.BNNewTransformContextReference(handle) , + true + ); + } + + internal static TransformContext? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new TransformContext(handle, true); + } + + internal static TransformContext MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new TransformContext(handle, true); + } + + internal static TransformContext? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new TransformContext(handle, false); + } + + internal static TransformContext MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new TransformContext(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeTransformContext(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + + public BinaryView? Input + { + get + { + return BinaryView.TakeHandle( + NativeMethods.BNTransformContextGetInput(this.handle) + ); + } + } + + public string FileName + { + get + { + return UnsafeUtils.TakeUtf8String( + NativeMethods.BNTransformContextGetFileName(this.handle) + ); + } + } + + public string TransformName + { + get + { + return UnsafeUtils.TakeAnsiString( + NativeMethods.BNTransformContextGetTransformName(this.handle) + ); + } + + } + + public TransformParameter[] Parameters + { + set + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + NativeMethods.BNTransformContextSetTransformParameters( + this.handle, + allocator.ConvertToNativeArrayEx( + value + ), + (ulong)value.Length + ); + } + } + } + + public void SetParameter(string name , byte[] value) + { + NativeMethods.BNTransformContextSetTransformParameter( + this.handle , + name , + DataBuffer.FromBytes(value).DangerousGetHandle() + ); + } + + public bool HasParameter(string name) + { + return NativeMethods.BNTransformContextHasTransformParameter(this.handle, name); + } + + public void ClearParameter(string name) + { + NativeMethods.BNTransformContextClearTransformParameter(this.handle, name); + } + + public string ExtractionMessage + { + get + { + return UnsafeUtils.TakeAnsiString( + NativeMethods.BNTransformContextGetExtractionMessage(this.handle) + ); + } + } + + public TransformResult ExtractionResult + { + get + { + return NativeMethods.BNTransformContextGetExtractionResult(this.handle); + } + } + + public TransformResult TransformResult + { + get + { + return NativeMethods.BNTransformContextGetTransformResult(this.handle); + } + } + + public Metadata? Metadata + { + get + { + return Metadata.TakeHandle( + NativeMethods.BNTransformContextGetMetadata(this.handle) + ); + } + } + + public TransformContext? Parent + { + get + { + return TransformContext.TakeHandle( + NativeMethods.BNTransformContextGetParent(this.handle) + ); + } + } + + public ulong ChildCount + { + get + { + return NativeMethods.BNTransformContextGetChildCount(this.handle); + } + } + + public TransformContext[] Children + { + get + { + IntPtr arrayPointer = NativeMethods.BNTransformContextGetChildren( + this.handle , + out ulong arrayLength + ); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer , + arrayLength , + TransformContext.MustBorrowHandle, + NativeMethods.BNFreeTransformContextList + ); + } + } + + public bool IsLeaf + { + get + { + return NativeMethods.BNTransformContextIsLeaf(this.handle); + } + } + + public bool IsRoot + { + get + { + return NativeMethods.BNTransformContextIsRoot(this.handle); + } + } + + public bool IsDatabase + { + get + { + return NativeMethods.BNTransformContextIsDatabase(this.handle); + } + } + } +} \ No newline at end of file diff --git a/Handle/BNTransformSession.cs b/Handle/BNTransformSession.cs new file mode 100644 index 0000000..369338f --- /dev/null +++ b/Handle/BNTransformSession.cs @@ -0,0 +1,93 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class TransformSession : AbstractSafeHandle + { + internal TransformSession(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static TransformSession? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new TransformSession( + NativeMethods.BNNewTransformSessionReference(handle) , + true + ); + } + + internal static TransformSession MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new TransformSession( + NativeMethods.BNNewTransformSessionReference(handle) , + true + ); + } + + internal static TransformSession? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new TransformSession(handle, true); + } + + internal static TransformSession MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new TransformSession(handle, true); + } + + internal static TransformSession? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new TransformSession(handle, false); + } + + internal static TransformSession MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new TransformSession(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeTransformSession(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + } +} \ No newline at end of file diff --git a/Handle/BNType.cs b/Handle/BNType.cs new file mode 100644 index 0000000..c1ac6ca --- /dev/null +++ b/Handle/BNType.cs @@ -0,0 +1,373 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Runtime.InteropServices.ComTypes; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public class Type: AbstractSafeHandle + { + internal Type(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static BinaryNinja.Type? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new BinaryNinja.Type( + NativeMethods.BNNewTypeReference(handle) , + true + ); + } + + internal static BinaryNinja.Type MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new BinaryNinja.Type( + NativeMethods.BNNewTypeReference(handle) , + true + ); + } + + internal static BinaryNinja.Type? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new BinaryNinja.Type(handle, true); + } + + internal static BinaryNinja.Type MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new BinaryNinja.Type(handle, true); + } + + internal static BinaryNinja.Type? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new BinaryNinja.Type(handle, false); + } + + internal static BinaryNinja.Type MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new BinaryNinja.Type(handle, false); + } + + + public static string GetNameTypeString( NameType classFunctionType ) + { + return Core.GetNameTypeString(classFunctionType); + } + + public static string GenerateAutoTypeId(string source , QualifiedName name) + { + return Core.GenerateAutoTypeId(source , name); + } + + public static string GenerateAutoDemangledTypeId( QualifiedName name) + { + return Core.GenerateAutoDemangledTypeId( name); + } + + public static string GetAutoDemangledTypeIdSource() + { + return Core.GetAutoDemangledTypeIdSource(); + } + + public static string GetAutoDebugTypeIdSource() + { + return Core.GetAutoDebugTypeIdSource(); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeType(this.handle); + this.SetHandleAsInvalid(); + } + return true; + } + + public override string ToString() + { + return this.GetString(); + } + + public NamedTypeReference GetNamedTypeReference() + { + return NamedTypeReference.MustTakeHandle( + NativeMethods.BNGetTypeNamedTypeReference(this.handle) + ); + } + + public NameType GetNameType() + { + return NativeMethods.BNTypeGetNameType(this.handle); + } + + public bool ShouldDisplayReturnType() + { + return NativeMethods.BNTypeShouldDisplayReturnType(this.handle); + } + + public QualifiedName Name + { + get + { + return QualifiedName.TakeNative( + NativeMethods.BNTypeGetTypeName(this.handle) + ); + } + } + + public QualifiedName GetName() + { + return QualifiedName.TakeNative( + NativeMethods.BNTypeGetTypeName(this.handle) + ); + } + + public string AlternateName + { + get + { + return UnsafeUtils.TakeAnsiString( + NativeMethods.BNGetTypeAlternateName(this.handle) + ); + } + } + + public TypeWithConfidence WithConfidence(byte confidence ) + { + return new TypeWithConfidence( + BinaryNinja.Type.MustNewFromHandle(this.DangerousGetHandle()) + , confidence + ); + } + + /// + /// seems just size i bytes + /// + public ulong Width + { + get + { + return NativeMethods.BNGetTypeWidth(this.handle); + } + } + + public ulong Alignment + { + get + { + return NativeMethods.BNGetTypeAlignment(this.handle); + } + } + + public ulong Offset + { + get + { + return NativeMethods.BNGetTypeOffset(this.handle); + } + } + + public string GetString( + Platform? platform = null, + TokenEscapingType escaping = TokenEscapingType.NoTokenEscapingType + ) + { + return UnsafeUtils.TakeAnsiString( + NativeMethods.BNGetTypeString( + this.handle , + null == platform ? IntPtr.Zero : platform.DangerousGetHandle() , + escaping + ) + ); + } + + public string GetStringBeforeName( + Platform? platform = null, + TokenEscapingType escaping = TokenEscapingType.NoTokenEscapingType + ) + { + return UnsafeUtils.TakeAnsiString( + NativeMethods.BNGetTypeStringBeforeName( + this.handle , + null == platform ? IntPtr.Zero : platform.DangerousGetHandle() , + escaping + ) + ); + } + + public string GetStringAfterName( + Platform? platform = null, + TokenEscapingType escaping = TokenEscapingType.NoTokenEscapingType + ) + { + return UnsafeUtils.TakeAnsiString( + NativeMethods.BNGetTypeStringAfterName( + this.handle , + null == platform ? IntPtr.Zero : platform.DangerousGetHandle() , + escaping + ) + ); + } + + public InstructionTextToken[] GetTokens( + byte baseConfidence = Core.MaxConfidence, + Platform? platform = null, + TokenEscapingType escaping = TokenEscapingType.NoTokenEscapingType + ) + { + IntPtr arrayPointer = NativeMethods.BNGetTypeTokens( + this.handle , + null == platform ? IntPtr.Zero : platform.DangerousGetHandle() , + baseConfidence , + escaping , + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + InstructionTextToken.FromNative , + NativeMethods.BNFreeInstructionText + ); + } + + public InstructionTextToken[] GetTokensBeforeName( + byte baseConfidence = Core.MaxConfidence, + Platform? platform = null, + TokenEscapingType escaping = TokenEscapingType.NoTokenEscapingType + ) + { + IntPtr arrayPointer = NativeMethods.BNGetTypeTokensBeforeName( + this.handle , + null == platform ? IntPtr.Zero : platform.DangerousGetHandle() , + baseConfidence , + escaping , + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + InstructionTextToken.FromNative , + NativeMethods.BNFreeInstructionText + ); + } + + public InstructionTextToken[] GetTokensAfterName( + byte baseConfidence = Core.MaxConfidence, + Platform? platform = null, + TokenEscapingType escaping = TokenEscapingType.NoTokenEscapingType + ) + { + IntPtr arrayPointer = NativeMethods.BNGetTypeTokensAfterName( + this.handle , + null == platform ? IntPtr.Zero : platform.DangerousGetHandle() , + baseConfidence , + escaping , + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + InstructionTextToken.FromNative , + NativeMethods.BNFreeInstructionText + ); + } + + public TypeDefinitionLine[] GetLines( + TypeContainer types, + string name, + int paddingCols, + bool collapsed, + TokenEscapingType escaping = TokenEscapingType.NoTokenEscapingType + ) + { + IntPtr arrayPointer = NativeMethods.BNGetTypeLines( + this.handle , + types.DangerousGetHandle(), + name, + paddingCols, + collapsed, + escaping , + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + TypeDefinitionLine.FromNative , + NativeMethods.BNFreeTypeDefinitionLineList + ); + } + + public BoolWithConfidence IsConst + { + get + { + return BoolWithConfidence.FromNative( + + NativeMethods.BNIsTypeConst(this.handle) + ); + } + } + + public BoolWithConfidence IsVolatile + { + get + { + return BoolWithConfidence.FromNative( + + NativeMethods.BNIsTypeVolatile(this.handle) + ); + } + } + + public bool IsSystemCall + { + get + { + return NativeMethods.BNTypeIsSystemCall(this.handle); + } + } + + public uint GetSystemCallNumber() + { + return NativeMethods.BNTypeGetSystemCallNumber(this.handle); + } + } + +} \ No newline at end of file diff --git a/Handle/BNTypeArchive.cs b/Handle/BNTypeArchive.cs new file mode 100644 index 0000000..12e2db3 --- /dev/null +++ b/Handle/BNTypeArchive.cs @@ -0,0 +1,94 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class TypeArchive : AbstractSafeHandle + { + internal TypeArchive(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static TypeArchive? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new TypeArchive( + NativeMethods.BNNewTypeArchiveReference(handle) , + true + ); + } + + internal static TypeArchive MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new TypeArchive( + NativeMethods.BNNewTypeArchiveReference(handle) , + true + ); + } + + internal static TypeArchive? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new TypeArchive(handle, true); + } + + internal static TypeArchive MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new TypeArchive(handle, true); + } + + internal static TypeArchive? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new TypeArchive(handle, false); + } + + internal static TypeArchive MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new TypeArchive(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeTypeArchiveReference(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + + } +} \ No newline at end of file diff --git a/Handle/BNTypeArchiveMergeConflict.cs b/Handle/BNTypeArchiveMergeConflict.cs new file mode 100644 index 0000000..0385ce2 --- /dev/null +++ b/Handle/BNTypeArchiveMergeConflict.cs @@ -0,0 +1,93 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class TypeArchiveMergeConflict : AbstractSafeHandle + { + internal TypeArchiveMergeConflict(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static TypeArchiveMergeConflict? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new TypeArchiveMergeConflict( + NativeMethods.BNNewTypeArchiveMergeConflictReference(handle) , + true + ); + } + + internal static TypeArchiveMergeConflict MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new TypeArchiveMergeConflict( + NativeMethods.BNNewTypeArchiveMergeConflictReference(handle) , + true + ); + } + + internal static TypeArchiveMergeConflict? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new TypeArchiveMergeConflict(handle, true); + } + + internal static TypeArchiveMergeConflict MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new TypeArchiveMergeConflict(handle, true); + } + + internal static TypeArchiveMergeConflict? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new TypeArchiveMergeConflict(handle, false); + } + + internal static TypeArchiveMergeConflict MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new TypeArchiveMergeConflict(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeTypeArchiveMergeConflict(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + } +} \ No newline at end of file diff --git a/Handle/BNTypeBuilder.cs b/Handle/BNTypeBuilder.cs new file mode 100644 index 0000000..0b271f4 --- /dev/null +++ b/Handle/BNTypeBuilder.cs @@ -0,0 +1,736 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public class TypeBuilder : AbstractSafeHandle + { + internal TypeBuilder(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static TypeBuilder? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new TypeBuilder(handle, true); + } + + internal static TypeBuilder MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new TypeBuilder(handle, true); + } + + internal static TypeBuilder? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new TypeBuilder(handle, false); + } + + internal static TypeBuilder MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new TypeBuilder(handle, false); + } + + protected override bool ReleaseHandle() + { + if (!this.IsInvalid) + { + NativeMethods.BNFreeTypeBuilder(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + + public ulong Width + { + get + { + return NativeMethods.BNGetTypeBuilderWidth(this.handle); + } + + set + { + NativeMethods.BNTypeBuilderSetWidth(this.handle , value); + } + } + + public BoolWithConfidence Const + { + get + { + return BoolWithConfidence.FromNative(NativeMethods.BNIsTypeBuilderConst(this.handle) ); + } + + set + { + NativeMethods.BNTypeBuilderSetConst(this.handle , value.ToNative()); + } + } + + public BoolWithConfidence Volatile + { + get + { + return BoolWithConfidence.FromNative( NativeMethods.BNIsTypeBuilderVolatile(this.handle) ); + } + + set + { + NativeMethods.BNTypeBuilderSetVolatile(this.handle , value.ToNative()); + } + } + + public ulong Alignment + { + get + { + return NativeMethods.BNGetTypeBuilderAlignment(this.handle); + } + + set + { + NativeMethods.BNTypeBuilderSetAlignment(this.handle , value); + } + } + + public string AlternateName + { + get + { + return UnsafeUtils.TakeAnsiString(NativeMethods.BNGetTypeBuilderAlternateName(this.handle)); + } + + set + { + NativeMethods.BNTypeBuilderSetAlternateName(this.handle , value); + } + } + + public bool SystemCall + { + get + { + return NativeMethods.BNTypeBuilderIsSystemCall(this.handle); + } + } + + public uint SystemCallNumber + { + get + { + return NativeMethods.BNTypeBuilderGetSystemCallNumber(this.handle); + } + + set + { + NativeMethods.BNTypeBuilderSetSystemCallNumber(this.handle , true , value); + } + } + + public void ClearSystemCall() + { + NativeMethods.BNTypeBuilderSetSystemCallNumber(this.handle , false , 0); + } + + public TypeClass TypeClass + { + get + { + return NativeMethods.BNGetTypeBuilderClass(this.handle); + } + } + + public BoolWithConfidence Signed + { + get + { + return BoolWithConfidence.FromNative( NativeMethods.BNIsTypeBuilderSigned(this.handle) ); + } + + set + { + NativeMethods.BNTypeBuilderSetSigned(this.handle , value.ToNative()); + } + } + } + + public sealed class VoidTypeBuilder : TypeBuilder + { + public VoidTypeBuilder() + : base(NativeMethods.BNCreateVoidTypeBuilder() , true) + { + + } + + public VoidType Build() + { + return new VoidType( NativeMethods.BNFinalizeTypeBuilder(this.handle) , true); + } + } + + public sealed class BoolTypeBuilder : TypeBuilder + { + public BoolTypeBuilder() + : base(NativeMethods.BNCreateBoolTypeBuilder() , true) + { + + } + + public BoolType Build() + { + return new BoolType( NativeMethods.BNFinalizeTypeBuilder(this.handle) , true); + } + } + + public sealed class IntegerTypeBuilder : TypeBuilder + { + public IntegerTypeBuilder( + ulong width , + BoolWithConfidence? sign = null, + string altName = "" + ) : base( + IntegerTypeBuilder.create( + width , + null == sign ? new BoolWithConfidence() : sign , + altName + ) , true) + { + + } + + internal static IntPtr create( + ulong width , + BoolWithConfidence sign, + string altName = "" + ) + { + + return NativeMethods.BNCreateIntegerTypeBuilder( + width , + sign.ToNative() , + altName + ); + } + + public IntegerType Build() + { + return new IntegerType( NativeMethods.BNFinalizeTypeBuilder(this.handle) , true); + } + } + + public sealed class FloatTypeBuilder : TypeBuilder + { + public FloatTypeBuilder(ulong width , string altName = "") + : base(NativeMethods.BNCreateFloatTypeBuilder(width , altName ) , true) + { + + } + + public FloatType Build() + { + return new FloatType( NativeMethods.BNFinalizeTypeBuilder(this.handle) , true); + } + } + + public sealed class CharTypeBuilder : TypeBuilder + { + public CharTypeBuilder(ulong width , string altName) + : base( + IntegerTypeBuilder.create( + width , + new BoolWithConfidence(true, Core.MaxConfidence) , + altName + ) , + true + ) + { + + } + + public CharType Build() + { + return new CharType( NativeMethods.BNFinalizeTypeBuilder(this.handle) , true); + } + } + + public sealed class WideCharTypeBuilder : TypeBuilder + { + public WideCharTypeBuilder(ulong width , string altName = "") + : base(NativeMethods.BNCreateWideCharTypeBuilder(width , altName ) , true) + { + + } + + public WideCharType Build() + { + return new WideCharType( NativeMethods.BNFinalizeTypeBuilder(this.handle) , true); + } + } + + public sealed class PointerTypeBuilder : TypeBuilder + { + public PointerTypeBuilder( + ulong width , + TypeWithConfidence kind , + BoolWithConfidence? cnst = null , + BoolWithConfidence? vltl = null, // volatile + ReferenceType refType = ReferenceType.PointerReferenceType + ) + : base( + PointerTypeBuilder.create( + width , + kind , + cnst ?? new BoolWithConfidence() , + vltl?? new BoolWithConfidence() , + refType + ) , true) + { + + } + + + private static IntPtr create( + ulong width , + TypeWithConfidence kind, + BoolWithConfidence cnst , + BoolWithConfidence vltl, // volatile + ReferenceType refType + ) + { + return NativeMethods.BNCreatePointerTypeBuilderOfWidth( + width , + kind.ToNative() , + cnst.ToNative() , + vltl.ToNative() , + refType + ); + } + + public PointerType Build() + { + return new PointerType( NativeMethods.BNFinalizeTypeBuilder(this.handle) , true); + } + + public ulong Offset + { + get + { + return NativeMethods.BNGetTypeBuilderOffset(this.handle); + } + + set + { + NativeMethods.BNSetTypeBuilderOffset(this.handle, value); + } + } + + public PointerSuffix[] PointerSuffix + { + get + { + ulong arrayLength = 0; + + IntPtr arrayPointer = NativeMethods.BNGetTypeBuilderPointerSuffix(this.handle , out arrayLength); + + return UnsafeUtils.TakeNumberArrayEx( + arrayPointer , + arrayLength , + NativeMethods.BNFreePointerSuffixList + ); + } + + set + { + NativeMethods.BNSetTypeBuilderPointerSuffix( + this.handle, + value, + (ulong)value.Length + ); + } + } + + public string PointerSuffixString + { + get + { + return UnsafeUtils.TakeAnsiString(NativeMethods.BNGetTypeBuilderPointerSuffixString(this.handle)); + } + } + + public void AddPointerSuffix(PointerSuffix suffix) + { + NativeMethods.BNAddTypeBuilderPointerSuffix(this.handle, suffix); + } + + public InstructionTextToken[] GetPointerSuffixTokens(byte baseConfidence) + { + ulong arrayLength = 0; + + IntPtr arrayPointer = NativeMethods.BNGetTypeBuilderPointerSuffixTokens( + this.handle , + baseConfidence , + out arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer, + arrayLength, + InstructionTextToken.FromNative, + NativeMethods.BNFreeInstructionText + ); + } + + public void SetPointerBase(PointerBaseType baseType , long baseOffset) + { + NativeMethods.BNSetTypeBuilderPointerBase(this.handle , baseType , baseOffset); + } + + public PointerBaseType PointerBaseType + { + get + { + return NativeMethods.BNTypeBuilderGetPointerBaseType(this.handle); + } + } + + public long PointerBaseOffset + { + get + { + return NativeMethods.BNTypeBuilderGetPointerBaseOffset(this.handle); + } + + set + { + NativeMethods.BNSetTypeBuilderPointerBase(this.handle, this.PointerBaseType, value); + } + } + + } + + public sealed class ArrayTypeBuilder : TypeBuilder + { + public ArrayTypeBuilder( + TypeWithConfidence elementType , + ulong elementCount + ) : base(ArrayTypeBuilder.create(elementType , elementCount) , true) + { + + } + + private static IntPtr create( + TypeWithConfidence elementType , + ulong elementCount + ) + { + return NativeMethods.BNCreateArrayTypeBuilder( + elementType.ToNative() , + elementCount + ); + } + + public ArrayType Build() + { + return new ArrayType( NativeMethods.BNFinalizeTypeBuilder(this.handle) , true); + } + + public ulong ElementCount + { + get + { + return NativeMethods.BNGetTypeBuilderElementCount(this.handle); + } + + } + + public TypeWithConfidence ElementType + { + get + { + return TypeWithConfidence.FromNative( NativeMethods.BNGetTypeBuilderChildType(this.handle) ); + } + + set + { + NativeMethods.BNTypeBuilderSetChildType(this.handle , value.ToNative()); + } + } + + } + + public sealed class FunctionTypeBuilder : TypeBuilder + { + public FunctionTypeBuilder( + TypeWithConfidence? returnType , + CallingConventionWithConfidence? callingConvention , + FunctionParameter[]? parameters , + BoolWithConfidence? varArg , + BoolWithConfidence? canReturn , + OffsetWithConfidence? stackAdjust , + uint[]? regStackAdjustRegs = null, + OffsetWithConfidence[]? regStackAdjustValues = null , + RegisterSetWithConfidence? returnRegs = null , + NameType ft = NameType.NoNameType, + BoolWithConfidence? pure = null + ) : base( + FunctionTypeBuilder.create( + returnType ?? new TypeWithConfidence(new VoidType() , 0), + callingConvention ?? new CallingConventionWithConfidence(callingConvention?.Convention , 0) , + parameters ?? Array.Empty() , + varArg ?? new BoolWithConfidence() , + canReturn ?? new BoolWithConfidence(), + stackAdjust ?? new OffsetWithConfidence(), + regStackAdjustRegs ?? Array.Empty() , + regStackAdjustValues ?? Array.Empty() , + returnRegs ?? new RegisterSetWithConfidence() , + ft , + pure ?? new BoolWithConfidence() + ) , true + ) + { + + } + + private static IntPtr create( + TypeWithConfidence returnType , + CallingConventionWithConfidence callingConvention , + FunctionParameter[] parameters , + BoolWithConfidence varArg , + BoolWithConfidence canReturn , + OffsetWithConfidence stackAdjust , + uint[] regStackAdjustRegs , + OffsetWithConfidence[] regStackAdjustValues , + RegisterSetWithConfidence returnRegs , + NameType ft , + BoolWithConfidence pure + ) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + return NativeMethods.BNCreateFunctionTypeBuilder( + returnType.ToNative() , + callingConvention.ToNative() , + allocator.ConvertToNativeArrayEx( + parameters + ), + (ulong)parameters.Length , + varArg.ToNative() , + canReturn.ToNative() , + stackAdjust.ToNative() , + regStackAdjustRegs , + UnsafeUtils.ConvertToNativeArray( + regStackAdjustValues + ), + (ulong)regStackAdjustValues.Length , + returnRegs.ToNativeEx(allocator) , + ft , + pure.ToNative() + ); + } + } + + public FunctionType Build() + { + return new FunctionType( NativeMethods.BNFinalizeTypeBuilder(this.handle) , true); + } + + public OffsetWithConfidence StackAdjustment + { + get + { + return OffsetWithConfidence.FromNative( NativeMethods.BNGetTypeBuilderStackAdjustment(this.handle) ); + } + + set + { + NativeMethods.BNTypeBuilderSetStackAdjustment(this.handle , value.ToNative() ); + } + } + + public TypeWithConfidence ReturnType + { + get + { + return TypeWithConfidence.FromNative( NativeMethods.BNGetTypeBuilderChildType(this.handle) ); + } + + set + { + NativeMethods.BNTypeBuilderSetChildType(this.handle, value.ToNative() ); + } + } + + public CallingConventionWithConfidence CallingConvention + { + get + { + return CallingConventionWithConfidence.FromNative(NativeMethods.BNGetTypeBuilderCallingConvention(this.handle)); + } + + set + { + NativeMethods.BNTypeBuilderSetCallingConvention(this.handle, value.ToNative() ); + } + } + + public FunctionParameter[] Parameters + { + get + { + ulong arrayLength = 0; + + IntPtr arrayPointer = NativeMethods.BNGetTypeBuilderParameters(this.handle , out arrayLength); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer, + arrayLength, + FunctionParameter.FromNative, + NativeMethods.BNFreeTypeParameterList + ); + } + + set + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + NativeMethods.BNSetFunctionTypeBuilderParameters( + this.handle , + allocator.ConvertToNativeArrayEx(value), + (ulong)value.Length + ); + } + } + } + + public BoolWithConfidence HasVariableArguments + { + get + { + return BoolWithConfidence.FromNative(NativeMethods.BNTypeBuilderHasVariableArguments(this.handle)); + } + } + + public BoolWithConfidence CanReturn + { + get + { + return BoolWithConfidence.FromNative(NativeMethods.BNFunctionTypeBuilderCanReturn(this.handle)); + } + + set + { + NativeMethods.BNSetFunctionTypeBuilderCanReturn(this.handle, value.ToNative()); + } + } + + public BoolWithConfidence Pure + { + get + { + return BoolWithConfidence.FromNative(NativeMethods.BNIsTypeBuilderPure(this.handle)); + } + + set + { + NativeMethods.BNSetTypeBuilderPure(this.handle, value.ToNative()); + } + } + } + + public sealed class NamedTypeReferenceTypeBuilder : TypeBuilder + { + public NamedTypeReferenceTypeBuilder( + NamedTypeReference namedType , + ulong width , + ulong align , + BoolWithConfidence cnst , + BoolWithConfidence vltl + ) + : base( + NamedTypeReferenceTypeBuilder.create( + namedType , + width , + align , + cnst , + vltl + ) , + true + ) + { + + } + + private static IntPtr create( + NamedTypeReference namedType , + ulong width , + ulong align , + BoolWithConfidence cnst , + BoolWithConfidence vltl + ) + { + return NativeMethods.BNCreateNamedTypeReferenceBuilder( + namedType.DangerousGetHandle() , + width , + align , + cnst.ToNative() , + vltl.ToNative() + ); + } + + public NamedTypeReferenceType Build() + { + return new NamedTypeReferenceType( NativeMethods.BNFinalizeTypeBuilder(this.handle) , true); + } + + public QualifiedName Name + { + get + { + return QualifiedName.FromNative(NativeMethods.BNGetTypeReferenceBuilderName(this.handle)); + } + } + + public NamedTypeReferenceClass NamedTypeReferenceClass + { + get + { + return NativeMethods.BNGetTypeReferenceBuilderClass(this.handle); + } + } + + public string TypeReferenceId + { + get + { + return UnsafeUtils.TakeAnsiString(NativeMethods.BNGetTypeReferenceBuilderId(this.handle)); + } + } + + } + + + +} \ No newline at end of file diff --git a/Handle/BNTypeContainer.cs b/Handle/BNTypeContainer.cs new file mode 100644 index 0000000..0d8664b --- /dev/null +++ b/Handle/BNTypeContainer.cs @@ -0,0 +1,457 @@ +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Linq; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class TypeContainer : AbstractSafeHandle + { + public TypeContainer() + : this( NativeMethods.BNGetEmptyTypeContainer() , true) + { + + } + + internal TypeContainer(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static TypeContainer MustDuplicateFromHandle(IntPtr handle) + { + return new TypeContainer( + NativeMethods.BNDuplicateTypeContainer(handle) , + true + ); + } + + + internal static TypeContainer? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new TypeContainer(handle, true); + } + + internal static TypeContainer MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new TypeContainer(handle, true); + } + + internal static TypeContainer? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new TypeContainer(handle, false); + } + + internal static TypeContainer MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new TypeContainer(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeTypeContainer(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + + public string Id + { + get + { + return UnsafeUtils.TakeAnsiString(NativeMethods.BNTypeContainerGetId(this.handle)); + } + } + + public string Name + { + get + { + return UnsafeUtils.TakeAnsiString(NativeMethods.BNTypeContainerGetName(this.handle)); + } + } + + public TypeContainerType Type + { + get + { + return NativeMethods.BNTypeContainerGetType(this.handle); + } + } + + public bool Mutable + { + get + { + return NativeMethods.BNTypeContainerIsMutable(this.handle); + } + } + + public Platform Platform + { + get + { + IntPtr raw = NativeMethods.BNTypeContainerGetPlatform(this.handle); + + if (IntPtr.Zero == raw) + { + throw new Exception("Unable to get platform"); + } + + return new Platform(raw , true); + } + } + + public QualifiedNameAndId[] AddTypes( + QualifiedNameAndType[] types, + ProgressDelegate? progress = null + ) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + QualifiedName[] typeNames = QualifiedNameAndType.PickNames(types); + + bool ok = NativeMethods.BNTypeContainerAddTypes( + this.handle, + allocator.ConvertToNativeArrayEx(typeNames), + allocator.AllocHandleArray(QualifiedNameAndType.PickTypes(types)) , + (ulong)typeNames.Length, + null == progress ? IntPtr.Zero : + Marshal.GetFunctionPointerForDelegate( + UnsafeUtils.WrapProgressDelegate(progress) + ), + IntPtr.Zero, + out IntPtr resultNamesPointer, + out IntPtr resultIdsPointer, + out ulong resultCount + ); + + List results = new List(); + + if (ok) + { + QualifiedName[] resultNames = UnsafeUtils.TakeStructArrayEx( + resultNamesPointer , + resultCount , + QualifiedName.FromNative , + NativeMethods.BNFreeTypeNameList + ); + + string[] resultIds = UnsafeUtils.TakeAnsiStringArray( + resultIdsPointer , + resultCount, + NativeMethods.BNFreeStringList + ); + + for (ulong i = 0; i < resultCount; i++) + { + results.Add( new QualifiedNameAndId( + resultNames[i], + resultIds[i] + )); + } + } + + return results.ToArray(); + } + } + + public bool RenameType(string typeId , QualifiedName newName) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + return NativeMethods.BNTypeContainerRenameType( + this.handle, + typeId, + newName.ToNativeEx(allocator) + ); + } + } + + public bool DeleteType(string typeId) + { + return NativeMethods.BNTypeContainerDeleteType(this.handle, typeId ); + } + + public string GetTypeId(QualifiedName typeName) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + bool ok = NativeMethods.BNTypeContainerGetTypeId( + this.handle, + typeName.ToNativeEx(allocator) , + out IntPtr typeIdPointer + ); + + if (!ok) + { + return String.Empty; + } + + return UnsafeUtils.TakeAnsiString(typeIdPointer); + } + } + + public QualifiedName? GetTypeName(string typeId) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + bool ok = NativeMethods.BNTypeContainerGetTypeName( + this.handle, + typeId , + out BNQualifiedName rawTypeName + ); + + if (!ok) + { + return null; + } + + return QualifiedName.FromNative(rawTypeName); + } + } + + public BinaryNinja.Type? GetTypeById(string typeId) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + bool ok = NativeMethods.BNTypeContainerGetTypeById( + this.handle, + typeId , + out IntPtr rawType + ); + + if (!ok) + { + return null; + } + + return new BinaryNinja.Type(rawType , true); + } + } + + // QualifiedNameTypeAndId + public QualifiedNameTypeAndId[] GetTypes() + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + bool ok = NativeMethods.BNTypeContainerGetTypes( + this.handle, + out IntPtr typeIdsPointer, + out IntPtr typeNamesPointer, + out IntPtr typesPointer, + out ulong typeCount + ); + + List results = new List(); + + if (ok) + { + QualifiedName[] typeNames = UnsafeUtils.TakeStructArrayEx( + typeNamesPointer , + typeCount , + QualifiedName.FromNative , + NativeMethods.BNFreeTypeNameList + ); + + string[] typeIds = UnsafeUtils.TakeAnsiStringArray( + typeIdsPointer , + typeCount, + NativeMethods.BNFreeStringList + ); + + BinaryNinja.Type[] types = UnsafeUtils.TakeHandleArrayEx( + typeNamesPointer , + typeCount , + BinaryNinja.Type.MustNewFromHandle, + NativeMethods.BNFreeTypeList + ); + + for (ulong i = 0; i < typeCount; i++) + { + results.Add( new QualifiedNameTypeAndId( + typeNames[i], + BinaryNinja.Type.MustNewFromHandle(types[i].DangerousGetHandle()), + typeIds[i] + )); + } + } + + return results.ToArray(); + } + } + + + public BinaryNinja.Type? GetTypeByName(QualifiedName typeName) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + bool ok = NativeMethods.BNTypeContainerGetTypeByName( + this.handle, + typeName.ToNativeEx(allocator), + out IntPtr pointer + ); + + if (!ok) + { + return null; + } + + return BinaryNinja.Type.TakeHandle(pointer); + } + } + + public string[] TypeIds + { + get + { + bool ok = NativeMethods.BNTypeContainerGetTypeIds( + this.handle, + out IntPtr typeIdsPointer, + out ulong typeCount + ); + + if (!ok) + { + return Array.Empty(); + } + + return UnsafeUtils.TakeAnsiStringArray( + typeIdsPointer , + typeCount, + NativeMethods.BNFreeStringList + ); + } + } + + public QualifiedName[] TypeNames + { + get + { + bool ok = NativeMethods.BNTypeContainerGetTypeNames( + this.handle, + out IntPtr typeNamesPointer, + out ulong typeCount + ); + + if (!ok) + { + return Array.Empty(); + } + + return UnsafeUtils.TakeStructArrayEx( + typeNamesPointer , + typeCount, + QualifiedName.FromNative, + NativeMethods.BNFreeTypeNameList + ); + } + } + + public QualifiedNameAndId[] TypeNameAndIds + { + get + { + bool ok = NativeMethods.BNTypeContainerGetTypeNamesAndIds( + this.handle, + out IntPtr typeIdsPointer, + out IntPtr typeNamesPointer, + out ulong typeCount + ); + + List results = new List(); + + if (ok) + { + QualifiedName[] typeNames; + + string[] typeIds; + + typeIds = UnsafeUtils.TakeAnsiStringArray( + typeIdsPointer , + typeCount, + NativeMethods.BNFreeStringList + ); + + typeNames = UnsafeUtils.TakeStructArrayEx( + typeNamesPointer , + typeCount, + QualifiedName.FromNative, + NativeMethods.BNFreeTypeNameList + ); + + for (ulong i = 0; i < typeCount; i++) + { + results.Add( new QualifiedNameAndId( + typeNames[i], + typeIds[i] + )); + } + } + + return results.ToArray(); + } + } + + public QualifiedNameAndType? ParseTypeString( + string source , + bool importDepencencies, + out TypeParserError[] errors + ) + { + bool ok = NativeMethods.BNTypeContainerParseTypeString( + this.handle, + source, + importDepencencies, + out BNQualifiedNameAndType rawNameAndType, + out IntPtr errorsPointer, + out ulong errorCount + ); + + if (ok) + { + errors = Array.Empty(); + + return QualifiedNameAndType.FromNative(rawNameAndType); + } + else + { + errors = UnsafeUtils.TakeStructArrayEx( + errorsPointer , + errorCount , + TypeParserError.FromNative , + NativeMethods.BNFreeTypeParserErrors + ); + + return null; + } + } + + } +} \ No newline at end of file diff --git a/Handle/BNTypeLibrary.cs b/Handle/BNTypeLibrary.cs new file mode 100644 index 0000000..8fc23b0 --- /dev/null +++ b/Handle/BNTypeLibrary.cs @@ -0,0 +1,396 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class TypeLibrary : AbstractSafeHandle + { + public TypeLibrary(Architecture arch , string name) + :this( NativeMethods.BNNewTypeLibrary(arch.DangerousGetHandle(), name) , true) + { + + } + + internal TypeLibrary(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static TypeLibrary? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new TypeLibrary( + NativeMethods.BNNewTypeLibraryReference(handle) , + true + ); + } + + internal static TypeLibrary MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new TypeLibrary( + NativeMethods.BNNewTypeLibraryReference(handle) , + true + ); + } + + internal static TypeLibrary? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new TypeLibrary(handle, true); + } + + internal static TypeLibrary MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new TypeLibrary(handle, true); + } + + internal static TypeLibrary? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new TypeLibrary(handle, false); + } + + internal static TypeLibrary MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new TypeLibrary(handle, false); + } + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeTypeLibrary(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + + public static bool DecompressToFile(string filename , string outdir) + { + return NativeMethods.BNTypeLibraryDecompressToFile(filename , outdir); + } + + public static TypeLibrary? LoadFromFile(string filename) + { + IntPtr raw = NativeMethods.BNLoadTypeLibraryFromFile(filename); + + if (IntPtr.Zero == raw) + { + return null; + } + + return new TypeLibrary(raw, true); + } + + public static TypeLibrary? LookupByName(Architecture arch ,string name) + { + IntPtr raw = NativeMethods.BNLookupTypeLibraryByName(arch.DangerousGetHandle() ,name); + + if (IntPtr.Zero == raw) + { + return null; + } + + return new TypeLibrary(raw, true); + } + + public bool WriteToFile(string filename) + { + return NativeMethods.BNWriteTypeLibraryToFile(this.handle , filename); + } + + public Architecture Architecture + { + get + { + return Architecture.MustFromHandle( + NativeMethods.BNGetTypeLibraryArchitecture(this.handle) + ); + } + } + + public string Name + { + get + { + return UnsafeUtils.TakeAnsiString(NativeMethods.BNGetTypeLibraryName(this.handle)); + } + + set + { + NativeMethods.BNSetTypeLibraryName(this.handle, value); + } + } + + public string DependencyName + { + get + { + return UnsafeUtils.TakeAnsiString(NativeMethods.BNGetTypeLibraryDependencyName(this.handle)); + } + + set + { + NativeMethods.BNSetTypeLibraryDependencyName(this.handle, value); + } + } + + public string Guid + { + get + { + return UnsafeUtils.TakeAnsiString(NativeMethods.BNGetTypeLibraryGuid(this.handle)); + } + + set + { + NativeMethods.BNSetTypeLibraryGuid(this.handle, value); + } + } + + public string[] AlternateNames + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetTypeLibraryAlternateNames( + this.handle, + out ulong arrayLength + ); + + return UnsafeUtils.TakeAnsiStringArray( + arrayPointer, + arrayLength, + NativeMethods.BNFreeStringList + ); + } + } + + public void AddAlternateName(string alternateName) + { + NativeMethods.BNAddTypeLibraryAlternateName(this.handle, alternateName); + } + + public string[] Platforms + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetTypeLibraryPlatforms( + this.handle, + out ulong arrayLength + ); + + return UnsafeUtils.TakeAnsiStringArray( + arrayPointer, + arrayLength, + NativeMethods.BNFreeStringList + ); + } + } + + public void AddPlatform(Platform platform) + { + NativeMethods.BNAddTypeLibraryPlatform(this.handle, platform.DangerousGetHandle()); + } + + public void ClearPlatforms(Platform platform) + { + NativeMethods.BNClearTypeLibraryPlatforms(this.handle); + } + + public bool Build() + { + return NativeMethods.BNFinalizeTypeLibrary(this.handle); + } + + public Metadata? Metadata + { + get + { + IntPtr raw = NativeMethods.BNTypeLibraryGetMetadata(this.handle); + + if (IntPtr.Zero == raw) + { + return null; + } + + return new Metadata(raw, true); + } + } + + public Metadata? QueryMetadata(string key) + { + IntPtr raw = NativeMethods.BNTypeLibraryQueryMetadata(this.handle , key); + + if (IntPtr.Zero == raw) + { + return null; + } + + return new Metadata(raw, true); + } + + public void StoreMetadata(string key , Metadata data) + { + NativeMethods.BNTypeLibraryStoreMetadata(this.handle , key , data.DangerousGetHandle() ); + } + + public void RemoveMetadata(string key ) + { + NativeMethods.BNTypeLibraryRemoveMetadata(this.handle , key ); + } + + public TypeContainer TypeContainer + { + get + { + IntPtr raw = NativeMethods.BNGetTypeLibraryTypeContainer(this.handle); + + if (IntPtr.Zero == raw) + { + throw new Exception("Failed to get TypeContainer"); + } + + return new TypeContainer(raw, true); + } + } + + public void AddNamedObject(QualifiedName name , BinaryNinja.Type kind) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + NativeMethods.BNAddTypeLibraryNamedObject( + this.handle , + name.ToNativeEx(allocator) , + kind.DangerousGetHandle() + ); + } + } + + public void AddNamedType(QualifiedName name , BinaryNinja.Type kind) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + NativeMethods.BNAddTypeLibraryNamedType( + this.handle , + name.ToNativeEx(allocator) , + kind.DangerousGetHandle() + ); + } + } + + public void AddTypeSource(QualifiedName name , string source) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + NativeMethods.BNAddTypeLibraryNamedTypeSource( + this.handle , + name.ToNativeEx(allocator) , + source + ); + } + } + + public BinaryNinja.Type? GetNamedObject(QualifiedName name) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + IntPtr raw = NativeMethods.BNGetTypeLibraryNamedObject( + this.handle , + name.ToNativeEx(allocator) + ); + + if (IntPtr.Zero == raw) + { + return null; + } + + return new BinaryNinja.Type(raw , true); + } + } + + public BinaryNinja.Type? GetNamedType(QualifiedName name) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + IntPtr raw = NativeMethods.BNGetTypeLibraryNamedType( + this.handle , + name.ToNativeEx(allocator) + ); + + if (IntPtr.Zero == raw) + { + return null; + } + + return new BinaryNinja.Type(raw , true); + } + } + + public QualifiedNameAndType[] NamedObjects + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetTypeLibraryNamedObjects( + this.handle , + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + QualifiedNameAndType.FromNative , + NativeMethods.BNFreeQualifiedNameAndTypeArray + ); + } + } + + public QualifiedNameAndType[] NamedTypes + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetTypeLibraryNamedTypes( + this.handle , + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + QualifiedNameAndType.FromNative , + NativeMethods.BNFreeQualifiedNameAndTypeArray + ); + } + } + + } +} \ No newline at end of file diff --git a/Handle/BNTypeLibraryMapping.cs b/Handle/BNTypeLibraryMapping.cs new file mode 100644 index 0000000..016dcf5 --- /dev/null +++ b/Handle/BNTypeLibraryMapping.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class TypeLibraryMapping : AbstractSafeHandle + { + internal TypeLibraryMapping(IntPtr handle) + :base(handle , false) + { + + } + } +} \ No newline at end of file diff --git a/Handle/BNTypeParser.cs b/Handle/BNTypeParser.cs new file mode 100644 index 0000000..5cf3637 --- /dev/null +++ b/Handle/BNTypeParser.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class TypeParser : AbstractSafeHandle + { + internal TypeParser(IntPtr handle) + :base(handle , false) + { + + } + } +} \ No newline at end of file diff --git a/Handle/BNTypePrinter.cs b/Handle/BNTypePrinter.cs new file mode 100644 index 0000000..36ac373 --- /dev/null +++ b/Handle/BNTypePrinter.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class TypePrinter : AbstractSafeHandle + { + internal TypePrinter(IntPtr handle) + : base(handle, false) + { + + } + } +} \ No newline at end of file diff --git a/Handle/BNUndoAction.cs b/Handle/BNUndoAction.cs new file mode 100644 index 0000000..866b497 --- /dev/null +++ b/Handle/BNUndoAction.cs @@ -0,0 +1,103 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class UndoAction : AbstractSafeHandle + { + internal UndoAction(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static UndoAction? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new UndoAction( + NativeMethods.BNNewUndoActionReference(handle) , + true + ); + } + + internal static UndoAction MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new UndoAction( + NativeMethods.BNNewUndoActionReference(handle) , + true + ); + } + + internal static UndoAction? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new UndoAction(handle, true); + } + + internal static UndoAction MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new UndoAction(handle, true); + } + + internal static UndoAction? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new UndoAction(handle, false); + } + + internal static UndoAction MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new UndoAction(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeUndoAction(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + + public string Summary + { + get + { + return UnsafeUtils.TakeAnsiString( + NativeMethods.BNUndoActionGetSummaryText(this.handle) + ); + } + } + } +} \ No newline at end of file diff --git a/Handle/BNUndoEntry.cs b/Handle/BNUndoEntry.cs new file mode 100644 index 0000000..7ab3cf0 --- /dev/null +++ b/Handle/BNUndoEntry.cs @@ -0,0 +1,93 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class UndoEntry : AbstractSafeHandle + { + internal UndoEntry(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static UndoEntry? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new UndoEntry( + NativeMethods.BNNewUndoEntryReference(handle) , + true + ); + } + + internal static UndoEntry MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new UndoEntry( + NativeMethods.BNNewUndoEntryReference(handle) , + true + ); + } + + internal static UndoEntry? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new UndoEntry(handle, true); + } + + internal static UndoEntry MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new UndoEntry(handle, true); + } + + internal static UndoEntry? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new UndoEntry(handle, false); + } + + internal static UndoEntry MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new UndoEntry(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeUndoEntry(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + } +} \ No newline at end of file diff --git a/Handle/BNUser.cs b/Handle/BNUser.cs new file mode 100644 index 0000000..7911e91 --- /dev/null +++ b/Handle/BNUser.cs @@ -0,0 +1,93 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class User : AbstractSafeHandle + { + internal User(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static User? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new User( + NativeMethods.BNNewUserReference(handle) , + true + ); + } + + internal static User MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new User( + NativeMethods.BNNewUserReference(handle) , + true + ); + } + + internal static User? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new User(handle, true); + } + + internal static User MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new User(handle, true); + } + + internal static User? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new User(handle, false); + } + + internal static User MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new User(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeUser(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + } +} \ No newline at end of file diff --git a/Handle/BNWebsocketClient.cs b/Handle/BNWebsocketClient.cs new file mode 100644 index 0000000..2354eef --- /dev/null +++ b/Handle/BNWebsocketClient.cs @@ -0,0 +1,93 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class WebsocketClient : AbstractSafeHandle + { + internal WebsocketClient(IntPtr handle , bool owner) + : base(handle , owner) + { + + } + + internal static WebsocketClient? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new WebsocketClient( + NativeMethods.BNNewWebsocketClientReference(handle) , + true + ); + } + + internal static WebsocketClient MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new WebsocketClient( + NativeMethods.BNNewWebsocketClientReference(handle) , + true + ); + } + + internal static WebsocketClient? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new WebsocketClient(handle, true); + } + + internal static WebsocketClient MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new WebsocketClient(handle, true); + } + + internal static WebsocketClient? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new WebsocketClient(handle, false); + } + + internal static WebsocketClient MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new WebsocketClient(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeWebsocketClient(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + } +} \ No newline at end of file diff --git a/Handle/BNWebsocketProvider.cs b/Handle/BNWebsocketProvider.cs new file mode 100644 index 0000000..5efe374 --- /dev/null +++ b/Handle/BNWebsocketProvider.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public sealed class WebsocketProvider : AbstractSafeHandle + { + internal WebsocketProvider(IntPtr handle) + :base(handle , false) + { + + } + } +} \ No newline at end of file diff --git a/Handle/BNWorkflow.cs b/Handle/BNWorkflow.cs new file mode 100644 index 0000000..030a188 --- /dev/null +++ b/Handle/BNWorkflow.cs @@ -0,0 +1,263 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public class Workflow : AbstractSafeHandle + { + public Workflow(string name) : base(true) + { + this.SetHandle( NativeMethods.BNCreateWorkflow(name) ); + } + + internal Workflow(IntPtr handle , bool owner) : base(owner) + { + this.SetHandle(handle); + } + + internal static Workflow? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new Workflow( + NativeMethods.BNNewWorkflowReference(handle) , + true + ); + } + + internal static Workflow MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new Workflow( + NativeMethods.BNNewWorkflowReference(handle) , + true + ); + } + + internal static Workflow? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new Workflow(handle, true); + } + + internal static Workflow MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new Workflow(handle, true); + } + + internal static Workflow? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new Workflow(handle, false); + } + + internal static Workflow MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new Workflow(handle, false); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + NativeMethods.BNFreeWorkflow(this.handle); + this.SetHandleAsInvalid(); + } + + return true; + } + + public static Workflow[] GetWorkflows() + { + IntPtr arrayPointer = NativeMethods.BNGetWorkflowList( + out ulong arrayLength + ); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer , + arrayLength , + Workflow.MustNewFromHandle , + NativeMethods.BNFreeWorkflowList + ); + } + + public static Workflow? Get(string name) + { + return Workflow.TakeHandle( + NativeMethods.BNWorkflowGet(name) + ); + } + + public static Workflow? GetOrCreate(string name) + { + return Workflow.TakeHandle( + NativeMethods.BNWorkflowGetOrCreate(name) + ); + } + + public bool RegisterWorkflow(string config) + { + return NativeMethods.BNRegisterWorkflow(this.handle, config); + } + + public Workflow Clone(string name , string activity) + { + return Workflow.MustTakeHandle( + NativeMethods.BNWorkflowClone( + this.handle , + name , + activity + ) + ); + } + + public bool ContainsActivity(string activity) + { + return NativeMethods.BNWorkflowContains(this.handle, activity); + } + + public string GetConfiguration(string activity) + { + return UnsafeUtils.TakeUtf8String( + NativeMethods.BNWorkflowGetConfiguration(this.handle , activity) + ); + } + + public string Name + { + get + { + return UnsafeUtils.TakeUtf8String( + NativeMethods.BNGetWorkflowName(this.handle) + ); + } + } + + public bool IsRegistered + { + get + { + return NativeMethods.BNWorkflowIsRegistered(this.handle); + } + } + + public ulong Size + { + get + { + return NativeMethods.BNWorkflowSize(this.handle); + } + } + + public Activity? GetActivity(string activity) + { + return Activity.TakeHandle( + NativeMethods.BNWorkflowGetActivity(this.handle, activity) + ); + } + + public string[] GetActivityRoots(string activity) + { + ulong arrayLength = 0; + + IntPtr arrayPointer = NativeMethods.BNWorkflowGetActivityRoots( + this.handle , + activity , + ref arrayLength + ); + + return UnsafeUtils.TakeAnsiStringArray( + arrayPointer , + arrayLength , + NativeMethods.BNFreeStringList + ); + } + + public string[] GetSubactivities(string activity , bool immediate) + { + ulong arrayLength = 0; + + IntPtr arrayPointer = NativeMethods.BNWorkflowGetSubactivities( + this.handle , + activity , + immediate, + ref arrayLength + ); + + return UnsafeUtils.TakeAnsiStringArray( + arrayPointer , + arrayLength , + NativeMethods.BNFreeStringList + ); + } + + public bool Clear() + { + return NativeMethods.BNWorkflowClear(this.handle); + } + + public bool Insert(string activity , string[] activities) + { + return NativeMethods.BNWorkflowInsert( + this.handle, + activity , + activities , + (ulong)activities.Length + ); + } + + public bool InsertAfter(string activity , string[] activities) + { + return NativeMethods.BNWorkflowInsertAfter( + this.handle, + activity , + activities , + (ulong)activities.Length + ); + } + + public bool Remove(string activity) + { + return NativeMethods.BNWorkflowRemove( + this.handle, + activity + ); + } + + public bool Replace(string activity , string newActivity) + { + return NativeMethods.BNWorkflowReplace( + this.handle, + activity , + newActivity + ); + } + } +} \ No newline at end of file diff --git a/HighLevelIL/AbstractHighLevelILBinaryInstruction.cs b/HighLevelIL/AbstractHighLevelILBinaryInstruction.cs new file mode 100644 index 0000000..5b9897f --- /dev/null +++ b/HighLevelIL/AbstractHighLevelILBinaryInstruction.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public abstract class AbstractHighLevelILBinaryInstruction : HighLevelILInstruction + { + internal AbstractHighLevelILBinaryInstruction( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public HighLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/HighLevelIL/AbstractHighLevelILCarryInstruction.cs b/HighLevelIL/AbstractHighLevelILCarryInstruction.cs new file mode 100644 index 0000000..de94eb5 --- /dev/null +++ b/HighLevelIL/AbstractHighLevelILCarryInstruction.cs @@ -0,0 +1,38 @@ +namespace BinaryNinja +{ + public class AbstractHighLevelILCarryInstruction : HighLevelILInstruction + { + internal AbstractHighLevelILCarryInstruction( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public HighLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + + public HighLevelILInstruction Carry + { + get + { + return this.GetOperandAsExpression((OperandIndex)2); + } + } + } +} diff --git a/HighLevelIL/AbstractHighLevelILConstInstruction.cs b/HighLevelIL/AbstractHighLevelILConstInstruction.cs new file mode 100644 index 0000000..d7b6b7f --- /dev/null +++ b/HighLevelIL/AbstractHighLevelILConstInstruction.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public abstract class AbstractHighLevelILConstInstruction : HighLevelILInstruction + { + internal AbstractHighLevelILConstInstruction( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public ulong Constant + { + get + { + return this.RawOperands[0]; + } + } + } +} diff --git a/HighLevelIL/AbstractHighLevelILUnaryInstruction.cs b/HighLevelIL/AbstractHighLevelILUnaryInstruction.cs new file mode 100644 index 0000000..dd4f684 --- /dev/null +++ b/HighLevelIL/AbstractHighLevelILUnaryInstruction.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public abstract class AbstractHighLevelILUnaryInstruction : HighLevelILInstruction + { + internal AbstractHighLevelILUnaryInstruction( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression(0); + } + } + } +} diff --git a/HighLevelIL/HLILAdd.cs b/HighLevelIL/HLILAdd.cs new file mode 100644 index 0000000..a7fa5af --- /dev/null +++ b/HighLevelIL/HLILAdd.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class HLILAdd : HighLevelILInstruction + { + internal HLILAdd( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public HighLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/HighLevelIL/HLILAddCarry.cs b/HighLevelIL/HLILAddCarry.cs new file mode 100644 index 0000000..0177a3a --- /dev/null +++ b/HighLevelIL/HLILAddCarry.cs @@ -0,0 +1,38 @@ +namespace BinaryNinja +{ + public sealed class HLILAddCarry : HighLevelILInstruction + { + internal HLILAddCarry( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public HighLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + + public HighLevelILInstruction Carry + { + get + { + return this.GetOperandAsExpression((OperandIndex)2); + } + } + } +} diff --git a/HighLevelIL/HLILAddOverflow.cs b/HighLevelIL/HLILAddOverflow.cs new file mode 100644 index 0000000..a06b3df --- /dev/null +++ b/HighLevelIL/HLILAddOverflow.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class HLILAddOverflow : HighLevelILInstruction + { + internal HLILAddOverflow( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public HighLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/HighLevelIL/HLILAddressOf.cs b/HighLevelIL/HLILAddressOf.cs new file mode 100644 index 0000000..2f120dc --- /dev/null +++ b/HighLevelIL/HLILAddressOf.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class HLILAddressOf : HighLevelILInstruction + { + internal HLILAddressOf( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression(0); + } + } + } +} diff --git a/HighLevelIL/HLILAnd.cs b/HighLevelIL/HLILAnd.cs new file mode 100644 index 0000000..a4cef57 --- /dev/null +++ b/HighLevelIL/HLILAnd.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class HLILAnd : HighLevelILInstruction + { + internal HLILAnd( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public HighLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/HighLevelIL/HLILArrayIndex.cs b/HighLevelIL/HLILArrayIndex.cs new file mode 100644 index 0000000..1a1dd8d --- /dev/null +++ b/HighLevelIL/HLILArrayIndex.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class HLILArrayIndex : HighLevelILInstruction + { + internal HLILArrayIndex( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public HighLevelILInstruction Index + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/HighLevelIL/HLILArrayIndexSSA.cs b/HighLevelIL/HLILArrayIndexSSA.cs new file mode 100644 index 0000000..6eacc06 --- /dev/null +++ b/HighLevelIL/HLILArrayIndexSSA.cs @@ -0,0 +1,38 @@ +namespace BinaryNinja +{ + public sealed class HLILArrayIndexSSA : HighLevelILInstruction + { + internal HLILArrayIndexSSA( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public ulong SourceMemory + { + get + { + return this.RawOperands[1]; + } + } + + public HighLevelILInstruction Index + { + get + { + return this.GetOperandAsExpression((OperandIndex)2); + } + } + } +} diff --git a/HighLevelIL/HLILAssert.cs b/HighLevelIL/HLILAssert.cs new file mode 100644 index 0000000..df705ef --- /dev/null +++ b/HighLevelIL/HLILAssert.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class HLILAssert : HighLevelILInstruction + { + internal HLILAssert( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILVariable Source + { + get + { + return this.GetOperandAsVariable(0); + } + } + + public PossibleValueSet Constraint + { + get + { + return this.GetOperandAsPossibleValueSet((OperandIndex)1); + } + } + } +} diff --git a/HighLevelIL/HLILAssertSSA.cs b/HighLevelIL/HLILAssertSSA.cs new file mode 100644 index 0000000..5881f99 --- /dev/null +++ b/HighLevelIL/HLILAssertSSA.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class HLILAssertSSA : HighLevelILInstruction + { + internal HLILAssertSSA( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILSSAVariable Source + { + get + { + return this.GetOperandAsSSAVariable(0 , (OperandIndex)1); + } + } + + public PossibleValueSet Constraint + { + get + { + return this.GetOperandAsPossibleValueSet((OperandIndex)2); + } + } + } +} diff --git a/HighLevelIL/HLILAssign.cs b/HighLevelIL/HLILAssign.cs new file mode 100644 index 0000000..3a00e77 --- /dev/null +++ b/HighLevelIL/HLILAssign.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class HLILAssign : HighLevelILInstruction + { + internal HLILAssign( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Destination + { + get + { + return this.GetOperandAsExpression((OperandIndex)0); + } + } + + public HighLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/HighLevelIL/HLILAssignMemorySSA.cs b/HighLevelIL/HLILAssignMemorySSA.cs new file mode 100644 index 0000000..cd2dd92 --- /dev/null +++ b/HighLevelIL/HLILAssignMemorySSA.cs @@ -0,0 +1,47 @@ +namespace BinaryNinja +{ + public sealed class HLILAssignMemorySSA : HighLevelILInstruction + { + internal HLILAssignMemorySSA( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Destination + { + get + { + return this.GetOperandAsExpression((OperandIndex)0); + } + } + + public ulong DestinationMemory + { + get + { + return (ulong)this.RawOperands[1]; + } + } + + public HighLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression((OperandIndex)2); + } + } + + public ulong SourceMemory + { + get + { + return (ulong)this.RawOperands[3]; + } + } + + } +} diff --git a/HighLevelIL/HLILAssignUnpack.cs b/HighLevelIL/HLILAssignUnpack.cs new file mode 100644 index 0000000..98944bb --- /dev/null +++ b/HighLevelIL/HLILAssignUnpack.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class HLILAssignUnpack : HighLevelILInstruction + { + internal HLILAssignUnpack( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction[] Destination + { + get + { + return this.GetOperandAsExpressionList((OperandIndex)0); + } + } + + public HighLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression((OperandIndex)2); + } + } + } +} diff --git a/HighLevelIL/HLILAssignUnpackMemorySSA.cs b/HighLevelIL/HLILAssignUnpackMemorySSA.cs new file mode 100644 index 0000000..61fb6d2 --- /dev/null +++ b/HighLevelIL/HLILAssignUnpackMemorySSA.cs @@ -0,0 +1,47 @@ +namespace BinaryNinja +{ + public sealed class HLILAssignUnpackMemorySSA : HighLevelILInstruction + { + internal HLILAssignUnpackMemorySSA( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction[] Destination + { + get + { + return this.GetOperandAsExpressionList((OperandIndex)0); + } + } + + public ulong DestinationMemory + { + get + { + return (ulong)this.RawOperands[2]; + } + } + + public HighLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression((OperandIndex)3); + } + } + + public ulong SourceMemory + { + get + { + return (ulong)this.RawOperands[4]; + } + } + + } +} diff --git a/HighLevelIL/HLILBlock.cs b/HighLevelIL/HLILBlock.cs new file mode 100644 index 0000000..64acdff --- /dev/null +++ b/HighLevelIL/HLILBlock.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class HLILBlock : HighLevelILInstruction + { + internal HLILBlock( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction[] Body + { + get + { + return this.GetOperandAsExpressionList(0); + } + } + } +} diff --git a/HighLevelIL/HLILBoolToInt.cs b/HighLevelIL/HLILBoolToInt.cs new file mode 100644 index 0000000..b09913b --- /dev/null +++ b/HighLevelIL/HLILBoolToInt.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class HLILBoolToInt : HighLevelILInstruction + { + internal HLILBoolToInt( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + } +} diff --git a/HighLevelIL/HLILBreak.cs b/HighLevelIL/HLILBreak.cs new file mode 100644 index 0000000..df100ff --- /dev/null +++ b/HighLevelIL/HLILBreak.cs @@ -0,0 +1,14 @@ +namespace BinaryNinja +{ + public sealed class HLILBreak : HighLevelILInstruction + { + internal HLILBreak( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + } +} diff --git a/HighLevelIL/HLILBreakpoint.cs b/HighLevelIL/HLILBreakpoint.cs new file mode 100644 index 0000000..057b744 --- /dev/null +++ b/HighLevelIL/HLILBreakpoint.cs @@ -0,0 +1,14 @@ +namespace BinaryNinja +{ + public sealed class HLILBreakpoint : HighLevelILInstruction + { + internal HLILBreakpoint( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + } +} diff --git a/HighLevelIL/HLILCall.cs b/HighLevelIL/HLILCall.cs new file mode 100644 index 0000000..20d42ae --- /dev/null +++ b/HighLevelIL/HLILCall.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class HLILCall : HighLevelILInstruction + { + internal HLILCall( + HighLevelILFunction ilFunction , + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex , native) + { + + } + + public HighLevelILInstruction Destination + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public HighLevelILInstruction[] Parameters + { + get + { + return this.GetOperandAsExpressionList((OperandIndex)1); + } + } + } +} diff --git a/HighLevelIL/HLILCallSSA.cs b/HighLevelIL/HLILCallSSA.cs new file mode 100644 index 0000000..05f930d --- /dev/null +++ b/HighLevelIL/HLILCallSSA.cs @@ -0,0 +1,46 @@ +namespace BinaryNinja +{ + public sealed class HLILCallSSA : HighLevelILInstruction + { + internal HLILCallSSA( + HighLevelILFunction ilFunction , + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex , native) + { + + } + + public HighLevelILInstruction Destination + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public HighLevelILInstruction[] Parameters + { + get + { + return this.GetOperandAsExpressionList((OperandIndex)1); + } + } + + public ulong DestinationMemory + { + get + { + return this.RawOperands[3]; + } + } + + public ulong SourceMemory + { + get + { + return this.RawOperands[4]; + } + } + } +} diff --git a/HighLevelIL/HLILCase.cs b/HighLevelIL/HLILCase.cs new file mode 100644 index 0000000..e5da4df --- /dev/null +++ b/HighLevelIL/HLILCase.cs @@ -0,0 +1,31 @@ +namespace BinaryNinja +{ + public sealed class HLILCase : HighLevelILInstruction + { + internal HLILCase( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction[] Values + { + get + { + return this.GetOperandAsExpressionList((OperandIndex)0); + } + } + + public HighLevelILInstruction Body + { + get + { + return this.GetOperandAsExpression((OperandIndex)2); + } + } + + } +} diff --git a/HighLevelIL/HLILCeil.cs b/HighLevelIL/HLILCeil.cs new file mode 100644 index 0000000..6ca3bde --- /dev/null +++ b/HighLevelIL/HLILCeil.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class HLILCeil : HighLevelILInstruction + { + internal HLILCeil( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + } +} diff --git a/HighLevelIL/HLILConst.cs b/HighLevelIL/HLILConst.cs new file mode 100644 index 0000000..d985c61 --- /dev/null +++ b/HighLevelIL/HLILConst.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class HLILConst : HighLevelILInstruction + { + internal HLILConst( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public ulong Constant + { + get + { + return this.RawOperands[0]; + } + } + } +} diff --git a/HighLevelIL/HLILConstData.cs b/HighLevelIL/HLILConstData.cs new file mode 100644 index 0000000..0001e0e --- /dev/null +++ b/HighLevelIL/HLILConstData.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class HLILConstData : HighLevelILInstruction + { + internal HLILConstData( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public RegisterValue Constant + { + get + { + return this.GetOperandAsConstantData(0 , (OperandIndex)1); + } + } + } +} diff --git a/HighLevelIL/HLILConstPointer.cs b/HighLevelIL/HLILConstPointer.cs new file mode 100644 index 0000000..da60931 --- /dev/null +++ b/HighLevelIL/HLILConstPointer.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class HLILConstPointer : HighLevelILInstruction + { + internal HLILConstPointer( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public ulong Constant + { + get + { + return this.RawOperands[0]; + } + } + } +} diff --git a/HighLevelIL/HLILContinue.cs b/HighLevelIL/HLILContinue.cs new file mode 100644 index 0000000..a9c52af --- /dev/null +++ b/HighLevelIL/HLILContinue.cs @@ -0,0 +1,14 @@ +namespace BinaryNinja +{ + public sealed class HLILContinue : HighLevelILInstruction + { + internal HLILContinue( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + } +} diff --git a/HighLevelIL/HLILDeref.cs b/HighLevelIL/HLILDeref.cs new file mode 100644 index 0000000..13b3528 --- /dev/null +++ b/HighLevelIL/HLILDeref.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class HLILDeref : HighLevelILInstruction + { + internal HLILDeref( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression(0); + } + } + } +} diff --git a/HighLevelIL/HLILDerefField.cs b/HighLevelIL/HLILDerefField.cs new file mode 100644 index 0000000..cdabe09 --- /dev/null +++ b/HighLevelIL/HLILDerefField.cs @@ -0,0 +1,38 @@ +namespace BinaryNinja +{ + public sealed class HLILDerefField : HighLevelILInstruction + { + internal HLILDerefField( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public long Offset + { + get + { + return (long)this.RawOperands[1]; + } + } + + public ulong MemoryIndex + { + get + { + return this.RawOperands[2]; + } + } + } +} diff --git a/HighLevelIL/HLILDerefFieldSSA.cs b/HighLevelIL/HLILDerefFieldSSA.cs new file mode 100644 index 0000000..8e37d01 --- /dev/null +++ b/HighLevelIL/HLILDerefFieldSSA.cs @@ -0,0 +1,46 @@ +namespace BinaryNinja +{ + public sealed class HLILDerefFieldSSA : HighLevelILInstruction + { + internal HLILDerefFieldSSA( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public ulong SourceMemory + { + get + { + return (ulong)this.RawOperands[1]; + } + } + + public long Offset + { + get + { + return (long)this.RawOperands[2]; + } + } + + public ulong MemoryIndex + { + get + { + return this.RawOperands[3]; + } + } + } +} diff --git a/HighLevelIL/HLILDerefSSA.cs b/HighLevelIL/HLILDerefSSA.cs new file mode 100644 index 0000000..c03a879 --- /dev/null +++ b/HighLevelIL/HLILDerefSSA.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class HLILDerefSSA : HighLevelILInstruction + { + internal HLILDerefSSA( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public ulong SourceMemory + { + get + { + return this.RawOperands[1]; + } + } + } +} diff --git a/HighLevelIL/HLILDivSigned.cs b/HighLevelIL/HLILDivSigned.cs new file mode 100644 index 0000000..14a89f4 --- /dev/null +++ b/HighLevelIL/HLILDivSigned.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class HLILDivSigned : HighLevelILInstruction + { + internal HLILDivSigned( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public HighLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/HighLevelIL/HLILDivSignedDoublePrecision.cs b/HighLevelIL/HLILDivSignedDoublePrecision.cs new file mode 100644 index 0000000..8d4ebd7 --- /dev/null +++ b/HighLevelIL/HLILDivSignedDoublePrecision.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class HLILDivSignedDoublePrecision : HighLevelILInstruction + { + internal HLILDivSignedDoublePrecision( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public HighLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/HighLevelIL/HLILDivUnsigned.cs b/HighLevelIL/HLILDivUnsigned.cs new file mode 100644 index 0000000..717abdc --- /dev/null +++ b/HighLevelIL/HLILDivUnsigned.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class HLILDivUnsigned : HighLevelILInstruction + { + internal HLILDivUnsigned( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public HighLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/HighLevelIL/HLILDivUnsignedDoublePrecision.cs b/HighLevelIL/HLILDivUnsignedDoublePrecision.cs new file mode 100644 index 0000000..8e0dfc3 --- /dev/null +++ b/HighLevelIL/HLILDivUnsignedDoublePrecision.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class HLILDivUnsignedDoublePrecision : HighLevelILInstruction + { + internal HLILDivUnsignedDoublePrecision( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public HighLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/HighLevelIL/HLILDoWhile.cs b/HighLevelIL/HLILDoWhile.cs new file mode 100644 index 0000000..57a5bc2 --- /dev/null +++ b/HighLevelIL/HLILDoWhile.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class HLILDoWhile : HighLevelILInstruction + { + internal HLILDoWhile( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Body + { + get + { + return this.GetOperandAsExpression((OperandIndex)0); + } + } + + public HighLevelILInstruction Condition + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/HighLevelIL/HLILDoWhileSSA.cs b/HighLevelIL/HLILDoWhileSSA.cs new file mode 100644 index 0000000..b095b5f --- /dev/null +++ b/HighLevelIL/HLILDoWhileSSA.cs @@ -0,0 +1,38 @@ +namespace BinaryNinja +{ + public sealed class HLILDoWhileSSA : HighLevelILInstruction + { + internal HLILDoWhileSSA( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Body + { + get + { + return this.GetOperandAsExpression((OperandIndex)0); + } + } + + public HighLevelILInstruction ConditionPHI + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + + public HighLevelILInstruction Condition + { + get + { + return this.GetOperandAsExpression((OperandIndex)2); + } + } + } +} diff --git a/HighLevelIL/HLILEqual.cs b/HighLevelIL/HLILEqual.cs new file mode 100644 index 0000000..8da57f6 --- /dev/null +++ b/HighLevelIL/HLILEqual.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class HLILEqual : HighLevelILInstruction + { + internal HLILEqual( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public HighLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/HighLevelIL/HLILExternPointer.cs b/HighLevelIL/HLILExternPointer.cs new file mode 100644 index 0000000..0a34f0b --- /dev/null +++ b/HighLevelIL/HLILExternPointer.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class HLILExternPointer : HighLevelILInstruction + { + internal HLILExternPointer( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public ulong Constant + { + get + { + return this.RawOperands[0]; + } + } + + public ulong Offset + { + get + { + return this.RawOperands[1]; + } + } + } +} diff --git a/HighLevelIL/HLILFloatAbs.cs b/HighLevelIL/HLILFloatAbs.cs new file mode 100644 index 0000000..fdc865d --- /dev/null +++ b/HighLevelIL/HLILFloatAbs.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class HLILFloatAbs : HighLevelILInstruction + { + internal HLILFloatAbs( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + } +} diff --git a/HighLevelIL/HLILFloatAdd.cs b/HighLevelIL/HLILFloatAdd.cs new file mode 100644 index 0000000..7c05deb --- /dev/null +++ b/HighLevelIL/HLILFloatAdd.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class HLILFloatAdd : HighLevelILInstruction + { + internal HLILFloatAdd( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public HighLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/HighLevelIL/HLILFloatCompareOrdered.cs b/HighLevelIL/HLILFloatCompareOrdered.cs new file mode 100644 index 0000000..3f20a7d --- /dev/null +++ b/HighLevelIL/HLILFloatCompareOrdered.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class HLILFloatCompareOrdered : HighLevelILInstruction + { + internal HLILFloatCompareOrdered( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public HighLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/HighLevelIL/HLILFloatCompareUnordered.cs b/HighLevelIL/HLILFloatCompareUnordered.cs new file mode 100644 index 0000000..395d8aa --- /dev/null +++ b/HighLevelIL/HLILFloatCompareUnordered.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class HLILFloatCompareUnordered : HighLevelILInstruction + { + internal HLILFloatCompareUnordered( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public HighLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/HighLevelIL/HLILFloatConst.cs b/HighLevelIL/HLILFloatConst.cs new file mode 100644 index 0000000..d4e5713 --- /dev/null +++ b/HighLevelIL/HLILFloatConst.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class HLILFloatConst : HighLevelILInstruction + { + internal HLILFloatConst( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public double Constant + { + get + { + return this.GetOperandAsDouble(0); + } + } + } +} diff --git a/HighLevelIL/HLILFloatConvert.cs b/HighLevelIL/HLILFloatConvert.cs new file mode 100644 index 0000000..95a34e0 --- /dev/null +++ b/HighLevelIL/HLILFloatConvert.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class HLILFloatConvert : HighLevelILInstruction + { + internal HLILFloatConvert( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + } +} diff --git a/HighLevelIL/HLILFloatDiv.cs b/HighLevelIL/HLILFloatDiv.cs new file mode 100644 index 0000000..f9e97e8 --- /dev/null +++ b/HighLevelIL/HLILFloatDiv.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class HLILFloatDiv : HighLevelILInstruction + { + internal HLILFloatDiv( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public HighLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/HighLevelIL/HLILFloatEqual.cs b/HighLevelIL/HLILFloatEqual.cs new file mode 100644 index 0000000..ecacffe --- /dev/null +++ b/HighLevelIL/HLILFloatEqual.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class HLILFloatEqual : HighLevelILInstruction + { + internal HLILFloatEqual( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public HighLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/HighLevelIL/HLILFloatGreaterEqual.cs b/HighLevelIL/HLILFloatGreaterEqual.cs new file mode 100644 index 0000000..39b60e9 --- /dev/null +++ b/HighLevelIL/HLILFloatGreaterEqual.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class HLILFloatGreaterEqual : HighLevelILInstruction + { + internal HLILFloatGreaterEqual( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public HighLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/HighLevelIL/HLILFloatGreaterThan.cs b/HighLevelIL/HLILFloatGreaterThan.cs new file mode 100644 index 0000000..dc79e7e --- /dev/null +++ b/HighLevelIL/HLILFloatGreaterThan.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class HLILFloatGreaterThan : HighLevelILInstruction + { + internal HLILFloatGreaterThan( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public HighLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/HighLevelIL/HLILFloatLessEqual.cs b/HighLevelIL/HLILFloatLessEqual.cs new file mode 100644 index 0000000..9cd51f5 --- /dev/null +++ b/HighLevelIL/HLILFloatLessEqual.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class HLILFloatLessEqual : HighLevelILInstruction + { + internal HLILFloatLessEqual( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public HighLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/HighLevelIL/HLILFloatLessThan.cs b/HighLevelIL/HLILFloatLessThan.cs new file mode 100644 index 0000000..8fff8f7 --- /dev/null +++ b/HighLevelIL/HLILFloatLessThan.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class HLILFloatLessThan : HighLevelILInstruction + { + internal HLILFloatLessThan( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public HighLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/HighLevelIL/HLILFloatMul.cs b/HighLevelIL/HLILFloatMul.cs new file mode 100644 index 0000000..060fabc --- /dev/null +++ b/HighLevelIL/HLILFloatMul.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class HLILFloatMul : HighLevelILInstruction + { + internal HLILFloatMul( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public HighLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/HighLevelIL/HLILFloatNeg.cs b/HighLevelIL/HLILFloatNeg.cs new file mode 100644 index 0000000..a8ac048 --- /dev/null +++ b/HighLevelIL/HLILFloatNeg.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class HLILFloatNeg : HighLevelILInstruction + { + internal HLILFloatNeg( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + } +} diff --git a/HighLevelIL/HLILFloatNotEqual.cs b/HighLevelIL/HLILFloatNotEqual.cs new file mode 100644 index 0000000..12968a2 --- /dev/null +++ b/HighLevelIL/HLILFloatNotEqual.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class HLILFloatNotEqual : HighLevelILInstruction + { + internal HLILFloatNotEqual( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public HighLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/HighLevelIL/HLILFloatSquareRoot.cs b/HighLevelIL/HLILFloatSquareRoot.cs new file mode 100644 index 0000000..95409d2 --- /dev/null +++ b/HighLevelIL/HLILFloatSquareRoot.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class HLILFloatSquareRoot : HighLevelILInstruction + { + internal HLILFloatSquareRoot( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + } +} diff --git a/HighLevelIL/HLILFloatSub.cs b/HighLevelIL/HLILFloatSub.cs new file mode 100644 index 0000000..20b64a2 --- /dev/null +++ b/HighLevelIL/HLILFloatSub.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class HLILFloatSub : HighLevelILInstruction + { + internal HLILFloatSub( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public HighLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/HighLevelIL/HLILFloatToInt.cs b/HighLevelIL/HLILFloatToInt.cs new file mode 100644 index 0000000..5ced78c --- /dev/null +++ b/HighLevelIL/HLILFloatToInt.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class HLILFloatToInt : HighLevelILInstruction + { + internal HLILFloatToInt( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + } +} diff --git a/HighLevelIL/HLILFloatTrunc.cs b/HighLevelIL/HLILFloatTrunc.cs new file mode 100644 index 0000000..1dac2d8 --- /dev/null +++ b/HighLevelIL/HLILFloatTrunc.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class HLILFloatTrunc : HighLevelILInstruction + { + internal HLILFloatTrunc( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + } +} diff --git a/HighLevelIL/HLILFloor.cs b/HighLevelIL/HLILFloor.cs new file mode 100644 index 0000000..8e88378 --- /dev/null +++ b/HighLevelIL/HLILFloor.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class HLILFloor : HighLevelILInstruction + { + internal HLILFloor( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + } +} diff --git a/HighLevelIL/HLILFor.cs b/HighLevelIL/HLILFor.cs new file mode 100644 index 0000000..f292733 --- /dev/null +++ b/HighLevelIL/HLILFor.cs @@ -0,0 +1,46 @@ +namespace BinaryNinja +{ + public sealed class HLILFor : HighLevelILInstruction + { + internal HLILFor( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Init + { + get + { + return this.GetOperandAsExpression((OperandIndex)0); + } + } + + public HighLevelILInstruction Condition + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + + public HighLevelILInstruction Update + { + get + { + return this.GetOperandAsExpression((OperandIndex)2); + } + } + + public HighLevelILInstruction Body + { + get + { + return this.GetOperandAsExpression((OperandIndex)3); + } + } + } +} diff --git a/HighLevelIL/HLILForSSA.cs b/HighLevelIL/HLILForSSA.cs new file mode 100644 index 0000000..eb72bcb --- /dev/null +++ b/HighLevelIL/HLILForSSA.cs @@ -0,0 +1,54 @@ +namespace BinaryNinja +{ + public sealed class HLILForSSA : HighLevelILInstruction + { + internal HLILForSSA( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Init + { + get + { + return this.GetOperandAsExpression((OperandIndex)0); + } + } + + public HighLevelILInstruction ConditionPHI + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + + public HighLevelILInstruction Condition + { + get + { + return this.GetOperandAsExpression((OperandIndex)2); + } + } + + public HighLevelILInstruction Update + { + get + { + return this.GetOperandAsExpression((OperandIndex)3); + } + } + + public HighLevelILInstruction Body + { + get + { + return this.GetOperandAsExpression((OperandIndex)4); + } + } + } +} diff --git a/HighLevelIL/HLILForceVersion.cs b/HighLevelIL/HLILForceVersion.cs new file mode 100644 index 0000000..0139d75 --- /dev/null +++ b/HighLevelIL/HLILForceVersion.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class HLILForceVersion : HighLevelILInstruction + { + internal HLILForceVersion( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILVariable Destination + { + get + { + return this.GetOperandAsVariable(0); + } + } + + public HighLevelILVariable Source + { + get + { + return this.GetOperandAsVariable((OperandIndex)1); + } + } + } +} diff --git a/HighLevelIL/HLILForceVersionSSA.cs b/HighLevelIL/HLILForceVersionSSA.cs new file mode 100644 index 0000000..05e578e --- /dev/null +++ b/HighLevelIL/HLILForceVersionSSA.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class HLILForceVersionSSA : HighLevelILInstruction + { + internal HLILForceVersionSSA( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILSSAVariable Destination + { + get + { + return this.GetOperandAsSSAVariable(0 , (OperandIndex)1); + } + } + + public HighLevelILSSAVariable Source + { + get + { + return this.GetOperandAsSSAVariable((OperandIndex)2 , (OperandIndex)3); + } + } + } +} diff --git a/HighLevelIL/HLILGoto.cs b/HighLevelIL/HLILGoto.cs new file mode 100644 index 0000000..7b09b2f --- /dev/null +++ b/HighLevelIL/HLILGoto.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class HLILGoto : HighLevelILInstruction + { + internal HLILGoto( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILLabel Destination + { + get + { + return this.GetOperandAsLabel((OperandIndex)0); + } + } + } +} diff --git a/HighLevelIL/HLILIf.cs b/HighLevelIL/HLILIf.cs new file mode 100644 index 0000000..d6444ec --- /dev/null +++ b/HighLevelIL/HLILIf.cs @@ -0,0 +1,38 @@ +namespace BinaryNinja +{ + public sealed class HLILIf : HighLevelILInstruction + { + internal HLILIf( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Condition + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public HighLevelILInstruction TrueBranch + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + + public HighLevelILInstruction FalseBranch + { + get + { + return this.GetOperandAsExpression((OperandIndex)2); + } + } + } +} diff --git a/HighLevelIL/HLILImport.cs b/HighLevelIL/HLILImport.cs new file mode 100644 index 0000000..22c34b1 --- /dev/null +++ b/HighLevelIL/HLILImport.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class HLILImport : HighLevelILInstruction + { + internal HLILImport( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public ulong Constant + { + get + { + return this.RawOperands[0]; + } + } + } +} diff --git a/HighLevelIL/HLILIntToFloat.cs b/HighLevelIL/HLILIntToFloat.cs new file mode 100644 index 0000000..9b8fa7e --- /dev/null +++ b/HighLevelIL/HLILIntToFloat.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class HLILIntToFloat : HighLevelILInstruction + { + internal HLILIntToFloat( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + } +} diff --git a/HighLevelIL/HLILIntrinsic.cs b/HighLevelIL/HLILIntrinsic.cs new file mode 100644 index 0000000..5c019e5 --- /dev/null +++ b/HighLevelIL/HLILIntrinsic.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class HLILIntrinsic : HighLevelILInstruction + { + internal HLILIntrinsic( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public Intrinsic Intrinsic + { + get + { + return this.GetOperandAsIntrinsic(0); + } + } + + public HighLevelILInstruction[] Parameters + { + get + { + return this.GetOperandAsExpressionList((OperandIndex)1); + } + } + } +} diff --git a/HighLevelIL/HLILIntrinsicSSA.cs b/HighLevelIL/HLILIntrinsicSSA.cs new file mode 100644 index 0000000..8286ac2 --- /dev/null +++ b/HighLevelIL/HLILIntrinsicSSA.cs @@ -0,0 +1,46 @@ +namespace BinaryNinja +{ + public sealed class HLILIntrinsicSSA : HighLevelILInstruction + { + internal HLILIntrinsicSSA( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public Intrinsic Intrinsic + { + get + { + return this.GetOperandAsIntrinsic(0); + } + } + + public HighLevelILInstruction[] Parameters + { + get + { + return this.GetOperandAsExpressionList((OperandIndex)1); + } + } + + public ulong DestionationMemory + { + get + { + return this.RawOperands[3]; + } + } + + public ulong SourceMemory + { + get + { + return this.RawOperands[4]; + } + } + } +} diff --git a/HighLevelIL/HLILJump.cs b/HighLevelIL/HLILJump.cs new file mode 100644 index 0000000..96e31ef --- /dev/null +++ b/HighLevelIL/HLILJump.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class HLILJump : HighLevelILInstruction + { + internal HLILJump( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Destination + { + get + { + return this.GetOperandAsExpression((OperandIndex)0); + } + } + } +} diff --git a/HighLevelIL/HLILLabel.cs b/HighLevelIL/HLILLabel.cs new file mode 100644 index 0000000..ec9318e --- /dev/null +++ b/HighLevelIL/HLILLabel.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class HLILLabel : HighLevelILInstruction + { + internal HLILLabel( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILLabel Destination + { + get + { + return this.GetOperandAsLabel((OperandIndex)0); + } + } + } +} diff --git a/HighLevelIL/HLILLogicalShiftLef.cs b/HighLevelIL/HLILLogicalShiftLef.cs new file mode 100644 index 0000000..bfeb756 --- /dev/null +++ b/HighLevelIL/HLILLogicalShiftLef.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class HLILLogicalShiftLef : HighLevelILInstruction + { + internal HLILLogicalShiftLef( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public HighLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/HighLevelIL/HLILLogicalShiftRight.cs b/HighLevelIL/HLILLogicalShiftRight.cs new file mode 100644 index 0000000..a45ed6d --- /dev/null +++ b/HighLevelIL/HLILLogicalShiftRight.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class HLILLogicalShiftRight : HighLevelILInstruction + { + internal HLILLogicalShiftRight( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public HighLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/HighLevelIL/HLILLowPart.cs b/HighLevelIL/HLILLowPart.cs new file mode 100644 index 0000000..c367648 --- /dev/null +++ b/HighLevelIL/HLILLowPart.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class HLILLowPart : HighLevelILInstruction + { + internal HLILLowPart( + HighLevelILFunction ilFunction , + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex , native) + { + + } + + public HighLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + } +} diff --git a/HighLevelIL/HLILMemoryPhi.cs b/HighLevelIL/HLILMemoryPhi.cs new file mode 100644 index 0000000..00594ca --- /dev/null +++ b/HighLevelIL/HLILMemoryPhi.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class HLILMemoryPhi : HighLevelILInstruction + { + internal HLILMemoryPhi( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public ulong Destination + { + get + { + return this.RawOperands[0]; + } + } + + public ulong[] Source + { + get + { + return this.GetOperandAsIntegerArray((OperandIndex)1); + } + } + } +} diff --git a/HighLevelIL/HLILModSignedDoublePrecision.cs b/HighLevelIL/HLILModSignedDoublePrecision.cs new file mode 100644 index 0000000..082d5bf --- /dev/null +++ b/HighLevelIL/HLILModSignedDoublePrecision.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class HLILModSignedDoublePrecision : HighLevelILInstruction + { + internal HLILModSignedDoublePrecision( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public HighLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/HighLevelIL/HLILModUnsigned.cs b/HighLevelIL/HLILModUnsigned.cs new file mode 100644 index 0000000..1723d2a --- /dev/null +++ b/HighLevelIL/HLILModUnsigned.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class HLILModUnsigned : HighLevelILInstruction + { + internal HLILModUnsigned( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public HighLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/HighLevelIL/HLILModUnsignedDoublePrecision.cs b/HighLevelIL/HLILModUnsignedDoublePrecision.cs new file mode 100644 index 0000000..bc22c6c --- /dev/null +++ b/HighLevelIL/HLILModUnsignedDoublePrecision.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class HLILModUnsignedDoublePrecision : HighLevelILInstruction + { + internal HLILModUnsignedDoublePrecision( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public HighLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/HighLevelIL/HLILMul.cs b/HighLevelIL/HLILMul.cs new file mode 100644 index 0000000..7137ce9 --- /dev/null +++ b/HighLevelIL/HLILMul.cs @@ -0,0 +1,31 @@ +namespace BinaryNinja +{ + public sealed class HLILMul : HighLevelILInstruction + { + internal HLILMul( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public HighLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + + } +} diff --git a/HighLevelIL/HLILMulSignedDoublePrecision.cs b/HighLevelIL/HLILMulSignedDoublePrecision.cs new file mode 100644 index 0000000..e83fd38 --- /dev/null +++ b/HighLevelIL/HLILMulSignedDoublePrecision.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class HLILMulSignedDoublePrecision : HighLevelILInstruction + { + internal HLILMulSignedDoublePrecision( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public HighLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/HighLevelIL/HLILMulUnsignedDoublePrecision.cs b/HighLevelIL/HLILMulUnsignedDoublePrecision.cs new file mode 100644 index 0000000..3d5bccb --- /dev/null +++ b/HighLevelIL/HLILMulUnsignedDoublePrecision.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class HLILMulUnsignedDoublePrecision : HighLevelILInstruction + { + internal HLILMulUnsignedDoublePrecision( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public HighLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/HighLevelIL/HLILNeg.cs b/HighLevelIL/HLILNeg.cs new file mode 100644 index 0000000..19d4f42 --- /dev/null +++ b/HighLevelIL/HLILNeg.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class HLILNeg : HighLevelILInstruction + { + internal HLILNeg( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + } +} diff --git a/HighLevelIL/HLILNoReturn.cs b/HighLevelIL/HLILNoReturn.cs new file mode 100644 index 0000000..043f806 --- /dev/null +++ b/HighLevelIL/HLILNoReturn.cs @@ -0,0 +1,14 @@ +namespace BinaryNinja +{ + public sealed class HLILNoReturn : HighLevelILInstruction + { + internal HLILNoReturn( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + } +} diff --git a/HighLevelIL/HLILNop.cs b/HighLevelIL/HLILNop.cs new file mode 100644 index 0000000..51c40e6 --- /dev/null +++ b/HighLevelIL/HLILNop.cs @@ -0,0 +1,14 @@ +namespace BinaryNinja +{ + public sealed class HLILNop : HighLevelILInstruction + { + internal HLILNop( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + } +} diff --git a/HighLevelIL/HLILNot.cs b/HighLevelIL/HLILNot.cs new file mode 100644 index 0000000..f9d8ba1 --- /dev/null +++ b/HighLevelIL/HLILNot.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class HLILNot : HighLevelILInstruction + { + internal HLILNot( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + } +} diff --git a/HighLevelIL/HLILNotEqual.cs b/HighLevelIL/HLILNotEqual.cs new file mode 100644 index 0000000..144fe16 --- /dev/null +++ b/HighLevelIL/HLILNotEqual.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class HLILNotEqual : HighLevelILInstruction + { + internal HLILNotEqual( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public HighLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/HighLevelIL/HLILOr.cs b/HighLevelIL/HLILOr.cs new file mode 100644 index 0000000..829a4fc --- /dev/null +++ b/HighLevelIL/HLILOr.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class HLILOr : HighLevelILInstruction + { + internal HLILOr( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public HighLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/HighLevelIL/HLILReturn.cs b/HighLevelIL/HLILReturn.cs new file mode 100644 index 0000000..3f43b89 --- /dev/null +++ b/HighLevelIL/HLILReturn.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class HLILReturn : HighLevelILInstruction + { + internal HLILReturn( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction[] Source + { + get + { + return this.GetOperandAsExpressionList((OperandIndex)0); + } + } + } +} diff --git a/HighLevelIL/HLILRotateLeft.cs b/HighLevelIL/HLILRotateLeft.cs new file mode 100644 index 0000000..1adc532 --- /dev/null +++ b/HighLevelIL/HLILRotateLeft.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class HLILRotateLeft : HighLevelILInstruction + { + internal HLILRotateLeft( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public HighLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/HighLevelIL/HLILRotateLeftCarry.cs b/HighLevelIL/HLILRotateLeftCarry.cs new file mode 100644 index 0000000..6191f96 --- /dev/null +++ b/HighLevelIL/HLILRotateLeftCarry.cs @@ -0,0 +1,38 @@ +namespace BinaryNinja +{ + public sealed class HLILRotateLeftCarry : HighLevelILInstruction + { + internal HLILRotateLeftCarry( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public HighLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + + public HighLevelILInstruction Carry + { + get + { + return this.GetOperandAsExpression((OperandIndex)2); + } + } + } +} diff --git a/HighLevelIL/HLILRotateRight.cs b/HighLevelIL/HLILRotateRight.cs new file mode 100644 index 0000000..69623ca --- /dev/null +++ b/HighLevelIL/HLILRotateRight.cs @@ -0,0 +1,38 @@ +namespace BinaryNinja +{ + public sealed class HLILRotateRight : HighLevelILInstruction + { + internal HLILRotateRight( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public HighLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + + public HighLevelILInstruction Carry + { + get + { + return this.GetOperandAsExpression((OperandIndex)2); + } + } + } +} diff --git a/HighLevelIL/HLILRotateRightCarry.cs b/HighLevelIL/HLILRotateRightCarry.cs new file mode 100644 index 0000000..9409214 --- /dev/null +++ b/HighLevelIL/HLILRotateRightCarry.cs @@ -0,0 +1,38 @@ +namespace BinaryNinja +{ + public sealed class HLILRotateRightCarry : HighLevelILInstruction + { + internal HLILRotateRightCarry( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public HighLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + + public HighLevelILInstruction Carry + { + get + { + return this.GetOperandAsExpression((OperandIndex)2); + } + } + } +} diff --git a/HighLevelIL/HLILRoundToInt.cs b/HighLevelIL/HLILRoundToInt.cs new file mode 100644 index 0000000..3f3e8e3 --- /dev/null +++ b/HighLevelIL/HLILRoundToInt.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class HLILRoundToInt : HighLevelILInstruction + { + internal HLILRoundToInt( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + } +} diff --git a/HighLevelIL/HLILSignExtend.cs b/HighLevelIL/HLILSignExtend.cs new file mode 100644 index 0000000..4264c5d --- /dev/null +++ b/HighLevelIL/HLILSignExtend.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class HLILSignExtend : HighLevelILInstruction + { + internal HLILSignExtend( + HighLevelILFunction ilFunction , + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex , native) + { + + } + + public HighLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + } +} diff --git a/HighLevelIL/HLILSignedGreaterEqual.cs b/HighLevelIL/HLILSignedGreaterEqual.cs new file mode 100644 index 0000000..240827d --- /dev/null +++ b/HighLevelIL/HLILSignedGreaterEqual.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class HLILSignedGreaterEqual : HighLevelILInstruction + { + internal HLILSignedGreaterEqual( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public HighLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/HighLevelIL/HLILSignedGreaterThan.cs b/HighLevelIL/HLILSignedGreaterThan.cs new file mode 100644 index 0000000..5088bc7 --- /dev/null +++ b/HighLevelIL/HLILSignedGreaterThan.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class HLILSignedGreaterThan : HighLevelILInstruction + { + internal HLILSignedGreaterThan( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public HighLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/HighLevelIL/HLILSignedLessEqual.cs b/HighLevelIL/HLILSignedLessEqual.cs new file mode 100644 index 0000000..6b293ff --- /dev/null +++ b/HighLevelIL/HLILSignedLessEqual.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class HLILSignedLessEqual : HighLevelILInstruction + { + internal HLILSignedLessEqual( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public HighLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/HighLevelIL/HLILSignedLessThan.cs b/HighLevelIL/HLILSignedLessThan.cs new file mode 100644 index 0000000..df98c45 --- /dev/null +++ b/HighLevelIL/HLILSignedLessThan.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class HLILSignedLessThan : HighLevelILInstruction + { + internal HLILSignedLessThan( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public HighLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/HighLevelIL/HLILSplit.cs b/HighLevelIL/HLILSplit.cs new file mode 100644 index 0000000..059401f --- /dev/null +++ b/HighLevelIL/HLILSplit.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class HLILSplit : HighLevelILInstruction + { + internal HLILSplit( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction High + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public HighLevelILInstruction Low + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/HighLevelIL/HLILStructField.cs b/HighLevelIL/HLILStructField.cs new file mode 100644 index 0000000..9728ff7 --- /dev/null +++ b/HighLevelIL/HLILStructField.cs @@ -0,0 +1,38 @@ +namespace BinaryNinja +{ + public sealed class HLILStructField : HighLevelILInstruction + { + internal HLILStructField( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public long Offset + { + get + { + return (long)this.RawOperands[1]; + } + } + + public ulong MemberIndex + { + get + { + return this.RawOperands[2]; + } + } + } +} diff --git a/HighLevelIL/HLILSub.cs b/HighLevelIL/HLILSub.cs new file mode 100644 index 0000000..ebc95e9 --- /dev/null +++ b/HighLevelIL/HLILSub.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class HLILSub : HighLevelILInstruction + { + internal HLILSub( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public HighLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/HighLevelIL/HLILSubBorrow.cs b/HighLevelIL/HLILSubBorrow.cs new file mode 100644 index 0000000..d25ba29 --- /dev/null +++ b/HighLevelIL/HLILSubBorrow.cs @@ -0,0 +1,38 @@ +namespace BinaryNinja +{ + public sealed class HLILSubBorrow : HighLevelILInstruction + { + internal HLILSubBorrow( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public HighLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + + public HighLevelILInstruction Carry + { + get + { + return this.GetOperandAsExpression((OperandIndex)2); + } + } + } +} diff --git a/HighLevelIL/HLILSwitch.cs b/HighLevelIL/HLILSwitch.cs new file mode 100644 index 0000000..d965ecf --- /dev/null +++ b/HighLevelIL/HLILSwitch.cs @@ -0,0 +1,38 @@ +namespace BinaryNinja +{ + public sealed class HLILSwitch : HighLevelILInstruction + { + internal HLILSwitch( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Condition + { + get + { + return this.GetOperandAsExpression((OperandIndex)0); + } + } + + public HighLevelILInstruction Default + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + + public HighLevelILInstruction[] Cases + { + get + { + return this.GetOperandAsExpressionList((OperandIndex)2); + } + } + } +} diff --git a/HighLevelIL/HLILSysCall.cs b/HighLevelIL/HLILSysCall.cs new file mode 100644 index 0000000..67f74bb --- /dev/null +++ b/HighLevelIL/HLILSysCall.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class HLILSysCall : HighLevelILInstruction + { + internal HLILSysCall( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction[] Parameters + { + get + { + return this.GetOperandAsExpressionList(0); + } + } + } +} diff --git a/HighLevelIL/HLILSysCallSSA.cs b/HighLevelIL/HLILSysCallSSA.cs new file mode 100644 index 0000000..bbb92e7 --- /dev/null +++ b/HighLevelIL/HLILSysCallSSA.cs @@ -0,0 +1,38 @@ +namespace BinaryNinja +{ + public sealed class HLILSysCallSSA : HighLevelILInstruction + { + internal HLILSysCallSSA( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction[] Parameters + { + get + { + return this.GetOperandAsExpressionList(0); + } + } + + public ulong DestionationMemory + { + get + { + return this.RawOperands[2]; + } + } + + public ulong SourceMemory + { + get + { + return this.RawOperands[3]; + } + } + } +} diff --git a/HighLevelIL/HLILTailCall.cs b/HighLevelIL/HLILTailCall.cs new file mode 100644 index 0000000..3510c5f --- /dev/null +++ b/HighLevelIL/HLILTailCall.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class HLILTailCall : HighLevelILInstruction + { + internal HLILTailCall( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Destination + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public HighLevelILInstruction[] Parameters + { + get + { + return this.GetOperandAsExpressionList((OperandIndex)1); + } + } + } +} diff --git a/HighLevelIL/HLILTestBit.cs b/HighLevelIL/HLILTestBit.cs new file mode 100644 index 0000000..057e540 --- /dev/null +++ b/HighLevelIL/HLILTestBit.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class HLILTestBit : HighLevelILInstruction + { + internal HLILTestBit( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public HighLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/HighLevelIL/HLILTrap.cs b/HighLevelIL/HLILTrap.cs new file mode 100644 index 0000000..556d6ca --- /dev/null +++ b/HighLevelIL/HLILTrap.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class HLILTrap : HighLevelILInstruction + { + internal HLILTrap( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public ulong Vector + { + get + { + return this.RawOperands[0]; + } + } + } +} diff --git a/HighLevelIL/HLILUndefined.cs b/HighLevelIL/HLILUndefined.cs new file mode 100644 index 0000000..361ab1a --- /dev/null +++ b/HighLevelIL/HLILUndefined.cs @@ -0,0 +1,14 @@ +namespace BinaryNinja +{ + public sealed class HLILUndefined : HighLevelILInstruction + { + internal HLILUndefined( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + } +} diff --git a/HighLevelIL/HLILUnimplemented.cs b/HighLevelIL/HLILUnimplemented.cs new file mode 100644 index 0000000..19b8d46 --- /dev/null +++ b/HighLevelIL/HLILUnimplemented.cs @@ -0,0 +1,14 @@ +namespace BinaryNinja +{ + public sealed class HLILUnimplemented : HighLevelILInstruction + { + internal HLILUnimplemented( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + } +} diff --git a/HighLevelIL/HLILUnimplementedMemory.cs b/HighLevelIL/HLILUnimplementedMemory.cs new file mode 100644 index 0000000..59789e1 --- /dev/null +++ b/HighLevelIL/HLILUnimplementedMemory.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class HLILUnimplementedMemory : HighLevelILInstruction + { + internal HLILUnimplementedMemory( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + } +} diff --git a/HighLevelIL/HLILUnreachable.cs b/HighLevelIL/HLILUnreachable.cs new file mode 100644 index 0000000..996ef5d --- /dev/null +++ b/HighLevelIL/HLILUnreachable.cs @@ -0,0 +1,14 @@ +namespace BinaryNinja +{ + public sealed class HLILUnreachable : HighLevelILInstruction + { + internal HLILUnreachable( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + } +} diff --git a/HighLevelIL/HLILUnsignedGreaterEqual.cs b/HighLevelIL/HLILUnsignedGreaterEqual.cs new file mode 100644 index 0000000..9dda4f0 --- /dev/null +++ b/HighLevelIL/HLILUnsignedGreaterEqual.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class HLILUnsignedGreaterEqual : HighLevelILInstruction + { + internal HLILUnsignedGreaterEqual( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public HighLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/HighLevelIL/HLILUnsignedGreaterThan.cs b/HighLevelIL/HLILUnsignedGreaterThan.cs new file mode 100644 index 0000000..de06b49 --- /dev/null +++ b/HighLevelIL/HLILUnsignedGreaterThan.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class HLILUnsignedGreaterThan : HighLevelILInstruction + { + internal HLILUnsignedGreaterThan( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public HighLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/HighLevelIL/HLILUnsignedLessEqual.cs b/HighLevelIL/HLILUnsignedLessEqual.cs new file mode 100644 index 0000000..59c1aee --- /dev/null +++ b/HighLevelIL/HLILUnsignedLessEqual.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class HLILUnsignedLessEqual : HighLevelILInstruction + { + internal HLILUnsignedLessEqual( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public HighLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/HighLevelIL/HLILUnsignedLessThan.cs b/HighLevelIL/HLILUnsignedLessThan.cs new file mode 100644 index 0000000..3102436 --- /dev/null +++ b/HighLevelIL/HLILUnsignedLessThan.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class HLILUnsignedLessThan : HighLevelILInstruction + { + internal HLILUnsignedLessThan( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public HighLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/HighLevelIL/HLILVariable.cs b/HighLevelIL/HLILVariable.cs new file mode 100644 index 0000000..6345617 --- /dev/null +++ b/HighLevelIL/HLILVariable.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class HLILVariable : HighLevelILInstruction + { + internal HLILVariable( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILVariable Variable + { + get + { + return this.GetOperandAsVariable((OperandIndex)0); + } + } + } +} diff --git a/HighLevelIL/HLILVariableDeclare.cs b/HighLevelIL/HLILVariableDeclare.cs new file mode 100644 index 0000000..df455ee --- /dev/null +++ b/HighLevelIL/HLILVariableDeclare.cs @@ -0,0 +1,24 @@ +namespace BinaryNinja +{ + public sealed class HLILVariableDeclare : HighLevelILInstruction + { + internal HLILVariableDeclare( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + /* + public HighLevelILVariable Variable + { + get + { + return this.GetOperandAsVariable((OperandIndex)0); + } + } + */ + } +} diff --git a/HighLevelIL/HLILVariableInit.cs b/HighLevelIL/HLILVariableInit.cs new file mode 100644 index 0000000..706de36 --- /dev/null +++ b/HighLevelIL/HLILVariableInit.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class HLILVariableInit : HighLevelILInstruction + { + internal HLILVariableInit( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILVariable Destination + { + get + { + return this.GetOperandAsVariable((OperandIndex)0); + } + } + + public HighLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/HighLevelIL/HLILVariableInitSSA.cs b/HighLevelIL/HLILVariableInitSSA.cs new file mode 100644 index 0000000..d14c47c --- /dev/null +++ b/HighLevelIL/HLILVariableInitSSA.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class HLILVariableInitSSA : HighLevelILInstruction + { + internal HLILVariableInitSSA( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILSSAVariable Destination + { + get + { + return this.GetOperandAsSSAVariable((OperandIndex)0 , (OperandIndex)1); + } + } + + public HighLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression((OperandIndex)2); + } + } + } +} diff --git a/HighLevelIL/HLILVariablePhi.cs b/HighLevelIL/HLILVariablePhi.cs new file mode 100644 index 0000000..81c80ed --- /dev/null +++ b/HighLevelIL/HLILVariablePhi.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class HLILVariablePhi : HighLevelILInstruction + { + internal HLILVariablePhi( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILSSAVariable Destination + { + get + { + return this.GetOperandAsSSAVariable((OperandIndex)0 , (OperandIndex)1); + } + } + + public HighLevelILSSAVariable[] Source + { + get + { + return this.GetOperandAsSSAVariableList((OperandIndex)2); + } + } + } +} diff --git a/HighLevelIL/HLILVariableSSA.cs b/HighLevelIL/HLILVariableSSA.cs new file mode 100644 index 0000000..773ada1 --- /dev/null +++ b/HighLevelIL/HLILVariableSSA.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class HLILVariableSSA : HighLevelILInstruction + { + internal HLILVariableSSA( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILSSAVariable Variable + { + get + { + return this.GetOperandAsSSAVariable((OperandIndex)0 , (OperandIndex)1); + } + } + } +} diff --git a/HighLevelIL/HLILWhile.cs b/HighLevelIL/HLILWhile.cs new file mode 100644 index 0000000..9cbf2c6 --- /dev/null +++ b/HighLevelIL/HLILWhile.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class HLILWhile : HighLevelILInstruction + { + internal HLILWhile( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Condition + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public HighLevelILInstruction Body + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/HighLevelIL/HLILWhileSSA.cs b/HighLevelIL/HLILWhileSSA.cs new file mode 100644 index 0000000..4e22b2a --- /dev/null +++ b/HighLevelIL/HLILWhileSSA.cs @@ -0,0 +1,38 @@ +namespace BinaryNinja +{ + public sealed class HLILWhileSSA : HighLevelILInstruction + { + internal HLILWhileSSA( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction ConditionPHI + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public HighLevelILInstruction Condition + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + + public HighLevelILInstruction Body + { + get + { + return this.GetOperandAsExpression((OperandIndex)2); + } + } + } +} diff --git a/HighLevelIL/HLILXor.cs b/HighLevelIL/HLILXor.cs new file mode 100644 index 0000000..e3bb00e --- /dev/null +++ b/HighLevelIL/HLILXor.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class HLILXor : HighLevelILInstruction + { + internal HLILXor( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public HighLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/HighLevelIL/HLILZeroExtend.cs b/HighLevelIL/HLILZeroExtend.cs new file mode 100644 index 0000000..37147af --- /dev/null +++ b/HighLevelIL/HLILZeroExtend.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class HLILZeroExtend : HighLevelILInstruction + { + internal HLILZeroExtend( + HighLevelILFunction ilFunction , + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex , native) + { + + } + + public HighLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + } +} diff --git a/HighLevelIL/HighLevelILBasicBlock.cs b/HighLevelIL/HighLevelILBasicBlock.cs new file mode 100644 index 0000000..babd7b4 --- /dev/null +++ b/HighLevelIL/HighLevelILBasicBlock.cs @@ -0,0 +1,329 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace BinaryNinja +{ + public sealed class HighLevelILBasicBlock : AbstractBasicBlock + { + internal HighLevelILFunction ILFunction { get; } + + internal HighLevelILBasicBlock( + HighLevelILFunction function , + IntPtr handle , + bool owner + ) : base(handle , owner) + { + this.ILFunction = function; + } + + internal static HighLevelILBasicBlock MustNewFromHandleEx( + HighLevelILFunction function , + IntPtr handle + ) + { + return new HighLevelILBasicBlock( + function, + NativeMethods.BNNewBasicBlockReference(handle) , + true + ); + } + + internal static HighLevelILBasicBlock? TakeHandleEx( + HighLevelILFunction function , + IntPtr handle , + bool ssa = false + ) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new HighLevelILBasicBlock( + function, + handle, + true + ); + } + + + public HighLevelILInstruction this[HighLevelILInstructionIndex index] + { + get + { + return this.MustGetInstructionByInstructionIndex(index); + } + } + + public HighLevelILInstruction? GetInstructionByInstructionIndex(HighLevelILInstructionIndex index) + { + if ( (ulong)index < this.Start) + { + return null; + } + + if ( (ulong)index >= this.End) + { + return null; + } + + return this.ILFunction.GetInstruction(index); + } + + public HighLevelILInstruction MustGetInstructionByInstructionIndex(HighLevelILInstructionIndex index) + { + if ( (ulong)index < this.Start) + { + throw new IndexOutOfRangeException(nameof(index)); + } + + if ( (ulong)index >= this.End) + { + throw new IndexOutOfRangeException(nameof(index)); + } + + return this.ILFunction.MustGetInstruction(index); + } + + public IEnumerable Instructions + { + get + { + for (ulong index = (ulong)this.Start; index < (ulong)this.End; index++) + { + yield return this.MustGetInstructionByInstructionIndex((HighLevelILInstructionIndex)index); + } + } + } + + public bool ContainsInstruction(HighLevelILInstructionIndex index) + { + return (ulong)index >= (ulong)this.Start && (ulong)index < (ulong)this.End; + } + + public HighLevelILBasicBlock? SourceBlock + { + get + { + return HighLevelILBasicBlock.TakeHandleEx( + this.ILFunction , + NativeMethods.BNGetBasicBlockSourceBlock(this.handle) + ); + } + } + + public HighLevelILBasicBlockEdge[] OutgoingEdges + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetBasicBlockOutgoingEdges( + this.handle , + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + (_native) => HighLevelILBasicBlockEdge.FromNativeEx( + _native , + this , + true + ) , + NativeMethods.BNFreeBasicBlockEdgeList + ); + } + } + + public HighLevelILBasicBlockEdge[] IncomingEdges + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetBasicBlockIncomingEdges( + this.handle , + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + (_native) => HighLevelILBasicBlockEdge.FromNativeEx( + _native , + this , + false + ) , + NativeMethods.BNFreeBasicBlockEdgeList + ); + } + } + + public HighLevelILBasicBlock[] GetDominators(bool post) + { + ulong arrayLength = 0; + + IntPtr arrayPointer = NativeMethods.BNGetBasicBlockDominators( + this.handle , + out arrayLength , + post + ); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer , + arrayLength , + (_native) => HighLevelILBasicBlock.MustNewFromHandleEx( + this.ILFunction , + _native + ), + NativeMethods.BNFreeBasicBlockList + ); + } + + public HighLevelILBasicBlock[] Dominators + { + get + { + return this.GetDominators(false); + } + } + + public HighLevelILBasicBlock[] PostDominators + { + get + { + return this.GetDominators(true); + } + } + + public HighLevelILBasicBlock[] GetStrictDominators(bool post) + { + ulong arrayLength = 0; + + IntPtr arrayPointer = NativeMethods.BNGetBasicBlockStrictDominators( + this.handle , + out arrayLength , + post + ); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer , + arrayLength , + (_native) => HighLevelILBasicBlock.MustNewFromHandleEx( + this.ILFunction , + _native + ), + NativeMethods.BNFreeBasicBlockList + ); + } + + public HighLevelILBasicBlock[] StrictDominators + { + get + { + return this.GetStrictDominators(false); + } + } + + public HighLevelILBasicBlock[] StrictPostDominators + { + get + { + return this.GetStrictDominators(true); + } + } + + + public HighLevelILBasicBlock? GetImmediateDominator(bool post) + { + return HighLevelILBasicBlock.TakeHandleEx( + this.ILFunction, + NativeMethods.BNGetBasicBlockImmediateDominator(this.handle , post) + ); + } + + public HighLevelILBasicBlock? ImmediateDominator + { + get + { + return this.GetImmediateDominator(false); + } + } + + public HighLevelILBasicBlock? ImmediatePostDominator + { + get + { + return this.GetImmediateDominator(true); + } + } + + public HighLevelILBasicBlock[] GetDominatorTreeChildren(bool post) + { + ulong arrayLength = 0; + + IntPtr arrayPointer = NativeMethods.BNGetBasicBlockDominatorTreeChildren( + this.handle , + out arrayLength , + post + ); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer , + arrayLength , + (_native) => HighLevelILBasicBlock.MustNewFromHandleEx(this.ILFunction , _native), + NativeMethods.BNFreeBasicBlockList + ); + } + + public HighLevelILBasicBlock[] DominatorTreeChildren + { + get + { + return this.GetDominatorTreeChildren(false); + } + } + + public HighLevelILBasicBlock[] PostDominatorTreeChildren + { + get + { + return this.GetDominatorTreeChildren(true); + } + } + + + public HighLevelILBasicBlock[] GetDominanceFrontier(bool post) + { + ulong arrayLength = 0; + + IntPtr arrayPointer = NativeMethods.BNGetBasicBlockDominanceFrontier( + this.handle , + out arrayLength , + post + ); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer , + arrayLength , + (_native) => HighLevelILBasicBlock.MustNewFromHandleEx(this.ILFunction , _native), + NativeMethods.BNFreeBasicBlockList + ); + } + + public HighLevelILBasicBlock[] DominanceFrontier + { + get + { + return this.GetDominanceFrontier(false); + } + } + + public HighLevelILBasicBlock[] PostDominanceFrontier + { + get + { + return this.GetDominanceFrontier(true); + } + } + + } +} diff --git a/HighLevelIL/HighLevelILBasicBlockEdge.cs b/HighLevelIL/HighLevelILBasicBlockEdge.cs new file mode 100644 index 0000000..ffa73ac --- /dev/null +++ b/HighLevelIL/HighLevelILBasicBlockEdge.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; + +namespace BinaryNinja +{ + public sealed class HighLevelILBasicBlockEdge : AbstractBasicBlockEdge + { + internal HighLevelILBasicBlockEdge( + BNBasicBlockEdge native , + HighLevelILBasicBlock source, + HighLevelILBasicBlock target, + bool outgoing + ) : base(native, source , target , outgoing) + { + + } + + internal static HighLevelILBasicBlockEdge FromNativeEx( + BNBasicBlockEdge native , + HighLevelILBasicBlock me, + bool outgoing + ) + { + if (outgoing) + { + return new HighLevelILBasicBlockEdge( + native, + me , + HighLevelILBasicBlock.MustNewFromHandleEx(me.ILFunction, native.target), + outgoing + ); + } + else + { + return new HighLevelILBasicBlockEdge( + native, + HighLevelILBasicBlock.MustNewFromHandleEx(me.ILFunction,native.target) , + me, + outgoing + ); + } + } + } +} diff --git a/HighLevelIL/HighLevelILFlowGraph.cs b/HighLevelIL/HighLevelILFlowGraph.cs new file mode 100644 index 0000000..ee7f4e3 --- /dev/null +++ b/HighLevelIL/HighLevelILFlowGraph.cs @@ -0,0 +1,159 @@ +using System; + +namespace BinaryNinja +{ + public sealed class HighLevelILFlowGraph : AbstractFlowGraph + { + internal HighLevelILFunction ILFunction { get; set; } + + internal HighLevelILFlowGraph( + HighLevelILFunction ilFunction, + IntPtr handle , + bool owner + ) : base(handle , owner) + { + this.ILFunction = ilFunction; + } + + internal static HighLevelILFlowGraph? NewFromHandleEx( + HighLevelILFunction ilFunction, + IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new HighLevelILFlowGraph( + ilFunction, + NativeMethods.BNNewFlowGraphReference(handle) , + true + ); + } + + internal static HighLevelILFlowGraph MustNewFromHandleEx( + HighLevelILFunction ilFunction, + IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new HighLevelILFlowGraph( + ilFunction, + NativeMethods.BNNewFlowGraphReference(handle) , + true + ); + } + + internal static HighLevelILFlowGraph? TakeHandleEx( + HighLevelILFunction ilFunction, + IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new HighLevelILFlowGraph(ilFunction , handle, true); + } + + internal static HighLevelILFlowGraph MustTakeHandleEx( + HighLevelILFunction ilFunction, + IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new HighLevelILFlowGraph(ilFunction , handle, true); + } + + internal static HighLevelILFlowGraph? BorrowHandleEx( + HighLevelILFunction ilFunction, + IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new HighLevelILFlowGraph(ilFunction , handle, false); + } + + internal static HighLevelILFlowGraph MustBorrowHandleEx( + HighLevelILFunction ilFunction, + IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new HighLevelILFlowGraph(ilFunction , handle, false); + } + + + + public HighLevelILFlowGraph? Update() + { + return HighLevelILFlowGraph.TakeHandleEx( + this.ILFunction, + NativeMethods.BNUpdateFlowGraph(this.handle ) + ); + } + + public HighLevelILFlowGraphNode[] Nodes + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetFlowGraphNodes( + this.handle, + out ulong arrayLength + ); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer , + arrayLength , + (_native) => HighLevelILFlowGraphNode.MustNewFromHandleEx(this.ILFunction,_native) , + NativeMethods.BNFreeFlowGraphNodeList + ); + } + } + + public HighLevelILFlowGraphNode? GetNode(ulong index) + { + return HighLevelILFlowGraphNode.TakeHandleEx( + this.ILFunction, + NativeMethods.BNGetFlowGraphNode(this.handle, index) + ); + } + + + public HighLevelILFlowGraphNode[] GetNodesInRegion( + int left , + int top , + int right , + int bottom + ) + { + IntPtr arrayPointer = NativeMethods.BNGetFlowGraphNodesInRegion( + this.handle, + left, + top, + right, + bottom, + out ulong arrayLength + ); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer, + arrayLength, + (_native) => HighLevelILFlowGraphNode.MustNewFromHandleEx(this.ILFunction,_native) , + NativeMethods.BNFreeFlowGraphNodeList + ); + } + } +} diff --git a/HighLevelIL/HighLevelILFlowGraphEdge.cs b/HighLevelIL/HighLevelILFlowGraphEdge.cs new file mode 100644 index 0000000..a6ec5e8 --- /dev/null +++ b/HighLevelIL/HighLevelILFlowGraphEdge.cs @@ -0,0 +1,26 @@ +namespace BinaryNinja +{ + public sealed class HighLevelILFlowGraphEdge : AbstractFlowGraphEdge + { + internal HighLevelILFunction ILFunction { get; set; } + + internal HighLevelILFlowGraphEdge( + HighLevelILFunction ilFunction, + BNFlowGraphEdge native) + : base(native , HighLevelILFlowGraphNode.NewFromHandleEx(ilFunction, native.target)) + { + this.ILFunction = ilFunction; + } + + internal static HighLevelILFlowGraphEdge FromNativeEx( + HighLevelILFunction ilFunction, + BNFlowGraphEdge native + ) + { + return new HighLevelILFlowGraphEdge( + ilFunction , + native + ); + } + } +} diff --git a/HighLevelIL/HighLevelILFlowGraphLayoutRequest.cs b/HighLevelIL/HighLevelILFlowGraphLayoutRequest.cs new file mode 100644 index 0000000..590fc55 --- /dev/null +++ b/HighLevelIL/HighLevelILFlowGraphLayoutRequest.cs @@ -0,0 +1,119 @@ +using System; + +namespace BinaryNinja +{ + public sealed class HighLevelILFlowGraphLayoutRequest : FlowGraphLayoutRequest + { + internal HighLevelILFunction ILFunction { get; set; } + + internal HighLevelILFlowGraphLayoutRequest( + HighLevelILFunction ilFunction, + IntPtr handle , + bool owner + ) : base(handle , owner) + { + this.ILFunction = ilFunction; + } + + internal static HighLevelILFlowGraphLayoutRequest? NewFromHandleEx( + HighLevelILFunction ilFunction, + IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new HighLevelILFlowGraphLayoutRequest( + ilFunction, + NativeMethods.BNNewFlowGraphLayoutRequestReference(handle) , + true + ); + } + + internal static HighLevelILFlowGraphLayoutRequest MustNewFromHandleEx( + HighLevelILFunction ilFunction, + IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new HighLevelILFlowGraphLayoutRequest( + ilFunction, + NativeMethods.BNNewFlowGraphLayoutRequestReference(handle) , + true + ); + } + + internal static HighLevelILFlowGraphLayoutRequest? TakeHandleEx( + HighLevelILFunction ilFunction, + IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new HighLevelILFlowGraphLayoutRequest( + ilFunction, + handle, true); + } + + internal static HighLevelILFlowGraphLayoutRequest MustTakeHandleEx( + HighLevelILFunction ilFunction, + IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new HighLevelILFlowGraphLayoutRequest( + ilFunction, + handle, true); + } + + internal static HighLevelILFlowGraphLayoutRequest? BorrowHandleEx( + HighLevelILFunction ilFunction, + IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new HighLevelILFlowGraphLayoutRequest( + ilFunction, + handle, false); + } + + internal static HighLevelILFlowGraphLayoutRequest MustBorrowHandleEx( + HighLevelILFunction ilFunction, + IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new HighLevelILFlowGraphLayoutRequest( + ilFunction, + handle, false); + } + + + public HighLevelILFlowGraph? FlowGraph + { + get + { + return HighLevelILFlowGraph.TakeHandleEx( + this.ILFunction, + NativeMethods.BNGetGraphForFlowGraphLayoutRequest(this.handle) + ); + } + } + + } +} diff --git a/HighLevelIL/HighLevelILFlowGraphNode.cs b/HighLevelIL/HighLevelILFlowGraphNode.cs new file mode 100644 index 0000000..83a2734 --- /dev/null +++ b/HighLevelIL/HighLevelILFlowGraphNode.cs @@ -0,0 +1,170 @@ +using System; + +namespace BinaryNinja +{ + public sealed class HighLevelILFlowGraphNode : FlowGraphNode + { + internal HighLevelILFunction ILFunction { get; set; } + + internal HighLevelILFlowGraphNode( + HighLevelILFunction ilFunction, + IntPtr handle , + bool owner) + : base(handle , owner) + { + this.ILFunction = ilFunction; + } + + internal static HighLevelILFlowGraphNode? NewFromHandleEx( + HighLevelILFunction ilFunction, + IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new HighLevelILFlowGraphNode( + ilFunction, + NativeMethods.BNNewFlowGraphNodeReference(handle) , + true + ); + } + + internal static HighLevelILFlowGraphNode MustNewFromHandleEx( + HighLevelILFunction ilFunction, + IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new HighLevelILFlowGraphNode( + ilFunction, + NativeMethods.BNNewFlowGraphNodeReference(handle) , + true + ); + } + + internal static HighLevelILFlowGraphNode? TakeHandleEx( + HighLevelILFunction ilFunction, + IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new HighLevelILFlowGraphNode( + ilFunction, + handle, + true); + } + + internal static HighLevelILFlowGraphNode MustTakeHandleEx( + HighLevelILFunction ilFunction, + IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new HighLevelILFlowGraphNode( + ilFunction, + handle, + true); + } + + internal static HighLevelILFlowGraphNode? BorrowHandleEx( + HighLevelILFunction ilFunction, + IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new HighLevelILFlowGraphNode( + ilFunction, + handle, + false); + } + + internal static HighLevelILFlowGraphNode MustBorrowHandleEx( + HighLevelILFunction ilFunction, + IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new HighLevelILFlowGraphNode( + ilFunction, + handle, + false); + } + + + public HighLevelILBasicBlock? BasicBlock + { + get + { + return HighLevelILBasicBlock.TakeHandleEx( + this.ILFunction, + NativeMethods.BNGetFlowGraphBasicBlock(this.handle) + ); + } + + set + { + NativeMethods.BNSetFlowGraphBasicBlock( + this.handle, + null == value ? IntPtr.Zero : value.DangerousGetHandle() + ); + } + } + + public HighLevelILFlowGraphEdge[] IncomingEdges + { + get + { + ulong arrayLength = 0; + + IntPtr arrayPointer = NativeMethods.BNGetFlowGraphNodeIncomingEdges( + this.handle, + out arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer, + arrayLength, + (_native) => HighLevelILFlowGraphEdge.FromNativeEx(this.ILFunction, _native), + NativeMethods.BNFreeFlowGraphNodeEdgeList + ); + } + } + + public HighLevelILFlowGraphEdge[] OutgoingEdges + { + get + { + ulong arrayLength = 0; + + IntPtr arrayPointer = NativeMethods.BNGetFlowGraphNodeOutgoingEdges( + this.handle, + out arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer, + arrayLength, + (_native) => HighLevelILFlowGraphEdge.FromNativeEx(this.ILFunction, _native), + NativeMethods.BNFreeFlowGraphNodeEdgeList + ); + } + } + } +} diff --git a/HighLevelIL/HighLevelILLabel.cs b/HighLevelIL/HighLevelILLabel.cs new file mode 100644 index 0000000..e771de2 --- /dev/null +++ b/HighLevelIL/HighLevelILLabel.cs @@ -0,0 +1,80 @@ +using System; +using System.Collections.Generic; + +namespace BinaryNinja +{ + public sealed class HighLevelILLabel : AbstractLabel + { + internal HighLevelILFunction ILFunction { get; } + + internal HighLevelILLabel(HighLevelILFunction ilfunction , ulong id) + : base( id) + { + this.ILFunction = ilfunction; + } + + public override string Name + { + get + { + return UnsafeUtils.TakeAnsiString( + NativeMethods.BNGetGotoLabelName( + this.ILFunction.OwnerFunction.DangerousGetHandle() , + this.Id + ) + ); + } + + set + { + NativeMethods.BNSetUserGotoLabelName( + this.ILFunction.OwnerFunction.DangerousGetHandle(), + this.Id, + value + ); + } + } + + public HighLevelILInstruction? Definition + { + get + { + HighLevelILExpressionIndex index = NativeMethods.BNGetHighLevelILExprIndexForLabel( + this.ILFunction.DangerousGetHandle() , + this.Id + ); + + return this.ILFunction.GetExpression(index); + } + } + + public HighLevelILInstruction[] Uses + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetHighLevelILUsesForLabel( + this.ILFunction.DangerousGetHandle() , + this.Id , + out ulong arrayLength + ); + + ulong[] indexes = UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNFreeILInstructionList + ); + + List instructions = new List(); + + foreach (HighLevelILExpressionIndex index in indexes) + { + instructions.Add( + this.ILFunction.MustGetExpression(index) + ); + } + + return instructions.ToArray(); + } + } + } +} diff --git a/HighLevelIL/HighLevelILSSAVariable.cs b/HighLevelIL/HighLevelILSSAVariable.cs new file mode 100644 index 0000000..ac7c403 --- /dev/null +++ b/HighLevelIL/HighLevelILSSAVariable.cs @@ -0,0 +1,80 @@ +using System; +using System.Collections.Generic; + +namespace BinaryNinja +{ + public sealed class HighLevelILSSAVariable : AbstractSSAVariable + { + public HighLevelILSSAVariable(HighLevelILVariable variable , ulong version) + :base(variable, version) + { + + } + + public HighLevelILInstruction? Definition + { + get + { + return this.Variable.ILFunction.GetExpression( + NativeMethods.BNGetHighLevelILSSAVarDefinition( + this.Variable.ILFunction.DangerousGetHandle() , + this.Variable.ToNative() , + this.Version + ) + ); + } + } + + public HighLevelILInstruction[] Uses + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetHighLevelILSSAVarUses( + this.Variable.ILFunction.DangerousGetHandle() , + this.Variable.ToNative() , + this.Version , + out ulong arrayLength + ); + + ulong[] indexes = UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNFreeILInstructionList + ); + + List instructions = new List(); + + foreach (HighLevelILExpressionIndex index in indexes) + { + instructions.Add( + this.Variable.ILFunction.MustGetExpression(index) + ); + } + + return instructions.ToArray(); + } + } + + public bool IsLive + { + get + { + return NativeMethods.BNIsHighLevelILSSAVarLive( + this.Variable.ILFunction.DangerousGetHandle() , + this.Variable.ToNative() , + this.Version + ); + } + } + + public bool IsLiveAt(HighLevelILInstructionIndex instruction) + { + return NativeMethods.BNIsHighLevelILSSAVarLiveAt( + this.Variable.ILFunction.DangerousGetHandle() , + this.Variable.ToNative() , + this.Version , + instruction + ); + } + } +} diff --git a/HighLevelIL/HighLevelILVariable.cs b/HighLevelIL/HighLevelILVariable.cs new file mode 100644 index 0000000..59bcfc0 --- /dev/null +++ b/HighLevelIL/HighLevelILVariable.cs @@ -0,0 +1,121 @@ +using System; +using System.Collections.Generic; + +namespace BinaryNinja +{ + public sealed class HighLevelILVariable : AbstractFunctionVariable + { + public HighLevelILFunction ILFunction { get; } + + internal HighLevelILVariable(HighLevelILVariable other) + : base( + other.ILFunction.OwnerFunction , + other.Type, + other.Index, + other.Storage + ) + { + this.ILFunction = other.ILFunction; + } + + public HighLevelILVariable(HighLevelILFunction ilFunction , Variable variable) + : base(ilFunction.OwnerFunction , variable.ToNative()) + { + this.ILFunction = ilFunction; + } + + public HighLevelILVariable(HighLevelILFunction ilFunction , CoreVariable variable) + : base(ilFunction.OwnerFunction , variable.ToNative()) + { + this.ILFunction = ilFunction; + } + + internal HighLevelILVariable(HighLevelILFunction ilFunction , BNVariable native) + : base(ilFunction.OwnerFunction , native) + { + this.ILFunction = ilFunction; + } + + internal static HighLevelILVariable FromIdentifierEx(HighLevelILFunction function ,ulong identifier) + { + return HighLevelILVariable.FromNativeEx( + function, + NativeMethods.BNFromVariableIdentifier(identifier) + ); + } + + internal static HighLevelILVariable FromNativeEx( + HighLevelILFunction function , + BNVariable native) + { + return new HighLevelILVariable(function, native); + } + + public bool IsLiveAt(HighLevelILInstructionIndex instruction) + { + return NativeMethods.BNIsHighLevelILVarLiveAt( + this.ILFunction.DangerousGetHandle() , + this.ToNative() , + instruction + ); + } + + public HighLevelILInstruction[] Definitions + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetHighLevelILVariableDefinitions( + this.ILFunction.DangerousGetHandle() , + this.ToNative() , + out ulong arrayLength + ); + + ulong[] indexes = UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNFreeILInstructionList + ); + + List instructions = new List(); + + foreach (HighLevelILExpressionIndex index in indexes) + { + instructions.Add( + this.ILFunction.MustGetExpression(index) + ); + } + + return instructions.ToArray(); + } + } + + public HighLevelILInstruction[] Uses + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetHighLevelILVariableUses( + this.ILFunction.DangerousGetHandle() , + this.ToNative() , + out ulong arrayLength + ); + + ulong[] indexes = UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNFreeILInstructionList + ); + + List instructions = new List(); + + foreach (HighLevelILExpressionIndex index in indexes) + { + instructions.Add( + this.ILFunction.MustGetExpression(index) + ); + } + + return instructions.ToArray(); + } + } + } +} diff --git a/HighLevelIL/HlilArithmeticShiftRight.cs b/HighLevelIL/HlilArithmeticShiftRight.cs new file mode 100644 index 0000000..4205407 --- /dev/null +++ b/HighLevelIL/HlilArithmeticShiftRight.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class HlilArithmeticShiftRight : HighLevelILInstruction + { + internal HlilArithmeticShiftRight( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public HighLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/HighLevelIL/HlilModSigned.cs b/HighLevelIL/HlilModSigned.cs new file mode 100644 index 0000000..cb6ce21 --- /dev/null +++ b/HighLevelIL/HlilModSigned.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class HlilModSigned : HighLevelILInstruction + { + internal HlilModSigned( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) : base(ilFunction , expressionIndex, native) + { + + } + + public HighLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public HighLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/IL/AbstractSSAVariable.cs b/IL/AbstractSSAVariable.cs new file mode 100644 index 0000000..d946723 --- /dev/null +++ b/IL/AbstractSSAVariable.cs @@ -0,0 +1,87 @@ +using System; + +namespace BinaryNinja +{ + public abstract class AbstractSSAVariable + : IEquatable< AbstractSSAVariable>, + IComparable< AbstractSSAVariable> + where T_VARIABLE : AbstractFunctionVariable + { + public T_VARIABLE Variable { get; } + + public ulong Version { get; } = 0; + + internal AbstractSSAVariable(T_VARIABLE variable , ulong version) + { + this.Variable = variable; + this.Version = version; + } + + public override string ToString() + { + return $"{this.Variable.Name}#{this.Version}"; + } + + public override bool Equals(object? other) + { + return Equals(other as AbstractSSAVariable ); + } + + public bool Equals(AbstractSSAVariable ? other) + { + if (other is null) + { + return false; + } + + if (ReferenceEquals(this , other)) + { + return true; + } + + if (this.Variable.Identifier != other.Variable.Identifier) + { + return false; + } + + return this.Version == other.Version; + } + + public override int GetHashCode() + { + return HashCode.Combine(this.Variable.Identifier, this.Version); + } + + public static bool operator ==(AbstractSSAVariable ? left, AbstractSSAVariable ? right) + { + if (left is null) + { + return right is null; + } + + return left.Equals(right); + } + + public static bool operator !=(AbstractSSAVariable ? left, AbstractSSAVariable ? right) + { + return !(left == right); + } + + public int CompareTo(AbstractSSAVariable ? other) + { + if (other is null) + { + return 1; + } + + int result = this.Variable.Identifier.CompareTo(other.Variable.Identifier); + + if (result == 0) + { + result = this.Version.CompareTo(other.Version); + } + + return result; + } + } +} diff --git a/IL/Alias.cs b/IL/Alias.cs new file mode 100644 index 0000000..10e8470 --- /dev/null +++ b/IL/Alias.cs @@ -0,0 +1,88 @@ +namespace BinaryNinja +{ + public enum IntrinsicIndex : uint + { + Invalid = 0xffffffff + } + + public enum FlagIndex : uint + { + Invalid = 0xffffffff + } + + public enum SemanticFlagClassIndex : uint + { + Invalid = 0xffffffff + } + + public enum SemanticFlagGroupIndex : uint + { + Invalid = 0xffffffff + } + + public enum RegisterIndex : uint + { + Invalid = 0xffffffff + } + + public enum RegisterStackIndex : uint + { + Invalid = 0xffffffff + } + + public enum OperandIndex : ulong + { + Invalid = 0xffffffff + } + + + public enum LowLevelILExpressionIndex : ulong + { + Invalid = 0xffffffff + } + + public enum LowLevelILInstructionIndex : ulong + { + Invalid = 0xffffffff + } + + public enum LowLevelILPossibleValueSetCacheIndex : ulong + { + Invalid = 0xffffffff + } + + public enum MediumLevelILExpressionIndex : ulong + { + Invalid = 0xffffffff + } + + public enum MediumLevelILInstructionIndex : ulong + { + Invalid = 0xffffffff + } + + public enum MediumLevelILPossibleValueSetCacheIndex : ulong + { + Invalid = 0xffffffff + } + + public enum HighLevelILExpressionIndex : ulong + { + Invalid = 0xffffffff + } + + public enum HighLevelILInstructionIndex : ulong + { + Invalid = 0xffffffff + } + + public enum HighLevelILPossibleValueSetCacheIndex : ulong + { + Invalid = 0xffffffff + } + + public enum VariableIdentifier : ulong + { + Invalid = 0xffffffff + } +} diff --git a/IL/FlagOrRegister.cs b/IL/FlagOrRegister.cs new file mode 100644 index 0000000..b650d29 --- /dev/null +++ b/IL/FlagOrRegister.cs @@ -0,0 +1,141 @@ +using System; + +namespace BinaryNinja +{ + public sealed class FlagOrRegister : IEquatable, + IComparable + { + public ILFlag? Flag { get; } = null; + + public ILRegister? Register { get; } = null; + + internal FlagOrRegister(ILFlag flag) + { + this.Flag = flag; + } + + internal FlagOrRegister(ILRegister register) + { + this.Register = register; + } + + public FlagOrRegister(FlagOrRegister other) + { + this.Flag = other.Flag; + this.Register = other.Register; + } + + public string Name + { + get + { + if (this.Flag != null) + { + return this.Flag.Name; + } + + if (null != this.Register) + { + return this.Register.Name; + } + + throw new Exception("Flag or Register must not both null"); + } + } + + public override string ToString() + { + if (null != this.Flag) + { + return this.Flag.Name; + } + + if (null != this.Register) + { + return this.Register.Name; + } + + throw new Exception("Flag or Register must not both null"); + } + + public override bool Equals(object? other) + { + return Equals(other as FlagOrRegister); + } + + public bool Equals(FlagOrRegister? other) + { + if (other is null) + { + return false; + } + + if (ReferenceEquals(this , other)) + { + return true; + } + + if (null != this.Flag && null != other.Flag) + { + return this.Flag == other.Flag; + } + + if (null != this.Register && null != other.Register) + { + return this.Register == other.Register; + } + + throw new Exception("Flag or Register must not both null"); + } + + public override int GetHashCode() + { + if (null != this.Flag) + { + return this.Flag.GetHashCode(); + } + + if (null != this.Register) + { + return this.Register.GetHashCode(); + } + + throw new Exception("Flag or Register must not both null"); + } + + public static bool operator ==(FlagOrRegister? left, FlagOrRegister? right) + { + if (left is null) + { + return right is null; + } + + return left.Equals(right); + } + + public static bool operator !=(FlagOrRegister? left, FlagOrRegister? right) + { + return !(left == right); + } + + public int CompareTo(FlagOrRegister? other) + { + if (other is null) + { + return 1; + } + + if (null != this.Flag && null != other.Flag) + { + return this.Flag.CompareTo(other.Flag); + } + + if (null != this.Register && null != other.Register) + { + return this.Register.CompareTo(other.Register); + } + + throw new Exception("Flag or Register must not both null"); + } + } +} diff --git a/IL/ILFlag.cs b/IL/ILFlag.cs new file mode 100644 index 0000000..9e68c05 --- /dev/null +++ b/IL/ILFlag.cs @@ -0,0 +1,96 @@ +using System; + +namespace BinaryNinja +{ + public class ILFlag : IEquatable, IComparable + { + internal Architecture Architecture { get; } + + public FlagIndex Index { get; } + + internal ILFlag(Architecture arch , FlagIndex index) + { + this.Architecture = arch; + this.Index = index; + } + + internal ILFlag(ILFlag other) + { + this.Architecture = other.Architecture; + this.Index = other.Index; + } + + public override string ToString() + { + return this.Name; + } + + public bool IsTemp() + { + return 0 != ( (uint)this.Index & 0x80000000 ); + } + + public string Name + { + get + { + if (this.IsTemp()) + { + return $"cond:{ (uint)this.Index & 0x7fffffff}"; + } + + return this.Architecture.GetFlagName(this.Index); + } + } + + public override bool Equals(object? other) + { + return Equals(other as ILFlag); + } + + public bool Equals(ILFlag? other) + { + if (other is null) + { + return false; + } + + if (ReferenceEquals(this , other)) + { + return true; + } + + return this.Index == other.Index; + } + + public override int GetHashCode() + { + return this.Index.GetHashCode(); + } + + public static bool operator ==(ILFlag? left, ILFlag? right) + { + if (left is null) + { + return right is null; + } + + return left.Equals(right); + } + + public static bool operator !=(ILFlag? left, ILFlag? right) + { + return !(left == right); + } + + public int CompareTo(ILFlag? other) + { + if (other is null) + { + return 1; + } + + return this.Index.CompareTo(other.Index); + } + } +} diff --git a/IL/ILLabel.cs b/IL/ILLabel.cs new file mode 100644 index 0000000..f7999b6 --- /dev/null +++ b/IL/ILLabel.cs @@ -0,0 +1,105 @@ +using System; + +namespace BinaryNinja +{ + public abstract class AbstractLabel : IEquatable, IComparable + where T_SELF : AbstractLabel + { + public ulong Id { get; } = 0; + + internal AbstractLabel(ulong id) + { + this.Id = id; + } + + public abstract string Name + { + get; + + set; + } + + public override bool Equals(object? other) + { + return Equals(other as T_SELF); + } + + public bool Equals(T_SELF? other) + { + if (other is null) + { + return false; + } + + if (ReferenceEquals(this , other)) + { + return true; + } + + return this.Id == other.Id; + } + + public override int GetHashCode() + { + return this.Id.GetHashCode(); + } + + public static bool operator ==(AbstractLabel? left, AbstractLabel? right) + { + if (left is null) + { + return right is null; + } + + return left.Equals(right); + } + + public static bool operator !=(AbstractLabel? left, AbstractLabel? right) + { + return !(left == right); + } + + public int CompareTo(T_SELF? other) + { + if (other is null) + { + return 1; + } + + return this.Id.CompareTo(other.Id); + } + } + + public class ILLabel : AbstractLabel + { + internal Function Function; + + internal ILLabel(Function function , ulong id) + :base(id) + { + this.Function = function; + } + + public override string Name + { + get + { + return UnsafeUtils.TakeAnsiString( + NativeMethods.BNGetGotoLabelName( + this.Function.DangerousGetHandle() , + this.Id + ) + ); + } + + set + { + NativeMethods.BNSetUserGotoLabelName( + this.Function.DangerousGetHandle(), + this.Id, + value + ); + } + } + } +} diff --git a/IL/ILRegister.cs b/IL/ILRegister.cs new file mode 100644 index 0000000..fbc09bb --- /dev/null +++ b/IL/ILRegister.cs @@ -0,0 +1,132 @@ +using System; + +namespace BinaryNinja +{ + public sealed class ILRegister : IEquatable, + IComparable + { + internal Architecture Architecture; + + public RegisterIndex Index { get; } + + public ILRegister(Architecture arch , RegisterIndex index) + { + this.Architecture = arch; + this.Index = index; + } + + internal ILRegister(ILRegister other) + { + this.Architecture = other.Architecture; + this.Index = other.Index; + } + + public override string ToString() + { + return this.Name; + } + + public bool IsTemp + { + get + { + return 0 != ( (uint)this.Index & 0x80000000 ); + } + } + + public bool IsGlobal + { + get + { + return NativeMethods.BNIsArchitectureGlobalRegister( + this.Architecture.DangerousGetHandle() , + this.Index + ); + } + } + + public bool IsSystem + { + get + { + return NativeMethods.BNIsArchitectureSystemRegister( + this.Architecture.DangerousGetHandle() , + this.Index + ); + } + } + + public string Name + { + get + { + if (this.IsTemp) + { + return $"temp{ (uint)this.Index & 0x7fffffff}"; + } + + return this.Architecture.GetRegisterName(this.Index); + } + } + + + public RegisterInfo Info + { + get + { + return this.Architecture.GetRegisterInfo(this.Index); + } + } + + + public override bool Equals(object? other) + { + return Equals(other as ILRegister); + } + + public bool Equals(ILRegister? other) + { + if (other is null) + { + return false; + } + + if (ReferenceEquals(this , other)) + { + return true; + } + + return this.Index == other.Index; + } + + public override int GetHashCode() + { + return this.Index.GetHashCode(); + } + + public static bool operator ==(ILRegister? left, ILRegister? right) + { + if (left is null) + { + return right is null; + } + + return left.Equals(right); + } + + public static bool operator !=(ILRegister? left, ILRegister? right) + { + return !(left == right); + } + + public int CompareTo(ILRegister? other) + { + if (other is null) + { + return 1; + } + + return this.Index.CompareTo(other.Index); + } + } +} diff --git a/IL/Intrinsic.cs b/IL/Intrinsic.cs new file mode 100644 index 0000000..b28c7cb --- /dev/null +++ b/IL/Intrinsic.cs @@ -0,0 +1,148 @@ +using System; + +namespace BinaryNinja +{ + public sealed class Intrinsic : IEquatable, + IComparable + { + public Architecture Architecture { get; } + + public IntrinsicIndex Index { get; } + + public Intrinsic(Architecture arch , IntrinsicIndex index) + { + this.Architecture = arch; + this.Index = index; + } + + public override string ToString() + { + return this.Name; + } + + public override bool Equals(object? other) + { + return Equals(other as Intrinsic); + } + + public bool Equals(Intrinsic? other) + { + if (other is null) + { + return false; + } + + if (ReferenceEquals(this , other)) + { + return true; + } + + if (this.Architecture != other.Architecture) + { + return false; + } + + return this.Index == other.Index; + } + + public override int GetHashCode() + { + return HashCode.Combine(this.Architecture.GetHashCode(), (uint)this.Index); + } + + public static bool operator ==(Intrinsic? left, Intrinsic? right) + { + if (left is null) + { + return right is null; + } + + return left.Equals(right); + } + + public static bool operator !=(Intrinsic? left, Intrinsic? right) + { + return !(left == right); + } + + public int CompareTo(Intrinsic? other) + { + if (other is null) + { + return 1; + } + + int result = this.Architecture.CompareTo(other.Architecture); + + if (0 == result) + { + return this.Index.CompareTo(other.Index); + } + + return result; + } + + public IntrinsicClass IntrinsicClass + { + get + { + return NativeMethods.BNGetArchitectureIntrinsicClass( + this.Architecture.DangerousGetHandle(), + this.Index + ); + } + } + + public string Name + { + get + { + return UnsafeUtils.TakeAnsiString( + NativeMethods.BNGetArchitectureIntrinsicName( + this.Architecture.DangerousGetHandle() , + this.Index + ) + ); + } + } + + public NameAndType[] Inputs + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetArchitectureIntrinsicInputs( + this.Architecture.DangerousGetHandle() , + this.Index , + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + NameAndType.FromNative , + NativeMethods.BNFreeNameAndTypeList + ); + } + } + + public TypeWithConfidence[] Outputs + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetArchitectureIntrinsicOutputs( + this.Architecture.DangerousGetHandle() , + this.Index , + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + TypeWithConfidence.FromNative , + NativeMethods.BNFreeOutputTypeList + ); + } + } + + } +} diff --git a/IL/RegisterStack.cs b/IL/RegisterStack.cs new file mode 100644 index 0000000..efe804e --- /dev/null +++ b/IL/RegisterStack.cs @@ -0,0 +1,100 @@ +using System; + +namespace BinaryNinja +{ + public sealed class RegisterStack : IEquatable, + IComparable + { + internal Architecture Architecture { get; } + + public RegisterStackIndex Index { get; } + + internal RegisterStack(Architecture arch , RegisterStackIndex index) + { + this.Architecture = arch; + this.Index = index; + } + + internal RegisterStack(RegisterStack other) + { + this.Architecture = other.Architecture; + this.Index = other.Index; + } + + public override bool Equals(object? other) + { + return Equals(other as RegisterStack); + } + + public bool Equals(RegisterStack? other) + { + if (other is null) + { + return false; + } + + if (ReferenceEquals(this , other)) + { + return true; + } + + if (this.Architecture != other.Architecture) + { + return false; + } + + return this.Index == other.Index; + } + + public override int GetHashCode() + { + return HashCode.Combine(this.Architecture.GetHashCode(), (uint)this.Index); + } + + public static bool operator ==(RegisterStack? left, RegisterStack? right) + { + if (left is null) + { + return right is null; + } + + return left.Equals(right); + } + + public static bool operator !=(RegisterStack? left, RegisterStack? right) + { + return !(left == right); + } + + public int CompareTo(RegisterStack? other) + { + if (other is null) + { + return 1; + } + + int result = this.Architecture.CompareTo(other.Architecture); + + if (0 == result) + { + result = this.Index.CompareTo(other.Index); + } + + return result; + } + + + public override string ToString() + { + return this.Name; + } + + public string Name + { + get + { + return this.Architecture.GetRegisterStackName(this.Index); + } + } + } +} diff --git a/IL/SSAFlagOrRegister.cs b/IL/SSAFlagOrRegister.cs new file mode 100644 index 0000000..6a8eea0 --- /dev/null +++ b/IL/SSAFlagOrRegister.cs @@ -0,0 +1,86 @@ +using System; + +namespace BinaryNinja +{ + public sealed class SSAFlagOrRegister : IEquatable, + IComparable + { + internal FlagOrRegister FlagOrRegister { get; } + + public ulong Version { get; } = 0; + + internal SSAFlagOrRegister(FlagOrRegister flagOrRegister , ulong version) + { + this.FlagOrRegister = flagOrRegister; + + this.Version = version; + } + + public override string ToString() + { + return $"{this.FlagOrRegister.Name}#{this.Version}"; + } + + public override bool Equals(object? other) + { + return Equals(other as SSAFlagOrRegister); + } + + public bool Equals(SSAFlagOrRegister? other) + { + if (other is null) + { + return false; + } + + if (ReferenceEquals(this , other)) + { + return true; + } + + if (this.FlagOrRegister != other.FlagOrRegister) + { + return false; + } + + return this.Version == other.Version; + } + + public override int GetHashCode() + { + return HashCode.Combine(this.FlagOrRegister.GetHashCode(), this.Version); + } + + public static bool operator ==(SSAFlagOrRegister? left, SSAFlagOrRegister? right) + { + if (left is null) + { + return right is null; + } + + return left.Equals(right); + } + + public static bool operator !=(SSAFlagOrRegister? left, SSAFlagOrRegister? right) + { + return !(left == right); + } + + public int CompareTo(SSAFlagOrRegister? other) + { + if (other is null) + { + return 1; + } + + int result = this.FlagOrRegister.CompareTo(other.FlagOrRegister); + + if (result == 0) + { + result = this.Version.CompareTo(other.Version); + } + + return result; + } + } +} diff --git a/IL/SSARegisterStack.cs b/IL/SSARegisterStack.cs new file mode 100644 index 0000000..8fae673 --- /dev/null +++ b/IL/SSARegisterStack.cs @@ -0,0 +1,85 @@ +using System; + +namespace BinaryNinja +{ + public sealed class SSARegisterStack : IEquatable, + IComparable + { + internal RegisterStack RegisterStack { get; } + + public ulong Version { get; } = 0; + + internal SSARegisterStack(RegisterStack registerStack , ulong version) + { + this.RegisterStack = registerStack; + this.Version = version; + } + + public override string ToString() + { + return $"{this.RegisterStack.Name}#{this.Version}"; + } + + public override bool Equals(object? other) + { + return Equals(other as SSARegisterStack); + } + + public bool Equals(SSARegisterStack? other) + { + if (other is null) + { + return false; + } + + if (ReferenceEquals(this , other)) + { + return true; + } + + if (this.RegisterStack != other.RegisterStack) + { + return false; + } + + return this.Version == other.Version; + } + + public override int GetHashCode() + { + return HashCode.Combine(this.RegisterStack.GetHashCode(), this.Version); + } + + public static bool operator ==(SSARegisterStack? left, SSARegisterStack? right) + { + if (left is null) + { + return right is null; + } + + return left.Equals(right); + } + + public static bool operator !=(SSARegisterStack? left, SSARegisterStack? right) + { + return !(left == right); + } + + public int CompareTo(SSARegisterStack? other) + { + if (other is null) + { + return 1; + } + + int result = this.RegisterStack.CompareTo(other.RegisterStack); + + if (result == 0) + { + result = this.Version.CompareTo(other.Version); + } + + return result; + } + } +} diff --git a/IL/SemanticFlagClass.cs b/IL/SemanticFlagClass.cs new file mode 100644 index 0000000..08fc153 --- /dev/null +++ b/IL/SemanticFlagClass.cs @@ -0,0 +1,99 @@ +using System; + +namespace BinaryNinja +{ + public sealed class SemanticFlagClass : IEquatable, + IComparable + { + internal Architecture Architecture { get; } + + public SemanticFlagClassIndex Index { get; } + + internal SemanticFlagClass(Architecture arch , SemanticFlagClassIndex index) + { + this.Architecture = arch; + this.Index = index; + } + + internal SemanticFlagClass(SemanticFlagClass other) + { + this.Architecture = other.Architecture; + this.Index = other.Index; + } + + public override bool Equals(object? other) + { + return Equals(other as SemanticFlagClass); + } + + public bool Equals(SemanticFlagClass? other) + { + if (other is null) + { + return false; + } + + if (ReferenceEquals(this , other)) + { + return true; + } + + if (this.Architecture != other.Architecture) + { + return false; + } + + return this.Index == other.Index; + } + + public override int GetHashCode() + { + return HashCode.Combine(this.Architecture.GetHashCode(), (uint)this.Index); + } + + public static bool operator ==(SemanticFlagClass? left, SemanticFlagClass? right) + { + if (left is null) + { + return right is null; + } + + return left.Equals(right); + } + + public static bool operator !=(SemanticFlagClass? left, SemanticFlagClass? right) + { + return !(left == right); + } + + public int CompareTo(SemanticFlagClass? other) + { + if (other is null) + { + return 1; + } + + int result = this.Architecture.CompareTo(other.Architecture); + + if (0 == result) + { + result = this.Index.CompareTo(other.Index); + } + + return result; + } + + public override string ToString() + { + return this.Name; + } + + public string Name + { + get + { + return this.Architecture.GetSemanticFlagClassName(this.Index); + } + } + } +} diff --git a/IL/SemanticFlagGroup.cs b/IL/SemanticFlagGroup.cs new file mode 100644 index 0000000..c5ac8b6 --- /dev/null +++ b/IL/SemanticFlagGroup.cs @@ -0,0 +1,99 @@ +using System; + +namespace BinaryNinja +{ + public sealed class SemanticFlagGroup : IEquatable, + IComparable + { + internal Architecture Architecture { get; } + + public SemanticFlagGroupIndex Index { get; } + + internal SemanticFlagGroup(Architecture arch , SemanticFlagGroupIndex index) + { + this.Architecture = arch; + this.Index = index; + } + + internal SemanticFlagGroup(SemanticFlagGroup other) + { + this.Architecture = other.Architecture; + this.Index = other.Index; + } + + public override bool Equals(object? other) + { + return Equals(other as SemanticFlagGroup); + } + + public bool Equals(SemanticFlagGroup? other) + { + if (other is null) + { + return false; + } + + if (ReferenceEquals(this , other)) + { + return true; + } + + if (this.Architecture != other.Architecture) + { + return false; + } + + return this.Index == other.Index; + } + + public override int GetHashCode() + { + return HashCode.Combine(this.Architecture.GetHashCode(), (uint)this.Index); + } + + public static bool operator ==(SemanticFlagGroup? left, SemanticFlagGroup? right) + { + if (left is null) + { + return right is null; + } + + return left.Equals(right); + } + + public static bool operator !=(SemanticFlagGroup? left, SemanticFlagGroup? right) + { + return !(left == right); + } + + public int CompareTo(SemanticFlagGroup? other) + { + if (other is null) + { + return 1; + } + + int result = this.Architecture.CompareTo(other.Architecture); + + if (0 == result) + { + result = this.Index.CompareTo(other.Index); + } + + return result; + } + + public override string ToString() + { + return this.Name; + } + + public string Name + { + get + { + return this.Architecture.GetSemanticFlagGroupName(this.Index); + } + } + } +} diff --git a/IL/SourceLocation.cs b/IL/SourceLocation.cs new file mode 100644 index 0000000..ddfac70 --- /dev/null +++ b/IL/SourceLocation.cs @@ -0,0 +1,85 @@ +using System; + +namespace BinaryNinja +{ + public sealed class SourceLocation : IEquatable, + IComparable + { + public ulong Address { get; } = 0; + + public OperandIndex Operand { get; } = 0; + + public SourceLocation() + { + + } + + public SourceLocation(ulong address, OperandIndex operand) + { + this.Address = address; + this.Operand = operand; + } + + public override bool Equals(object? other) + { + return Equals(other as SourceLocation); + } + + public bool Equals(SourceLocation? other) + { + if (other is null) + { + return false; + } + + if (ReferenceEquals(this , other)) + { + return true; + } + + if (this.Address != other.Address) + { + return false; + } + + return this.Operand == other.Operand; + } + + public override int GetHashCode() + { + return HashCode.Combine(this.Address, (ulong)this.Operand); + } + + public static bool operator ==(SourceLocation? left, SourceLocation? right) + { + if (left is null) + { + return right is null; + } + + return left.Equals(right); + } + + public static bool operator !=(SourceLocation? left, SourceLocation? right) + { + return !(left == right); + } + + public int CompareTo(SourceLocation? other) + { + if (other is null) + { + return 1; + } + + int result = this.Address.CompareTo(other.Address); + + if (result == 0) + { + result = this.Operand.CompareTo(other.Operand); + } + + return result; + } + } +} diff --git a/IL/Variable.cs b/IL/Variable.cs new file mode 100644 index 0000000..57ac951 --- /dev/null +++ b/IL/Variable.cs @@ -0,0 +1,113 @@ +namespace BinaryNinja +{ + public abstract class AbstractFunctionVariable : AbstractVariable + where T_SELF : AbstractFunctionVariable + { + public Function Function { get; } + + internal AbstractFunctionVariable(AbstractFunctionVariable other) + :base(other.Type , other.Index ,other.Storage) + { + this.Function = other.Function; + } + + internal AbstractFunctionVariable( + Function function , + VariableSourceType type , + uint index , + long storage + ) : base(type , index , storage) + { + this.Function = function; + } + + public AbstractFunctionVariable(Function function , BNVariable native) + :base(native) + { + this.Function = function; + } + + public string Name + { + get + { + return UnsafeUtils.TakeAnsiString( + NativeMethods.BNGetVariableNameOrDefault( + this.Function.DangerousGetHandle() , + this.ToNative() + ) + ); + } + } + + public string LastSeenName + { + get + { + return UnsafeUtils.TakeAnsiString( + NativeMethods.BNGetLastSeenVariableNameOrDefault( + this.Function.DangerousGetHandle() , + this.ToNative() + ) + ); + } + } + + public override string ToString() + { + return this.Name; + } + + public void SetUserValue(ArchitectureAndAddress defSite , PossibleValueSet value , bool after) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + NativeMethods.BNSetUserVariableValue( + this.Function.DangerousGetHandle() , + this.ToNative() , + defSite.ToNative() , + after , + value.ToNativeEx(allocator) + ); + } + } + + public void ClearUserValue(ArchitectureAndAddress defSite , bool after) + { + NativeMethods.BNClearUserVariableValue( + this.Function.DangerousGetHandle() , + this.ToNative() , + defSite.ToNative() , + after + ); + } + } + + public sealed class Variable : AbstractFunctionVariable + { + internal Variable(Variable other) + :base(other) + { + + } + + public Variable(Function function , BNVariable native) + :base(function , native) + { + + } + + internal static Variable FromIdentifierEx(Function function ,ulong identifier) + { + return Variable.FromNativeEx( + function, + NativeMethods.BNFromVariableIdentifier(identifier) + ); + } + + internal static Variable FromNativeEx(Function function , BNVariable native) + { + return new Variable(function, native); + } + } +} diff --git a/LibraryResolver.cs b/LibraryResolver.cs new file mode 100644 index 0000000..63ea8b0 --- /dev/null +++ b/LibraryResolver.cs @@ -0,0 +1,136 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Reflection; +using System.Runtime.InteropServices; + +namespace BinaryNinja +{ + public class LibraryResolver + { + private List m_searchDirs = new List(); + + public LibraryResolver() + { + this.AddSearchDir( + Directory.GetCurrentDirectory() + ); + + this.AddEnvironment( + "BINARYNINJA_BASE" + ); + } + + public void AddEnvironment(params string[] environments) + { + foreach (string environment in environments) + { + string? dirname = Environment.GetEnvironmentVariable(environment); + + if (!string.IsNullOrEmpty(dirname) && Directory.Exists(dirname)) + { + this.AddSearchDir(dirname); + } + } + } + + public void AddSearchDir(params string[] dirnames) + { + foreach (string dirname in dirnames) + { + if (!string.IsNullOrEmpty(dirname)) + { + if (!this.m_searchDirs.Contains(dirname)) + { + if (Directory.Exists(dirname)) + { + this.m_searchDirs.Add(dirname); + } + } + } + } + } + + public IntPtr ResolveDllImport( + string libraryName , + Assembly assembly , + DllImportSearchPath? searchPath + ) + { + IntPtr handle = IntPtr.Zero; + + string[] possibleNames = this.GetPossibleNames(libraryName); + + foreach (string searchDir in this.m_searchDirs) + { + foreach (string possibleName in possibleNames) + { + string fullname = Path.Combine(searchDir, possibleName); + + if (Path.Exists(fullname)) + { + try + { + if (NativeLibrary.TryLoad( + fullname, + assembly, + searchPath, + out handle)) + { + return handle; + } + } + catch (Exception e) + { + Console.WriteLine(e); + + throw; + } + } + } + } + + return IntPtr.Zero; + } + + public string[] GetPossibleNames(string libraryName) + { + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) + { + return new string[] + { + $"{libraryName}.dll" + }; + } + else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) + { + return new string[] + { + $"lib{libraryName}.so.1", + $"lib{libraryName}.so", + $"{libraryName}.so.1", + $"{libraryName}.so" + }; + } + else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) + { + return new string[] + { + $"lib{libraryName}.dylib", + $"{libraryName}.dylib", + $"lib{libraryName}.so.1", + $"lib{libraryName}.so", + $"{libraryName}.so.1", + $"{libraryName}.so" + }; + } + else + { + return new string[] + { + libraryName + }; + } + } + } +} diff --git a/LowLevelIL/LLILAdd.cs b/LowLevelIL/LLILAdd.cs new file mode 100644 index 0000000..7d17dae --- /dev/null +++ b/LowLevelIL/LLILAdd.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILAdd : LowLevelILInstruction + { + internal LLILAdd( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public LowLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/LowLevelIL/LLILAddCarry.cs b/LowLevelIL/LLILAddCarry.cs new file mode 100644 index 0000000..d4bba00 --- /dev/null +++ b/LowLevelIL/LLILAddCarry.cs @@ -0,0 +1,38 @@ +namespace BinaryNinja +{ + public sealed class LLILAddCarry : LowLevelILInstruction + { + internal LLILAddCarry( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression((OperandIndex)0 ); + } + } + + public LowLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression( (OperandIndex)1 ); + } + } + + public LowLevelILInstruction Carry + { + get + { + return this.GetOperandAsExpression( (OperandIndex)2 ); + } + } + } +} diff --git a/LowLevelIL/LLILAddOverflow.cs b/LowLevelIL/LLILAddOverflow.cs new file mode 100644 index 0000000..b7160a2 --- /dev/null +++ b/LowLevelIL/LLILAddOverflow.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILAddOverflow : LowLevelILInstruction + { + internal LLILAddOverflow( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public LowLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/LowLevelIL/LLILAnd.cs b/LowLevelIL/LLILAnd.cs new file mode 100644 index 0000000..ed4784e --- /dev/null +++ b/LowLevelIL/LLILAnd.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILAnd : LowLevelILInstruction + { + internal LLILAnd( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression((OperandIndex)0); + } + } + + public LowLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/LowLevelIL/LLILArithmeticShiftRight.cs b/LowLevelIL/LLILArithmeticShiftRight.cs new file mode 100644 index 0000000..3e89037 --- /dev/null +++ b/LowLevelIL/LLILArithmeticShiftRight.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILArithmeticShiftRight : LowLevelILInstruction + { + internal LLILArithmeticShiftRight( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public LowLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/LowLevelIL/LLILAssert.cs b/LowLevelIL/LLILAssert.cs new file mode 100644 index 0000000..dc15ae8 --- /dev/null +++ b/LowLevelIL/LLILAssert.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILAssert : LowLevelILInstruction + { + internal LLILAssert( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public ILRegister Source + { + get + { + return this.GetOperandAsRegister((OperandIndex)0); + } + } + + public PossibleValueSet Constraint + { + get + { + return this.GetOperandAsPossibleValueSet((OperandIndex)1); + } + } + } +} diff --git a/LowLevelIL/LLILAssertSSA.cs b/LowLevelIL/LLILAssertSSA.cs new file mode 100644 index 0000000..1fae77d --- /dev/null +++ b/LowLevelIL/LLILAssertSSA.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILAssertSSA : LowLevelILInstruction + { + internal LLILAssertSSA( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILSSARegister Source + { + get + { + return this.GetOperandAsSSARegister((OperandIndex)0 , (OperandIndex)1); + } + } + + public PossibleValueSet Constraint + { + get + { + return this.GetOperandAsPossibleValueSet((OperandIndex)2); + } + } + } +} diff --git a/LowLevelIL/LLILBoolToInt.cs b/LowLevelIL/LLILBoolToInt.cs new file mode 100644 index 0000000..0ac8eb9 --- /dev/null +++ b/LowLevelIL/LLILBoolToInt.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class LLILBoolToInt : LowLevelILInstruction + { + internal LLILBoolToInt( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression(0); + } + } + } +} diff --git a/LowLevelIL/LLILBreakpoint.cs b/LowLevelIL/LLILBreakpoint.cs new file mode 100644 index 0000000..d9efc12 --- /dev/null +++ b/LowLevelIL/LLILBreakpoint.cs @@ -0,0 +1,14 @@ +namespace BinaryNinja +{ + public sealed class LLILBreakpoint : LowLevelILInstruction + { + internal LLILBreakpoint( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + } +} diff --git a/LowLevelIL/LLILCall.cs b/LowLevelIL/LLILCall.cs new file mode 100644 index 0000000..66da1f4 --- /dev/null +++ b/LowLevelIL/LLILCall.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class LLILCall : LowLevelILInstruction + { + internal LLILCall( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Destination + { + get + { + return this.GetOperandAsExpression(0); + } + } + } +} diff --git a/LowLevelIL/LLILCallOutputSSA.cs b/LowLevelIL/LLILCallOutputSSA.cs new file mode 100644 index 0000000..7fa77d6 --- /dev/null +++ b/LowLevelIL/LLILCallOutputSSA.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILCallOutputSSA : LowLevelILInstruction + { + internal LLILCallOutputSSA( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public ulong DestinationMemory + { + get + { + return this.RawOperands[0]; + } + } + + public LowLevelILSSARegister[] Destination + { + get + { + return this.GetOperandAsSSARegisterList((OperandIndex)1); + } + } + } +} diff --git a/LowLevelIL/LLILCallParameter.cs b/LowLevelIL/LLILCallParameter.cs new file mode 100644 index 0000000..9da4acb --- /dev/null +++ b/LowLevelIL/LLILCallParameter.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class LLILCallParameter : LowLevelILInstruction + { + internal LLILCallParameter( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction[] Source + { + get + { + return this.GetOperandAsExpressionList(0); + } + } + } +} diff --git a/LowLevelIL/LLILCallSSA.cs b/LowLevelIL/LLILCallSSA.cs new file mode 100644 index 0000000..d39cf7b --- /dev/null +++ b/LowLevelIL/LLILCallSSA.cs @@ -0,0 +1,60 @@ +namespace BinaryNinja +{ + public sealed class LLILCallSSA : LowLevelILInstruction + { + internal LLILCallSSA( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILSSARegister[] Output + { + get + { + LLILCallOutputSSA? instruction = this.GetOperandAsExpression(0) as LLILCallOutputSSA; + + return instruction!.Destination; + } + } + + public LowLevelILInstruction Destination + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + + public LowLevelILInstruction Stack + { + get + { + return this.GetOperandAsExpression((OperandIndex)2); + } + } + + public LLILCallParameter Parameter + { + get + { + LLILCallParameter? instruction = this.GetOperandAsExpression((OperandIndex)3) as LLILCallParameter; + + return instruction!; + } + } + + public LowLevelILInstruction[] Parameters + { + get + { + LLILCallParameter? instruction = this.GetOperandAsExpression((OperandIndex)3) as LLILCallParameter; + + return instruction!.Source; + } + } + } +} diff --git a/LowLevelIL/LLILCallStackAdjust.cs b/LowLevelIL/LLILCallStackAdjust.cs new file mode 100644 index 0000000..d50d608 --- /dev/null +++ b/LowLevelIL/LLILCallStackAdjust.cs @@ -0,0 +1,40 @@ +using System.Collections.Generic; + +namespace BinaryNinja +{ + public sealed class LLILCallStackAdjust : LowLevelILInstruction + { + internal LLILCallStackAdjust( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Dest + { + get + { + return this.GetOperandAsExpression((OperandIndex)0); + } + } + + public ulong StackRdjustment + { + get + { + return this.RawOperands[1]; + } + } + + public IDictionary RegisterStackAdjustments + { + get + { + return this.GetOperandAsRegisterStackDict((OperandIndex)0); + } + } + } +} diff --git a/LowLevelIL/LLILCallStackSSA.cs b/LowLevelIL/LLILCallStackSSA.cs new file mode 100644 index 0000000..8d53aa6 --- /dev/null +++ b/LowLevelIL/LLILCallStackSSA.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILCallStackSSA : LowLevelILInstruction + { + internal LLILCallStackSSA( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILSSARegister Source + { + get + { + return this.GetOperandAsSSARegister((OperandIndex)0 , (OperandIndex)1); + } + } + + public ulong SourceMemory + { + get + { + return this.RawOperands[2]; + } + } + } +} diff --git a/LowLevelIL/LLILCeil.cs b/LowLevelIL/LLILCeil.cs new file mode 100644 index 0000000..a4de42e --- /dev/null +++ b/LowLevelIL/LLILCeil.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class LLILCeil : LowLevelILInstruction + { + internal LLILCeil( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression(0); + } + } + } +} diff --git a/LowLevelIL/LLILConst.cs b/LowLevelIL/LLILConst.cs new file mode 100644 index 0000000..e7a1bf5 --- /dev/null +++ b/LowLevelIL/LLILConst.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class LLILConst : LowLevelILInstruction + { + internal LLILConst( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public ulong Constant + { + get + { + return this.RawOperands[0]; + } + } + } +} diff --git a/LowLevelIL/LLILConstPointer.cs b/LowLevelIL/LLILConstPointer.cs new file mode 100644 index 0000000..5c9918d --- /dev/null +++ b/LowLevelIL/LLILConstPointer.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class LLILConstPointer : LowLevelILInstruction + { + internal LLILConstPointer( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public ulong Constant + { + get + { + return this.RawOperands[0]; + } + } + } +} diff --git a/LowLevelIL/LLILDivSigned.cs b/LowLevelIL/LLILDivSigned.cs new file mode 100644 index 0000000..49be0cd --- /dev/null +++ b/LowLevelIL/LLILDivSigned.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILDivSigned : LowLevelILInstruction + { + internal LLILDivSigned( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public LowLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/LowLevelIL/LLILDivSignedDoublePrecision.cs b/LowLevelIL/LLILDivSignedDoublePrecision.cs new file mode 100644 index 0000000..ca9badd --- /dev/null +++ b/LowLevelIL/LLILDivSignedDoublePrecision.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILDivSignedDoublePrecision : LowLevelILInstruction + { + internal LLILDivSignedDoublePrecision( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public LowLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/LowLevelIL/LLILDivUnsigned.cs b/LowLevelIL/LLILDivUnsigned.cs new file mode 100644 index 0000000..66e1d9b --- /dev/null +++ b/LowLevelIL/LLILDivUnsigned.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILDivUnsigned : LowLevelILInstruction + { + internal LLILDivUnsigned( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public LowLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/LowLevelIL/LLILDivUnsignedDoublePrecision.cs b/LowLevelIL/LLILDivUnsignedDoublePrecision.cs new file mode 100644 index 0000000..ff3a1c3 --- /dev/null +++ b/LowLevelIL/LLILDivUnsignedDoublePrecision.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILDivUnsignedDoublePrecision : LowLevelILInstruction + { + internal LLILDivUnsignedDoublePrecision( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public LowLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/LowLevelIL/LLILEqual.cs b/LowLevelIL/LLILEqual.cs new file mode 100644 index 0000000..ad273d1 --- /dev/null +++ b/LowLevelIL/LLILEqual.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILEqual : LowLevelILInstruction + { + internal LLILEqual( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public LowLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/LowLevelIL/LLILExternPointer.cs b/LowLevelIL/LLILExternPointer.cs new file mode 100644 index 0000000..70d84fd --- /dev/null +++ b/LowLevelIL/LLILExternPointer.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILExternPointer : LowLevelILInstruction + { + internal LLILExternPointer( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public ulong Constant + { + get + { + return this.RawOperands[0]; + } + } + + public ulong Offset + { + get + { + return this.RawOperands[1]; + } + } + } +} diff --git a/LowLevelIL/LLILFlag.cs b/LowLevelIL/LLILFlag.cs new file mode 100644 index 0000000..e73cfda --- /dev/null +++ b/LowLevelIL/LLILFlag.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class LLILFlag : LowLevelILInstruction + { + internal LLILFlag( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public ILFlag Source + { + get + { + return this.GetOperandAsFlag(0); + } + } + } +} diff --git a/LowLevelIL/LLILFlagBit.cs b/LowLevelIL/LLILFlagBit.cs new file mode 100644 index 0000000..acf5169 --- /dev/null +++ b/LowLevelIL/LLILFlagBit.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILFlagBit : LowLevelILInstruction + { + internal LLILFlagBit( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public ILFlag Source + { + get + { + return this.GetOperandAsFlag(0); + } + } + + public ulong Bit + { + get + { + return this.RawOperands[1]; + } + } + } +} diff --git a/LowLevelIL/LLILFlagBitSSA.cs b/LowLevelIL/LLILFlagBitSSA.cs new file mode 100644 index 0000000..3b91b9e --- /dev/null +++ b/LowLevelIL/LLILFlagBitSSA.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILFlagBitSSA : LowLevelILInstruction + { + internal LLILFlagBitSSA( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILSSAFlag Source + { + get + { + return this.GetOperandAsSSAFlag((OperandIndex)0 , (OperandIndex)1); + } + } + + public ulong Bit + { + get + { + return (ulong)this.RawOperands[2]; + } + } + } +} diff --git a/LowLevelIL/LLILFlagCond.cs b/LowLevelIL/LLILFlagCond.cs new file mode 100644 index 0000000..2f98c21 --- /dev/null +++ b/LowLevelIL/LLILFlagCond.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILFlagCond : LowLevelILInstruction + { + internal LLILFlagCond( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILFlagCondition Condition + { + get + { + return this.GetOperandAsFlagCondition(0); + } + } + + public SemanticFlagClass SemanticFlagClass + { + get + { + return this.GetOperandAsSemanticFlagClass((OperandIndex)1); + } + } + } +} diff --git a/LowLevelIL/LLILFlagGroup.cs b/LowLevelIL/LLILFlagGroup.cs new file mode 100644 index 0000000..588b18e --- /dev/null +++ b/LowLevelIL/LLILFlagGroup.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class LLILFlagGroup : LowLevelILInstruction + { + internal LLILFlagGroup( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public SemanticFlagGroup SemanticFlagGroup + { + get + { + return this.GetOperandAsSemanticFlagGroup(0); + } + } + } +} diff --git a/LowLevelIL/LLILFlagPhi.cs b/LowLevelIL/LLILFlagPhi.cs new file mode 100644 index 0000000..93a9579 --- /dev/null +++ b/LowLevelIL/LLILFlagPhi.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILFlagPhi : LowLevelILInstruction + { + internal LLILFlagPhi( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILSSAFlag Destination + { + get + { + return this.GetOperandAsSSAFlag((OperandIndex)0 , (OperandIndex)1 ); + } + } + + public LowLevelILSSAFlag[] Source + { + get + { + return this.GetOperandAsSSAFlagList( (OperandIndex)2 ); + } + } + } +} diff --git a/LowLevelIL/LLILFlagSSA.cs b/LowLevelIL/LLILFlagSSA.cs new file mode 100644 index 0000000..68997ea --- /dev/null +++ b/LowLevelIL/LLILFlagSSA.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class LLILFlagSSA : LowLevelILInstruction + { + internal LLILFlagSSA( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILSSAFlag Source + { + get + { + return this.GetOperandAsSSAFlag((OperandIndex)0,(OperandIndex)1); + } + } + } +} diff --git a/LowLevelIL/LLILFloatAbs.cs b/LowLevelIL/LLILFloatAbs.cs new file mode 100644 index 0000000..df5ddd2 --- /dev/null +++ b/LowLevelIL/LLILFloatAbs.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class LLILFloatAbs : LowLevelILInstruction + { + internal LLILFloatAbs( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Destination + { + get + { + return this.GetOperandAsExpression(0); + } + } + } +} diff --git a/LowLevelIL/LLILFloatAdd.cs b/LowLevelIL/LLILFloatAdd.cs new file mode 100644 index 0000000..6513e07 --- /dev/null +++ b/LowLevelIL/LLILFloatAdd.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILFloatAdd : LowLevelILInstruction + { + internal LLILFloatAdd( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public LowLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/LowLevelIL/LLILFloatCompareOrdered.cs b/LowLevelIL/LLILFloatCompareOrdered.cs new file mode 100644 index 0000000..cf93c94 --- /dev/null +++ b/LowLevelIL/LLILFloatCompareOrdered.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILFloatCompareOrdered : LowLevelILInstruction + { + internal LLILFloatCompareOrdered( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public LowLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/LowLevelIL/LLILFloatCompareUnordered.cs b/LowLevelIL/LLILFloatCompareUnordered.cs new file mode 100644 index 0000000..4068371 --- /dev/null +++ b/LowLevelIL/LLILFloatCompareUnordered.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILFloatCompareUnordered : LowLevelILInstruction + { + internal LLILFloatCompareUnordered( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public LowLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/LowLevelIL/LLILFloatConst.cs b/LowLevelIL/LLILFloatConst.cs new file mode 100644 index 0000000..49bb851 --- /dev/null +++ b/LowLevelIL/LLILFloatConst.cs @@ -0,0 +1,26 @@ +using System; + +namespace BinaryNinja +{ + public sealed class LLILFloatConst : LowLevelILInstruction + { + internal LLILFloatConst( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public double Constant + { + get + { + return BitConverter.UInt64BitsToDouble( + this.RawOperands[0] + ); + } + } + } +} diff --git a/LowLevelIL/LLILFloatConvert.cs b/LowLevelIL/LLILFloatConvert.cs new file mode 100644 index 0000000..415320d --- /dev/null +++ b/LowLevelIL/LLILFloatConvert.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class LLILFloatConvert : LowLevelILInstruction + { + internal LLILFloatConvert( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression(0); + } + } + } +} diff --git a/LowLevelIL/LLILFloatDiv.cs b/LowLevelIL/LLILFloatDiv.cs new file mode 100644 index 0000000..c178309 --- /dev/null +++ b/LowLevelIL/LLILFloatDiv.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILFloatDiv : LowLevelILInstruction + { + internal LLILFloatDiv( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public LowLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/LowLevelIL/LLILFloatEqual.cs b/LowLevelIL/LLILFloatEqual.cs new file mode 100644 index 0000000..a0e3b9b --- /dev/null +++ b/LowLevelIL/LLILFloatEqual.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILFloatEqual : LowLevelILInstruction + { + internal LLILFloatEqual( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public LowLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/LowLevelIL/LLILFloatGreaterEqual.cs b/LowLevelIL/LLILFloatGreaterEqual.cs new file mode 100644 index 0000000..6ba141c --- /dev/null +++ b/LowLevelIL/LLILFloatGreaterEqual.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILFloatGreaterEqual : LowLevelILInstruction + { + internal LLILFloatGreaterEqual( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public LowLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/LowLevelIL/LLILFloatGreaterThan.cs b/LowLevelIL/LLILFloatGreaterThan.cs new file mode 100644 index 0000000..30702d5 --- /dev/null +++ b/LowLevelIL/LLILFloatGreaterThan.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILFloatGreaterThan : LowLevelILInstruction + { + internal LLILFloatGreaterThan( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public LowLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/LowLevelIL/LLILFloatLessEqual.cs b/LowLevelIL/LLILFloatLessEqual.cs new file mode 100644 index 0000000..28e6c42 --- /dev/null +++ b/LowLevelIL/LLILFloatLessEqual.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILFloatLessEqual : LowLevelILInstruction + { + internal LLILFloatLessEqual( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public LowLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/LowLevelIL/LLILFloatLessThan.cs b/LowLevelIL/LLILFloatLessThan.cs new file mode 100644 index 0000000..16da5fd --- /dev/null +++ b/LowLevelIL/LLILFloatLessThan.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILFloatLessThan : LowLevelILInstruction + { + internal LLILFloatLessThan( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public LowLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/LowLevelIL/LLILFloatMul.cs b/LowLevelIL/LLILFloatMul.cs new file mode 100644 index 0000000..c8e9b21 --- /dev/null +++ b/LowLevelIL/LLILFloatMul.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILFloatMul : LowLevelILInstruction + { + internal LLILFloatMul( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public LowLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/LowLevelIL/LLILFloatNeg.cs b/LowLevelIL/LLILFloatNeg.cs new file mode 100644 index 0000000..b6aeaed --- /dev/null +++ b/LowLevelIL/LLILFloatNeg.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class LLILFloatNeg : LowLevelILInstruction + { + internal LLILFloatNeg( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Destination + { + get + { + return this.GetOperandAsExpression(0); + } + } + } +} diff --git a/LowLevelIL/LLILFloatNotEqual.cs b/LowLevelIL/LLILFloatNotEqual.cs new file mode 100644 index 0000000..2275e7b --- /dev/null +++ b/LowLevelIL/LLILFloatNotEqual.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILFloatNotEqual : LowLevelILInstruction + { + internal LLILFloatNotEqual( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public LowLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/LowLevelIL/LLILFloatSquareRoot.cs b/LowLevelIL/LLILFloatSquareRoot.cs new file mode 100644 index 0000000..37c1227 --- /dev/null +++ b/LowLevelIL/LLILFloatSquareRoot.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class LLILFloatSquareRoot : LowLevelILInstruction + { + internal LLILFloatSquareRoot( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression(0); + } + } + } +} diff --git a/LowLevelIL/LLILFloatSub.cs b/LowLevelIL/LLILFloatSub.cs new file mode 100644 index 0000000..dff7cee --- /dev/null +++ b/LowLevelIL/LLILFloatSub.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILFloatSub : LowLevelILInstruction + { + internal LLILFloatSub( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public LowLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/LowLevelIL/LLILFloatToInt.cs b/LowLevelIL/LLILFloatToInt.cs new file mode 100644 index 0000000..d69127d --- /dev/null +++ b/LowLevelIL/LLILFloatToInt.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class LLILFloatToInt : LowLevelILInstruction + { + internal LLILFloatToInt( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Destination + { + get + { + return this.GetOperandAsExpression(0); + } + } + } +} diff --git a/LowLevelIL/LLILFloatTrunc.cs b/LowLevelIL/LLILFloatTrunc.cs new file mode 100644 index 0000000..82a1439 --- /dev/null +++ b/LowLevelIL/LLILFloatTrunc.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class LLILFloatTrunc : LowLevelILInstruction + { + internal LLILFloatTrunc( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression(0); + } + } + } +} diff --git a/LowLevelIL/LLILFloor.cs b/LowLevelIL/LLILFloor.cs new file mode 100644 index 0000000..67f8197 --- /dev/null +++ b/LowLevelIL/LLILFloor.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class LLILFloor : LowLevelILInstruction + { + internal LLILFloor( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression(0); + } + } + } +} diff --git a/LowLevelIL/LLILForceVersion.cs b/LowLevelIL/LLILForceVersion.cs new file mode 100644 index 0000000..f19b6c3 --- /dev/null +++ b/LowLevelIL/LLILForceVersion.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class LLILForceVersion : LowLevelILInstruction + { + internal LLILForceVersion( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public ILRegister Destination + { + get + { + return this.GetOperandAsRegister((OperandIndex)0 ); + } + } + } +} diff --git a/LowLevelIL/LLILForceVersionSSA.cs b/LowLevelIL/LLILForceVersionSSA.cs new file mode 100644 index 0000000..e72b04d --- /dev/null +++ b/LowLevelIL/LLILForceVersionSSA.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILForceVersionSSA : LowLevelILInstruction + { + internal LLILForceVersionSSA( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILSSARegister Destination + { + get + { + return this.GetOperandAsSSARegister((OperandIndex)0 , (OperandIndex)1 ); + } + } + + public LowLevelILSSARegister Source + { + get + { + return this.GetOperandAsSSARegister((OperandIndex)2 , (OperandIndex)3 ); + } + } + } +} diff --git a/LowLevelIL/LLILGoto.cs b/LowLevelIL/LLILGoto.cs new file mode 100644 index 0000000..ed4d7d7 --- /dev/null +++ b/LowLevelIL/LLILGoto.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class LLILGoto : LowLevelILInstruction + { + internal LLILGoto( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstructionIndex Destination + { + get + { + return (LowLevelILInstructionIndex)this.RawOperands[0]; + } + } + } +} diff --git a/LowLevelIL/LLILIf.cs b/LowLevelIL/LLILIf.cs new file mode 100644 index 0000000..ec18332 --- /dev/null +++ b/LowLevelIL/LLILIf.cs @@ -0,0 +1,42 @@ +namespace BinaryNinja +{ + public sealed class LLILIf : LowLevelILInstruction + { + internal LLILIf( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Condition + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public LowLevelILInstruction TrueBranch + { + get + { + return this.ILFunction.MustGetInstruction( + (LowLevelILInstructionIndex)this.RawOperands[1] + ); + } + } + + public LowLevelILInstruction FalseBranch + { + get + { + return this.ILFunction.MustGetInstruction( + (LowLevelILInstructionIndex)this.RawOperands[2] + ); + } + } + } +} diff --git a/LowLevelIL/LLILIntToFloat.cs b/LowLevelIL/LLILIntToFloat.cs new file mode 100644 index 0000000..ae036f3 --- /dev/null +++ b/LowLevelIL/LLILIntToFloat.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class LLILIntToFloat : LowLevelILInstruction + { + internal LLILIntToFloat( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression(0); + } + } + } +} diff --git a/LowLevelIL/LLILIntrinsic.cs b/LowLevelIL/LLILIntrinsic.cs new file mode 100644 index 0000000..dd0bdd9 --- /dev/null +++ b/LowLevelIL/LLILIntrinsic.cs @@ -0,0 +1,51 @@ +namespace BinaryNinja +{ + public sealed class LLILIntrinsic : LowLevelILInstruction + { + internal LLILIntrinsic( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public FlagOrRegister[] output + { + get + { + + return this.GetOperandAsFlagOrRegisterList(0); + } + } + + public Intrinsic Intrinsic + { + get + { + return this.GetOperandAsIntrinsic((OperandIndex)2); + } + } + + public LLILCallParameter Parameter + { + get + { + LLILCallParameter? instruction = this.GetOperandAsExpression((OperandIndex)3) as LLILCallParameter; + + return instruction!; + } + } + + public LowLevelILInstruction[] Parameters + { + get + { + LLILCallParameter? instruction = this.GetOperandAsExpression((OperandIndex)3) as LLILCallParameter; + + return instruction!.Source; + } + } + } +} diff --git a/LowLevelIL/LLILIntrinsicSSA.cs b/LowLevelIL/LLILIntrinsicSSA.cs new file mode 100644 index 0000000..83c0d43 --- /dev/null +++ b/LowLevelIL/LLILIntrinsicSSA.cs @@ -0,0 +1,51 @@ +namespace BinaryNinja +{ + public sealed class LLILIntrinsicSSA : LowLevelILInstruction + { + internal LLILIntrinsicSSA( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public SSAFlagOrRegister[] output + { + get + { + + return this.GetOperandAsSSAFlagOrRegisterList(0); + } + } + + public Intrinsic Intrinsic + { + get + { + return this.GetOperandAsIntrinsic((OperandIndex)2); + } + } + + public LLILCallParameter Parameter + { + get + { + LLILCallParameter? instruction = this.GetOperandAsExpression((OperandIndex)3) as LLILCallParameter; + + return instruction!; + } + } + + public LowLevelILInstruction[] Parameters + { + get + { + LLILCallParameter? instruction = this.GetOperandAsExpression((OperandIndex)3) as LLILCallParameter; + + return instruction!.Source; + } + } + } +} diff --git a/LowLevelIL/LLILJump.cs b/LowLevelIL/LLILJump.cs new file mode 100644 index 0000000..9a68082 --- /dev/null +++ b/LowLevelIL/LLILJump.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class LLILJump : LowLevelILInstruction + { + internal LLILJump( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Destination + { + get + { + return this.GetOperandAsExpression(0); + } + } + } +} diff --git a/LowLevelIL/LLILJumpTo.cs b/LowLevelIL/LLILJumpTo.cs new file mode 100644 index 0000000..83bff6b --- /dev/null +++ b/LowLevelIL/LLILJumpTo.cs @@ -0,0 +1,32 @@ +using System.Collections.Generic; + +namespace BinaryNinja +{ + public sealed class LLILJumpTo : LowLevelILInstruction + { + internal LLILJumpTo( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Destination + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public IDictionary Targets + { + get + { + return this.GetOperandAsIntegerDict((OperandIndex)1); + } + } + } +} diff --git a/LowLevelIL/LLILLoad.cs b/LowLevelIL/LLILLoad.cs new file mode 100644 index 0000000..01403c8 --- /dev/null +++ b/LowLevelIL/LLILLoad.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class LLILLoad : LowLevelILInstruction + { + internal LLILLoad( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression(0); + } + } + } +} diff --git a/LowLevelIL/LLILLoadSSA.cs b/LowLevelIL/LLILLoadSSA.cs new file mode 100644 index 0000000..4c459d3 --- /dev/null +++ b/LowLevelIL/LLILLoadSSA.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILLoadSSA : LowLevelILInstruction + { + internal LLILLoadSSA( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression((OperandIndex)0 ); + } + } + + public ulong SourceMemory + { + get + { + return this.RawOperands[1]; + } + } + } +} diff --git a/LowLevelIL/LLILLogicalShiftLeft.cs b/LowLevelIL/LLILLogicalShiftLeft.cs new file mode 100644 index 0000000..664e1a2 --- /dev/null +++ b/LowLevelIL/LLILLogicalShiftLeft.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILLogicalShiftLeft : LowLevelILInstruction + { + internal LLILLogicalShiftLeft( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public LowLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/LowLevelIL/LLILLogicalShiftRight.cs b/LowLevelIL/LLILLogicalShiftRight.cs new file mode 100644 index 0000000..5b68beb --- /dev/null +++ b/LowLevelIL/LLILLogicalShiftRight.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILLogicalShiftRight : LowLevelILInstruction + { + internal LLILLogicalShiftRight( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public LowLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/LowLevelIL/LLILLowPart.cs b/LowLevelIL/LLILLowPart.cs new file mode 100644 index 0000000..0ee1b77 --- /dev/null +++ b/LowLevelIL/LLILLowPart.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class LLILLowPart : LowLevelILInstruction + { + internal LLILLowPart( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression(0); + } + } + } +} diff --git a/LowLevelIL/LLILMemoryIntrinsicOutputSSA.cs b/LowLevelIL/LLILMemoryIntrinsicOutputSSA.cs new file mode 100644 index 0000000..0c075a9 --- /dev/null +++ b/LowLevelIL/LLILMemoryIntrinsicOutputSSA.cs @@ -0,0 +1,32 @@ +namespace BinaryNinja +{ + public sealed class LLILMemoryIntrinsicOutputSSA : LowLevelILInstruction + { + internal LLILMemoryIntrinsicOutputSSA( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public ulong DestinationMemory + { + get + { + + return this.RawOperands[0]; + } + } + + public SSAFlagOrRegister[] Output + { + get + { + + return this.GetOperandAsSSAFlagOrRegisterList(0); + } + } + } +} diff --git a/LowLevelIL/LLILMemoryIntrinsicSSA.cs b/LowLevelIL/LLILMemoryIntrinsicSSA.cs new file mode 100644 index 0000000..d5c49b8 --- /dev/null +++ b/LowLevelIL/LLILMemoryIntrinsicSSA.cs @@ -0,0 +1,72 @@ +namespace BinaryNinja +{ + public sealed class LLILMemoryIntrinsicSSA : LowLevelILInstruction + { + internal LLILMemoryIntrinsicSSA( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + + public SSAFlagOrRegister[] Output + { + get + { + LLILMemoryIntrinsicOutputSSA? instruction = this.GetOperandAsExpression(0) as LLILMemoryIntrinsicOutputSSA; + + return instruction!.Output; + } + } + + public ulong DestinationMemory + { + get + { + LLILMemoryIntrinsicOutputSSA? instruction = this.GetOperandAsExpression(0) as LLILMemoryIntrinsicOutputSSA; + + return instruction!.DestinationMemory; + } + } + + public Intrinsic Intrinsic + { + get + { + return this.GetOperandAsIntrinsic((OperandIndex)1); + } + } + + public LLILCallParameter Parameter + { + get + { + LLILCallParameter? instruction = this.GetOperandAsExpression((OperandIndex)2) as LLILCallParameter; + + return instruction!; + } + } + + public LowLevelILInstruction[] Parameters + { + get + { + LLILCallParameter? instruction = this.GetOperandAsExpression((OperandIndex)2) as LLILCallParameter; + + return instruction!.Source; + } + } + + public ulong SourceMemory + { + get + { + return this.RawOperands[3]; + } + } + + } +} diff --git a/LowLevelIL/LLILMemoryPhi.cs b/LowLevelIL/LLILMemoryPhi.cs new file mode 100644 index 0000000..6eac3d7 --- /dev/null +++ b/LowLevelIL/LLILMemoryPhi.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILMemoryPhi : LowLevelILInstruction + { + internal LLILMemoryPhi( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public ulong DestionationMemory + { + get + { + return this.RawOperands[0]; + } + } + + public ulong[] SourceMemory + { + get + { + return this.GetOperandAsIntegerArray(0); + } + } + } +} diff --git a/LowLevelIL/LLILModSigned.cs b/LowLevelIL/LLILModSigned.cs new file mode 100644 index 0000000..a52e44b --- /dev/null +++ b/LowLevelIL/LLILModSigned.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILModSigned : LowLevelILInstruction + { + internal LLILModSigned( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public LowLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/LowLevelIL/LLILModSignedDoublePrecision.cs b/LowLevelIL/LLILModSignedDoublePrecision.cs new file mode 100644 index 0000000..fd42091 --- /dev/null +++ b/LowLevelIL/LLILModSignedDoublePrecision.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILModSignedDoublePrecision : LowLevelILInstruction + { + internal LLILModSignedDoublePrecision( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public LowLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/LowLevelIL/LLILModUnsigned.cs b/LowLevelIL/LLILModUnsigned.cs new file mode 100644 index 0000000..1eb0c27 --- /dev/null +++ b/LowLevelIL/LLILModUnsigned.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILModUnsigned : LowLevelILInstruction + { + internal LLILModUnsigned( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public LowLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/LowLevelIL/LLILModUnsignedDoublePrecision.cs b/LowLevelIL/LLILModUnsignedDoublePrecision.cs new file mode 100644 index 0000000..46db121 --- /dev/null +++ b/LowLevelIL/LLILModUnsignedDoublePrecision.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILModUnsignedDoublePrecision : LowLevelILInstruction + { + internal LLILModUnsignedDoublePrecision( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public LowLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/LowLevelIL/LLILMul.cs b/LowLevelIL/LLILMul.cs new file mode 100644 index 0000000..e63420f --- /dev/null +++ b/LowLevelIL/LLILMul.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILMul : LowLevelILInstruction + { + internal LLILMul( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public LowLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/LowLevelIL/LLILMulSignedDoublePrecision.cs b/LowLevelIL/LLILMulSignedDoublePrecision.cs new file mode 100644 index 0000000..5e9d6c1 --- /dev/null +++ b/LowLevelIL/LLILMulSignedDoublePrecision.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILMulSignedDoublePrecision : LowLevelILInstruction + { + internal LLILMulSignedDoublePrecision( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public LowLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/LowLevelIL/LLILMulUnsignedDoublePrecision.cs b/LowLevelIL/LLILMulUnsignedDoublePrecision.cs new file mode 100644 index 0000000..6a47a8c --- /dev/null +++ b/LowLevelIL/LLILMulUnsignedDoublePrecision.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILMulUnsignedDoublePrecision : LowLevelILInstruction + { + internal LLILMulUnsignedDoublePrecision( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public LowLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/LowLevelIL/LLILNeg.cs b/LowLevelIL/LLILNeg.cs new file mode 100644 index 0000000..49ab104 --- /dev/null +++ b/LowLevelIL/LLILNeg.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class LLILNeg : LowLevelILInstruction + { + internal LLILNeg( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression(0); + } + } + } +} diff --git a/LowLevelIL/LLILNoReturn.cs b/LowLevelIL/LLILNoReturn.cs new file mode 100644 index 0000000..fda746f --- /dev/null +++ b/LowLevelIL/LLILNoReturn.cs @@ -0,0 +1,14 @@ +namespace BinaryNinja +{ + public sealed class LLILNoReturn : LowLevelILInstruction + { + internal LLILNoReturn( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + } +} diff --git a/LowLevelIL/LLILNop.cs b/LowLevelIL/LLILNop.cs new file mode 100644 index 0000000..8ae2eeb --- /dev/null +++ b/LowLevelIL/LLILNop.cs @@ -0,0 +1,14 @@ +namespace BinaryNinja +{ + public sealed class LLILNop : LowLevelILInstruction + { + internal LLILNop( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + } +} diff --git a/LowLevelIL/LLILNot.cs b/LowLevelIL/LLILNot.cs new file mode 100644 index 0000000..1118b83 --- /dev/null +++ b/LowLevelIL/LLILNot.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class LLILNot : LowLevelILInstruction + { + internal LLILNot( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression(0); + } + } + } +} diff --git a/LowLevelIL/LLILNotEqual.cs b/LowLevelIL/LLILNotEqual.cs new file mode 100644 index 0000000..cfcab09 --- /dev/null +++ b/LowLevelIL/LLILNotEqual.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILNotEqual : LowLevelILInstruction + { + internal LLILNotEqual( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public LowLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/LowLevelIL/LLILOr.cs b/LowLevelIL/LLILOr.cs new file mode 100644 index 0000000..4b70a33 --- /dev/null +++ b/LowLevelIL/LLILOr.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILOr : LowLevelILInstruction + { + internal LLILOr( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public LowLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/LowLevelIL/LLILPop.cs b/LowLevelIL/LLILPop.cs new file mode 100644 index 0000000..550f1cd --- /dev/null +++ b/LowLevelIL/LLILPop.cs @@ -0,0 +1,14 @@ +namespace BinaryNinja +{ + public sealed class LLILPop : LowLevelILInstruction + { + internal LLILPop( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + } +} diff --git a/LowLevelIL/LLILPush.cs b/LowLevelIL/LLILPush.cs new file mode 100644 index 0000000..faf5867 --- /dev/null +++ b/LowLevelIL/LLILPush.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class LLILPush : LowLevelILInstruction + { + internal LLILPush( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression(0); + } + } + } +} diff --git a/LowLevelIL/LLILRegister.cs b/LowLevelIL/LLILRegister.cs new file mode 100644 index 0000000..aff5f36 --- /dev/null +++ b/LowLevelIL/LLILRegister.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class LLILRegister : LowLevelILInstruction + { + internal LLILRegister( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public ILRegister Source + { + get + { + return this.GetOperandAsRegister(0); + } + } + } +} diff --git a/LowLevelIL/LLILRegisterPhi.cs b/LowLevelIL/LLILRegisterPhi.cs new file mode 100644 index 0000000..15949c4 --- /dev/null +++ b/LowLevelIL/LLILRegisterPhi.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILRegisterPhi : LowLevelILInstruction + { + internal LLILRegisterPhi( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILSSARegister Destination + { + get + { + return this.GetOperandAsSSARegister((OperandIndex)0 , (OperandIndex)1 ); + } + } + + public LowLevelILSSARegister[] Source + { + get + { + return this.GetOperandAsSSARegisterList( (OperandIndex)2 ); + } + } + } +} diff --git a/LowLevelIL/LLILRegisterSSA.cs b/LowLevelIL/LLILRegisterSSA.cs new file mode 100644 index 0000000..4edbaff --- /dev/null +++ b/LowLevelIL/LLILRegisterSSA.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class LLILRegisterSSA : LowLevelILInstruction + { + internal LLILRegisterSSA( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILSSARegister Source + { + get + { + return this.GetOperandAsSSARegister((OperandIndex)0,(OperandIndex)1); + } + } + } +} diff --git a/LowLevelIL/LLILRegisterSSAPartial.cs b/LowLevelIL/LLILRegisterSSAPartial.cs new file mode 100644 index 0000000..c3ec92a --- /dev/null +++ b/LowLevelIL/LLILRegisterSSAPartial.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILRegisterSSAPartial : LowLevelILInstruction + { + internal LLILRegisterSSAPartial( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILSSARegister FullRegister + { + get + { + return this.GetOperandAsSSARegister((OperandIndex)0,(OperandIndex)1); + } + } + + public ILRegister Source + { + get + { + return this.GetOperandAsRegister((OperandIndex)2); + } + } + } +} diff --git a/LowLevelIL/LLILRegisterSplit.cs b/LowLevelIL/LLILRegisterSplit.cs new file mode 100644 index 0000000..64cff44 --- /dev/null +++ b/LowLevelIL/LLILRegisterSplit.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILRegisterSplit : LowLevelILInstruction + { + internal LLILRegisterSplit( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public ILRegister High + { + get + { + return this.GetOperandAsRegister(0); + } + } + + public ILRegister Low + { + get + { + return this.GetOperandAsRegister((OperandIndex)1); + } + } + } +} diff --git a/LowLevelIL/LLILRegisterSplitDestinationSSA.cs b/LowLevelIL/LLILRegisterSplitDestinationSSA.cs new file mode 100644 index 0000000..b925618 --- /dev/null +++ b/LowLevelIL/LLILRegisterSplitDestinationSSA.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class LLILRegisterSplitDestinationSSA : LowLevelILInstruction + { + internal LLILRegisterSplitDestinationSSA( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILSSARegister Destination + { + get + { + return this.GetOperandAsSSARegister((OperandIndex)0,(OperandIndex)1); + } + } + } +} diff --git a/LowLevelIL/LLILRegisterSplitSSA.cs b/LowLevelIL/LLILRegisterSplitSSA.cs new file mode 100644 index 0000000..5da26a7 --- /dev/null +++ b/LowLevelIL/LLILRegisterSplitSSA.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILRegisterSplitSSA : LowLevelILInstruction + { + internal LLILRegisterSplitSSA( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILSSARegister High + { + get + { + return this.GetOperandAsSSARegister((OperandIndex)0,(OperandIndex)1); + } + } + + public LowLevelILSSARegister Low + { + get + { + return this.GetOperandAsSSARegister((OperandIndex)2,(OperandIndex)3); + } + } + } +} diff --git a/LowLevelIL/LLILRegisterStackAbsSSA.cs b/LowLevelIL/LLILRegisterStackAbsSSA.cs new file mode 100644 index 0000000..fd9967c --- /dev/null +++ b/LowLevelIL/LLILRegisterStackAbsSSA.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILRegisterStackAbsSSA : LowLevelILInstruction + { + internal LLILRegisterStackAbsSSA( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native ) + { + + } + + public SSARegisterStack Stack + { + get + { + return this.GetOperandAsSSARegisterStack((OperandIndex)0,(OperandIndex)1); + } + } + + public ILRegister Source + { + get + { + return this.GetOperandAsRegister((OperandIndex)2); + } + } + } +} diff --git a/LowLevelIL/LLILRegisterStackDestinationSSA.cs b/LowLevelIL/LLILRegisterStackDestinationSSA.cs new file mode 100644 index 0000000..cab813b --- /dev/null +++ b/LowLevelIL/LLILRegisterStackDestinationSSA.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILRegisterStackDestinationSSA : LowLevelILInstruction + { + internal LLILRegisterStackDestinationSSA( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public SSARegisterStack Destination + { + get + { + return this.GetOperandAsSSARegisterStack((OperandIndex)0,(OperandIndex)1); + } + } + + public SSARegisterStack Source + { + get + { + return this.GetOperandAsSSARegisterStack((OperandIndex)0,(OperandIndex)2); + } + } + } +} diff --git a/LowLevelIL/LLILRegisterStackFreeAbsSSA.cs b/LowLevelIL/LLILRegisterStackFreeAbsSSA.cs new file mode 100644 index 0000000..0924b1e --- /dev/null +++ b/LowLevelIL/LLILRegisterStackFreeAbsSSA.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILRegisterStackFreeAbsSSA : LowLevelILInstruction + { + internal LLILRegisterStackFreeAbsSSA( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Stack + { + get + { + return this.GetOperandAsExpression((OperandIndex)0); + } + } + + public ILRegister Destination + { + get + { + return this.GetOperandAsRegister((OperandIndex)1); + } + } + } +} diff --git a/LowLevelIL/LLILRegisterStackFreeRegister.cs b/LowLevelIL/LLILRegisterStackFreeRegister.cs new file mode 100644 index 0000000..30a71fe --- /dev/null +++ b/LowLevelIL/LLILRegisterStackFreeRegister.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class LLILRegisterStackFreeRegister : LowLevelILInstruction + { + internal LLILRegisterStackFreeRegister( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public ILRegister Destination + { + get + { + return this.GetOperandAsRegister(0); + } + } + } +} diff --git a/LowLevelIL/LLILRegisterStackFreeRel.cs b/LowLevelIL/LLILRegisterStackFreeRel.cs new file mode 100644 index 0000000..00f77f5 --- /dev/null +++ b/LowLevelIL/LLILRegisterStackFreeRel.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILRegisterStackFreeRel : LowLevelILInstruction + { + internal LLILRegisterStackFreeRel( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public RegisterStack Stack + { + get + { + return this.GetOperandAsRegisterStack(0); + } + } + + public LowLevelILInstruction Destination + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/LowLevelIL/LLILRegisterStackFreeRelativeSSA.cs b/LowLevelIL/LLILRegisterStackFreeRelativeSSA.cs new file mode 100644 index 0000000..dc10376 --- /dev/null +++ b/LowLevelIL/LLILRegisterStackFreeRelativeSSA.cs @@ -0,0 +1,38 @@ +namespace BinaryNinja +{ + public sealed class LLILRegisterStackFreeRelativeSSA : LowLevelILInstruction + { + internal LLILRegisterStackFreeRelativeSSA( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Stack + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public LowLevelILInstruction Destination + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + + public LowLevelILInstruction Top + { + get + { + return this.GetOperandAsExpression((OperandIndex)2); + } + } + } +} diff --git a/LowLevelIL/LLILRegisterStackPhi.cs b/LowLevelIL/LLILRegisterStackPhi.cs new file mode 100644 index 0000000..a8a5f5a --- /dev/null +++ b/LowLevelIL/LLILRegisterStackPhi.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILRegisterStackPhi : LowLevelILInstruction + { + internal LLILRegisterStackPhi( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public SSARegisterStack Destination + { + get + { + return this.GetOperandAsSSARegisterStack((OperandIndex)0 , (OperandIndex)1 ); + } + } + + public SSARegisterStack[] Source + { + get + { + return this.GetOperandAsSSARegisterStackList( (OperandIndex)2 ); + } + } + } +} diff --git a/LowLevelIL/LLILRegisterStackPop.cs b/LowLevelIL/LLILRegisterStackPop.cs new file mode 100644 index 0000000..3a01055 --- /dev/null +++ b/LowLevelIL/LLILRegisterStackPop.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class LLILRegisterStackPop : LowLevelILInstruction + { + internal LLILRegisterStackPop( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public RegisterStack Stack + { + get + { + return this.GetOperandAsRegisterStack(0); + } + } + } +} diff --git a/LowLevelIL/LLILRegisterStackPush.cs b/LowLevelIL/LLILRegisterStackPush.cs new file mode 100644 index 0000000..c5bd455 --- /dev/null +++ b/LowLevelIL/LLILRegisterStackPush.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILRegisterStackPush : LowLevelILInstruction + { + internal LLILRegisterStackPush( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public RegisterStack Stack + { + get + { + return this.GetOperandAsRegisterStack(0); + } + } + + public LowLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/LowLevelIL/LLILRegisterStackRelative.cs b/LowLevelIL/LLILRegisterStackRelative.cs new file mode 100644 index 0000000..616de3c --- /dev/null +++ b/LowLevelIL/LLILRegisterStackRelative.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILRegisterStackRelative : LowLevelILInstruction + { + internal LLILRegisterStackRelative( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public RegisterStack Stack + { + get + { + return this.GetOperandAsRegisterStack(0); + } + } + + public LowLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/LowLevelIL/LLILRegisterStackRelativeSSA.cs b/LowLevelIL/LLILRegisterStackRelativeSSA.cs new file mode 100644 index 0000000..71c59cf --- /dev/null +++ b/LowLevelIL/LLILRegisterStackRelativeSSA.cs @@ -0,0 +1,38 @@ +namespace BinaryNinja +{ + public sealed class LLILRegisterStackRelativeSSA : LowLevelILInstruction + { + internal LLILRegisterStackRelativeSSA( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public SSARegisterStack Stack + { + get + { + return this.GetOperandAsSSARegisterStack((OperandIndex)0 , (OperandIndex)1); + } + } + + public LowLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression((OperandIndex)2); + } + } + + public LowLevelILInstruction Top + { + get + { + return this.GetOperandAsExpression((OperandIndex)3); + } + } + } +} diff --git a/LowLevelIL/LLILReturn.cs b/LowLevelIL/LLILReturn.cs new file mode 100644 index 0000000..f584919 --- /dev/null +++ b/LowLevelIL/LLILReturn.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class LLILReturn : LowLevelILInstruction + { + internal LLILReturn( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Destination + { + get + { + return this.GetOperandAsExpression(0); + } + } + } +} diff --git a/LowLevelIL/LLILRotateLeft.cs b/LowLevelIL/LLILRotateLeft.cs new file mode 100644 index 0000000..edb76bf --- /dev/null +++ b/LowLevelIL/LLILRotateLeft.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILRotateLeft : LowLevelILInstruction + { + internal LLILRotateLeft( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public LowLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/LowLevelIL/LLILRotateLeftCarry.cs b/LowLevelIL/LLILRotateLeftCarry.cs new file mode 100644 index 0000000..c73455b --- /dev/null +++ b/LowLevelIL/LLILRotateLeftCarry.cs @@ -0,0 +1,38 @@ +namespace BinaryNinja +{ + public sealed class LLILRotateLeftCarry : LowLevelILInstruction + { + internal LLILRotateLeftCarry( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression((OperandIndex)0 ); + } + } + + public LowLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression( (OperandIndex)1 ); + } + } + + public LowLevelILInstruction Carry + { + get + { + return this.GetOperandAsExpression( (OperandIndex)2 ); + } + } + } +} diff --git a/LowLevelIL/LLILRotateRight.cs b/LowLevelIL/LLILRotateRight.cs new file mode 100644 index 0000000..432d616 --- /dev/null +++ b/LowLevelIL/LLILRotateRight.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILRotateRight : LowLevelILInstruction + { + internal LLILRotateRight( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public LowLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/LowLevelIL/LLILRotateRightCarry.cs b/LowLevelIL/LLILRotateRightCarry.cs new file mode 100644 index 0000000..5d24a7e --- /dev/null +++ b/LowLevelIL/LLILRotateRightCarry.cs @@ -0,0 +1,38 @@ +namespace BinaryNinja +{ + public sealed class LLILRotateRightCarry : LowLevelILInstruction + { + internal LLILRotateRightCarry( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression((OperandIndex)0 ); + } + } + + public LowLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression( (OperandIndex)1 ); + } + } + + public LowLevelILInstruction Carry + { + get + { + return this.GetOperandAsExpression( (OperandIndex)2 ); + } + } + } +} diff --git a/LowLevelIL/LLILRoundToInt.cs b/LowLevelIL/LLILRoundToInt.cs new file mode 100644 index 0000000..080b3ce --- /dev/null +++ b/LowLevelIL/LLILRoundToInt.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class LLILRoundToInt : LowLevelILInstruction + { + internal LLILRoundToInt( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression(0); + } + } + } +} diff --git a/LowLevelIL/LLILSeparateParamListSSA.cs b/LowLevelIL/LLILSeparateParamListSSA.cs new file mode 100644 index 0000000..d2c70a0 --- /dev/null +++ b/LowLevelIL/LLILSeparateParamListSSA.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class LLILSeparateParamListSSA : LowLevelILInstruction + { + internal LLILSeparateParamListSSA( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction[] Source + { + get + { + return this.GetOperandAsExpressionList(0); + } + } + } +} diff --git a/LowLevelIL/LLILSetFlag.cs b/LowLevelIL/LLILSetFlag.cs new file mode 100644 index 0000000..68ae44f --- /dev/null +++ b/LowLevelIL/LLILSetFlag.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILSetFlag : LowLevelILInstruction + { + internal LLILSetFlag( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public ILFlag Destionation + { + get + { + return this.GetOperandAsFlag(0); + } + } + + public LowLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/LowLevelIL/LLILSetFlagSSA.cs b/LowLevelIL/LLILSetFlagSSA.cs new file mode 100644 index 0000000..b2ad1ab --- /dev/null +++ b/LowLevelIL/LLILSetFlagSSA.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILSetFlagSSA : LowLevelILInstruction + { + internal LLILSetFlagSSA( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILSSAFlag Source + { + get + { + return this.GetOperandAsSSAFlag((OperandIndex)0 , (OperandIndex)1); + } + } + + public LowLevelILInstruction Destination + { + get + { + return this.GetOperandAsExpression((OperandIndex)2); + } + } + } +} diff --git a/LowLevelIL/LLILSetRegister.cs b/LowLevelIL/LLILSetRegister.cs new file mode 100644 index 0000000..a5fa1db --- /dev/null +++ b/LowLevelIL/LLILSetRegister.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILSetRegister : LowLevelILInstruction + { + internal LLILSetRegister( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public ILRegister Destionation + { + get + { + return this.GetOperandAsRegister(0); + } + } + + public LowLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/LowLevelIL/LLILSetRegisterSSA.cs b/LowLevelIL/LLILSetRegisterSSA.cs new file mode 100644 index 0000000..0ebb5bf --- /dev/null +++ b/LowLevelIL/LLILSetRegisterSSA.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILSetRegisterSSA : LowLevelILInstruction + { + internal LLILSetRegisterSSA( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILSSARegister Destination + { + get + { + return this.GetOperandAsSSARegister((OperandIndex)0,(OperandIndex)1); + } + } + + public LowLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression((OperandIndex)2); + } + } + } +} diff --git a/LowLevelIL/LLILSetRegisterSSAPartial.cs b/LowLevelIL/LLILSetRegisterSSAPartial.cs new file mode 100644 index 0000000..6f588cd --- /dev/null +++ b/LowLevelIL/LLILSetRegisterSSAPartial.cs @@ -0,0 +1,38 @@ +namespace BinaryNinja +{ + public sealed class LLILSetRegisterSSAPartial : LowLevelILInstruction + { + internal LLILSetRegisterSSAPartial( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILSSARegister FullRegister + { + get + { + return this.GetOperandAsSSARegister((OperandIndex)0,(OperandIndex)1); + } + } + + public ILRegister Destination + { + get + { + return this.GetOperandAsRegister((OperandIndex)2); + } + } + + public LowLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression((OperandIndex)3); + } + } + } +} diff --git a/LowLevelIL/LLILSetRegisterSplit.cs b/LowLevelIL/LLILSetRegisterSplit.cs new file mode 100644 index 0000000..69fd7c9 --- /dev/null +++ b/LowLevelIL/LLILSetRegisterSplit.cs @@ -0,0 +1,38 @@ +namespace BinaryNinja +{ + public sealed class LLILSetRegisterSplit : LowLevelILInstruction + { + internal LLILSetRegisterSplit( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public ILRegister High + { + get + { + return this.GetOperandAsRegister((OperandIndex)0 ); + } + } + + public ILRegister Low + { + get + { + return this.GetOperandAsRegister( (OperandIndex)1 ); + } + } + + public LowLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression( (OperandIndex)2 ); + } + } + } +} diff --git a/LowLevelIL/LLILSetRegisterSplitSSA.cs b/LowLevelIL/LLILSetRegisterSplitSSA.cs new file mode 100644 index 0000000..43df7a3 --- /dev/null +++ b/LowLevelIL/LLILSetRegisterSplitSSA.cs @@ -0,0 +1,38 @@ +namespace BinaryNinja +{ + public sealed class LLILSetRegisterSplitSSA : LowLevelILInstruction + { + internal LLILSetRegisterSplitSSA( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction High + { + get + { + return this.GetOperandAsExpression((OperandIndex)0); + } + } + + public LowLevelILInstruction Low + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + + public LowLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression((OperandIndex)2); + } + } + } +} diff --git a/LowLevelIL/LLILSetRegisterStackAbsSSA.cs b/LowLevelIL/LLILSetRegisterStackAbsSSA.cs new file mode 100644 index 0000000..3ecbeaf --- /dev/null +++ b/LowLevelIL/LLILSetRegisterStackAbsSSA.cs @@ -0,0 +1,38 @@ +namespace BinaryNinja +{ + public sealed class LLILSetRegisterStackAbsSSA : LowLevelILInstruction + { + internal LLILSetRegisterStackAbsSSA( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Stack + { + get + { + return this.GetOperandAsExpression((OperandIndex)0); + } + } + + public ILRegister Destination + { + get + { + return this.GetOperandAsRegister((OperandIndex)1); + } + } + + public LowLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression((OperandIndex)2); + } + } + } +} diff --git a/LowLevelIL/LLILSetRegisterStackRel.cs b/LowLevelIL/LLILSetRegisterStackRel.cs new file mode 100644 index 0000000..c9374b2 --- /dev/null +++ b/LowLevelIL/LLILSetRegisterStackRel.cs @@ -0,0 +1,38 @@ +namespace BinaryNinja +{ + public sealed class LLILSetRegisterStackRel : LowLevelILInstruction + { + internal LLILSetRegisterStackRel( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public RegisterStack Stack + { + get + { + return this.GetOperandAsRegisterStack((OperandIndex)0 ); + } + } + + public LowLevelILInstruction Destination + { + get + { + return this.GetOperandAsExpression( (OperandIndex)1 ); + } + } + + public LowLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression( (OperandIndex)2 ); + } + } + } +} diff --git a/LowLevelIL/LLILSetRegisterStackRelativeSSA.cs b/LowLevelIL/LLILSetRegisterStackRelativeSSA.cs new file mode 100644 index 0000000..9f85745 --- /dev/null +++ b/LowLevelIL/LLILSetRegisterStackRelativeSSA.cs @@ -0,0 +1,46 @@ +namespace BinaryNinja +{ + public sealed class LLILSetRegisterStackRelativeSSA : LowLevelILInstruction + { + internal LLILSetRegisterStackRelativeSSA( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Stack + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public LowLevelILInstruction Destination + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + + public LowLevelILInstruction Top + { + get + { + return this.GetOperandAsExpression((OperandIndex)2); + } + } + + public LowLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression((OperandIndex)3); + } + } + } +} diff --git a/LowLevelIL/LLILSharedParamSlotSSA.cs b/LowLevelIL/LLILSharedParamSlotSSA.cs new file mode 100644 index 0000000..3e55c6a --- /dev/null +++ b/LowLevelIL/LLILSharedParamSlotSSA.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class LLILSharedParamSlotSSA : LowLevelILInstruction + { + internal LLILSharedParamSlotSSA( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction[] Source + { + get + { + return this.GetOperandAsExpressionList(0); + } + } + } +} diff --git a/LowLevelIL/LLILSignExtend.cs b/LowLevelIL/LLILSignExtend.cs new file mode 100644 index 0000000..4e27d55 --- /dev/null +++ b/LowLevelIL/LLILSignExtend.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class LLILSignExtend : LowLevelILInstruction + { + internal LLILSignExtend( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression(0); + } + } + } +} diff --git a/LowLevelIL/LLILSignedGreaterEqual.cs b/LowLevelIL/LLILSignedGreaterEqual.cs new file mode 100644 index 0000000..1137a17 --- /dev/null +++ b/LowLevelIL/LLILSignedGreaterEqual.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILSignedGreaterEqual : LowLevelILInstruction + { + internal LLILSignedGreaterEqual( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public LowLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/LowLevelIL/LLILSignedGreaterThan.cs b/LowLevelIL/LLILSignedGreaterThan.cs new file mode 100644 index 0000000..48142be --- /dev/null +++ b/LowLevelIL/LLILSignedGreaterThan.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILSignedGreaterThan : LowLevelILInstruction + { + internal LLILSignedGreaterThan( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public LowLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/LowLevelIL/LLILSignedLessEqual.cs b/LowLevelIL/LLILSignedLessEqual.cs new file mode 100644 index 0000000..eb9c367 --- /dev/null +++ b/LowLevelIL/LLILSignedLessEqual.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILSignedLessEqual : LowLevelILInstruction + { + internal LLILSignedLessEqual( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public LowLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/LowLevelIL/LLILSignedLessThan.cs b/LowLevelIL/LLILSignedLessThan.cs new file mode 100644 index 0000000..2a99536 --- /dev/null +++ b/LowLevelIL/LLILSignedLessThan.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILSignedLessThan : LowLevelILInstruction + { + internal LLILSignedLessThan( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public LowLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/LowLevelIL/LLILStore.cs b/LowLevelIL/LLILStore.cs new file mode 100644 index 0000000..cc13e38 --- /dev/null +++ b/LowLevelIL/LLILStore.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILStore : LowLevelILInstruction + { + internal LLILStore( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Destionation + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public LowLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/LowLevelIL/LLILStoreSSA.cs b/LowLevelIL/LLILStoreSSA.cs new file mode 100644 index 0000000..11c038f --- /dev/null +++ b/LowLevelIL/LLILStoreSSA.cs @@ -0,0 +1,46 @@ +namespace BinaryNinja +{ + public sealed class LLILStoreSSA : LowLevelILInstruction + { + internal LLILStoreSSA( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Destination + { + get + { + return this.GetOperandAsExpression((OperandIndex)0); + } + } + + public ulong DestinationMemory + { + get + { + return this.RawOperands[1]; + } + } + + public ulong SourceMemory + { + get + { + return this.RawOperands[2]; + } + } + + public LowLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression((OperandIndex)3); + } + } + } +} diff --git a/LowLevelIL/LLILSub.cs b/LowLevelIL/LLILSub.cs new file mode 100644 index 0000000..4310a50 --- /dev/null +++ b/LowLevelIL/LLILSub.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILSub : LowLevelILInstruction + { + internal LLILSub( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public LowLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/LowLevelIL/LLILSubBorrow.cs b/LowLevelIL/LLILSubBorrow.cs new file mode 100644 index 0000000..f09e371 --- /dev/null +++ b/LowLevelIL/LLILSubBorrow.cs @@ -0,0 +1,38 @@ +namespace BinaryNinja +{ + public sealed class LLILSubBorrow : LowLevelILInstruction + { + internal LLILSubBorrow( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression((OperandIndex)0 ); + } + } + + public LowLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression( (OperandIndex)1 ); + } + } + + public LowLevelILInstruction Carry + { + get + { + return this.GetOperandAsExpression( (OperandIndex)2 ); + } + } + } +} diff --git a/LowLevelIL/LLILSysCall.cs b/LowLevelIL/LLILSysCall.cs new file mode 100644 index 0000000..fc99c90 --- /dev/null +++ b/LowLevelIL/LLILSysCall.cs @@ -0,0 +1,14 @@ +namespace BinaryNinja +{ + public sealed class LLILSysCall : LowLevelILInstruction + { + internal LLILSysCall( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + } +} diff --git a/LowLevelIL/LLILSysCallSSA.cs b/LowLevelIL/LLILSysCallSSA.cs new file mode 100644 index 0000000..4f55917 --- /dev/null +++ b/LowLevelIL/LLILSysCallSSA.cs @@ -0,0 +1,70 @@ +namespace BinaryNinja +{ + public sealed class LLILSysCallSSA : LowLevelILInstruction + { + internal LLILSysCallSSA( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILSSARegister[] Output + { + get + { + LLILCallOutputSSA? instruction = this.GetOperandAsExpression(0) as LLILCallOutputSSA; + + return instruction!.Destination; + } + } + + public LLILCallStackSSA Stack + { + get + { + LLILCallStackSSA? instruction = this.GetOperandAsExpression((OperandIndex)1) as LLILCallStackSSA; + + return instruction!; + } + } + + public LowLevelILSSARegister StackRegister + { + get + { + return this.Stack.Source; + } + } + + public ulong StackMemory + { + get + { + return this.Stack.SourceMemory; + } + } + + public LLILCallParameter Parameter + { + get + { + LLILCallParameter? instruction = this.GetOperandAsExpression((OperandIndex)2) as LLILCallParameter; + + return instruction!; + } + } + + public LowLevelILInstruction[] Parameters + { + get + { + LLILCallParameter? instruction = this.GetOperandAsExpression((OperandIndex)2) as LLILCallParameter; + + return instruction!.Source; + } + } + } +} diff --git a/LowLevelIL/LLILTailCall.cs b/LowLevelIL/LLILTailCall.cs new file mode 100644 index 0000000..00b621b --- /dev/null +++ b/LowLevelIL/LLILTailCall.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class LLILTailCall : LowLevelILInstruction + { + internal LLILTailCall( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Destination + { + get + { + return this.GetOperandAsExpression(0); + } + } + } +} diff --git a/LowLevelIL/LLILTailCallSSA.cs b/LowLevelIL/LLILTailCallSSA.cs new file mode 100644 index 0000000..450e385 --- /dev/null +++ b/LowLevelIL/LLILTailCallSSA.cs @@ -0,0 +1,60 @@ +namespace BinaryNinja +{ + public sealed class LLILTailCallSSA : LowLevelILInstruction + { + internal LLILTailCallSSA( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILSSARegister[] Output + { + get + { + LLILCallOutputSSA? instruction = this.GetOperandAsExpression(0) as LLILCallOutputSSA; + + return instruction!.Destination; + } + } + + public LowLevelILInstruction Destination + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + + public LowLevelILInstruction Stack + { + get + { + return this.GetOperandAsExpression((OperandIndex)2); + } + } + + public LLILCallParameter Parameter + { + get + { + LLILCallParameter? instruction = this.GetOperandAsExpression((OperandIndex)3) as LLILCallParameter; + + return instruction!; + } + } + + public LowLevelILInstruction[] Parameters + { + get + { + LLILCallParameter? instruction = this.GetOperandAsExpression((OperandIndex)3) as LLILCallParameter; + + return instruction!.Source; + } + } + } +} diff --git a/LowLevelIL/LLILTestBit.cs b/LowLevelIL/LLILTestBit.cs new file mode 100644 index 0000000..e57a117 --- /dev/null +++ b/LowLevelIL/LLILTestBit.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILTestBit : LowLevelILInstruction + { + internal LLILTestBit( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public LowLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/LowLevelIL/LLILTrap.cs b/LowLevelIL/LLILTrap.cs new file mode 100644 index 0000000..9deecc6 --- /dev/null +++ b/LowLevelIL/LLILTrap.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class LLILTrap : LowLevelILInstruction + { + internal LLILTrap( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public ulong Vector + { + get + { + return this.RawOperands[0]; + } + } + } +} diff --git a/LowLevelIL/LLILUndefined.cs b/LowLevelIL/LLILUndefined.cs new file mode 100644 index 0000000..3469f64 --- /dev/null +++ b/LowLevelIL/LLILUndefined.cs @@ -0,0 +1,14 @@ +namespace BinaryNinja +{ + public sealed class LLILUndefined : LowLevelILInstruction + { + internal LLILUndefined( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + } +} diff --git a/LowLevelIL/LLILUnimplemented.cs b/LowLevelIL/LLILUnimplemented.cs new file mode 100644 index 0000000..54ec4fd --- /dev/null +++ b/LowLevelIL/LLILUnimplemented.cs @@ -0,0 +1,14 @@ +namespace BinaryNinja +{ + public sealed class LLILUnimplemented : LowLevelILInstruction + { + internal LLILUnimplemented( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + } +} diff --git a/LowLevelIL/LLILUnimplementedMemory.cs b/LowLevelIL/LLILUnimplementedMemory.cs new file mode 100644 index 0000000..9352397 --- /dev/null +++ b/LowLevelIL/LLILUnimplementedMemory.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class LLILUnimplementedMemory : LowLevelILInstruction + { + internal LLILUnimplementedMemory( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Destination + { + get + { + return this.GetOperandAsExpression(0); + } + } + } +} diff --git a/LowLevelIL/LLILUnsignedGreaterEqual.cs b/LowLevelIL/LLILUnsignedGreaterEqual.cs new file mode 100644 index 0000000..434824c --- /dev/null +++ b/LowLevelIL/LLILUnsignedGreaterEqual.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILUnsignedGreaterEqual : LowLevelILInstruction + { + internal LLILUnsignedGreaterEqual( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public LowLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/LowLevelIL/LLILUnsignedGreaterThan.cs b/LowLevelIL/LLILUnsignedGreaterThan.cs new file mode 100644 index 0000000..3cc3231 --- /dev/null +++ b/LowLevelIL/LLILUnsignedGreaterThan.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILUnsignedGreaterThan : LowLevelILInstruction + { + internal LLILUnsignedGreaterThan( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public LowLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/LowLevelIL/LLILUnsignedLessEqual.cs b/LowLevelIL/LLILUnsignedLessEqual.cs new file mode 100644 index 0000000..2e3d8ae --- /dev/null +++ b/LowLevelIL/LLILUnsignedLessEqual.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILUnsignedLessEqual : LowLevelILInstruction + { + internal LLILUnsignedLessEqual( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public LowLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/LowLevelIL/LLILUnsignedLessThan.cs b/LowLevelIL/LLILUnsignedLessThan.cs new file mode 100644 index 0000000..7da19aa --- /dev/null +++ b/LowLevelIL/LLILUnsignedLessThan.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILUnsignedLessThan : LowLevelILInstruction + { + internal LLILUnsignedLessThan( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public LowLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/LowLevelIL/LLILXor.cs b/LowLevelIL/LLILXor.cs new file mode 100644 index 0000000..7757a90 --- /dev/null +++ b/LowLevelIL/LLILXor.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class LLILXor : LowLevelILInstruction + { + internal LLILXor( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public LowLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/LowLevelIL/LLILZeroExtend.cs b/LowLevelIL/LLILZeroExtend.cs new file mode 100644 index 0000000..3f3ebf9 --- /dev/null +++ b/LowLevelIL/LLILZeroExtend.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class LLILZeroExtend : LowLevelILInstruction + { + internal LLILZeroExtend( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) : base(function , expressionIndex , native) + { + + } + + public LowLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression(0); + } + } + } +} diff --git a/LowLevelIL/LowLevelILBasicBlock.cs b/LowLevelIL/LowLevelILBasicBlock.cs new file mode 100644 index 0000000..8eb2b56 --- /dev/null +++ b/LowLevelIL/LowLevelILBasicBlock.cs @@ -0,0 +1,326 @@ +using System; +using System.Collections.Generic; + +namespace BinaryNinja +{ + public sealed class LowLevelILBasicBlock : AbstractBasicBlock + { + internal LowLevelILFunction ILFunction { get; } + + internal LowLevelILBasicBlock( + LowLevelILFunction function, + IntPtr handle , + bool owner + ) : base(handle , owner) + { + this.ILFunction = function; + } + + internal static LowLevelILBasicBlock MustNewFromHandleEx( + LowLevelILFunction function, + IntPtr handle + ) + { + return new LowLevelILBasicBlock( + function, + NativeMethods.BNNewBasicBlockReference(handle) , + true + ); + } + + internal static LowLevelILBasicBlock? TakeHandleEx( + LowLevelILFunction function, + IntPtr handle + ) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new LowLevelILBasicBlock( + function, + handle, + true + ); + } + + public LowLevelILInstruction this[LowLevelILInstructionIndex index] + { + get + { + return this.MustGetInstruction(index); + } + } + + public LowLevelILInstruction? GetInstruction(LowLevelILInstructionIndex index) + { + if ( (ulong)index < this.Start) + { + return null; + } + + if ( (ulong)index >= this.End) + { + return null; + } + + return this.ILFunction.GetInstruction(index); + } + + public LowLevelILInstruction MustGetInstruction(LowLevelILInstructionIndex index) + { + if ( (ulong)index < this.Start) + { + throw new IndexOutOfRangeException(nameof(index)); + } + + if ( (ulong)index >= this.End) + { + throw new IndexOutOfRangeException(nameof(index)); + } + + return this.ILFunction.MustGetInstruction(index); + } + + public IEnumerable Instructions + { + get + { + for (ulong index = (ulong)this.Start; index < (ulong)this.End; index++) + { + yield return this.MustGetInstruction((LowLevelILInstructionIndex)index); + } + } + } + + public bool ContainsInstruction(LowLevelILInstructionIndex index) + { + return (ulong)index >= (ulong)this.Start && (ulong)index < (ulong)this.End; + } + + public LowLevelILBasicBlock? SourceBlock + { + get + { + return LowLevelILBasicBlock.TakeHandleEx( + this.ILFunction , + NativeMethods.BNGetBasicBlockSourceBlock(this.handle) + ); + } + } + + public LowLevelILBasicBlockEdge[] OutgoingEdges + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetBasicBlockOutgoingEdges( + this.handle , + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + (_native) => LowLevelILBasicBlockEdge.FromNativeEx( + _native , + this , + true + ) , + NativeMethods.BNFreeBasicBlockEdgeList + ); + } + } + + public LowLevelILBasicBlockEdge[] IncomingEdges + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetBasicBlockIncomingEdges( + this.handle , + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + (_native) => LowLevelILBasicBlockEdge.FromNativeEx( + _native , + this , + false + ) , + NativeMethods.BNFreeBasicBlockEdgeList + ); + } + } + + public LowLevelILBasicBlock[] GetDominators(bool post) + { + ulong arrayLength = 0; + + IntPtr arrayPointer = NativeMethods.BNGetBasicBlockDominators( + this.handle , + out arrayLength , + post + ); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer , + arrayLength , + (_native) => LowLevelILBasicBlock.MustNewFromHandleEx(this.ILFunction , _native), + NativeMethods.BNFreeBasicBlockList + ); + } + + public LowLevelILBasicBlock[] Dominators + { + get + { + return this.GetDominators(false); + } + } + + public LowLevelILBasicBlock[] PostDominators + { + get + { + return this.GetDominators(true); + } + } + + public LowLevelILBasicBlock[] GetStrictDominators(bool post) + { + ulong arrayLength = 0; + + IntPtr arrayPointer = NativeMethods.BNGetBasicBlockStrictDominators( + this.handle , + out arrayLength , + post + ); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer , + arrayLength , + (_native) => LowLevelILBasicBlock.MustNewFromHandleEx(this.ILFunction , _native), + NativeMethods.BNFreeBasicBlockList + ); + } + + public LowLevelILBasicBlock[] StrictDominators + { + get + { + return this.GetStrictDominators(false); + } + } + + public LowLevelILBasicBlock[] StrictPostDominators + { + get + { + return this.GetStrictDominators(true); + } + } + + public LowLevelILBasicBlock? GetImmediateDominator(bool post) + { + return LowLevelILBasicBlock.TakeHandleEx( + this.ILFunction, + NativeMethods.BNGetBasicBlockImmediateDominator(this.handle , post) + ); + } + + public LowLevelILBasicBlock? ImmediateDominator + { + get + { + return this.GetImmediateDominator(false); + } + } + + public LowLevelILBasicBlock? ImmediatePostDominator + { + get + { + return this.GetImmediateDominator(true); + } + } + + public LowLevelILBasicBlock[] GetDominatorTreeChildren(bool post) + { + ulong arrayLength = 0; + + IntPtr arrayPointer = NativeMethods.BNGetBasicBlockDominatorTreeChildren( + this.handle , + out arrayLength , + post + ); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer , + arrayLength , + (_native) => LowLevelILBasicBlock.MustNewFromHandleEx(this.ILFunction , _native), + NativeMethods.BNFreeBasicBlockList + ); + } + + public LowLevelILBasicBlock[] DominatorTreeChildren + { + get + { + return this.GetDominatorTreeChildren(false); + } + } + + public LowLevelILBasicBlock[] PostDominatorTreeChildren + { + get + { + return this.GetDominatorTreeChildren(true); + } + } + + public LowLevelILBasicBlock[] GetDominanceFrontier(bool post) + { + ulong arrayLength = 0; + + IntPtr arrayPointer = NativeMethods.BNGetBasicBlockDominanceFrontier( + this.handle , + out arrayLength , + post + ); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer , + arrayLength , + (_native) => LowLevelILBasicBlock.MustNewFromHandleEx(this.ILFunction , _native), + NativeMethods.BNFreeBasicBlockList + ); + } + + public LowLevelILBasicBlock[] DominanceFrontier + { + get + { + return this.GetDominanceFrontier(false); + } + } + + public LowLevelILBasicBlock[] PostDominanceFrontier + { + get + { + return this.GetDominanceFrontier(true); + } + } + + public void PrepareToCopy() + { + NativeMethods.BNPrepareToCopyLowLevelILBasicBlock( + this.ILFunction.DangerousGetHandle(), + this.DangerousGetHandle() + ); + } + + } +} diff --git a/LowLevelIL/LowLevelILBasicBlockEdge.cs b/LowLevelIL/LowLevelILBasicBlockEdge.cs new file mode 100644 index 0000000..63ee6de --- /dev/null +++ b/LowLevelIL/LowLevelILBasicBlockEdge.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; + +namespace BinaryNinja +{ + public sealed class LowLevelILBasicBlockEdge : AbstractBasicBlockEdge + { + internal LowLevelILBasicBlockEdge( + BNBasicBlockEdge native , + LowLevelILBasicBlock source, + LowLevelILBasicBlock target, + bool outgoing + ) : base(native, source , target , outgoing) + { + + } + + internal static LowLevelILBasicBlockEdge FromNativeEx( + BNBasicBlockEdge native , + LowLevelILBasicBlock me, + bool outgoing + ) + { + if (outgoing) + { + return new LowLevelILBasicBlockEdge( + native, + me , + LowLevelILBasicBlock.MustNewFromHandleEx(me.ILFunction, native.target), + outgoing + ); + } + else + { + return new LowLevelILBasicBlockEdge( + native, + LowLevelILBasicBlock.MustNewFromHandleEx(me.ILFunction,native.target) , + me, + outgoing + ); + } + } + } +} diff --git a/LowLevelIL/LowLevelILFlag.cs b/LowLevelIL/LowLevelILFlag.cs new file mode 100644 index 0000000..4a7ff82 --- /dev/null +++ b/LowLevelIL/LowLevelILFlag.cs @@ -0,0 +1,27 @@ +namespace BinaryNinja +{ + public sealed class LowLevelILFlag : ILFlag + { + public LowLevelILFunction ILFunction { get; } + + public LowLevelILFlag(LowLevelILFunction function , ILFlag flag) + : base(flag) + { + this.ILFunction = function; + } + + public LowLevelILFlag( LowLevelILFlag other) + : base(other) + { + this.ILFunction = other.ILFunction; + } + + public ulong[] Versions + { + get + { + return this.ILFunction.SSAForm.GetFlagSSAVersions(this.Index); + } + } + } +} diff --git a/LowLevelIL/LowLevelILFlowGraph.cs b/LowLevelIL/LowLevelILFlowGraph.cs new file mode 100644 index 0000000..6399123 --- /dev/null +++ b/LowLevelIL/LowLevelILFlowGraph.cs @@ -0,0 +1,158 @@ +using System; + +namespace BinaryNinja +{ + public sealed class LowLevelILFlowGraph : AbstractFlowGraph + { + internal LowLevelILFunction ILFunction { get; set; } + + internal LowLevelILFlowGraph( + LowLevelILFunction ilFunction, + IntPtr handle , + bool owner + ) : base(handle , owner) + { + this.ILFunction = ilFunction; + } + + internal static LowLevelILFlowGraph? NewFromHandleEx( + LowLevelILFunction ilFunction, + IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new LowLevelILFlowGraph( + ilFunction, + NativeMethods.BNNewFlowGraphReference(handle) , + true + ); + } + + internal static LowLevelILFlowGraph MustNewFromHandleEx( + LowLevelILFunction ilFunction, + IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new LowLevelILFlowGraph( + ilFunction, + NativeMethods.BNNewFlowGraphReference(handle) , + true + ); + } + + internal static LowLevelILFlowGraph? TakeHandleEx( + LowLevelILFunction ilFunction, + IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new LowLevelILFlowGraph(ilFunction , handle, true); + } + + internal static LowLevelILFlowGraph MustTakeHandleEx( + LowLevelILFunction ilFunction, + IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new LowLevelILFlowGraph(ilFunction , handle, true); + } + + internal static LowLevelILFlowGraph? BorrowHandleEx( + LowLevelILFunction ilFunction, + IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new LowLevelILFlowGraph(ilFunction , handle, false); + } + + internal static LowLevelILFlowGraph MustBorrowHandleEx( + LowLevelILFunction ilFunction, + IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new LowLevelILFlowGraph(ilFunction , handle, false); + } + + + public LowLevelILFlowGraph? Update() + { + return LowLevelILFlowGraph.TakeHandleEx( + this.ILFunction, + NativeMethods.BNUpdateFlowGraph(this.handle ) + ); + } + + public LowLevelILFlowGraphNode[] Nodes + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetFlowGraphNodes( + this.handle, + out ulong arrayLength + ); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer , + arrayLength , + (_native) => LowLevelILFlowGraphNode.MustNewFromHandleEx(this.ILFunction,_native) , + NativeMethods.BNFreeFlowGraphNodeList + ); + } + } + + public LowLevelILFlowGraphNode? GetNode(ulong index) + { + return LowLevelILFlowGraphNode.TakeHandleEx( + this.ILFunction, + NativeMethods.BNGetFlowGraphNode(this.handle, index) + ); + } + + + public LowLevelILFlowGraphNode[] GetNodesInRegion( + int left , + int top , + int right , + int bottom + ) + { + IntPtr arrayPointer = NativeMethods.BNGetFlowGraphNodesInRegion( + this.handle, + left, + top, + right, + bottom, + out ulong arrayLength + ); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer, + arrayLength, + (_native) => LowLevelILFlowGraphNode.MustNewFromHandleEx(this.ILFunction,_native) , + NativeMethods.BNFreeFlowGraphNodeList + ); + } + } +} diff --git a/LowLevelIL/LowLevelILFlowGraphEdge.cs b/LowLevelIL/LowLevelILFlowGraphEdge.cs new file mode 100644 index 0000000..d11d20e --- /dev/null +++ b/LowLevelIL/LowLevelILFlowGraphEdge.cs @@ -0,0 +1,24 @@ +namespace BinaryNinja +{ + public sealed class LowLevelILFlowGraphEdge : AbstractFlowGraphEdge + { + public LowLevelILFlowGraphEdge( + LowLevelILFunction ilFunction, + BNFlowGraphEdge native) + : base(native , LowLevelILFlowGraphNode.NewFromHandleEx(ilFunction, native.target)) + { + + } + + internal static LowLevelILFlowGraphEdge FromNativeEx( + LowLevelILFunction ilFunction, + BNFlowGraphEdge native + ) + { + return new LowLevelILFlowGraphEdge( + ilFunction , + native + ); + } + } +} diff --git a/LowLevelIL/LowLevelILFlowGraphNode.cs b/LowLevelIL/LowLevelILFlowGraphNode.cs new file mode 100644 index 0000000..6d833df --- /dev/null +++ b/LowLevelIL/LowLevelILFlowGraphNode.cs @@ -0,0 +1,170 @@ +using System; + +namespace BinaryNinja +{ + public class LowLevelILFlowGraphNode : FlowGraphNode + { + internal LowLevelILFunction ILFunction { get; set; } + + internal LowLevelILFlowGraphNode( + LowLevelILFunction ilFunction, + IntPtr handle , + bool owner) + : base(handle , owner) + { + this.ILFunction = ilFunction; + } + + internal static LowLevelILFlowGraphNode? NewFromHandleEx( + LowLevelILFunction ilFunction, + IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new LowLevelILFlowGraphNode( + ilFunction, + NativeMethods.BNNewFlowGraphNodeReference(handle) , + true + ); + } + + internal static LowLevelILFlowGraphNode MustNewFromHandleEx( + LowLevelILFunction ilFunction, + IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new LowLevelILFlowGraphNode( + ilFunction, + NativeMethods.BNNewFlowGraphNodeReference(handle) , + true + ); + } + + internal static LowLevelILFlowGraphNode? TakeHandleEx( + LowLevelILFunction ilFunction, + IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new LowLevelILFlowGraphNode( + ilFunction, + handle, + true); + } + + internal static LowLevelILFlowGraphNode MustTakeHandleEx( + LowLevelILFunction ilFunction, + IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new LowLevelILFlowGraphNode( + ilFunction, + handle, + true); + } + + internal static LowLevelILFlowGraphNode? BorrowHandleEx( + LowLevelILFunction ilFunction, + IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new LowLevelILFlowGraphNode( + ilFunction, + handle, + false); + } + + internal static LowLevelILFlowGraphNode MustBorrowHandleEx( + LowLevelILFunction ilFunction, + IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new LowLevelILFlowGraphNode( + ilFunction, + handle, + false); + } + + + public LowLevelILBasicBlock? BasicBlock + { + get + { + return LowLevelILBasicBlock.TakeHandleEx( + this.ILFunction, + NativeMethods.BNGetFlowGraphBasicBlock(this.handle) + ); + } + + set + { + NativeMethods.BNSetFlowGraphBasicBlock( + this.handle, + null == value ? IntPtr.Zero : value.DangerousGetHandle() + ); + } + } + + public LowLevelILFlowGraphEdge[] IncomingEdges + { + get + { + ulong arrayLength = 0; + + IntPtr arrayPointer = NativeMethods.BNGetFlowGraphNodeIncomingEdges( + this.handle, + out arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer, + arrayLength, + (_native) => LowLevelILFlowGraphEdge.FromNativeEx(this.ILFunction, _native), + NativeMethods.BNFreeFlowGraphNodeEdgeList + ); + } + } + + public LowLevelILFlowGraphEdge[] OutgoingEdges + { + get + { + ulong arrayLength = 0; + + IntPtr arrayPointer = NativeMethods.BNGetFlowGraphNodeOutgoingEdges( + this.handle, + out arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer, + arrayLength, + (_native) => LowLevelILFlowGraphEdge.FromNativeEx(this.ILFunction, _native), + NativeMethods.BNFreeFlowGraphNodeEdgeList + ); + } + } + } +} diff --git a/LowLevelIL/LowLevelILSSAFlag.cs b/LowLevelIL/LowLevelILSSAFlag.cs new file mode 100644 index 0000000..169db51 --- /dev/null +++ b/LowLevelIL/LowLevelILSSAFlag.cs @@ -0,0 +1,95 @@ +using System; +using System.Collections.Generic; + +namespace BinaryNinja +{ + public sealed class LowLevelILSSAFlag + { + public LowLevelILFlag Flag { get; } + + public ulong Vesion { get; } = 0; + + public LowLevelILSSAFlag(LowLevelILFunction function , ILFlag flag , ulong vesion) + :this( new LowLevelILFlag(function , flag) , vesion ) + { + + } + + public LowLevelILSSAFlag(LowLevelILFlag flag , ulong vesion) + { + this.Flag = flag; + this.Vesion = vesion; + } + + public override string ToString() + { + return $"{this.Flag.Name}#{this.Vesion}"; + } + + public LowLevelILInstruction? Definition + { + get + { + LowLevelILInstructionIndex index = NativeMethods.BNGetLowLevelILSSAFlagDefinition( + this.Flag.ILFunction.DangerousGetHandle() , + this.Flag.Index , + this.Vesion + ); + + if ((ulong)index >= this.Flag.ILFunction.InstructionCount) + { + return null; + } + + return this.Flag.ILFunction.MustGetInstruction(index); + } + } + + public LowLevelILInstruction[] Uses + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetLowLevelILSSAFlagUses( + this.Flag.ILFunction.DangerousGetHandle() , + this.Flag.Index , + this.Vesion, + out ulong arrayLength + ); + + if (0 == arrayLength) + { + return Array.Empty(); + } + + ulong[] indices = UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNFreeILInstructionList + ); + + List instructions = new List(); + + foreach (LowLevelILInstructionIndex index in indices) + { + instructions.Add( this.Flag.ILFunction.MustGetInstruction( index ) ); + } + + return instructions.ToArray(); + } + } + + public RegisterValue Value + { + get + { + return RegisterValue.FromNative( + NativeMethods.BNGetLowLevelILSSAFlagValue( + this.Flag.ILFunction.DangerousGetHandle() , + this.Flag.Index , + this.Vesion + ) + ); + } + } + } +} diff --git a/LowLevelIL/LowLevelILSSARegister.cs b/LowLevelIL/LowLevelILSSARegister.cs new file mode 100644 index 0000000..b6e6790 --- /dev/null +++ b/LowLevelIL/LowLevelILSSARegister.cs @@ -0,0 +1,102 @@ +using System; +using System.Collections.Generic; + +namespace BinaryNinja +{ + public sealed class LowLevelILSSARegister + { + public ILRegister Register { get; } + + public ulong Vesion { get; set; } = 0; + + public LowLevelILFunction ILFunction { get; } + + public LowLevelILSSARegister(LowLevelILFunction function , ILRegister register , ulong vesion) + { + this.ILFunction = function; + + this.Register = register; + + this.Vesion = vesion; + } + + public override string ToString() + { + return $"{this.Register.Name}#{this.Vesion}"; + } + + public LowLevelILInstruction? Definition + { + get + { + LowLevelILInstructionIndex index = NativeMethods.BNGetLowLevelILSSARegisterDefinition( + this.ILFunction.DangerousGetHandle() , + this.Register.Index , + this.Vesion + ); + + if ((ulong)index >= this.ILFunction.InstructionCount) + { + return null; + } + + return this.ILFunction.MustGetInstruction(index); + } + } + + public LowLevelILInstruction[] Uses + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetLowLevelILSSARegisterUses( + this.ILFunction.DangerousGetHandle() , + this.Register.Index , + this.Vesion, + out ulong arrayLength + ); + + if (0 == arrayLength) + { + return Array.Empty(); + } + + ulong[] indices = UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNFreeILInstructionList + ); + + List instructions = new List(); + + foreach (LowLevelILInstructionIndex index in indices) + { + instructions.Add( this.ILFunction.MustGetInstruction( index ) ); + } + + return instructions.ToArray(); + } + } + + public RegisterValue Value + { + get + { + return RegisterValue.FromNative( + NativeMethods.BNGetLowLevelILSSARegisterValue( + this.ILFunction.DangerousGetHandle() , + this.Register.Index , + this.Vesion + ) + ); + } + } + + public ulong[] Versions + { + get + { + return this.ILFunction.SSAForm.GetRegisterSSAVersions(this.Register.Index); + } + } + } +} diff --git a/LowLevelIL/LowLevelILSSAVariable.cs b/LowLevelIL/LowLevelILSSAVariable.cs new file mode 100644 index 0000000..d4c28fa --- /dev/null +++ b/LowLevelIL/LowLevelILSSAVariable.cs @@ -0,0 +1,11 @@ +namespace BinaryNinja +{ + public sealed class LowLevelILSSAVariable : AbstractSSAVariable + { + public LowLevelILSSAVariable(LowLevelILVariable variable , ulong version) + :base(variable , version) + { + + } + } +} diff --git a/LowLevelIL/LowLevelILVariable.cs b/LowLevelIL/LowLevelILVariable.cs new file mode 100644 index 0000000..e4b77a4 --- /dev/null +++ b/LowLevelIL/LowLevelILVariable.cs @@ -0,0 +1,56 @@ +using System; + +namespace BinaryNinja +{ + public sealed class LowLevelILVariable : AbstractFunctionVariable + { + internal LowLevelILFunction ILFunction; + + public LowLevelILVariable(LowLevelILVariable other) + : base( + other.ILFunction.OwnerFunction , + other.Type, + other.Index, + other.Storage + ) + { + this.ILFunction = other.ILFunction; + } + + public LowLevelILVariable(LowLevelILFunction ilFunction , Variable variable) + : base(ilFunction.OwnerFunction , variable.ToNative()) + { + this.ILFunction = ilFunction; + } + + public LowLevelILVariable(LowLevelILFunction ilFunction , CoreVariable variable) + : base(ilFunction.OwnerFunction , variable.ToNative()) + { + this.ILFunction = ilFunction; + } + + + internal LowLevelILVariable(LowLevelILFunction ilFunction , BNVariable native) + : base(ilFunction.OwnerFunction , native) + { + this.ILFunction = ilFunction; + } + + internal static LowLevelILVariable FromIdentifier(LowLevelILFunction function ,ulong identifier) + { + return LowLevelILVariable.FromNative( + function, + NativeMethods.BNFromVariableIdentifier(identifier) + ); + } + + internal static LowLevelILVariable FromNative( + LowLevelILFunction function , + BNVariable native) + { + return new LowLevelILVariable(function, native); + } + + + } +} diff --git a/MediumLevelIL/MLILAdd.cs b/MediumLevelIL/MLILAdd.cs new file mode 100644 index 0000000..2fe8126 --- /dev/null +++ b/MediumLevelIL/MLILAdd.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class MLILAdd : MediumLevelILInstruction + { + internal MLILAdd( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public MediumLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/MediumLevelIL/MLILAddCarry.cs b/MediumLevelIL/MLILAddCarry.cs new file mode 100644 index 0000000..62b970b --- /dev/null +++ b/MediumLevelIL/MLILAddCarry.cs @@ -0,0 +1,38 @@ +namespace BinaryNinja +{ + public sealed class MLILAddCarry : MediumLevelILInstruction + { + internal MLILAddCarry( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public MediumLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + + public MediumLevelILInstruction Carry + { + get + { + return this.GetOperandAsExpression((OperandIndex)2); + } + } + } +} diff --git a/MediumLevelIL/MLILAddOverflow.cs b/MediumLevelIL/MLILAddOverflow.cs new file mode 100644 index 0000000..d20c915 --- /dev/null +++ b/MediumLevelIL/MLILAddOverflow.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class MLILAddOverflow : MediumLevelILInstruction + { + internal MLILAddOverflow( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public MediumLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/MediumLevelIL/MLILAddressOf.cs b/MediumLevelIL/MLILAddressOf.cs new file mode 100644 index 0000000..71a68d2 --- /dev/null +++ b/MediumLevelIL/MLILAddressOf.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class MLILAddressOf : MediumLevelILInstruction + { + internal MLILAddressOf( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILVariable Source + { + get + { + return this.GetOperandAsVariable(0); + } + } + } +} diff --git a/MediumLevelIL/MLILAddressOfField.cs b/MediumLevelIL/MLILAddressOfField.cs new file mode 100644 index 0000000..fd8170a --- /dev/null +++ b/MediumLevelIL/MLILAddressOfField.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class MLILAddressOfField : MediumLevelILInstruction + { + internal MLILAddressOfField( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILVariable Source + { + get + { + return this.GetOperandAsVariable(0); + } + } + + public ulong Offset + { + get + { + return this.RawOperands[1]; + } + } + } +} diff --git a/MediumLevelIL/MLILAnd.cs b/MediumLevelIL/MLILAnd.cs new file mode 100644 index 0000000..386b455 --- /dev/null +++ b/MediumLevelIL/MLILAnd.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class MLILAnd : MediumLevelILInstruction + { + internal MLILAnd( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public MediumLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/MediumLevelIL/MLILArithmeticShiftRight.cs b/MediumLevelIL/MLILArithmeticShiftRight.cs new file mode 100644 index 0000000..7e726ba --- /dev/null +++ b/MediumLevelIL/MLILArithmeticShiftRight.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class MLILArithmeticShiftRight : MediumLevelILInstruction + { + internal MLILArithmeticShiftRight( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public MediumLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/MediumLevelIL/MLILAssert.cs b/MediumLevelIL/MLILAssert.cs new file mode 100644 index 0000000..1674786 --- /dev/null +++ b/MediumLevelIL/MLILAssert.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class MLILAssert : MediumLevelILInstruction + { + internal MLILAssert( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILVariable Source + { + get + { + return this.GetOperandAsVariable(0); + } + } + + public PossibleValueSet Constraint + { + get + { + return this.GetOperandAsPossibleValueSet((OperandIndex)1); + } + } + } +} diff --git a/MediumLevelIL/MLILAssertSSA.cs b/MediumLevelIL/MLILAssertSSA.cs new file mode 100644 index 0000000..0ce4e28 --- /dev/null +++ b/MediumLevelIL/MLILAssertSSA.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class MLILAssertSSA : MediumLevelILInstruction + { + internal MLILAssertSSA( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILSSAVariable Source + { + get + { + return this.GetOperandAsSSAVariable((OperandIndex)0,(OperandIndex)1); + } + } + + public PossibleValueSet Constraint + { + get + { + return this.GetOperandAsPossibleValueSet((OperandIndex)1); + } + } + } +} diff --git a/MediumLevelIL/MLILBoolToInt.cs b/MediumLevelIL/MLILBoolToInt.cs new file mode 100644 index 0000000..aa75ab4 --- /dev/null +++ b/MediumLevelIL/MLILBoolToInt.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class MLILBoolToInt : MediumLevelILInstruction + { + internal MLILBoolToInt( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression(0); + } + } + } +} diff --git a/MediumLevelIL/MLILBreakpoint.cs b/MediumLevelIL/MLILBreakpoint.cs new file mode 100644 index 0000000..de01ac6 --- /dev/null +++ b/MediumLevelIL/MLILBreakpoint.cs @@ -0,0 +1,14 @@ +namespace BinaryNinja +{ + public sealed class MLILBreakpoint : MediumLevelILInstruction + { + internal MLILBreakpoint( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + } +} diff --git a/MediumLevelIL/MLILCall.cs b/MediumLevelIL/MLILCall.cs new file mode 100644 index 0000000..d2f6b2e --- /dev/null +++ b/MediumLevelIL/MLILCall.cs @@ -0,0 +1,38 @@ +namespace BinaryNinja +{ + public sealed class MLILCall : MediumLevelILInstruction + { + internal MLILCall( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILVariable[] Output + { + get + { + return this.GetOperandAsVariableList(0); + } + } + + public MediumLevelILInstruction Destination + { + get + { + return this.GetOperandAsExpression((OperandIndex)2); + } + } + + public MediumLevelILInstruction[] Parameters + { + get + { + return this.GetOperandAsExpressionList((OperandIndex)1); + } + } + } +} diff --git a/MediumLevelIL/MLILCallOutput.cs b/MediumLevelIL/MLILCallOutput.cs new file mode 100644 index 0000000..d856000 --- /dev/null +++ b/MediumLevelIL/MLILCallOutput.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class MLILCallOutput : MediumLevelILInstruction + { + internal MLILCallOutput( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILVariable[] Destination + { + get + { + return this.GetOperandAsVariableList(0); + } + } + } +} diff --git a/MediumLevelIL/MLILCallOutputSSA.cs b/MediumLevelIL/MLILCallOutputSSA.cs new file mode 100644 index 0000000..793718a --- /dev/null +++ b/MediumLevelIL/MLILCallOutputSSA.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class MLILCallOutputSSA : MediumLevelILInstruction + { + internal MLILCallOutputSSA( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public ulong DestinationMemory + { + get + { + return this.RawOperands[0]; + } + } + + public MediumLevelILSSAVariable[] Destination + { + get + { + return this.GetOperandAsSSAVariableList((OperandIndex)1); + } + } + } +} diff --git a/MediumLevelIL/MLILCallParam.cs b/MediumLevelIL/MLILCallParam.cs new file mode 100644 index 0000000..49a3b0a --- /dev/null +++ b/MediumLevelIL/MLILCallParam.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class MLILCallParam : MediumLevelILInstruction + { + internal MLILCallParam( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction[] Source + { + get + { + return this.GetOperandAsExpressionList(0); + } + } + } +} diff --git a/MediumLevelIL/MLILCallParamSSA.cs b/MediumLevelIL/MLILCallParamSSA.cs new file mode 100644 index 0000000..bcaac84 --- /dev/null +++ b/MediumLevelIL/MLILCallParamSSA.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class MLILCallParamSSA : MediumLevelILInstruction + { + internal MLILCallParamSSA( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public ulong SourceMemory + { + get + { + return this.RawOperands[0]; + } + } + + public MediumLevelILInstruction[] Source + { + get + { + return this.GetOperandAsExpressionList((OperandIndex)1); + } + } + } +} diff --git a/MediumLevelIL/MLILCallSSA.cs b/MediumLevelIL/MLILCallSSA.cs new file mode 100644 index 0000000..74f8ae5 --- /dev/null +++ b/MediumLevelIL/MLILCallSSA.cs @@ -0,0 +1,70 @@ +using System; + +namespace BinaryNinja +{ + public sealed class MLILCallSSA : MediumLevelILInstruction + { + internal MLILCallSSA( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILSSAVariable[] Output + { + get + { + MLILCallOutputSSA? instruction = this.GetOperandAsExpression(0) as MLILCallOutputSSA; + + if (null == instruction) + { + throw new Exception("must be MediumLevelILCallOutputSSA"); + } + + return instruction.Destination; + } + } + + public ulong OutputDestMemory + { + get + { + MLILCallOutputSSA? instruction = this.GetOperandAsExpression(0) as MLILCallOutputSSA; + + if (null == instruction) + { + throw new Exception("must be MediumLevelILCallOutputSSA"); + } + + return instruction.DestinationMemory; + } + } + + public MediumLevelILInstruction Destination + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + + public MediumLevelILInstruction[] Parameters + { + get + { + return this.GetOperandAsExpressionList((OperandIndex)2); + } + } + + public ulong SourceMemory + { + get + { + return this.RawOperands[4]; + } + } + } +} diff --git a/MediumLevelIL/MLILCallUntyped.cs b/MediumLevelIL/MLILCallUntyped.cs new file mode 100644 index 0000000..3210b94 --- /dev/null +++ b/MediumLevelIL/MLILCallUntyped.cs @@ -0,0 +1,62 @@ +using System; + +namespace BinaryNinja +{ + public sealed class MLILCallUntyped : MediumLevelILInstruction + { + internal MLILCallUntyped( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILVariable[] Output + { + get + { + MLILCallOutput? instruction = this.GetOperandAsExpression(0) as MLILCallOutput; + + if (null == instruction) + { + throw new Exception("must be MediumLevelILCallOutput"); + } + + return instruction.Destination; + } + } + + public MediumLevelILInstruction Destination + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + + public MediumLevelILInstruction[] Parameters + { + get + { + MLILCallParam? instruction = this.GetOperandAsExpression((OperandIndex)2) as MLILCallParam; + + if (null == instruction) + { + throw new Exception("must be MediumLevelILCallParam"); + } + + return instruction.Source; + } + } + + public MediumLevelILInstruction Stack + { + get + { + return this.GetOperandAsExpression((OperandIndex)3); + } + } + } +} diff --git a/MediumLevelIL/MLILCallUntypedSSA.cs b/MediumLevelIL/MLILCallUntypedSSA.cs new file mode 100644 index 0000000..9edc1dc --- /dev/null +++ b/MediumLevelIL/MLILCallUntypedSSA.cs @@ -0,0 +1,92 @@ +using System; + +namespace BinaryNinja +{ + public sealed class MLILCallUntypedSSA : MediumLevelILInstruction + { + internal MLILCallUntypedSSA( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILSSAVariable[] Output + { + get + { + MLILCallOutputSSA? instruction = this.GetOperandAsExpression(0) as MLILCallOutputSSA; + + if (null == instruction) + { + throw new Exception("must be MediumLevelILCallOutput"); + } + + return instruction.Destination; + } + } + + public ulong OutputDestinationMemory + { + get + { + MLILCallOutputSSA? instruction = this.GetOperandAsExpression(0) as MLILCallOutputSSA; + + if (null == instruction) + { + throw new Exception("must be MediumLevelILCallOutput"); + } + + return instruction.DestinationMemory; + } + } + + public MediumLevelILInstruction Destination + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + + public MediumLevelILInstruction[] Parameters + { + get + { + MLILCallParamSSA? instruction = this.GetOperandAsExpression((OperandIndex)2) as MLILCallParamSSA; + + if (null == instruction) + { + throw new Exception("must be MediumLevelILCallParam"); + } + + return instruction.Source; + } + } + + public ulong ParameterSourceMemory + { + get + { + MLILCallParamSSA? instruction = this.GetOperandAsExpression((OperandIndex)2) as MLILCallParamSSA; + + if (null == instruction) + { + throw new Exception("must be MediumLevelILCallParam"); + } + + return instruction.SourceMemory; + } + } + + public MediumLevelILInstruction Stack + { + get + { + return this.GetOperandAsExpression((OperandIndex)3); + } + } + } +} diff --git a/MediumLevelIL/MLILCeil.cs b/MediumLevelIL/MLILCeil.cs new file mode 100644 index 0000000..1ef0d65 --- /dev/null +++ b/MediumLevelIL/MLILCeil.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class MLILCeil : MediumLevelILInstruction + { + internal MLILCeil( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression(0); + } + } + } +} diff --git a/MediumLevelIL/MLILConst.cs b/MediumLevelIL/MLILConst.cs new file mode 100644 index 0000000..8b02fe1 --- /dev/null +++ b/MediumLevelIL/MLILConst.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class MLILConst : MediumLevelILInstruction + { + internal MLILConst( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public ulong Constant + { + get + { + return this.RawOperands[0]; + } + } + } +} diff --git a/MediumLevelIL/MLILConstData.cs b/MediumLevelIL/MLILConstData.cs new file mode 100644 index 0000000..e249ade --- /dev/null +++ b/MediumLevelIL/MLILConstData.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class MLILConstData : MediumLevelILInstruction + { + internal MLILConstData( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public RegisterValue ConstantData + { + get + { + return this.GetOperandAsConstantData((OperandIndex)0,(OperandIndex)1); + } + } + } +} diff --git a/MediumLevelIL/MLILConstPointer.cs b/MediumLevelIL/MLILConstPointer.cs new file mode 100644 index 0000000..0587392 --- /dev/null +++ b/MediumLevelIL/MLILConstPointer.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class MLILConstPointer : MediumLevelILInstruction + { + internal MLILConstPointer( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public ulong Constant + { + get + { + return this.RawOperands[0]; + } + } + } +} diff --git a/MediumLevelIL/MLILDivSigned.cs b/MediumLevelIL/MLILDivSigned.cs new file mode 100644 index 0000000..1309336 --- /dev/null +++ b/MediumLevelIL/MLILDivSigned.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class MLILDivSigned : MediumLevelILInstruction + { + internal MLILDivSigned( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public MediumLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/MediumLevelIL/MLILDivSignedDoublePrecision.cs b/MediumLevelIL/MLILDivSignedDoublePrecision.cs new file mode 100644 index 0000000..7f245f2 --- /dev/null +++ b/MediumLevelIL/MLILDivSignedDoublePrecision.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class MLILDivSignedDoublePrecision : MediumLevelILInstruction + { + internal MLILDivSignedDoublePrecision( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public MediumLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/MediumLevelIL/MLILDivUnsigned.cs b/MediumLevelIL/MLILDivUnsigned.cs new file mode 100644 index 0000000..492c60c --- /dev/null +++ b/MediumLevelIL/MLILDivUnsigned.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class MLILDivUnsigned : MediumLevelILInstruction + { + internal MLILDivUnsigned( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public MediumLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/MediumLevelIL/MLILDivUnsignedDoublePrecision.cs b/MediumLevelIL/MLILDivUnsignedDoublePrecision.cs new file mode 100644 index 0000000..6da00ab --- /dev/null +++ b/MediumLevelIL/MLILDivUnsignedDoublePrecision.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class MLILDivUnsignedDoublePrecision : MediumLevelILInstruction + { + internal MLILDivUnsignedDoublePrecision( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public MediumLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/MediumLevelIL/MLILEqual.cs b/MediumLevelIL/MLILEqual.cs new file mode 100644 index 0000000..3abd43c --- /dev/null +++ b/MediumLevelIL/MLILEqual.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class MLILEqual : MediumLevelILInstruction + { + internal MLILEqual( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public MediumLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/MediumLevelIL/MLILExternPointer.cs b/MediumLevelIL/MLILExternPointer.cs new file mode 100644 index 0000000..2bb59b6 --- /dev/null +++ b/MediumLevelIL/MLILExternPointer.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class MLILExternPointer : MediumLevelILInstruction + { + internal MLILExternPointer( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public ulong Constant + { + get + { + return this.RawOperands[0]; + } + } + + public ulong Offset + { + get + { + return this.RawOperands[1]; + } + } + } +} diff --git a/MediumLevelIL/MLILFloatAbs.cs b/MediumLevelIL/MLILFloatAbs.cs new file mode 100644 index 0000000..7f36ee3 --- /dev/null +++ b/MediumLevelIL/MLILFloatAbs.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class MLILFloatAbs : MediumLevelILInstruction + { + internal MLILFloatAbs( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression(0); + } + } + } +} diff --git a/MediumLevelIL/MLILFloatAdd.cs b/MediumLevelIL/MLILFloatAdd.cs new file mode 100644 index 0000000..55e1614 --- /dev/null +++ b/MediumLevelIL/MLILFloatAdd.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class MLILFloatAdd : MediumLevelILInstruction + { + internal MLILFloatAdd( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public MediumLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/MediumLevelIL/MLILFloatCompareOrdered.cs b/MediumLevelIL/MLILFloatCompareOrdered.cs new file mode 100644 index 0000000..38b9450 --- /dev/null +++ b/MediumLevelIL/MLILFloatCompareOrdered.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class MLILFloatCompareOrdered : MediumLevelILInstruction + { + internal MLILFloatCompareOrdered( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public MediumLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/MediumLevelIL/MLILFloatCompareUnordered.cs b/MediumLevelIL/MLILFloatCompareUnordered.cs new file mode 100644 index 0000000..d3308c8 --- /dev/null +++ b/MediumLevelIL/MLILFloatCompareUnordered.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class MLILFloatCompareUnordered : MediumLevelILInstruction + { + internal MLILFloatCompareUnordered( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public MediumLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/MediumLevelIL/MLILFloatConst.cs b/MediumLevelIL/MLILFloatConst.cs new file mode 100644 index 0000000..09751b3 --- /dev/null +++ b/MediumLevelIL/MLILFloatConst.cs @@ -0,0 +1,26 @@ +using System; + +namespace BinaryNinja +{ + public sealed class MLILFloatConst : MediumLevelILInstruction + { + internal MLILFloatConst( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public double Constant + { + get + { + return BitConverter.UInt64BitsToDouble( + this.RawOperands[0] + ); + } + } + } +} diff --git a/MediumLevelIL/MLILFloatConvert.cs b/MediumLevelIL/MLILFloatConvert.cs new file mode 100644 index 0000000..fc7c857 --- /dev/null +++ b/MediumLevelIL/MLILFloatConvert.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class MLILFloatConvert : MediumLevelILInstruction + { + internal MLILFloatConvert( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression(0); + } + } + } +} diff --git a/MediumLevelIL/MLILFloatDiv.cs b/MediumLevelIL/MLILFloatDiv.cs new file mode 100644 index 0000000..2814a15 --- /dev/null +++ b/MediumLevelIL/MLILFloatDiv.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class MLILFloatDiv : MediumLevelILInstruction + { + internal MLILFloatDiv( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public MediumLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/MediumLevelIL/MLILFloatEqual.cs b/MediumLevelIL/MLILFloatEqual.cs new file mode 100644 index 0000000..e12bdf8 --- /dev/null +++ b/MediumLevelIL/MLILFloatEqual.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class MLILFloatEqual : MediumLevelILInstruction + { + internal MLILFloatEqual( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public MediumLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/MediumLevelIL/MLILFloatGreaterOrEqual.cs b/MediumLevelIL/MLILFloatGreaterOrEqual.cs new file mode 100644 index 0000000..23bed8b --- /dev/null +++ b/MediumLevelIL/MLILFloatGreaterOrEqual.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class MLILFloatGreaterOrEqual : MediumLevelILInstruction + { + internal MLILFloatGreaterOrEqual( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public MediumLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/MediumLevelIL/MLILFloatGreaterThan.cs b/MediumLevelIL/MLILFloatGreaterThan.cs new file mode 100644 index 0000000..38bd21b --- /dev/null +++ b/MediumLevelIL/MLILFloatGreaterThan.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class MLILFloatGreaterThan : MediumLevelILInstruction + { + internal MLILFloatGreaterThan( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public MediumLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/MediumLevelIL/MLILFloatLessThan.cs b/MediumLevelIL/MLILFloatLessThan.cs new file mode 100644 index 0000000..014fcdd --- /dev/null +++ b/MediumLevelIL/MLILFloatLessThan.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class MLILFloatLessThan : MediumLevelILInstruction + { + internal MLILFloatLessThan( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public MediumLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/MediumLevelIL/MLILFloatLessThanOrEqual.cs b/MediumLevelIL/MLILFloatLessThanOrEqual.cs new file mode 100644 index 0000000..27a1f31 --- /dev/null +++ b/MediumLevelIL/MLILFloatLessThanOrEqual.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class MLILFloatLessThanOrEqual : MediumLevelILInstruction + { + internal MLILFloatLessThanOrEqual( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public MediumLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/MediumLevelIL/MLILFloatMul.cs b/MediumLevelIL/MLILFloatMul.cs new file mode 100644 index 0000000..faa1cc9 --- /dev/null +++ b/MediumLevelIL/MLILFloatMul.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class MLILFloatMul : MediumLevelILInstruction + { + internal MLILFloatMul( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public MediumLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/MediumLevelIL/MLILFloatNeg.cs b/MediumLevelIL/MLILFloatNeg.cs new file mode 100644 index 0000000..95ced3a --- /dev/null +++ b/MediumLevelIL/MLILFloatNeg.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class MLILFloatNeg : MediumLevelILInstruction + { + internal MLILFloatNeg( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression(0); + } + } + } +} diff --git a/MediumLevelIL/MLILFloatNotEqual.cs b/MediumLevelIL/MLILFloatNotEqual.cs new file mode 100644 index 0000000..af41b8c --- /dev/null +++ b/MediumLevelIL/MLILFloatNotEqual.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class MLILFloatNotEqual : MediumLevelILInstruction + { + internal MLILFloatNotEqual( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public MediumLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/MediumLevelIL/MLILFloatSquareRoot.cs b/MediumLevelIL/MLILFloatSquareRoot.cs new file mode 100644 index 0000000..235ed9f --- /dev/null +++ b/MediumLevelIL/MLILFloatSquareRoot.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class MLILFloatSquareRoot : MediumLevelILInstruction + { + internal MLILFloatSquareRoot( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression(0); + } + } + } +} diff --git a/MediumLevelIL/MLILFloatSub.cs b/MediumLevelIL/MLILFloatSub.cs new file mode 100644 index 0000000..17197ca --- /dev/null +++ b/MediumLevelIL/MLILFloatSub.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class MLILFloatSub : MediumLevelILInstruction + { + internal MLILFloatSub( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public MediumLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/MediumLevelIL/MLILFloatToInt.cs b/MediumLevelIL/MLILFloatToInt.cs new file mode 100644 index 0000000..3e1b87e --- /dev/null +++ b/MediumLevelIL/MLILFloatToInt.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class MLILFloatToInt : MediumLevelILInstruction + { + internal MLILFloatToInt( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression(0); + } + } + } +} diff --git a/MediumLevelIL/MLILFloatTruncate.cs b/MediumLevelIL/MLILFloatTruncate.cs new file mode 100644 index 0000000..0d664bc --- /dev/null +++ b/MediumLevelIL/MLILFloatTruncate.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class MLILFloatTruncate : MediumLevelILInstruction + { + internal MLILFloatTruncate( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression(0); + } + } + } +} diff --git a/MediumLevelIL/MLILFloor.cs b/MediumLevelIL/MLILFloor.cs new file mode 100644 index 0000000..8a47134 --- /dev/null +++ b/MediumLevelIL/MLILFloor.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class MLILFloor : MediumLevelILInstruction + { + internal MLILFloor( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression(0); + } + } + } +} diff --git a/MediumLevelIL/MLILForceVersion.cs b/MediumLevelIL/MLILForceVersion.cs new file mode 100644 index 0000000..e0142c4 --- /dev/null +++ b/MediumLevelIL/MLILForceVersion.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class MLILForceVersion : MediumLevelILInstruction + { + internal MLILForceVersion( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILVariable Destination + { + get + { + return this.GetOperandAsVariable(0); + } + } + + public MediumLevelILVariable Source + { + get + { + return this.GetOperandAsVariable((OperandIndex)1); + } + } + } +} diff --git a/MediumLevelIL/MLILForceVersionSSA.cs b/MediumLevelIL/MLILForceVersionSSA.cs new file mode 100644 index 0000000..913d790 --- /dev/null +++ b/MediumLevelIL/MLILForceVersionSSA.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class MLILForceVersionSSA : MediumLevelILInstruction + { + internal MLILForceVersionSSA( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILSSAVariable Destination + { + get + { + return this.GetOperandAsSSAVariable((OperandIndex)0,(OperandIndex)1); + } + } + + public MediumLevelILSSAVariable Source + { + get + { + return this.GetOperandAsSSAVariable((OperandIndex)2,(OperandIndex)3); + } + } + } +} diff --git a/MediumLevelIL/MLILFreeVariableSlot.cs b/MediumLevelIL/MLILFreeVariableSlot.cs new file mode 100644 index 0000000..6aeaa4f --- /dev/null +++ b/MediumLevelIL/MLILFreeVariableSlot.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class MLILFreeVariableSlot : MediumLevelILInstruction + { + internal MLILFreeVariableSlot( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILVariable Destination + { + get + { + return this.GetOperandAsVariable(0); + } + } + } +} diff --git a/MediumLevelIL/MLILFreeVariableSlotSSA.cs b/MediumLevelIL/MLILFreeVariableSlotSSA.cs new file mode 100644 index 0000000..e4cd87b --- /dev/null +++ b/MediumLevelIL/MLILFreeVariableSlotSSA.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class MLILFreeVariableSlotSSA : MediumLevelILInstruction + { + internal MLILFreeVariableSlotSSA( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILSSAVariable Destination + { + get + { + return this.GetOperandAsSSAVariable((OperandIndex)0,(OperandIndex)1); + } + } + + public MediumLevelILSSAVariable Prev + { + get + { + return this.GetOperandAsSSAVariable((OperandIndex)0,(OperandIndex)2); + } + } + } +} diff --git a/MediumLevelIL/MLILGoto.cs b/MediumLevelIL/MLILGoto.cs new file mode 100644 index 0000000..2af776b --- /dev/null +++ b/MediumLevelIL/MLILGoto.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class MLILGoto : MediumLevelILInstruction + { + internal MLILGoto( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstructionIndex Destination + { + get + { + return (MediumLevelILInstructionIndex)( this.RawOperands[0] ); + } + } + } +} diff --git a/MediumLevelIL/MLILIf.cs b/MediumLevelIL/MLILIf.cs new file mode 100644 index 0000000..6c5bb62 --- /dev/null +++ b/MediumLevelIL/MLILIf.cs @@ -0,0 +1,40 @@ +using System; + +namespace BinaryNinja +{ + public sealed class MLILIf : MediumLevelILInstruction + { + internal MLILIf( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Condition + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public MediumLevelILInstructionIndex TrueBranch + { + get + { + return (MediumLevelILInstructionIndex)this.RawOperands[1]; + } + } + + public MediumLevelILInstructionIndex FalseBranch + { + get + { + return (MediumLevelILInstructionIndex)this.RawOperands[2]; + } + } + } +} diff --git a/MediumLevelIL/MLILImport.cs b/MediumLevelIL/MLILImport.cs new file mode 100644 index 0000000..f59bb00 --- /dev/null +++ b/MediumLevelIL/MLILImport.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class MLILImport : MediumLevelILInstruction + { + internal MLILImport( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public ulong Constant + { + get + { + return this.RawOperands[0]; + } + } + } +} diff --git a/MediumLevelIL/MLILIntToFloat.cs b/MediumLevelIL/MLILIntToFloat.cs new file mode 100644 index 0000000..0ce9aac --- /dev/null +++ b/MediumLevelIL/MLILIntToFloat.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class MLILIntToFloat : MediumLevelILInstruction + { + internal MLILIntToFloat( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression(0); + } + } + } +} diff --git a/MediumLevelIL/MLILIntrinsic.cs b/MediumLevelIL/MLILIntrinsic.cs new file mode 100644 index 0000000..e8c9401 --- /dev/null +++ b/MediumLevelIL/MLILIntrinsic.cs @@ -0,0 +1,38 @@ +namespace BinaryNinja +{ + public sealed class MLILIntrinsic : MediumLevelILInstruction + { + internal MLILIntrinsic( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILVariable[] Output + { + get + { + return this.GetOperandAsVariableList(0); + } + } + + public Intrinsic Intrinsic + { + get + { + return this.GetOperandAsIntrinsic((OperandIndex)2); + } + } + + public MediumLevelILInstruction[] Parameters + { + get + { + return this.GetOperandAsExpressionList((OperandIndex)3); + } + } + } +} diff --git a/MediumLevelIL/MLILIntrinsicSSA.cs b/MediumLevelIL/MLILIntrinsicSSA.cs new file mode 100644 index 0000000..6029a2f --- /dev/null +++ b/MediumLevelIL/MLILIntrinsicSSA.cs @@ -0,0 +1,70 @@ +using System.Collections.Generic; + +namespace BinaryNinja +{ + public sealed class MLILIntrinsicSSA : MediumLevelILInstruction + { + internal MLILIntrinsicSSA( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILSSAVariable[] Output + { + get + { + return this.GetOperandAsSSAVariableList(0); + } + } + + public Intrinsic Intrinsic + { + get + { + return this.GetOperandAsIntrinsic((OperandIndex)2); + } + } + + public MediumLevelILInstruction[] Parameters + { + get + { + return this.GetOperandAsExpressionList((OperandIndex)3); + } + } + + public override MediumLevelILVariable[] VariablesRead + { + get + { + List variables = new List(); + + foreach (MediumLevelILInstruction parameter in Parameters) + { + variables.AddRange( parameter.VariablesRead ); + } + + return variables.ToArray(); + } + } + + public override MediumLevelILSSAVariable[] SSAVariablesRead + { + get + { + List variables = new List(); + + foreach (MediumLevelILInstruction parameter in Parameters) + { + variables.AddRange( parameter.SSAVariablesRead ); + } + + return variables.ToArray(); + } + } + } +} diff --git a/MediumLevelIL/MLILJump.cs b/MediumLevelIL/MLILJump.cs new file mode 100644 index 0000000..b85cc95 --- /dev/null +++ b/MediumLevelIL/MLILJump.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class MLILJump : MediumLevelILInstruction + { + internal MLILJump( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Destination + { + get + { + return this.GetOperandAsExpression(0); + } + } + } +} diff --git a/MediumLevelIL/MLILJumpTo.cs b/MediumLevelIL/MLILJumpTo.cs new file mode 100644 index 0000000..83cd390 --- /dev/null +++ b/MediumLevelIL/MLILJumpTo.cs @@ -0,0 +1,32 @@ +using System.Collections.Generic; + +namespace BinaryNinja +{ + public sealed class MLILJumpTo : MediumLevelILInstruction + { + internal MLILJumpTo( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Destination + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public IDictionary Targets + { + get + { + return this.GetOperandAsIntegerMap((OperandIndex)1); + } + } + } +} diff --git a/MediumLevelIL/MLILLoad.cs b/MediumLevelIL/MLILLoad.cs new file mode 100644 index 0000000..04285a0 --- /dev/null +++ b/MediumLevelIL/MLILLoad.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class MLILLoad : MediumLevelILInstruction + { + internal MLILLoad( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression(0); + } + } + } +} diff --git a/MediumLevelIL/MLILLoadSSA.cs b/MediumLevelIL/MLILLoadSSA.cs new file mode 100644 index 0000000..6afe19c --- /dev/null +++ b/MediumLevelIL/MLILLoadSSA.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class MLILLoadSSA : MediumLevelILInstruction + { + internal MLILLoadSSA( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public ulong SourceMemory + { + get + { + return this.RawOperands[1]; + } + } + } +} diff --git a/MediumLevelIL/MLILLoadStruct.cs b/MediumLevelIL/MLILLoadStruct.cs new file mode 100644 index 0000000..30685b1 --- /dev/null +++ b/MediumLevelIL/MLILLoadStruct.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class MLILLoadStruct : MediumLevelILInstruction + { + internal MLILLoadStruct( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + + public ulong Offset + { + get + { + return this.RawOperands[0]; + } + } + } +} diff --git a/MediumLevelIL/MLILLoadStructSSA.cs b/MediumLevelIL/MLILLoadStructSSA.cs new file mode 100644 index 0000000..90f5c19 --- /dev/null +++ b/MediumLevelIL/MLILLoadStructSSA.cs @@ -0,0 +1,38 @@ +namespace BinaryNinja +{ + public sealed class MLILLoadStructSSA : MediumLevelILInstruction + { + internal MLILLoadStructSSA( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + + public ulong Offset + { + get + { + return this.RawOperands[1]; + } + } + + public ulong SourceMemory + { + get + { + return this.RawOperands[2]; + } + } + } +} diff --git a/MediumLevelIL/MLILLogicalShiftLeft.cs b/MediumLevelIL/MLILLogicalShiftLeft.cs new file mode 100644 index 0000000..59dc7b6 --- /dev/null +++ b/MediumLevelIL/MLILLogicalShiftLeft.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class MLILLogicalShiftLeft : MediumLevelILInstruction + { + internal MLILLogicalShiftLeft( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public MediumLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/MediumLevelIL/MLILLogicalShiftRight.cs b/MediumLevelIL/MLILLogicalShiftRight.cs new file mode 100644 index 0000000..35536c5 --- /dev/null +++ b/MediumLevelIL/MLILLogicalShiftRight.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class MLILLogicalShiftRight : MediumLevelILInstruction + { + internal MLILLogicalShiftRight( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public MediumLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/MediumLevelIL/MLILLowPart.cs b/MediumLevelIL/MLILLowPart.cs new file mode 100644 index 0000000..9329aea --- /dev/null +++ b/MediumLevelIL/MLILLowPart.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class MLILLowPart : MediumLevelILInstruction + { + internal MLILLowPart( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression(0); + } + } + } +} diff --git a/MediumLevelIL/MLILMemoryIntrinsicOutputSSA.cs b/MediumLevelIL/MLILMemoryIntrinsicOutputSSA.cs new file mode 100644 index 0000000..1e0a14b --- /dev/null +++ b/MediumLevelIL/MLILMemoryIntrinsicOutputSSA.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class MLILMemoryIntrinsicOutputSSA : MediumLevelILInstruction + { + internal MLILMemoryIntrinsicOutputSSA( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public ulong DestinationMemory + { + get + { + return (ulong)this.RawOperands[0]; + } + } + + public MediumLevelILSSAVariable[] Output + { + get + { + return this.GetOperandAsSSAVariableList((OperandIndex)1); + } + } + } +} diff --git a/MediumLevelIL/MLILMemoryIntrinsicSSA.cs b/MediumLevelIL/MLILMemoryIntrinsicSSA.cs new file mode 100644 index 0000000..471d5c1 --- /dev/null +++ b/MediumLevelIL/MLILMemoryIntrinsicSSA.cs @@ -0,0 +1,71 @@ +using System; + +namespace BinaryNinja +{ + public sealed class MLILMemoryIntrinsicSSA : MediumLevelILInstruction + { + internal MLILMemoryIntrinsicSSA( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILSSAVariable[] Output + { + get + { + MLILMemoryIntrinsicOutputSSA? intruction = this.GetOperandAsExpression(0) as MLILMemoryIntrinsicOutputSSA; + + if (null == intruction) + { + throw new Exception("must MediumLevelILMemoryIntrinsicOutputSSA"); + } + + return intruction.Output; + } + } + + public ulong DestinationMemory + { + get + { + MLILMemoryIntrinsicOutputSSA? intruction = this.GetOperandAsExpression(0) as MLILMemoryIntrinsicOutputSSA; + + if (null == intruction) + { + throw new Exception("must MediumLevelILMemoryIntrinsicOutputSSA"); + } + + return intruction.DestinationMemory; + } + } + + + public Intrinsic Intrinsic + { + get + { + return this.GetOperandAsIntrinsic((OperandIndex)1); + } + } + + public MediumLevelILInstruction[] Parameters + { + get + { + return this.GetOperandAsExpressionList((OperandIndex)2); + } + } + + public ulong SourceMemory + { + get + { + return (ulong)this.RawOperands[4]; + } + } + } +} diff --git a/MediumLevelIL/MLILMemoryPhi.cs b/MediumLevelIL/MLILMemoryPhi.cs new file mode 100644 index 0000000..136fe31 --- /dev/null +++ b/MediumLevelIL/MLILMemoryPhi.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class MLILMemoryPhi : MediumLevelILInstruction + { + internal MLILMemoryPhi( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public ulong Destination + { + get + { + return this.RawOperands[0]; + } + } + + public ulong[] Source + { + get + { + return this.GetOperandAsIntegerArray((OperandIndex)1); + } + } + } +} diff --git a/MediumLevelIL/MLILModSigned.cs b/MediumLevelIL/MLILModSigned.cs new file mode 100644 index 0000000..c9ff9b9 --- /dev/null +++ b/MediumLevelIL/MLILModSigned.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class MLILModSigned : MediumLevelILInstruction + { + internal MLILModSigned( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public MediumLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/MediumLevelIL/MLILModSignedDoublePrecision.cs b/MediumLevelIL/MLILModSignedDoublePrecision.cs new file mode 100644 index 0000000..d035031 --- /dev/null +++ b/MediumLevelIL/MLILModSignedDoublePrecision.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class MLILModSignedDoublePrecision : MediumLevelILInstruction + { + internal MLILModSignedDoublePrecision( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public MediumLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/MediumLevelIL/MLILModUnsigned.cs b/MediumLevelIL/MLILModUnsigned.cs new file mode 100644 index 0000000..694046c --- /dev/null +++ b/MediumLevelIL/MLILModUnsigned.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class MLILModUnsigned : MediumLevelILInstruction + { + internal MLILModUnsigned( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public MediumLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/MediumLevelIL/MLILModUnsignedDoublePrecision.cs b/MediumLevelIL/MLILModUnsignedDoublePrecision.cs new file mode 100644 index 0000000..5c8886b --- /dev/null +++ b/MediumLevelIL/MLILModUnsignedDoublePrecision.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class MLILModUnsignedDoublePrecision : MediumLevelILInstruction + { + internal MLILModUnsignedDoublePrecision( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public MediumLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/MediumLevelIL/MLILMul.cs b/MediumLevelIL/MLILMul.cs new file mode 100644 index 0000000..6c508ca --- /dev/null +++ b/MediumLevelIL/MLILMul.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class MLILMul : MediumLevelILInstruction + { + internal MLILMul( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public MediumLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/MediumLevelIL/MLILMulSignedDoublePrecision.cs b/MediumLevelIL/MLILMulSignedDoublePrecision.cs new file mode 100644 index 0000000..26d8b5a --- /dev/null +++ b/MediumLevelIL/MLILMulSignedDoublePrecision.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class MLILMulSignedDoublePrecision : MediumLevelILInstruction + { + internal MLILMulSignedDoublePrecision( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public MediumLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/MediumLevelIL/MLILMulUnsignedDoublePrecision.cs b/MediumLevelIL/MLILMulUnsignedDoublePrecision.cs new file mode 100644 index 0000000..0e1f198 --- /dev/null +++ b/MediumLevelIL/MLILMulUnsignedDoublePrecision.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class MLILMulUnsignedDoublePrecision : MediumLevelILInstruction + { + internal MLILMulUnsignedDoublePrecision( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public MediumLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/MediumLevelIL/MLILNeg.cs b/MediumLevelIL/MLILNeg.cs new file mode 100644 index 0000000..f9e4405 --- /dev/null +++ b/MediumLevelIL/MLILNeg.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class MLILNeg : MediumLevelILInstruction + { + internal MLILNeg( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression(0); + } + } + } +} diff --git a/MediumLevelIL/MLILNoReturn.cs b/MediumLevelIL/MLILNoReturn.cs new file mode 100644 index 0000000..bfd653b --- /dev/null +++ b/MediumLevelIL/MLILNoReturn.cs @@ -0,0 +1,14 @@ +namespace BinaryNinja +{ + public sealed class MLILNoReturn : MediumLevelILInstruction + { + internal MLILNoReturn( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + } +} diff --git a/MediumLevelIL/MLILNop.cs b/MediumLevelIL/MLILNop.cs new file mode 100644 index 0000000..aa3cc48 --- /dev/null +++ b/MediumLevelIL/MLILNop.cs @@ -0,0 +1,14 @@ +namespace BinaryNinja +{ + public sealed class MLILNop : MediumLevelILInstruction + { + internal MLILNop( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + } +} diff --git a/MediumLevelIL/MLILNot.cs b/MediumLevelIL/MLILNot.cs new file mode 100644 index 0000000..07c937d --- /dev/null +++ b/MediumLevelIL/MLILNot.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class MLILNot : MediumLevelILInstruction + { + internal MLILNot( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression(0); + } + } + } +} diff --git a/MediumLevelIL/MLILNotEqual.cs b/MediumLevelIL/MLILNotEqual.cs new file mode 100644 index 0000000..62aa48c --- /dev/null +++ b/MediumLevelIL/MLILNotEqual.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class MLILNotEqual : MediumLevelILInstruction + { + internal MLILNotEqual( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public MediumLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/MediumLevelIL/MLILOr.cs b/MediumLevelIL/MLILOr.cs new file mode 100644 index 0000000..e74e555 --- /dev/null +++ b/MediumLevelIL/MLILOr.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class MLILOr : MediumLevelILInstruction + { + internal MLILOr( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public MediumLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/MediumLevelIL/MLILReturn.cs b/MediumLevelIL/MLILReturn.cs new file mode 100644 index 0000000..57fbe37 --- /dev/null +++ b/MediumLevelIL/MLILReturn.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class MLILReturn : MediumLevelILInstruction + { + internal MLILReturn( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction[] Source + { + get + { + return this.GetOperandAsExpressionList(0); + } + } + } +} diff --git a/MediumLevelIL/MLILReturnHint.cs b/MediumLevelIL/MLILReturnHint.cs new file mode 100644 index 0000000..4d4ce8a --- /dev/null +++ b/MediumLevelIL/MLILReturnHint.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class MLILReturnHint : MediumLevelILInstruction + { + internal MLILReturnHint( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Destination + { + get + { + return this.GetOperandAsExpression(0); + } + } + } +} diff --git a/MediumLevelIL/MLILRotateLeft.cs b/MediumLevelIL/MLILRotateLeft.cs new file mode 100644 index 0000000..23c33ca --- /dev/null +++ b/MediumLevelIL/MLILRotateLeft.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class MLILRotateLeft : MediumLevelILInstruction + { + internal MLILRotateLeft( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public MediumLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/MediumLevelIL/MLILRotateLeftCarry.cs b/MediumLevelIL/MLILRotateLeftCarry.cs new file mode 100644 index 0000000..2155aa3 --- /dev/null +++ b/MediumLevelIL/MLILRotateLeftCarry.cs @@ -0,0 +1,38 @@ +namespace BinaryNinja +{ + public sealed class MLILRotateLeftCarry : MediumLevelILInstruction + { + internal MLILRotateLeftCarry( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public MediumLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + + public MediumLevelILInstruction Carry + { + get + { + return this.GetOperandAsExpression((OperandIndex)2); + } + } + } +} diff --git a/MediumLevelIL/MLILRotateRight.cs b/MediumLevelIL/MLILRotateRight.cs new file mode 100644 index 0000000..cbfb3f1 --- /dev/null +++ b/MediumLevelIL/MLILRotateRight.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class MLILRotateRight : MediumLevelILInstruction + { + internal MLILRotateRight( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public MediumLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/MediumLevelIL/MLILRotateRightCarry.cs b/MediumLevelIL/MLILRotateRightCarry.cs new file mode 100644 index 0000000..2385558 --- /dev/null +++ b/MediumLevelIL/MLILRotateRightCarry.cs @@ -0,0 +1,38 @@ +namespace BinaryNinja +{ + public sealed class MLILRotateRightCarry : MediumLevelILInstruction + { + internal MLILRotateRightCarry( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public MediumLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + + public MediumLevelILInstruction Carry + { + get + { + return this.GetOperandAsExpression((OperandIndex)2); + } + } + } +} diff --git a/MediumLevelIL/MLILRoundToInt.cs b/MediumLevelIL/MLILRoundToInt.cs new file mode 100644 index 0000000..2569677 --- /dev/null +++ b/MediumLevelIL/MLILRoundToInt.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class MLILRoundToInt : MediumLevelILInstruction + { + internal MLILRoundToInt( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression(0); + } + } + } +} diff --git a/MediumLevelIL/MLILSeparateParamList.cs b/MediumLevelIL/MLILSeparateParamList.cs new file mode 100644 index 0000000..14ccf6b --- /dev/null +++ b/MediumLevelIL/MLILSeparateParamList.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class MLILSeparateParamList : MediumLevelILInstruction + { + internal MLILSeparateParamList( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction[] Parameters + { + get + { + return this.GetOperandAsExpressionList(0); + } + } + } +} diff --git a/MediumLevelIL/MLILSetVariable.cs b/MediumLevelIL/MLILSetVariable.cs new file mode 100644 index 0000000..f1f7b0b --- /dev/null +++ b/MediumLevelIL/MLILSetVariable.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class MLILSetVariable : MediumLevelILInstruction + { + internal MLILSetVariable( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILVariable Destination + { + get + { + return this.GetOperandAsVariable(0); + } + } + + public MediumLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/MediumLevelIL/MLILSetVariableAliased.cs b/MediumLevelIL/MLILSetVariableAliased.cs new file mode 100644 index 0000000..ae5b717 --- /dev/null +++ b/MediumLevelIL/MLILSetVariableAliased.cs @@ -0,0 +1,38 @@ +namespace BinaryNinja +{ + public sealed class MLILSetVariableAliased : MediumLevelILInstruction + { + internal MLILSetVariableAliased( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILSSAVariable Destination + { + get + { + return this.GetOperandAsSSAVariable((OperandIndex)0,(OperandIndex)1); + } + } + + public MediumLevelILSSAVariable Prev + { + get + { + return this.GetOperandAsSSAVariable((OperandIndex)0,(OperandIndex)2); + } + } + + public MediumLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression((OperandIndex)3); + } + } + } +} diff --git a/MediumLevelIL/MLILSetVariableAliasedField.cs b/MediumLevelIL/MLILSetVariableAliasedField.cs new file mode 100644 index 0000000..4a14472 --- /dev/null +++ b/MediumLevelIL/MLILSetVariableAliasedField.cs @@ -0,0 +1,62 @@ +using System.Collections.Generic; + +namespace BinaryNinja +{ + public sealed class MLILSetVariableAliasedField : MediumLevelILInstruction + { + internal MLILSetVariableAliasedField( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILSSAVariable Destination + { + get + { + return this.GetOperandAsSSAVariable((OperandIndex)0,(OperandIndex)1); + } + } + + public MediumLevelILSSAVariable Prev + { + get + { + return this.GetOperandAsSSAVariable((OperandIndex)0,(OperandIndex)2); + } + } + + public ulong Offset + { + get + { + return this.RawOperands[3]; + } + } + + public MediumLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression((OperandIndex)4); + } + } + + public override MediumLevelILSSAVariable[] SSAVariablesRead + { + get + { + List variables = new List(); + + variables.Add(this.Prev); + + variables.AddRange(this.Source.SSAVariablesRead); + + return variables.ToArray(); + } + } + } +} diff --git a/MediumLevelIL/MLILSetVariableField.cs b/MediumLevelIL/MLILSetVariableField.cs new file mode 100644 index 0000000..25bf6fa --- /dev/null +++ b/MediumLevelIL/MLILSetVariableField.cs @@ -0,0 +1,38 @@ +namespace BinaryNinja +{ + public sealed class MLILSetVariableField : MediumLevelILInstruction + { + internal MLILSetVariableField( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILVariable Destination + { + get + { + return this.GetOperandAsVariable(0); + } + } + + public ulong Offset + { + get + { + return this.RawOperands[1]; + } + } + + public MediumLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression((OperandIndex)2); + } + } + } +} diff --git a/MediumLevelIL/MLILSetVariableSSA.cs b/MediumLevelIL/MLILSetVariableSSA.cs new file mode 100644 index 0000000..72eb7ef --- /dev/null +++ b/MediumLevelIL/MLILSetVariableSSA.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class MLILSetVariableSSA : MediumLevelILInstruction + { + internal MLILSetVariableSSA( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILSSAVariable Destination + { + get + { + return this.GetOperandAsSSAVariable((OperandIndex)0 , (OperandIndex)1); + } + } + + public MediumLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression((OperandIndex)2); + } + } + } +} diff --git a/MediumLevelIL/MLILSetVariableSSAField.cs b/MediumLevelIL/MLILSetVariableSSAField.cs new file mode 100644 index 0000000..7395a06 --- /dev/null +++ b/MediumLevelIL/MLILSetVariableSSAField.cs @@ -0,0 +1,73 @@ +using System.Collections.Generic; + +namespace BinaryNinja +{ + public sealed class MLILSetVariableSSAField : MediumLevelILInstruction + { + internal MLILSetVariableSSAField( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILSSAVariable Destination + { + get + { + return this.GetOperandAsSSAVariable((OperandIndex)0,(OperandIndex)1); + } + } + + public MediumLevelILSSAVariable Prev + { + get + { + return this.GetOperandAsSSAVariable((OperandIndex)0,(OperandIndex)2); + } + } + + public ulong Offset + { + get + { + return (ulong)this.RawOperands[3]; + } + } + + public MediumLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression((OperandIndex)4); + } + } + + public override MediumLevelILSSAVariable[] SSAVariablesRead + { + get + { + List variables = new List(); + + variables.Add(this.Prev); + + variables.AddRange(this.Source.SSAVariablesRead); + + return variables.ToArray(); + } + } + + public override MediumLevelILSSAVariable[] SSAVariablesWrite + { + get + { + return new MediumLevelILSSAVariable[] + { + this.Destination + }; + } + } + } +} diff --git a/MediumLevelIL/MLILSetVariableSplit.cs b/MediumLevelIL/MLILSetVariableSplit.cs new file mode 100644 index 0000000..4b20952 --- /dev/null +++ b/MediumLevelIL/MLILSetVariableSplit.cs @@ -0,0 +1,50 @@ +namespace BinaryNinja +{ + public sealed class MLILSetVariableSplit : MediumLevelILInstruction + { + internal MLILSetVariableSplit( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILVariable High + { + get + { + return this.GetOperandAsVariable(0); + } + } + + public MediumLevelILVariable Low + { + get + { + return this.GetOperandAsVariable((OperandIndex)1); + } + } + + public MediumLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression((OperandIndex)2); + } + } + + public override MediumLevelILVariable[] VariablesWrite + { + get + { + return new MediumLevelILVariable[] + { + this.High , + this.Low + }; + } + } + } +} diff --git a/MediumLevelIL/MLILSetVariableSplitSSA.cs b/MediumLevelIL/MLILSetVariableSplitSSA.cs new file mode 100644 index 0000000..0fde7fb --- /dev/null +++ b/MediumLevelIL/MLILSetVariableSplitSSA.cs @@ -0,0 +1,58 @@ +namespace BinaryNinja +{ + public sealed class MLILSetVariableSplitSSA : MediumLevelILInstruction + { + internal MLILSetVariableSplitSSA( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILSSAVariable High + { + get + { + return this.GetOperandAsSSAVariable((OperandIndex)0,(OperandIndex)1); + } + } + + public MediumLevelILSSAVariable Low + { + get + { + return this.GetOperandAsSSAVariable((OperandIndex)2,(OperandIndex)3); + } + } + + public MediumLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression((OperandIndex)4); + } + } + + public override MediumLevelILSSAVariable[] SSAVariablesRead + { + get + { + return this.Source.SSAVariablesRead; + } + } + + public override MediumLevelILSSAVariable[] SSAVariablesWrite + { + get + { + return new MediumLevelILSSAVariable[] + { + this.High , + this.Low + }; + } + } + } +} diff --git a/MediumLevelIL/MLILSharedParamSlot.cs b/MediumLevelIL/MLILSharedParamSlot.cs new file mode 100644 index 0000000..d0e08a7 --- /dev/null +++ b/MediumLevelIL/MLILSharedParamSlot.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class MLILSharedParamSlot : MediumLevelILInstruction + { + internal MLILSharedParamSlot( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction[] Parameters + { + get + { + return this.GetOperandAsExpressionList(0); + } + } + } +} diff --git a/MediumLevelIL/MLILSignExtend.cs b/MediumLevelIL/MLILSignExtend.cs new file mode 100644 index 0000000..085f099 --- /dev/null +++ b/MediumLevelIL/MLILSignExtend.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class MLILSignExtend : MediumLevelILInstruction + { + internal MLILSignExtend( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression(0); + } + } + } +} diff --git a/MediumLevelIL/MLILSignedGreaterOrEqual.cs b/MediumLevelIL/MLILSignedGreaterOrEqual.cs new file mode 100644 index 0000000..ee4119a --- /dev/null +++ b/MediumLevelIL/MLILSignedGreaterOrEqual.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class MLILSignedGreaterOrEqual : MediumLevelILInstruction + { + internal MLILSignedGreaterOrEqual( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public MediumLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/MediumLevelIL/MLILSignedGreaterThan.cs b/MediumLevelIL/MLILSignedGreaterThan.cs new file mode 100644 index 0000000..03b1e4c --- /dev/null +++ b/MediumLevelIL/MLILSignedGreaterThan.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class MLILSignedGreaterThan : MediumLevelILInstruction + { + internal MLILSignedGreaterThan( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public MediumLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/MediumLevelIL/MLILSignedLessOrEqual.cs b/MediumLevelIL/MLILSignedLessOrEqual.cs new file mode 100644 index 0000000..f7149c0 --- /dev/null +++ b/MediumLevelIL/MLILSignedLessOrEqual.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class MLILSignedLessOrEqual : MediumLevelILInstruction + { + internal MLILSignedLessOrEqual( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public MediumLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/MediumLevelIL/MLILSignedLessThan.cs b/MediumLevelIL/MLILSignedLessThan.cs new file mode 100644 index 0000000..d04a3c0 --- /dev/null +++ b/MediumLevelIL/MLILSignedLessThan.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class MLILSignedLessThan : MediumLevelILInstruction + { + internal MLILSignedLessThan( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public MediumLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/MediumLevelIL/MLILStore.cs b/MediumLevelIL/MLILStore.cs new file mode 100644 index 0000000..3e7cd5e --- /dev/null +++ b/MediumLevelIL/MLILStore.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class MLILStore : MediumLevelILInstruction + { + internal MLILStore( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Destination + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public MediumLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/MediumLevelIL/MLILStoreSSA.cs b/MediumLevelIL/MLILStoreSSA.cs new file mode 100644 index 0000000..2f85bde --- /dev/null +++ b/MediumLevelIL/MLILStoreSSA.cs @@ -0,0 +1,46 @@ +namespace BinaryNinja +{ + public sealed class MLILStoreSSA : MediumLevelILInstruction + { + internal MLILStoreSSA( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Destination + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public ulong DestinationMemory + { + get + { + return this.RawOperands[1]; + } + } + + public ulong SourceMemory + { + get + { + return this.RawOperands[2]; + } + } + + public MediumLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression((OperandIndex)3); + } + } + } +} diff --git a/MediumLevelIL/MLILStoreStruct.cs b/MediumLevelIL/MLILStoreStruct.cs new file mode 100644 index 0000000..a7efb0f --- /dev/null +++ b/MediumLevelIL/MLILStoreStruct.cs @@ -0,0 +1,38 @@ +namespace BinaryNinja +{ + public sealed class MLILStoreStruct : MediumLevelILInstruction + { + internal MLILStoreStruct( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Destination + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public ulong Offset + { + get + { + return this.RawOperands[1]; + } + } + + public MediumLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/MediumLevelIL/MLILStoreStructSSA.cs b/MediumLevelIL/MLILStoreStructSSA.cs new file mode 100644 index 0000000..dec8bbc --- /dev/null +++ b/MediumLevelIL/MLILStoreStructSSA.cs @@ -0,0 +1,54 @@ +namespace BinaryNinja +{ + public sealed class MLILStoreStructSSA : MediumLevelILInstruction + { + internal MLILStoreStructSSA( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Destination + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public ulong Offset + { + get + { + return this.RawOperands[1]; + } + } + + public ulong DestinationMemory + { + get + { + return this.RawOperands[2]; + } + } + + public ulong SourceMemory + { + get + { + return this.RawOperands[3]; + } + } + + public MediumLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/MediumLevelIL/MLILSub.cs b/MediumLevelIL/MLILSub.cs new file mode 100644 index 0000000..254514f --- /dev/null +++ b/MediumLevelIL/MLILSub.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class MLILSub : MediumLevelILInstruction + { + internal MLILSub( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public MediumLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/MediumLevelIL/MLILSubBorrow.cs b/MediumLevelIL/MLILSubBorrow.cs new file mode 100644 index 0000000..39c5b77 --- /dev/null +++ b/MediumLevelIL/MLILSubBorrow.cs @@ -0,0 +1,38 @@ +namespace BinaryNinja +{ + public sealed class MLILSubBorrow : MediumLevelILInstruction + { + internal MLILSubBorrow( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public MediumLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + + public MediumLevelILInstruction Carry + { + get + { + return this.GetOperandAsExpression((OperandIndex)2); + } + } + } +} diff --git a/MediumLevelIL/MLILSysCall.cs b/MediumLevelIL/MLILSysCall.cs new file mode 100644 index 0000000..e9606d2 --- /dev/null +++ b/MediumLevelIL/MLILSysCall.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class MLILSysCall : MediumLevelILInstruction + { + internal MLILSysCall( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILVariable[] Output + { + get + { + return this.GetOperandAsVariableList(0); + } + } + + public MediumLevelILInstruction[] Parameters + { + get + { + return this.GetOperandAsExpressionList((OperandIndex)2); + } + } + } +} diff --git a/MediumLevelIL/MLILSysCallSSA.cs b/MediumLevelIL/MLILSysCallSSA.cs new file mode 100644 index 0000000..55496d5 --- /dev/null +++ b/MediumLevelIL/MLILSysCallSSA.cs @@ -0,0 +1,62 @@ +using System; + +namespace BinaryNinja +{ + public sealed class MLILSysCallSSA : MediumLevelILInstruction + { + internal MLILSysCallSSA( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILSSAVariable[] Output + { + get + { + MLILCallOutputSSA? instruction = this.GetOperandAsExpression(0) as MLILCallOutputSSA; + + if (null == instruction) + { + throw new Exception("must MediumLevelILCallOutputSSA"); + } + + return instruction.Destination; + } + } + + public ulong OutputDestMemory + { + get + { + MLILCallOutputSSA? instruction = this.GetOperandAsExpression(0) as MLILCallOutputSSA; + + if (null == instruction) + { + throw new Exception("must MediumLevelILCallOutputSSA"); + } + + return instruction.DestinationMemory; + } + } + + public MediumLevelILInstruction[] Parameters + { + get + { + return this.GetOperandAsExpressionList((OperandIndex)1); + } + } + + public ulong SourceMemory + { + get + { + return this.RawOperands[3]; + } + } + } +} diff --git a/MediumLevelIL/MLILSysCallUntyped.cs b/MediumLevelIL/MLILSysCallUntyped.cs new file mode 100644 index 0000000..7a314df --- /dev/null +++ b/MediumLevelIL/MLILSysCallUntyped.cs @@ -0,0 +1,54 @@ +using System; + +namespace BinaryNinja +{ + public sealed class MLILSysCallUntyped : MediumLevelILInstruction + { + internal MLILSysCallUntyped( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILVariable[] Output + { + get + { + MLILCallOutput? instruction = this.GetOperandAsExpression(0) as MLILCallOutput; + + if (null == instruction) + { + throw new Exception("must be MediumLevelILCallOutput"); + } + + return instruction.Destination; + } + } + + public MediumLevelILInstruction[] Parameters + { + get + { + MLILCallParam? instruction = this.GetOperandAsExpression((OperandIndex)1) as MLILCallParam; + + if (null == instruction) + { + throw new Exception("must be MediumLevelILCallParam"); + } + + return instruction.Source; + } + } + + public MediumLevelILInstruction Stack + { + get + { + return this.GetOperandAsExpression((OperandIndex)2); + } + } + } +} diff --git a/MediumLevelIL/MLILSysCallUntypedSSA.cs b/MediumLevelIL/MLILSysCallUntypedSSA.cs new file mode 100644 index 0000000..3915485 --- /dev/null +++ b/MediumLevelIL/MLILSysCallUntypedSSA.cs @@ -0,0 +1,84 @@ +using System; + +namespace BinaryNinja +{ + public sealed class MLILSysCallUntypedSSA : MediumLevelILInstruction + { + internal MLILSysCallUntypedSSA( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILSSAVariable[] Output + { + get + { + MLILCallOutputSSA? instruction = this.GetOperandAsExpression(0) as MLILCallOutputSSA; + + if (null == instruction) + { + throw new Exception("must MediumLevelILCallOutputSSA"); + } + + return instruction.Destination; + } + } + + public ulong OutputDestinationMemory + { + get + { + MLILCallOutputSSA? instruction = this.GetOperandAsExpression(0) as MLILCallOutputSSA; + + if (null == instruction) + { + throw new Exception("must MediumLevelILCallOutputSSA"); + } + + return instruction.DestinationMemory; + } + } + + public MediumLevelILInstruction[] Parameters + { + get + { + MLILCallParamSSA? instruction = this.GetOperandAsExpression((OperandIndex)1) as MLILCallParamSSA; + + if (null == instruction) + { + throw new Exception("must MediumLevelILCallParamSSA"); + } + + return instruction.Source; + } + } + + public ulong ParametersSourceMemory + { + get + { + MLILCallParamSSA? instruction = this.GetOperandAsExpression((OperandIndex)1) as MLILCallParamSSA; + + if (null == instruction) + { + throw new Exception("must MediumLevelILCallParamSSA"); + } + + return instruction.SourceMemory; + } + } + + public MediumLevelILInstruction Stack + { + get + { + return this.GetOperandAsExpression((OperandIndex)2); + } + } + } +} diff --git a/MediumLevelIL/MLILTailCall.cs b/MediumLevelIL/MLILTailCall.cs new file mode 100644 index 0000000..747dbde --- /dev/null +++ b/MediumLevelIL/MLILTailCall.cs @@ -0,0 +1,38 @@ +namespace BinaryNinja +{ + public sealed class MLILTailCall : MediumLevelILInstruction + { + internal MLILTailCall( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILVariable[] Output + { + get + { + return this.GetOperandAsVariableList(0); + } + } + + public MediumLevelILInstruction Destination + { + get + { + return this.GetOperandAsExpression((OperandIndex)2); + } + } + + public MediumLevelILInstruction[] Parameters + { + get + { + return this.GetOperandAsExpressionList((OperandIndex)3); + } + } + } +} diff --git a/MediumLevelIL/MLILTailCallSSA.cs b/MediumLevelIL/MLILTailCallSSA.cs new file mode 100644 index 0000000..532ce5e --- /dev/null +++ b/MediumLevelIL/MLILTailCallSSA.cs @@ -0,0 +1,70 @@ +using System; + +namespace BinaryNinja +{ + public sealed class MLILTailCallSSA : MediumLevelILInstruction + { + internal MLILTailCallSSA( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILSSAVariable[] Output + { + get + { + MLILCallOutputSSA? instruction = this.GetOperandAsExpression(0) as MLILCallOutputSSA; + + if (null == instruction) + { + throw new Exception("must be MediumLevelILCallOutputSSA"); + } + + return instruction.Destination; + } + } + + public ulong OutputDestMemory + { + get + { + MLILCallOutputSSA? instruction = this.GetOperandAsExpression(0) as MLILCallOutputSSA; + + if (null == instruction) + { + throw new Exception("must be MediumLevelILCallOutputSSA"); + } + + return instruction.DestinationMemory; + } + } + + public MediumLevelILInstruction Destination + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + + public MediumLevelILInstruction[] Parameters + { + get + { + return this.GetOperandAsExpressionList((OperandIndex)2); + } + } + + public ulong SourceMemory + { + get + { + return this.RawOperands[4]; + } + } + } +} diff --git a/MediumLevelIL/MLILTailCallUntyped.cs b/MediumLevelIL/MLILTailCallUntyped.cs new file mode 100644 index 0000000..ac2dc08 --- /dev/null +++ b/MediumLevelIL/MLILTailCallUntyped.cs @@ -0,0 +1,46 @@ +namespace BinaryNinja +{ + public sealed class MLILTailCallUntyped : MediumLevelILInstruction + { + internal MLILTailCallUntyped( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILVariable[] Output + { + get + { + return this.GetOperandAsVariableList(0); + } + } + + public MediumLevelILInstruction Dest + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + + public MediumLevelILInstruction[] Parameters + { + get + { + return this.GetOperandAsExpressionList((OperandIndex)2); + } + } + + public MediumLevelILInstruction Stack + { + get + { + return this.GetOperandAsExpression((OperandIndex)3); + } + } + } +} diff --git a/MediumLevelIL/MLILTailCallUntypedSSA.cs b/MediumLevelIL/MLILTailCallUntypedSSA.cs new file mode 100644 index 0000000..fefc561 --- /dev/null +++ b/MediumLevelIL/MLILTailCallUntypedSSA.cs @@ -0,0 +1,77 @@ +using System; + +namespace BinaryNinja +{ + public sealed class MLILTailCallUntypedSSA : MediumLevelILInstruction + { + internal MLILTailCallUntypedSSA( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILSSAVariable[] Output + { + get + { + MLILCallOutputSSA? instruction = this.GetOperandAsExpression(0) as MLILCallOutputSSA; + + if (null == instruction) + { + throw new Exception("must be MediumLevelILCallOutputSsa"); + } + + return instruction.Destination; + } + } + + public ulong OutputDestinationMemory + { + get + { + MLILCallOutputSSA? instruction = this.GetOperandAsExpression(0) as MLILCallOutputSSA; + + if (null == instruction) + { + throw new Exception("must be MediumLevelILCallOutputSsa"); + } + + return instruction.DestinationMemory; + } + } + + public MediumLevelILInstruction Destination + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + + public MediumLevelILInstruction[] Parameters + { + get + { + MLILCallParamSSA? instruction = this.GetOperandAsExpression((OperandIndex)2) as MLILCallParamSSA; + + if (null == instruction) + { + throw new Exception("must be MediumLevelILCallOutputSsa"); + } + + return instruction.Source; + } + } + + public MediumLevelILInstruction Stack + { + get + { + return this.GetOperandAsExpression((OperandIndex)3); + } + } + } +} diff --git a/MediumLevelIL/MLILTestBit.cs b/MediumLevelIL/MLILTestBit.cs new file mode 100644 index 0000000..aad3068 --- /dev/null +++ b/MediumLevelIL/MLILTestBit.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class MLILTestBit : MediumLevelILInstruction + { + internal MLILTestBit( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public MediumLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/MediumLevelIL/MLILTrap.cs b/MediumLevelIL/MLILTrap.cs new file mode 100644 index 0000000..1d247d1 --- /dev/null +++ b/MediumLevelIL/MLILTrap.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class MLILTrap : MediumLevelILInstruction + { + internal MLILTrap( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public ulong Number + { + get + { + return this.RawOperands[0]; + } + } + } +} diff --git a/MediumLevelIL/MLILUndefine.cs b/MediumLevelIL/MLILUndefine.cs new file mode 100644 index 0000000..fde1de5 --- /dev/null +++ b/MediumLevelIL/MLILUndefine.cs @@ -0,0 +1,14 @@ +namespace BinaryNinja +{ + public sealed class MLILUndefine : MediumLevelILInstruction + { + internal MLILUndefine( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + } +} diff --git a/MediumLevelIL/MLILUnimplemented.cs b/MediumLevelIL/MLILUnimplemented.cs new file mode 100644 index 0000000..d55af17 --- /dev/null +++ b/MediumLevelIL/MLILUnimplemented.cs @@ -0,0 +1,14 @@ +namespace BinaryNinja +{ + public sealed class MLILUnimplemented : MediumLevelILInstruction + { + internal MLILUnimplemented( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + } +} diff --git a/MediumLevelIL/MLILUnimplementedMemory.cs b/MediumLevelIL/MLILUnimplementedMemory.cs new file mode 100644 index 0000000..14981e8 --- /dev/null +++ b/MediumLevelIL/MLILUnimplementedMemory.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class MLILUnimplementedMemory : MediumLevelILInstruction + { + internal MLILUnimplementedMemory( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression(0); + } + } + } +} diff --git a/MediumLevelIL/MLILUnsignedGreaterOrEqual.cs b/MediumLevelIL/MLILUnsignedGreaterOrEqual.cs new file mode 100644 index 0000000..78c3648 --- /dev/null +++ b/MediumLevelIL/MLILUnsignedGreaterOrEqual.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class MLILUnsignedGreaterOrEqual : MediumLevelILInstruction + { + internal MLILUnsignedGreaterOrEqual( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public MediumLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/MediumLevelIL/MLILUnsignedGreaterThan.cs b/MediumLevelIL/MLILUnsignedGreaterThan.cs new file mode 100644 index 0000000..f6ba251 --- /dev/null +++ b/MediumLevelIL/MLILUnsignedGreaterThan.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class MLILUnsignedGreaterThan : MediumLevelILInstruction + { + internal MLILUnsignedGreaterThan( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public MediumLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/MediumLevelIL/MLILUnsignedLessOrEqual.cs b/MediumLevelIL/MLILUnsignedLessOrEqual.cs new file mode 100644 index 0000000..d5e5e79 --- /dev/null +++ b/MediumLevelIL/MLILUnsignedLessOrEqual.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class MLILUnsignedLessOrEqual : MediumLevelILInstruction + { + internal MLILUnsignedLessOrEqual( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public MediumLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/MediumLevelIL/MLILUnsignedLessThan.cs b/MediumLevelIL/MLILUnsignedLessThan.cs new file mode 100644 index 0000000..9e07d42 --- /dev/null +++ b/MediumLevelIL/MLILUnsignedLessThan.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class MLILUnsignedLessThan : MediumLevelILInstruction + { + internal MLILUnsignedLessThan( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public MediumLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/MediumLevelIL/MLILVariable.cs b/MediumLevelIL/MLILVariable.cs new file mode 100644 index 0000000..21a373d --- /dev/null +++ b/MediumLevelIL/MLILVariable.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class MLILVariable : MediumLevelILInstruction + { + internal MLILVariable( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILVariable Variable + { + get + { + return this.GetOperandAsVariable(0); + } + } + } +} diff --git a/MediumLevelIL/MLILVariableAliased.cs b/MediumLevelIL/MLILVariableAliased.cs new file mode 100644 index 0000000..25b58ae --- /dev/null +++ b/MediumLevelIL/MLILVariableAliased.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class MLILVariableAliased : MediumLevelILInstruction + { + internal MLILVariableAliased( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILSSAVariable Source + { + get + { + return this.GetOperandAsSSAVariable((OperandIndex)0,(OperandIndex)1); + } + } + } +} diff --git a/MediumLevelIL/MLILVariableAliasedField.cs b/MediumLevelIL/MLILVariableAliasedField.cs new file mode 100644 index 0000000..f4e101b --- /dev/null +++ b/MediumLevelIL/MLILVariableAliasedField.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class MLILVariableAliasedField : MediumLevelILInstruction + { + internal MLILVariableAliasedField( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILSSAVariable Source + { + get + { + return this.GetOperandAsSSAVariable((OperandIndex)0,(OperandIndex)1); + } + } + + public ulong Offset + { + get + { + return (ulong)this.RawOperands[2]; + } + } + } +} diff --git a/MediumLevelIL/MLILVariableField.cs b/MediumLevelIL/MLILVariableField.cs new file mode 100644 index 0000000..95c21ff --- /dev/null +++ b/MediumLevelIL/MLILVariableField.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class MLILVariableField : MediumLevelILInstruction + { + internal MLILVariableField( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILVariable Source + { + get + { + return this.GetOperandAsVariable(0); + } + } + + public ulong Offset + { + get + { + return (ulong)this.RawOperands[1]; + } + } + } +} diff --git a/MediumLevelIL/MLILVariablePhi.cs b/MediumLevelIL/MLILVariablePhi.cs new file mode 100644 index 0000000..1f9237c --- /dev/null +++ b/MediumLevelIL/MLILVariablePhi.cs @@ -0,0 +1,38 @@ +namespace BinaryNinja +{ + public sealed class MLILVariablePhi : MediumLevelILInstruction + { + internal MLILVariablePhi( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILSSAVariable Destination + { + get + { + return this.GetOperandAsSSAVariable((OperandIndex)0,(OperandIndex)1); + } + } + + public MediumLevelILSSAVariable[] Source + { + get + { + return this.GetOperandAsSSAVariableList((OperandIndex)2); + } + } + + public ulong SourceMemory + { + get + { + return this.RawOperands[1]; + } + } + } +} diff --git a/MediumLevelIL/MLILVariableSSA.cs b/MediumLevelIL/MLILVariableSSA.cs new file mode 100644 index 0000000..e763bcf --- /dev/null +++ b/MediumLevelIL/MLILVariableSSA.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class MLILVariableSSA : MediumLevelILInstruction + { + internal MLILVariableSSA( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILSSAVariable Variable + { + get + { + return this.GetOperandAsSSAVariable((OperandIndex)0,(OperandIndex)1); + } + } + } +} diff --git a/MediumLevelIL/MLILVariableSSAField.cs b/MediumLevelIL/MLILVariableSSAField.cs new file mode 100644 index 0000000..380cf1d --- /dev/null +++ b/MediumLevelIL/MLILVariableSSAField.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class MLILVariableSSAField : MediumLevelILInstruction + { + internal MLILVariableSSAField( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILSSAVariable Source + { + get + { + return this.GetOperandAsSSAVariable((OperandIndex)0,(OperandIndex)1); + } + } + + public ulong Offset + { + get + { + return (ulong)this.RawOperands[2]; + } + } + } +} diff --git a/MediumLevelIL/MLILVariableSplit.cs b/MediumLevelIL/MLILVariableSplit.cs new file mode 100644 index 0000000..a4b0623 --- /dev/null +++ b/MediumLevelIL/MLILVariableSplit.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class MLILVariableSplit : MediumLevelILInstruction + { + internal MLILVariableSplit( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILVariable High + { + get + { + return this.GetOperandAsVariable(0); + } + } + + public MediumLevelILVariable Low + { + get + { + return this.GetOperandAsVariable((OperandIndex)1); + } + } + } +} diff --git a/MediumLevelIL/MLILVariableSplitSSA.cs b/MediumLevelIL/MLILVariableSplitSSA.cs new file mode 100644 index 0000000..95f31ae --- /dev/null +++ b/MediumLevelIL/MLILVariableSplitSSA.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class MLILVariableSplitSSA : MediumLevelILInstruction + { + internal MLILVariableSplitSSA( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILSSAVariable High + { + get + { + return this.GetOperandAsSSAVariable((OperandIndex)0,(OperandIndex)1); + } + } + + public MediumLevelILSSAVariable Low + { + get + { + return this.GetOperandAsSSAVariable((OperandIndex)2,(OperandIndex)3); + } + } + } +} diff --git a/MediumLevelIL/MLILXor.cs b/MediumLevelIL/MLILXor.cs new file mode 100644 index 0000000..eb54c4c --- /dev/null +++ b/MediumLevelIL/MLILXor.cs @@ -0,0 +1,30 @@ +namespace BinaryNinja +{ + public sealed class MLILXor : MediumLevelILInstruction + { + internal MLILXor( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Left + { + get + { + return this.GetOperandAsExpression(0); + } + } + + public MediumLevelILInstruction Right + { + get + { + return this.GetOperandAsExpression((OperandIndex)1); + } + } + } +} diff --git a/MediumLevelIL/MLILZeroExtend.cs b/MediumLevelIL/MLILZeroExtend.cs new file mode 100644 index 0000000..24b7910 --- /dev/null +++ b/MediumLevelIL/MLILZeroExtend.cs @@ -0,0 +1,22 @@ +namespace BinaryNinja +{ + public sealed class MLILZeroExtend : MediumLevelILInstruction + { + internal MLILZeroExtend( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) :base(ilFunction, expressionIndex , native) + { + + } + + public MediumLevelILInstruction Source + { + get + { + return this.GetOperandAsExpression(0); + } + } + } +} diff --git a/MediumLevelIL/MediumLevelILBasicBlock.cs b/MediumLevelIL/MediumLevelILBasicBlock.cs new file mode 100644 index 0000000..56c0818 --- /dev/null +++ b/MediumLevelIL/MediumLevelILBasicBlock.cs @@ -0,0 +1,323 @@ +using System; +using System.Collections.Generic; + +namespace BinaryNinja +{ + public sealed class MediumLevelILBasicBlock : AbstractBasicBlock + { + internal MediumLevelILFunction ILFunction { get; } + + internal MediumLevelILBasicBlock( + MediumLevelILFunction function , + IntPtr handle , + bool owner + ) : base(handle , owner) + { + this.ILFunction = function; + } + + internal static MediumLevelILBasicBlock MustNewFromHandleEx( + MediumLevelILFunction function , + IntPtr handle) + { + return new MediumLevelILBasicBlock( + function, + NativeMethods.BNNewBasicBlockReference(handle) , + true + ); + } + + internal static MediumLevelILBasicBlock? TakeHandleEx( + MediumLevelILFunction function , + IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new MediumLevelILBasicBlock( + function, + handle, + true + ); + } + + public MediumLevelILInstruction this[MediumLevelILInstructionIndex index] + { + get + { + return this.MustGetInstructionByInstructionIndex(index); + } + } + + public MediumLevelILInstruction? GetInstructionByInstructionIndex(MediumLevelILInstructionIndex index) + { + if ( (ulong)index < this.Start) + { + return null; + } + + if ( (ulong)index >= this.End) + { + return null; + } + + return this.ILFunction.GetInstruction(index); + } + + public MediumLevelILInstruction MustGetInstructionByInstructionIndex(MediumLevelILInstructionIndex index) + { + if ( (ulong)index < this.Start) + { + throw new IndexOutOfRangeException(nameof(index)); + } + + if ( (ulong)index >= this.End) + { + throw new IndexOutOfRangeException(nameof(index)); + } + + return this.ILFunction.MustGetInstruction(index); + } + + public IEnumerable Instructions + { + get + { + for (ulong index = (ulong)this.Start; index < (ulong)this.End; index++) + { + yield return this.MustGetInstructionByInstructionIndex((MediumLevelILInstructionIndex)index); + } + } + } + + public bool ContainsInstruction(MediumLevelILInstructionIndex index) + { + return (ulong)index >= (ulong)this.Start && (ulong)index < (ulong)this.End; + } + + public MediumLevelILBasicBlock? SourceBlock + { + get + { + return MediumLevelILBasicBlock.TakeHandleEx( + this.ILFunction , + NativeMethods.BNGetBasicBlockSourceBlock(this.handle) + ); + } + } + + public MediumLevelILBasicBlockEdge[] OutgoingEdges + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetBasicBlockOutgoingEdges( + this.handle , + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + (_native) => MediumLevelILBasicBlockEdge.FromNativeEx( + _native , + this , + true + ) , + NativeMethods.BNFreeBasicBlockEdgeList + ); + } + } + + public MediumLevelILBasicBlockEdge[] IncomingEdges + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetBasicBlockIncomingEdges( + this.handle , + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + (_native) => MediumLevelILBasicBlockEdge.FromNativeEx( + _native , + this , + false + ) , + NativeMethods.BNFreeBasicBlockEdgeList + ); + } + } + + public MediumLevelILBasicBlock[] GetDominators(bool post) + { + ulong arrayLength = 0; + + IntPtr arrayPointer = NativeMethods.BNGetBasicBlockDominators( + this.handle , + out arrayLength , + post + ); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer , + arrayLength , + (_native) => MediumLevelILBasicBlock.MustNewFromHandleEx(this.ILFunction , _native), + NativeMethods.BNFreeBasicBlockList + ); + } + + public MediumLevelILBasicBlock[] Dominators + { + get + { + return this.GetDominators(false); + } + } + + public MediumLevelILBasicBlock[] PostDominators + { + get + { + return this.GetDominators(true); + } + } + + public MediumLevelILBasicBlock[] GetStrictDominators(bool post) + { + ulong arrayLength = 0; + + IntPtr arrayPointer = NativeMethods.BNGetBasicBlockStrictDominators( + this.handle , + out arrayLength , + post + ); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer , + arrayLength , + (_native) => MediumLevelILBasicBlock.MustNewFromHandleEx(this.ILFunction , _native), + NativeMethods.BNFreeBasicBlockList + ); + } + + public MediumLevelILBasicBlock[] StrictDominators + { + get + { + return this.GetStrictDominators(false); + } + } + + public MediumLevelILBasicBlock[] StrictPostDominators + { + get + { + return this.GetStrictDominators(true); + } + } + + public MediumLevelILBasicBlock? GetImmediateDominator(bool post) + { + return MediumLevelILBasicBlock.TakeHandleEx( + this.ILFunction, + NativeMethods.BNGetBasicBlockImmediateDominator(this.handle , post) + ); + } + + public MediumLevelILBasicBlock? ImmediateDominator + { + get + { + return this.GetImmediateDominator(false); + } + } + + public MediumLevelILBasicBlock? ImmediatePostDominator + { + get + { + return this.GetImmediateDominator(true); + } + } + + public MediumLevelILBasicBlock[] GetDominatorTreeChildren(bool post) + { + ulong arrayLength = 0; + + IntPtr arrayPointer = NativeMethods.BNGetBasicBlockDominatorTreeChildren( + this.handle , + out arrayLength , + post + ); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer , + arrayLength , + (_native) => MediumLevelILBasicBlock.MustNewFromHandleEx(this.ILFunction , _native), + NativeMethods.BNFreeBasicBlockList + ); + } + + public MediumLevelILBasicBlock[] DominatorTreeChildren + { + get + { + return this.GetDominatorTreeChildren(false); + } + } + + public MediumLevelILBasicBlock[] PostDominatorTreeChildren + { + get + { + return this.GetDominatorTreeChildren(true); + } + } + + public MediumLevelILBasicBlock[] GetDominanceFrontier(bool post) + { + ulong arrayLength = 0; + + IntPtr arrayPointer = NativeMethods.BNGetBasicBlockDominanceFrontier( + this.handle , + out arrayLength , + post + ); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer , + arrayLength , + (_native) => MediumLevelILBasicBlock.MustNewFromHandleEx(this.ILFunction , _native), + NativeMethods.BNFreeBasicBlockList + ); + } + + public MediumLevelILBasicBlock[] DominanceFrontier + { + get + { + return this.GetDominanceFrontier(false); + } + } + + public MediumLevelILBasicBlock[] PostDominanceFrontier + { + get + { + return this.GetDominanceFrontier(true); + } + } + + public void PrepareToCopy() + { + NativeMethods.BNPrepareToCopyMediumLevelILBasicBlock( + this.ILFunction.DangerousGetHandle(), + this.DangerousGetHandle() + ); + } + } +} diff --git a/MediumLevelIL/MediumLevelILBasicBlockEdge.cs b/MediumLevelIL/MediumLevelILBasicBlockEdge.cs new file mode 100644 index 0000000..71ce32e --- /dev/null +++ b/MediumLevelIL/MediumLevelILBasicBlockEdge.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; + +namespace BinaryNinja +{ + public sealed class MediumLevelILBasicBlockEdge : AbstractBasicBlockEdge + { + internal MediumLevelILBasicBlockEdge( + BNBasicBlockEdge native , + MediumLevelILBasicBlock source, + MediumLevelILBasicBlock target, + bool outgoing + ) : base(native, source , target , outgoing) + { + + } + + internal static MediumLevelILBasicBlockEdge FromNativeEx( + BNBasicBlockEdge native , + MediumLevelILBasicBlock me, + bool outgoing + ) + { + if (outgoing) + { + return new MediumLevelILBasicBlockEdge( + native, + me , + MediumLevelILBasicBlock.MustNewFromHandleEx(me.ILFunction, native.target), + outgoing + ); + } + else + { + return new MediumLevelILBasicBlockEdge( + native, + MediumLevelILBasicBlock.MustNewFromHandleEx(me.ILFunction,native.target) , + me, + outgoing + ); + } + } + } +} diff --git a/MediumLevelIL/MediumLevelILFlowGraph.cs b/MediumLevelIL/MediumLevelILFlowGraph.cs new file mode 100644 index 0000000..33f504c --- /dev/null +++ b/MediumLevelIL/MediumLevelILFlowGraph.cs @@ -0,0 +1,158 @@ +using System; + +namespace BinaryNinja +{ + public sealed class MediumLevelILFlowGraph : AbstractFlowGraph + { + internal MediumLevelILFunction ILFunction { get; set; } + + internal MediumLevelILFlowGraph( + MediumLevelILFunction ilFunction, + IntPtr handle , + bool owner + ) : base(handle , owner) + { + this.ILFunction = ilFunction; + } + + internal static MediumLevelILFlowGraph? NewFromHandleEx( + MediumLevelILFunction ilFunction, + IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new MediumLevelILFlowGraph( + ilFunction, + NativeMethods.BNNewFlowGraphReference(handle) , + true + ); + } + + internal static MediumLevelILFlowGraph MustNewFromHandleEx( + MediumLevelILFunction ilFunction, + IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new MediumLevelILFlowGraph( + ilFunction, + NativeMethods.BNNewFlowGraphReference(handle) , + true + ); + } + + internal static MediumLevelILFlowGraph? TakeHandleEx( + MediumLevelILFunction ilFunction, + IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new MediumLevelILFlowGraph(ilFunction , handle, true); + } + + internal static MediumLevelILFlowGraph MustTakeHandleEx( + MediumLevelILFunction ilFunction, + IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new MediumLevelILFlowGraph(ilFunction , handle, true); + } + + internal static MediumLevelILFlowGraph? BorrowHandleEx( + MediumLevelILFunction ilFunction, + IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new MediumLevelILFlowGraph(ilFunction , handle, false); + } + + internal static MediumLevelILFlowGraph MustBorrowHandleEx( + MediumLevelILFunction ilFunction, + IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new MediumLevelILFlowGraph(ilFunction , handle, false); + } + + + public MediumLevelILFlowGraph? Update() + { + return MediumLevelILFlowGraph.TakeHandleEx( + this.ILFunction, + NativeMethods.BNUpdateFlowGraph(this.handle ) + ); + } + + public MediumLevelILFlowGraphNode[] Nodes + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetFlowGraphNodes( + this.handle, + out ulong arrayLength + ); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer , + arrayLength , + (_native) => MediumLevelILFlowGraphNode.MustNewFromHandleEx(this.ILFunction,_native) , + NativeMethods.BNFreeFlowGraphNodeList + ); + } + } + + public MediumLevelILFlowGraphNode? GetNode(ulong index) + { + return MediumLevelILFlowGraphNode.TakeHandleEx( + this.ILFunction, + NativeMethods.BNGetFlowGraphNode(this.handle, index) + ); + } + + + public MediumLevelILFlowGraphNode[] GetNodesInRegion( + int left , + int top , + int right , + int bottom + ) + { + IntPtr arrayPointer = NativeMethods.BNGetFlowGraphNodesInRegion( + this.handle, + left, + top, + right, + bottom, + out ulong arrayLength + ); + + return UnsafeUtils.TakeHandleArrayEx( + arrayPointer, + arrayLength, + (_native) => MediumLevelILFlowGraphNode.MustNewFromHandleEx(this.ILFunction,_native) , + NativeMethods.BNFreeFlowGraphNodeList + ); + } + } +} diff --git a/MediumLevelIL/MediumLevelILFlowGraphEdge.cs b/MediumLevelIL/MediumLevelILFlowGraphEdge.cs new file mode 100644 index 0000000..3abe90a --- /dev/null +++ b/MediumLevelIL/MediumLevelILFlowGraphEdge.cs @@ -0,0 +1,28 @@ +namespace BinaryNinja +{ + public sealed class MediumLevelILFlowGraphEdge : AbstractFlowGraphEdge + { + internal MediumLevelILFunction ILFunction { get; set; } + + public MediumLevelILFlowGraphEdge( + MediumLevelILFunction ilFunction, + BNFlowGraphEdge native) + : base(native , MediumLevelILFlowGraphNode.NewFromHandleEx(ilFunction, native.target)) + { + this.ILFunction = ilFunction; + } + + internal static MediumLevelILFlowGraphEdge FromNativeEx( + MediumLevelILFunction ilFunction, + BNFlowGraphEdge native + ) + { + return new MediumLevelILFlowGraphEdge( + ilFunction , + native + ); + } + } + + +} diff --git a/MediumLevelIL/MediumLevelILFlowGraphNode.cs b/MediumLevelIL/MediumLevelILFlowGraphNode.cs new file mode 100644 index 0000000..5c723b9 --- /dev/null +++ b/MediumLevelIL/MediumLevelILFlowGraphNode.cs @@ -0,0 +1,174 @@ +using System; + +namespace BinaryNinja +{ + public sealed class MediumLevelILFlowGraphNode : FlowGraphNode + { + internal MediumLevelILFunction ILFunction { get; set; } + + internal MediumLevelILFlowGraphNode( + MediumLevelILFunction ilFunction , + IntPtr handle , + bool owner) + : base(handle , owner) + { + this.ILFunction = ilFunction; + } + + internal static MediumLevelILFlowGraphNode? NewFromHandleEx( + MediumLevelILFunction ilFunction , + IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new MediumLevelILFlowGraphNode( + ilFunction , + NativeMethods.BNNewFlowGraphNodeReference(handle) , + true + ); + } + + internal static MediumLevelILFlowGraphNode MustNewFromHandleEx( + MediumLevelILFunction ilFunction , + IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new MediumLevelILFlowGraphNode( + ilFunction , + NativeMethods.BNNewFlowGraphNodeReference(handle) , + true + ); + } + + internal static MediumLevelILFlowGraphNode? TakeHandleEx( + MediumLevelILFunction ilFunction , + IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new MediumLevelILFlowGraphNode( + ilFunction , + handle , + true + ); + } + + internal static MediumLevelILFlowGraphNode MustTakeHandleEx( + MediumLevelILFunction ilFunction , + IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new MediumLevelILFlowGraphNode( + ilFunction , + handle , + true + ); + } + + internal static MediumLevelILFlowGraphNode? BorrowHandleEx( + MediumLevelILFunction ilFunction , + IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new MediumLevelILFlowGraphNode( + ilFunction , + handle , + false + ); + } + + internal static MediumLevelILFlowGraphNode MustBorrowHandleEx( + MediumLevelILFunction ilFunction , + IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new MediumLevelILFlowGraphNode( + ilFunction , + handle , + false + ); + } + + + public MediumLevelILBasicBlock? BasicBlock + { + get + { + return MediumLevelILBasicBlock.TakeHandleEx( + this.ILFunction , + NativeMethods.BNGetFlowGraphBasicBlock(this.handle) + ); + } + + set + { + NativeMethods.BNSetFlowGraphBasicBlock( + this.handle , + null == value ? IntPtr.Zero : value.DangerousGetHandle() + ); + } + } + + public MediumLevelILFlowGraphEdge[] IncomingEdges + { + get + { + ulong arrayLength = 0; + + IntPtr arrayPointer = NativeMethods.BNGetFlowGraphNodeIncomingEdges( + this.handle , + out arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + (_native) => MediumLevelILFlowGraphEdge.FromNativeEx(this.ILFunction , _native) , + NativeMethods.BNFreeFlowGraphNodeEdgeList + ); + } + } + + public MediumLevelILFlowGraphEdge[] OutgoingEdges + { + get + { + ulong arrayLength = 0; + + IntPtr arrayPointer = NativeMethods.BNGetFlowGraphNodeOutgoingEdges( + this.handle , + out arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + (_native) => MediumLevelILFlowGraphEdge.FromNativeEx(this.ILFunction , _native) , + NativeMethods.BNFreeFlowGraphNodeEdgeList + ); + } + } + } +} diff --git a/MediumLevelIL/MediumLevelILSSAVariable.cs b/MediumLevelIL/MediumLevelILSSAVariable.cs new file mode 100644 index 0000000..1461d58 --- /dev/null +++ b/MediumLevelIL/MediumLevelILSSAVariable.cs @@ -0,0 +1,99 @@ +using System; +using System.Collections.Generic; + +namespace BinaryNinja +{ + public sealed class MediumLevelILSSAVariable : AbstractSSAVariable + { + public MediumLevelILSSAVariable(MediumLevelILVariable variable , ulong version) + :base(variable, version) + { + + } + + public MediumLevelILInstruction? Definition + { + get + { + return this.Variable.ILFunction.GetExpression( + NativeMethods.BNGetMediumLevelILSSAVarDefinition( + this.Variable.ILFunction.DangerousGetHandle() , + this.Variable.ToNative() , + this.Version + ) + ); + } + } + + public MediumLevelILInstruction[] Uses + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetMediumLevelILSSAVarUses( + this.Variable.ILFunction.DangerousGetHandle() , + this.Variable.ToNative() , + this.Version , + out ulong arrayLength + ); + + ulong[] indexes = UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNFreeILInstructionList + ); + + List instructions = new List(); + + foreach (MediumLevelILExpressionIndex index in indexes) + { + instructions.Add( + this.Variable.ILFunction.MustGetExpression(index) + ); + } + + return instructions.ToArray(); + } + } + + public RegisterValue Value + { + get + { + return RegisterValue.FromNative( + NativeMethods.BNGetMediumLevelILSSAVarValue( + this.Variable.ILFunction.DangerousGetHandle() , + this.Variable.ToNative() , + this.Version + ) + ); + } + } + + public PossibleValueSet GetPossibleValues( + MediumLevelILInstructionIndex instruction , + DataFlowQueryOption[] options + ) + { + return PossibleValueSet.TakeNative( + NativeMethods.BNGetMediumLevelILPossibleSSAVarValues( + this.Variable.ILFunction.DangerousGetHandle() , + this.Variable.ToNative(), + this.Version , + instruction, + options, + (ulong)options.Length + ) + ); + } + + public bool IsLiveAt(MediumLevelILInstructionIndex instruction) + { + return NativeMethods.BNIsMediumLevelILSSAVarLiveAt( + this.Variable.ILFunction.DangerousGetHandle() , + this.Variable.ToNative() , + this.Version, + instruction + ); + } + } +} diff --git a/MediumLevelIL/MediumLevelILVariable.cs b/MediumLevelIL/MediumLevelILVariable.cs new file mode 100644 index 0000000..8f523a0 --- /dev/null +++ b/MediumLevelIL/MediumLevelILVariable.cs @@ -0,0 +1,139 @@ +using System; +using System.Collections.Generic; + +namespace BinaryNinja +{ + public sealed class MediumLevelILVariable : AbstractFunctionVariable + { + public MediumLevelILFunction ILFunction { get; } + + internal MediumLevelILVariable(MediumLevelILVariable other) + : base( + other.ILFunction.OwnerFunction, + other.Type, + other.Index, + other.Storage + ) + { + this.ILFunction = other.ILFunction; + } + + public MediumLevelILVariable(MediumLevelILFunction ilFunction , Variable variable) + : base(ilFunction.OwnerFunction , variable.ToNative() ) + { + this.ILFunction = ilFunction; + } + + public MediumLevelILVariable(MediumLevelILFunction ilFunction , CoreVariable variable) + : base(ilFunction.OwnerFunction , variable.ToNative() ) + { + this.ILFunction = ilFunction; + } + + internal MediumLevelILVariable(MediumLevelILFunction ilFunction , BNVariable native) + : base(ilFunction.OwnerFunction , native) + { + this.ILFunction = ilFunction; + } + + internal static MediumLevelILVariable FromIdentifier(MediumLevelILFunction function ,ulong identifier) + { + return MediumLevelILVariable.FromNative( + function, + NativeMethods.BNFromVariableIdentifier(identifier) + ); + } + + internal static MediumLevelILVariable FromNative( + MediumLevelILFunction function , + BNVariable native) + { + return new MediumLevelILVariable(function, native); + } + + public ulong[] SSAVersions + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetMediumLevelILVariableSSAVersions( + this.ILFunction.DangerousGetHandle() , + this.ToNative() , + out ulong arrayLength + ); + + return UnsafeUtils.TakeNumberArray( + arrayPointer, + arrayLength, + NativeMethods.BNFreeILInstructionList + ); + } + } + + public bool IsLiveAt(MediumLevelILInstructionIndex instruction) + { + return NativeMethods.BNIsMediumLevelILVarLiveAt( + this.ILFunction.DangerousGetHandle() , + this.ToNative() , + instruction + ); + } + + public MediumLevelILInstruction[] Definitions + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetMediumLevelILVariableDefinitions( + this.ILFunction.DangerousGetHandle() , + this.ToNative() , + out ulong arrayLength + ); + + ulong[] indexes = UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNFreeILInstructionList + ); + + List instructions = new List(); + + foreach (MediumLevelILExpressionIndex index in indexes) + { + instructions.Add( + this.ILFunction.MustGetExpression(index) + ); + } + + return instructions.ToArray(); + } + } + + public MediumLevelILInstruction[] Uses + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetMediumLevelILVariableUses( + this.ILFunction.DangerousGetHandle() , + this.ToNative() , + out ulong arrayLength + ); + + ulong[] indexes = UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNFreeILInstructionList + ); + + List instructions = new List(); + + foreach (MediumLevelILExpressionIndex index in indexes) + { + instructions.Add( + this.ILFunction.MustGetExpression(index) + ); + } + + return instructions.ToArray(); + } + } + } +} diff --git a/Misc/AbstractBinaryView.cs b/Misc/AbstractBinaryView.cs new file mode 100644 index 0000000..3534b61 --- /dev/null +++ b/Misc/AbstractBinaryView.cs @@ -0,0 +1,150 @@ +using System; + +namespace BinaryNinja +{ + public abstract class AbstractBinaryView : CustomBinaryView + { + protected BinaryView m_backend; + + internal AbstractBinaryView(BinaryView backend) + { + this.m_backend = backend; + } + + public override bool Init() + { + return true; + } + + public override void FreeObject() + { + + } + + public override void ExternalRefTaken() + { + + } + + public override void ExternalRefReleased() + { + + } + + public override byte[] Read(ulong offset , ulong length) + { + return this.m_backend.ReadData(offset, length); + } + + public override int Write(ulong offset , byte[] data) + { + return (int)this.m_backend.WriteData(offset , data); + } + + public override int Insert(ulong offset , byte[] data) + { + return (int)this.m_backend.InsertData(offset , data); + } + + public override ulong Remove(ulong offset , ulong length) + { + return this.m_backend.RemoveData(offset,length); + } + + public override ModificationStatus GetModification(ulong offset) + { + return this.m_backend.GetModification(offset); + } + + public override bool IsValidOffset(ulong offset) + { + return this.m_backend.IsValidOffset(offset); + } + + public override bool IsOffsetReadable(ulong offset) + { + return this.m_backend.IsOffsetReadable(offset); + } + + public override bool IsOffsetWritable(ulong offset) + { + return this.m_backend.IsOffsetWritable(offset); + } + + public override bool IsOffsetExecutable(ulong offset) + { + return this.m_backend.IsOffsetExecutable(offset); + } + + public override bool IsOffsetBackedByFile(ulong offset) + { + return this.m_backend.IsOffsetBackedByFile(offset); + } + + public override ulong GetNextValidOffset(ulong offset) + { + return this.m_backend.GetNextValidOffset(offset); + } + + public override ulong Start + { + get + { + return this.m_backend.Start; + } + } + + public override ulong Length + { + get + { + return this.m_backend.Length; + } + } + + public override ulong EntryPoint + { + get + { + return this.m_backend.EntryPoint; + } + } + + public override bool Executable + { + get + { + return this.m_backend.Executable; + } + } + + public override Endianness DefaultEndianness + { + get + { + return this.m_backend.DefaultEndiannes; + } + } + + public override bool Relocatable + { + get + { + return this.m_backend.Relocatable; + } + } + + public override ulong AddressSize + { + get + { + return this.m_backend.AddressSize; + } + } + + public override bool Save(FileAccessor accessor) + { + return this.m_backend.SaveToFile(accessor); + } + } +} diff --git a/Misc/AbstractSafeHandle.cs b/Misc/AbstractSafeHandle.cs new file mode 100644 index 0000000..d4cd240 --- /dev/null +++ b/Misc/AbstractSafeHandle.cs @@ -0,0 +1,94 @@ +using System; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + public abstract class AbstractSafeHandle : SafeHandleZeroOrMinusOneIsInvalid , + IEquatable, + IComparable + where T_SELF : AbstractSafeHandle + { + internal AbstractSafeHandle(bool owner) : base(owner) + { + + } + + internal AbstractSafeHandle(IntPtr handle , bool owner) : base(owner) + { + this.SetHandle(handle); + } + + public override bool Equals(object? other) + { + T_SELF? otherNative = other as T_SELF; + + if (otherNative is null) + { + return false; + } + + if (ReferenceEquals(this , otherNative)) + { + return true; + } + + return this.handle == otherNative.handle; + } + + public bool Equals(T_SELF? other) + { + if (other is null) + { + return false; + } + + if (ReferenceEquals(this , other)) + { + return true; + } + + return this.handle == other.handle; + } + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2218:OverrideGetHashCodeOnOverridingEquals")] + public override int GetHashCode() + { + return HashCode.Combine( (IntPtr)this.handle); + } + + public static bool operator ==(AbstractSafeHandle? left, AbstractSafeHandle? right) + { + if (left is null) + { + return right is null; + } + + return left.Equals(right); + } + + public static bool operator !=(AbstractSafeHandle? left, AbstractSafeHandle? right) + { + return !(left == right); + } + + public int CompareTo(T_SELF? other) + { + if (other is null) + { + return 1; + } + + return this.handle.CompareTo(other.handle); + } + + protected override bool ReleaseHandle() + { + if ( !this.IsInvalid ) + { + this.SetHandleAsInvalid(); + } + + return true; + } + } +} diff --git a/Misc/BinaryViewStream.cs b/Misc/BinaryViewStream.cs new file mode 100644 index 0000000..bc6abaa --- /dev/null +++ b/Misc/BinaryViewStream.cs @@ -0,0 +1,233 @@ +using System; +using System.IO; + +namespace BinaryNinja +{ + public sealed class BinaryViewStream : Stream + { + private BinaryView m_view; + + private long m_position = 0; + + private bool m_isReadOnly = false; + + public BinaryViewStream( + BinaryView view , + bool isReadOnly = false + ) + { + this.m_view = view; + + this.m_isReadOnly = isReadOnly; + } + + public override void Flush() + { + + } + + public override int Read(byte[] buffer , int offset , int count) + { + if (null == buffer) + { + throw new ArgumentNullException(nameof(buffer)); + } + + if ( ( offset < 0 ) || ( offset > buffer.Length ) ) + { + throw new ArgumentOutOfRangeException(nameof(offset)); + } + + if ( ( count < 0) || ( count > (buffer.Length - offset) ) ) + { + throw new ArgumentOutOfRangeException(nameof(count)); + } + + if (this.Position >= this.Length) + { + return 0; + } + + long remaining = this.Length - this.Position; + + int toRead = (int)Math.Min(remaining, (long)count); + + if (toRead <= 0) + { + return 0; + } + + byte[] data = this.m_view.ReadData( + (ulong)this.m_position, + (ulong)toRead + ); + + if (( null == data ) || ( 0 == data.Length )) + { + return 0; + } + + Array.Copy( + data, + 0, + buffer, + offset, + data.Length + ); + + this.m_position += data.Length; + + return data.Length; + } + + public override long Seek(long offset , SeekOrigin origin) + { + long pos = this.m_position; + + switch (origin) + { + case SeekOrigin.Begin: + { + pos = offset; + break; + } + + case SeekOrigin.Current: + { + pos = this.m_position + offset; + break; + } + + case SeekOrigin.End: + { + pos = checked(this.Length + offset); + break; + } + + default: + { + throw new ArgumentOutOfRangeException(nameof(origin)); + } + } + + if (pos < 0 ) + { + throw new IOException(); + } + + this.m_position = pos; + + return this.m_position; + } + + public override void SetLength(long value) + { + throw new NotSupportedException(); + } + + public override void Write(byte[] buffer , int offset , int count) + { + if (null == buffer) + { + throw new ArgumentNullException(nameof(buffer)); + } + + if ( ( offset < 0 ) || ( offset > buffer.Length ) ) + { + throw new ArgumentOutOfRangeException(nameof(offset)); + } + + if ( ( count < 0) || ( count > (buffer.Length - offset) ) ) + { + throw new ArgumentOutOfRangeException(nameof(count)); + } + + if (this.m_position >= this.Length) + { + throw new IOException(); + } + + long remaining = this.Length - m_position; + + if (remaining <= 0) + { + return; + //throw new IOException("Attempt to write past end of stream"); + } + + int toWrite = (int)Math.Min(remaining, (long)count); + + if (toWrite <= 0) + { + return; + } + + byte[] slice = new byte[toWrite]; + + Array.Copy( + buffer, + offset, + slice, + 0, + toWrite + ); + + ulong written = this.m_view.WriteData( + (ulong)this.m_position, + slice + ); + + if ((long)written != toWrite) + { + throw new IOException("Failed to write the expected number of bytes to the BinaryView."); + } + + this.m_position += (long)written; + } + + public override bool CanRead + { + get + { + return true; + } + } + + public override bool CanSeek + { + get + { + return true; + } + } + + public override bool CanWrite + { + get + { + return !this.m_isReadOnly; + } + } + + public override long Length + { + get + { + return (long)this.m_view.Length; + } + } + + public override long Position + { + get + { + return this.m_position; + } + + set + { + this.m_position = value; + } + } + } +} diff --git a/Misc/NativeWrapper.cs b/Misc/NativeWrapper.cs new file mode 100644 index 0000000..995231f --- /dev/null +++ b/Misc/NativeWrapper.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; + +namespace BinaryNinja +{ + internal interface INativeWrapper + { + internal T ToNative(); + } + + internal interface INativeWrapperEx + { + internal T ToNativeEx(ScopedAllocator allocator); + } +} diff --git a/README.md b/README.md new file mode 100644 index 0000000..139597f --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ + + diff --git a/Report/AbstractReport.cs b/Report/AbstractReport.cs new file mode 100644 index 0000000..b1b74b0 --- /dev/null +++ b/Report/AbstractReport.cs @@ -0,0 +1,53 @@ +namespace BinaryNinja +{ + public abstract class AbstractReport : IReport + { + protected ReportCollection m_collection; + + protected ulong m_index; + + internal AbstractReport(ReportCollection collection , ulong index) + { + this.m_collection = collection; + this.m_index = index; + } + + public ReportType Type + { + get + { + return NativeMethods.BNGetReportType( + this.m_collection.DangerousGetHandle() , + this.m_index + ); + } + } + + public string Title + { + get + { + return UnsafeUtils.TakeUtf8String( + NativeMethods.BNGetReportTitle( + this.m_collection.DangerousGetHandle() , + this.m_index + ) + ); + } + } + + public BinaryView? View + { + get + { + return BinaryView.TakeHandle( + NativeMethods.BNGetReportView( + this.m_collection.DangerousGetHandle(), this.m_index) + ); + + } + } + + + } +} diff --git a/Report/FlowGraphReport.cs b/Report/FlowGraphReport.cs new file mode 100644 index 0000000..415ac6c --- /dev/null +++ b/Report/FlowGraphReport.cs @@ -0,0 +1,25 @@ +namespace BinaryNinja +{ + public sealed class FlowGraphReport : AbstractReport + { + internal FlowGraphReport(ReportCollection collection , ulong index): + base(collection, index) + { + + } + + public FlowGraph FlowGraph + { + get + { + return FlowGraph.MustTakeHandle( + NativeMethods.BNGetReportFlowGraph( + this.m_collection.DangerousGetHandle() , + this.m_index + ) + ); + } + } + + } +} diff --git a/Report/HTMLReport.cs b/Report/HTMLReport.cs new file mode 100644 index 0000000..4ead666 --- /dev/null +++ b/Report/HTMLReport.cs @@ -0,0 +1,37 @@ +namespace BinaryNinja +{ + public sealed class HTMLReport : AbstractReport + { + internal HTMLReport(ReportCollection collection , ulong index): + base(collection, index) + { + + } + + public string Contents + { + get + { + return UnsafeUtils.TakeUtf8String( + NativeMethods.BNGetReportContents( + this.m_collection.DangerousGetHandle() , + this.m_index + ) + ); + } + } + + public string PlainText + { + get + { + return UnsafeUtils.TakeUtf8String( + NativeMethods.BNGetReportPlainText( + this.m_collection.DangerousGetHandle() , + this.m_index + ) + ); + } + } + } +} diff --git a/Report/IReport.cs b/Report/IReport.cs new file mode 100644 index 0000000..d678944 --- /dev/null +++ b/Report/IReport.cs @@ -0,0 +1,20 @@ +namespace BinaryNinja +{ + public interface IReport + { + public ReportType Type + { + get; + } + + public string Title + { + get; + } + + public BinaryView? View + { + get; + } + } +} diff --git a/Report/MarkdownReport.cs b/Report/MarkdownReport.cs new file mode 100644 index 0000000..f8e05e0 --- /dev/null +++ b/Report/MarkdownReport.cs @@ -0,0 +1,37 @@ +namespace BinaryNinja +{ + public sealed class MarkdownReport : AbstractReport + { + internal MarkdownReport(ReportCollection collection , ulong index): + base(collection, index) + { + + } + + public string Contents + { + get + { + return UnsafeUtils.TakeUtf8String( + NativeMethods.BNGetReportContents( + this.m_collection.DangerousGetHandle() , + this.m_index + ) + ); + } + } + + public string PlainText + { + get + { + return UnsafeUtils.TakeUtf8String( + NativeMethods.BNGetReportPlainText( + this.m_collection.DangerousGetHandle() , + this.m_index + ) + ); + } + } + } +} diff --git a/Report/PlainTextReport.cs b/Report/PlainTextReport.cs new file mode 100644 index 0000000..df1c380 --- /dev/null +++ b/Report/PlainTextReport.cs @@ -0,0 +1,24 @@ +namespace BinaryNinja +{ + public sealed class PlainTextReport : AbstractReport + { + internal PlainTextReport(ReportCollection collection , ulong index): + base(collection, index) + { + + } + + public string Contents + { + get + { + return UnsafeUtils.TakeUtf8String( + NativeMethods.BNGetReportContents( + this.m_collection.DangerousGetHandle() , + this.m_index + ) + ); + } + } + } +} diff --git a/ScopedAllocator.cs b/ScopedAllocator.cs new file mode 100644 index 0000000..0e84f52 --- /dev/null +++ b/ScopedAllocator.cs @@ -0,0 +1,212 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; + +namespace BinaryNinja +{ + public class ScopedAllocator : IDisposable + { + private readonly List m_pointers = new List(); + + private bool m_disposed = false; + + public void Dispose() + { + if (!m_disposed) + { + foreach (IntPtr pointer in m_pointers) + { + if (pointer != IntPtr.Zero) + { + Marshal.FreeHGlobal(pointer); + } + } + + m_pointers.Clear(); + + m_disposed = true; + } + } + + internal IntPtr AllocHGlobal(int size) + { + IntPtr pointer = Marshal.AllocHGlobal(size); + + m_pointers.Add(pointer); + + return pointer; + } + + internal IntPtr AllocAnsiString(string text) + { + IntPtr pointer = Marshal.StringToHGlobalAnsi(text); + + m_pointers.Add(pointer); + + return pointer; + } + + internal IntPtr AllocAnsiStringArray(string[] texts) + { + if (texts == null || texts.Length == 0) + { + return IntPtr.Zero; + } + + IntPtr arrayPointer = this.AllocHGlobal(IntPtr.Size * texts.Length); + + for (int i = 0; i < texts.Length; i++) + { + IntPtr textPointer = this.AllocAnsiString(texts[i]); + + Marshal.WriteIntPtr(arrayPointer , i * IntPtr.Size , textPointer); + } + + return arrayPointer; + } + + internal IntPtr AllocInteger(T value) where T : IConvertible + { + int elementSize = Marshal.SizeOf(); + + IntPtr pointer = this.AllocHGlobal(elementSize); + + if (1 == elementSize) + { + Marshal.WriteByte(pointer , Convert.ToByte((IConvertible)value)); + } + else if (2 == elementSize) + { + Marshal.WriteInt16(pointer , Convert.ToInt16((IConvertible)value)); + } + else if (4 == elementSize) + { + Marshal.WriteInt32(pointer , Convert.ToInt32((IConvertible)value)); + } + else if (8 == elementSize) + { + Marshal.WriteInt64(pointer , Convert.ToInt64((IConvertible)value)); + } + else + { + throw new Exception("Unsupported element type"); + } + + return pointer; + } + + internal IntPtr AllocIntegerArray(T[] items) where T : IConvertible + { + if (items == null || items.Length == 0) + { + return IntPtr.Zero; + } + + int elementSize = Marshal.SizeOf(); + + IntPtr arrayPointer = this.AllocHGlobal(IntPtr.Size * items.Length); + + for (int i = 0; i < items.Length; i++) + { + IntPtr addressOfElement = IntPtr.Add(arrayPointer , i * elementSize); + + if (1 == elementSize) + { + Marshal.WriteByte(addressOfElement , Convert.ToByte((IConvertible)items[i])); + } + else if (2 == elementSize) + { + Marshal.WriteInt16(addressOfElement , Convert.ToInt16((IConvertible)items[i])); + } + else if (4 == elementSize) + { + Marshal.WriteInt32(addressOfElement , Convert.ToInt32((IConvertible)items[i])); + } + else if (8 == elementSize) + { + Marshal.WriteInt64(addressOfElement , Convert.ToInt64((IConvertible)items[i])); + } + else + { + throw new Exception("Unsupported element type"); + } + } + + return arrayPointer; + } + + internal IntPtr AllocStruct(T structure) where T : struct + { + int size = Marshal.SizeOf(); + + IntPtr pointer = this.AllocHGlobal(size); + + Marshal.StructureToPtr(structure , pointer , false); + + return pointer; + } + + internal IntPtr AllocStructArray(T[] structures) where T : struct + { + if (structures == null || structures.Length == 0) + { + return IntPtr.Zero; + } + + int structSize = Marshal.SizeOf(); + + int totalSize = structSize * structures.Length; + + IntPtr arrayPointer = this.AllocHGlobal(totalSize); + + for (int i = 0; i < structures.Length; i++) + { + IntPtr addressOfElement = IntPtr.Add(arrayPointer , i * structSize); + + Marshal.StructureToPtr(structures[i] , addressOfElement , false); + } + + return arrayPointer; + } + + internal IntPtr AllocHandleArray(T[] handles) where T : SafeHandle + { + if (handles == null || handles.Length == 0) + { + return IntPtr.Zero; + } + + int totalSize = IntPtr.Size * handles.Length; + + IntPtr arrayPointer = this.AllocHGlobal(totalSize); + + for (int i = 0; i < handles.Length; i++) + { + IntPtr addressOfElement = IntPtr.Add(arrayPointer , i * IntPtr.Size); + + Marshal.WriteIntPtr(addressOfElement , handles[i].DangerousGetHandle() ); + } + + return arrayPointer; + } + + internal TNative[] ConvertToNativeArrayEx(TManaged[] sources) + where TManaged : INativeWrapperEx + { + if (sources == null || sources.Length == 0) + { + return Array.Empty(); + } + + List targets = new List(); + + for (int i = 0; i < sources.Length; i++) + { + targets.Add( sources[i].ToNativeEx(this)); + } + + return targets.ToArray(); + } + } +} diff --git a/Struct/BNActiveAnalysisInfo.cs b/Struct/BNActiveAnalysisInfo.cs new file mode 100644 index 0000000..8f523da --- /dev/null +++ b/Struct/BNActiveAnalysisInfo.cs @@ -0,0 +1,63 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNActiveAnalysisInfo + { + /// + /// BNFunction* func + /// + internal IntPtr func; + + /// + /// uint64_t analysisTime + /// + internal ulong analysisTime; + + /// + /// uint64_t updateCount + /// + internal ulong updateCount; + + /// + /// uint64_t submitCount + /// + internal ulong submitCount; + } + + public class ActiveAnalysisInfo + { + public Function? Function { get; set; } = null; + + public ulong AnalysisTime { get; set; } = 0; + + public ulong UpdateCount { get; set; } = 0; + + public ulong SubmitCount { get; set; } = 0; + + public ActiveAnalysisInfo() + { + + } + + internal static ActiveAnalysisInfo FromNativeStructPtr(IntPtr rawPtr) + { + return ActiveAnalysisInfo.FromNative( Marshal.PtrToStructure( rawPtr ) ); + } + + internal static ActiveAnalysisInfo FromNative(BNActiveAnalysisInfo raw) + { + return new ActiveAnalysisInfo() + { + Function = IntPtr.Zero == raw.func ? null : Function.MustNewFromHandle(raw.func), + AnalysisTime = raw.analysisTime, + UpdateCount = raw.updateCount, + SubmitCount = raw.submitCount, + }; + } + } +} \ No newline at end of file diff --git a/Struct/BNAddressRange.cs b/Struct/BNAddressRange.cs new file mode 100644 index 0000000..dd55169 --- /dev/null +++ b/Struct/BNAddressRange.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNAddressRange + { + /// + /// uint64_t start + /// + internal ulong start; + + /// + /// uint64_t end + /// + internal ulong end; + } + + public sealed class AddressRange + { + public ulong Start { get; set; } = 0; + + public ulong End { get; set; } = 0; + + public AddressRange() + { + + } + + public AddressRange(ulong start, ulong end) + { + this.Start = start; + this.End = end; + } + + internal static AddressRange FromNative(BNAddressRange raw ) + { + return new AddressRange( + raw.start , + raw.end + ); + } + } +} \ No newline at end of file diff --git a/Struct/BNAllTypeFieldReferences.cs b/Struct/BNAllTypeFieldReferences.cs new file mode 100644 index 0000000..33201f2 --- /dev/null +++ b/Struct/BNAllTypeFieldReferences.cs @@ -0,0 +1,67 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNAllTypeFieldReferences + { + /// + /// BNTypeFieldReference* codeRefs + /// + internal IntPtr codeRefs; + + /// + /// uint64_t codeRefCount + /// + internal ulong codeRefCount; + + /// + /// uint64_t* dataRefsTo + /// + internal IntPtr dataRefsTo; + + /// + /// uint64_t dataRefToCount + /// + internal ulong dataRefToCount; + + /// + /// uint64_t* dataRefsFrom + /// + internal IntPtr dataRefsFrom; + + /// + /// uint64_t dataRefFromCount + /// + internal ulong dataRefFromCount; + + /// + /// BNTypeReferenceSource* typeRefs + /// + internal IntPtr typeRefs; + + /// + /// uint64_t typeRefCount + /// + internal ulong typeRefCount; + } + + public class AllTypeFieldReferences + { + public TypeFieldReference[] CodeRefs { get; set; } = Array.Empty(); + + public ulong[] DataRefsTo { get; set; } = Array.Empty(); + + public ulong[] DataRefsFrom { get; set; } = Array.Empty(); + + public TypeReferenceSource[] TypeRefs { get; set; } = Array.Empty(); + + public AllTypeFieldReferences() + { + + } + } +} \ No newline at end of file diff --git a/Struct/BNAllTypeReferences.cs b/Struct/BNAllTypeReferences.cs new file mode 100644 index 0000000..22b490a --- /dev/null +++ b/Struct/BNAllTypeReferences.cs @@ -0,0 +1,55 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNAllTypeReferences + { + /// + /// BNReferenceSource* codeRefs + /// + public IntPtr codeRefs; + + /// + /// uint64_t codeRefCount + /// + public ulong codeRefCount; + + /// + /// uint64_t* dataRefs + /// + public IntPtr dataRefs; + + /// + /// uint64_t dataRefCount + /// + public ulong dataRefCount; + + /// + /// BNTypeReferenceSource* typeRefs + /// + public IntPtr typeRefs; + + /// + /// uint64_t typeRefCount + /// + public ulong typeRefCount; + } + + public class AllTypeReferences + { + public ReferenceSource[] CodeRefs { get; set; } = Array.Empty(); + + public ulong[] DataRefs { get; set; } = Array.Empty(); + + public TypeReferenceSource[] TypeRefs { get; set; } = Array.Empty(); + + public AllTypeReferences() + { + + } + } +} \ No newline at end of file diff --git a/Struct/BNAnalysisInfo.cs b/Struct/BNAnalysisInfo.cs new file mode 100644 index 0000000..66bf719 --- /dev/null +++ b/Struct/BNAnalysisInfo.cs @@ -0,0 +1,77 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNAnalysisInfo + { + /// + /// BNAnalysisState state + /// + public AnalysisState state; + + /// + /// uint64_t analysisTime + /// + public ulong analysisTime; + + /// + /// BNActiveAnalysisInfo* activeInfo + /// + public IntPtr activeInfo; + + /// + /// uint64_t count + /// + public ulong count; + } + + public class AnalysisInfo + { + public AnalysisState State { get; set; } = AnalysisState.InitialState; + + public ulong AnalysisTime { get; set; } = 0; + + public ActiveAnalysisInfo? ActiveInfo { get; set; } = null; + + public ulong Count { get; set; } = 0; + + public AnalysisInfo() + { + + } + + internal static AnalysisInfo MustTakeNativePointer(IntPtr pointer) + { + AnalysisInfo target = AnalysisInfo.MustFromNativePointer(pointer); + + NativeMethods.BNFreeAnalysisInfo(pointer); + + return target; + } + + internal static AnalysisInfo MustFromNativePointer(IntPtr rawPtr) + { + if (IntPtr.Zero == rawPtr) + { + throw new ArgumentNullException(nameof(rawPtr)); + } + + return AnalysisInfo.FromNative(Marshal.PtrToStructure(rawPtr)); + } + + internal static AnalysisInfo FromNative(BNAnalysisInfo raw) + { + return new AnalysisInfo() + { + State = raw.state , + AnalysisTime = raw.analysisTime , + ActiveInfo = ( IntPtr.Zero == raw.activeInfo ? null : ActiveAnalysisInfo.FromNativeStructPtr(raw.activeInfo) ) , + Count = raw.count + }; + } + } +} \ No newline at end of file diff --git a/Struct/BNAnalysisMergeConflictSplitterCallbacks.cs b/Struct/BNAnalysisMergeConflictSplitterCallbacks.cs new file mode 100644 index 0000000..75e3117 --- /dev/null +++ b/Struct/BNAnalysisMergeConflictSplitterCallbacks.cs @@ -0,0 +1,65 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNAnalysisMergeConflictSplitterCallbacks + { + /// + /// void* context + /// + public IntPtr context; + + /// + /// void** getName + /// + public IntPtr getName; + + /// + /// void** reset + /// + public IntPtr reset; + + /// + /// void** finished + /// + public IntPtr finished; + + /// + /// void** canSplit + /// + public IntPtr canSplit; + + /// + /// void** split + /// + public IntPtr split; + + /// + /// void** freeName + /// + public IntPtr freeName; + + /// + /// void** freeKeyList + /// + public IntPtr freeKeyList; + + /// + /// void** freeConflictList + /// + public IntPtr freeConflictList; + } + + public class AnalysisMergeConflictSplitterCallbacks + { + + public AnalysisMergeConflictSplitterCallbacks() + { + + } + } +} \ No newline at end of file diff --git a/Struct/BNAnalysisParameters.cs b/Struct/BNAnalysisParameters.cs new file mode 100644 index 0000000..740c573 --- /dev/null +++ b/Struct/BNAnalysisParameters.cs @@ -0,0 +1,114 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNAnalysisParameters + { + /// + /// uint64_t maxAnalysisTime + /// + internal ulong maxAnalysisTime; + + /// + /// uint64_t maxFunctionSize + /// + internal ulong maxFunctionSize; + + /// + /// uint64_t maxFunctionAnalysisTime + /// + internal ulong maxFunctionAnalysisTime; + + /// + /// uint64_t maxFunctionUpdateCount + /// + internal ulong maxFunctionUpdateCount; + + /// + /// uint64_t maxFunctionSubmitCount + /// + internal ulong maxFunctionSubmitCount; + + /// + /// bool suppressNewAutoFunctionAnalysis + /// + internal bool suppressNewAutoFunctionAnalysis; + + /// + /// BNAnalysisMode mode + /// + internal AnalysisMode mode; + + /// + /// bool alwaysAnalyzeIndirectBranches + /// + internal bool alwaysAnalyzeIndirectBranches; + + /// + /// uint64_t advancedAnalysisCacheSize + /// + internal ulong advancedAnalysisCacheSize; + } + + public sealed class AnalysisParameters : INativeWrapper + { + public ulong MaxAnalysisTime { get; set; } = 0; + + public ulong MaxFunctionSize { get; set; } = 0; + + public ulong MaxFunctionAnalysisTime { get; set; } = 0; + + public ulong MaxFunctionUpdateCount { get; set; } = 0; + + public ulong MaxFunctionSubmitCount { get; set; } = 0; + + public bool SuppressNewAutoFunctionAnalysis { get; set; } = false; + + public AnalysisMode Mode { get; set; } = AnalysisMode.FullAnalysisMode; + + public bool AlwaysAnalyzeIndirectBranches { get; set; } = false; + + public ulong AdvancedAnalysisCacheSize { get; set; } = 0; + + public AnalysisParameters() + { + + } + + internal static AnalysisParameters FromNative(BNAnalysisParameters native) + { + return new AnalysisParameters() + { + MaxAnalysisTime = native.maxAnalysisTime , + MaxFunctionSize = native.maxFunctionSize , + MaxFunctionAnalysisTime = native.maxFunctionAnalysisTime , + MaxFunctionUpdateCount = native.maxFunctionUpdateCount , + MaxFunctionSubmitCount = native.maxFunctionSubmitCount , + SuppressNewAutoFunctionAnalysis = native.suppressNewAutoFunctionAnalysis , + Mode = native.mode , + AlwaysAnalyzeIndirectBranches = native.alwaysAnalyzeIndirectBranches , + AdvancedAnalysisCacheSize = native.advancedAnalysisCacheSize + }; + } + + public BNAnalysisParameters ToNative() + { + return new BNAnalysisParameters() + { + maxAnalysisTime = this.MaxAnalysisTime , + maxFunctionSize = this.MaxFunctionSize , + maxFunctionAnalysisTime = this.MaxFunctionAnalysisTime , + maxFunctionUpdateCount = this.MaxFunctionUpdateCount , + maxFunctionSubmitCount = this.MaxFunctionSubmitCount , + suppressNewAutoFunctionAnalysis = this.SuppressNewAutoFunctionAnalysis , + mode = this.Mode , + alwaysAnalyzeIndirectBranches = this.AlwaysAnalyzeIndirectBranches , + advancedAnalysisCacheSize = this.AdvancedAnalysisCacheSize + }; + } + } +} \ No newline at end of file diff --git a/Struct/BNAnalysisProgress.cs b/Struct/BNAnalysisProgress.cs new file mode 100644 index 0000000..628f329 --- /dev/null +++ b/Struct/BNAnalysisProgress.cs @@ -0,0 +1,56 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + /// + /// + /// + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNAnalysisProgress + { + /// + /// + /// BNAnalysisState state + /// + internal AnalysisState state; + + /// + /// + /// uint64_t count + /// + internal ulong count; + + /// + /// + /// uint64_t total + /// + internal ulong total; + } + + public sealed class AnalysisProgress + { + public AnalysisState State { get; set; } = AnalysisState.InitialState; + + public ulong Count { get; set; } = 0; + + public ulong Total { get; set; } = 0; + + internal AnalysisProgress( ) + { + + } + + internal static AnalysisProgress FromNative(BNAnalysisProgress raw ) + { + return new AnalysisProgress() + { + State = raw.state , + Count = raw.count , + Total = raw.total + }; + } + } +} \ No newline at end of file diff --git a/Struct/BNArchitectureAndAddress.cs b/Struct/BNArchitectureAndAddress.cs new file mode 100644 index 0000000..f909b26 --- /dev/null +++ b/Struct/BNArchitectureAndAddress.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNArchitectureAndAddress + { + /// + /// BNArchitecture* arch + /// + internal IntPtr arch; + + /// + /// uint64_t address + /// + internal ulong address; + } + + public sealed class ArchitectureAndAddress : INativeWrapper + { + public Architecture Architecture { get; set; } + + public ulong Address { get; set; } = 0; + + public ArchitectureAndAddress(Architecture arch , ulong address) + { + this.Architecture = arch; + this.Address = address; + } + + internal static ArchitectureAndAddress FromNative(BNArchitectureAndAddress raw) + { + return new ArchitectureAndAddress( + Architecture.MustFromHandle(raw.arch), + raw.address + ); + } + + public BNArchitectureAndAddress ToNative() + { + return new BNArchitectureAndAddress() + { + arch = this.Architecture.DangerousGetHandle() , address = this.Address + }; + } + } +} \ No newline at end of file diff --git a/Struct/BNBaseAddressDetectionReason.cs b/Struct/BNBaseAddressDetectionReason.cs new file mode 100644 index 0000000..e99bddf --- /dev/null +++ b/Struct/BNBaseAddressDetectionReason.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNBaseAddressDetectionReason + { + /// + /// uint64_t Pointer + /// + public ulong Pointer; + + /// + /// uint64_t POIOffset + /// + public ulong POIOffset; + + /// + /// BNBaseAddressDetectionPOIType POIType + /// + public BaseAddressDetectionPOIType POIType; + + } + + public sealed class BaseAddressDetectionReason + { + public ulong Pointer { get; set; } = 0; + + public ulong POIOffset { get; set; } = 0; + + public BaseAddressDetectionPOIType POIType { get; set; } = BaseAddressDetectionPOIType.POIString; + + public BaseAddressDetectionReason() + { + + } + } +} \ No newline at end of file diff --git a/Struct/BNBaseAddressDetectionScore.cs b/Struct/BNBaseAddressDetectionScore.cs new file mode 100644 index 0000000..863fea6 --- /dev/null +++ b/Struct/BNBaseAddressDetectionScore.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNBaseAddressDetectionScore + { + /// + /// uint64_t Score + /// + public ulong Score; + + /// + /// uint64_t BaseAddress + /// + public ulong BaseAddress; + } + + public sealed class BaseAddressDetectionScore + { + public ulong Score { get; set; } = 0; + + public ulong BaseAddress { get; set; } = 0; + + public BaseAddressDetectionScore() + { + + } + } +} \ No newline at end of file diff --git a/Struct/BNBaseAddressDetectionSettings.cs b/Struct/BNBaseAddressDetectionSettings.cs new file mode 100644 index 0000000..d3edb89 --- /dev/null +++ b/Struct/BNBaseAddressDetectionSettings.cs @@ -0,0 +1,76 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNBaseAddressDetectionSettings + { + /// + /// const char* Architecture + /// + public IntPtr Architecture; + + /// + /// const char* Analysis + /// + public IntPtr Analysis; + + /// + /// uint32_t MinStrlen + /// + public uint MinStrlen; + + /// + /// uint32_t Alignment + /// + public uint Alignment; + + /// + /// uint64_t LowerBoundary + /// + public ulong LowerBoundary; + + /// + /// uint64_t UpperBoundary + /// + public ulong UpperBoundary; + + /// + /// BNBaseAddressDetectionPOISetting POIAnalysis + /// + public BaseAddressDetectionPOISetting POIAnalysis; + + /// + /// uint32_t MaxPointersPerCluster + /// + public uint MaxPointersPerCluster; + } + + public sealed class BaseAddressDetectionSettings + { + public string Architecture { get; set; } = string.Empty; + + public string Analysis { get; set; } = string.Empty; + + public uint MinStrlen { get; set; } = 0; + + public uint Alignment { get; set; } = 0; + + public ulong LowerBoundary { get; set; } = 0; + + public ulong UpperBoundary { get; set; } = 0; + + public BaseAddressDetectionPOISetting POIAnalysis { get; set; } = + BaseAddressDetectionPOISetting.POIAnalysisStringsOnly; + + public uint MaxPointersPerCluster { get; set; } = 0; + + public BaseAddressDetectionSettings() + { + + } + } +} \ No newline at end of file diff --git a/Struct/BNBaseStructure.cs b/Struct/BNBaseStructure.cs new file mode 100644 index 0000000..7c07a11 --- /dev/null +++ b/Struct/BNBaseStructure.cs @@ -0,0 +1,63 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNBaseStructure + { + /// + /// BNNamedTypeReference* type + /// + internal IntPtr type; + + /// + /// uint64_t offset + /// + internal ulong offset; + + /// + /// uint64_t width + /// + internal ulong width; + } + + public sealed class BaseStructure : INativeWrapper + { + public NamedTypeReference Type { get; set; } + + public ulong Offset { get; set; } = 0; + + public ulong Width { get; set; } = 0; + + public BaseStructure(NamedTypeReference kind , ulong offset , ulong width) + { + this.Type = kind; + + this.Offset = offset; + + this.Width = width; + } + + internal static BaseStructure FromNative(BNBaseStructure native) + { + return new BaseStructure( + new NamedTypeReference(NativeMethods.BNNewNamedTypeReference(native.type) , true) , + native.offset , + native.width + ); + } + + public BNBaseStructure ToNative() + { + return new BNBaseStructure() + { + type = this.Type.DangerousGetHandle(), + offset = this.Offset, + width = this.Width + }; + } + } +} \ No newline at end of file diff --git a/Struct/BNBasicBlockAnalysisContext.cs b/Struct/BNBasicBlockAnalysisContext.cs new file mode 100644 index 0000000..0ad7002 --- /dev/null +++ b/Struct/BNBasicBlockAnalysisContext.cs @@ -0,0 +1,231 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNBasicBlockAnalysisContext + { + /// + /// BNFunction* function + /// + public IntPtr function; + + /// + /// BNFunctionAnalysisSkipOverride analysisSkipOverride + /// + public FunctionAnalysisSkipOverride analysisSkipOverride; + + /// + /// bool guidedAnalysisMode + /// + public bool guidedAnalysisMode; + + /// + /// bool triggerGuidedOnInvalidInstruction + /// + public bool triggerGuidedOnInvalidInstruction; + + /// + /// bool translateTailCalls + /// + public bool translateTailCalls; + + /// + /// bool disallowBranchToString + /// + public bool disallowBranchToString; + + /// + /// uint64_t maxFunctionSize + /// + public ulong maxFunctionSize; + + /// + /// uint64_t indirectBranchesCount + /// + public ulong indirectBranchesCount; + + /// + /// BNIndirectBranchInfo* indirectBranches + /// + public IntPtr indirectBranches; + + /// + /// uint64_t indirectNoReturnCallsCount + /// + public ulong indirectNoReturnCallsCount; + + /// + /// BNArchitectureAndAddress* indirectNoReturnCalls + /// + public IntPtr indirectNoReturnCalls; + + /// + /// bool maxSizeReached + /// + public bool maxSizeReached; + + /// + /// uint64_t contextualFunctionReturnCount + /// + public ulong contextualFunctionReturnCount; + + /// + /// BNArchitectureAndAddress* contextualFunctionReturnLocations + /// + public IntPtr contextualFunctionReturnLocations; + + /// + /// bool* contextualFunctionReturnValues + /// + public IntPtr contextualFunctionReturnValues; + + /// + /// uint64_t directRefCount + /// + public ulong directRefCount; + + /// + /// BNArchitectureAndAddress* directRefSources + /// + public IntPtr directRefSources; + + /// + /// uint64_t* directRefTargets + /// + public IntPtr directRefTargets; + + /// + /// uint64_t directNoReturnCallsCount + /// + public ulong directNoReturnCallsCount; + + /// + /// BNArchitectureAndAddress* directNoReturnCalls + /// + public IntPtr directNoReturnCalls; + + /// + /// uint64_t haltedDisassemblyAddressesCount + /// + public ulong haltedDisassemblyAddressesCount; + + /// + /// BNArchitectureAndAddress* haltedDisassemblyAddresses + /// + public IntPtr haltedDisassemblyAddresses; + + /// + /// uint64_t inlinedUnresolvedIndirectBranchCount + /// + public ulong inlinedUnresolvedIndirectBranchCount; + + /// + /// BNArchitectureAndAddress* inlinedUnresolvedIndirectBranches + /// + public IntPtr inlinedUnresolvedIndirectBranches; + } + + public class BasicBlockAnalysisContext + { + public Function? Function { get; set; } = null; + + public FunctionAnalysisSkipOverride AnalysisSkipOverride { get; set; } = + FunctionAnalysisSkipOverride.DefaultFunctionAnalysisSkip; + + public bool GuidedAnalysisMode { get; set; } = false; + + public bool TriggerGuidedOnInvalidInstruction { get; set; } = false; + + public bool TranslateTailCalls { get; set; } = false; + + public bool DisallowBranchToString { get; set; } = false; + + public ulong MaxFunctionSize { get; set; } = 0; + + public ulong IndirectBranchesCount { get; set; } = 0; + + /// + /// BNIndirectBranchInfo* indirectBranches + /// + public IntPtr IndirectBranches { get; set; } = IntPtr.Zero; + + /// + /// uint64_t indirectNoReturnCallsCount + /// + public ulong IndirectNoReturnCallsCount { get; set; } = 0; + + /// + /// BNArchitectureAndAddress* indirectNoReturnCalls + /// + public IntPtr IndirectNoReturnCalls { get; set; } = IntPtr.Zero; + + public bool MaxSizeReached { get; set; } = false; + + public ulong ContextualFunctionReturnCount { get; set; } = 0; + + /// + /// BNArchitectureAndAddress* contextualFunctionReturnLocations + /// + public IntPtr ContextualFunctionReturnLocations { get; set; } = IntPtr.Zero; + + /// + /// bool* contextualFunctionReturnValues + /// + public IntPtr ContextualFunctionReturnValues { get; set; } = IntPtr.Zero; + + /// + /// uint64_t directRefCount + /// + public ulong DirectRefCount { get; set; } = 0; + + /// + /// BNArchitectureAndAddress* directRefSources + /// + public IntPtr DirectRefSources { get; set; } = IntPtr.Zero; + + /// + /// uint64_t* directRefTargets + /// + public IntPtr DirectRefTargets { get; set; } = IntPtr.Zero; + + /// + /// uint64_t directNoReturnCallsCount + /// + public ulong DirectNoReturnCallsCount { get; set; } = 0; + + /// + /// BNArchitectureAndAddress* directNoReturnCalls + /// + public IntPtr DirectNoReturnCalls { get; set; } = IntPtr.Zero; + + /// + /// uint64_t haltedDisassemblyAddressesCount + /// + public ulong HaltedDisassemblyAddressesCount { get; set; } = 0; + + /// + /// BNArchitectureAndAddress* haltedDisassemblyAddresses + /// + public IntPtr HaltedDisassemblyAddresses { get; set; } = IntPtr.Zero; + + /// + /// uint64_t inlinedUnresolvedIndirectBranchCount + /// + public ulong InlinedUnresolvedIndirectBranchCount { get; set; } = 0; + + /// + /// BNArchitectureAndAddress* inlinedUnresolvedIndirectBranches + /// + public IntPtr InlinedUnresolvedIndirectBranches { get; set; } = IntPtr.Zero; + + + public BasicBlockAnalysisContext() + { + + } + } +} \ No newline at end of file diff --git a/Struct/BNBasicBlockEdge.cs b/Struct/BNBasicBlockEdge.cs new file mode 100644 index 0000000..3d7d678 --- /dev/null +++ b/Struct/BNBasicBlockEdge.cs @@ -0,0 +1,201 @@ +using System; +using System.Collections.Generic; +using System.Data; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNBasicBlockEdge + { + /// + /// BNBranchType type + /// + internal BranchType type; + + /// + /// BNBasicBlock* target + /// + internal IntPtr target; + + /// + /// bool backEdge + /// + internal bool backEdge; + + /// + /// bool fallThrough + /// + internal bool fallThrough; + } + + + public abstract class AbstractBasicBlockEdge + : IEquatable, IComparable< T_SELF> + where T_SELF : AbstractBasicBlockEdge + where T_BASICBLOCK : AbstractBasicBlock + { + public BranchType Type { get; } = BranchType.UnconditionalBranch; + + public T_BASICBLOCK Source { get; } + + public T_BASICBLOCK Target { get; } + + public bool BackEdge { get; } = false; + + public bool FallThrough { get; } = false; + + public bool Outgoing { get; } = false; + + internal AbstractBasicBlockEdge( + BNBasicBlockEdge native , + T_BASICBLOCK source, + T_BASICBLOCK target, + bool outgoing + ) + { + this.Type = native.type; + + this.Source = source; + this.Target = target; + + this.BackEdge = native.backEdge; + this.FallThrough = native.fallThrough; + + this.Outgoing = outgoing; + } + + public override bool Equals(object? other) + { + return Equals(other as T_SELF); + } + + public bool Equals(T_SELF? other) + { + if (other is null) + { + return false; + } + + if (ReferenceEquals(this , other)) + { + return true; + } + + if (this.Source.Equals(other.Source) + && this.Target.Equals(other.Target) + && this.Type == other.Type + && this.BackEdge == other.BackEdge + && this.FallThrough == other.FallThrough + ) + { + return true; + } + + return false; + } + + public override int GetHashCode() + { + return HashCode.Combine( + (uint)Type, + Source.GetHashCode(), + Target.GetHashCode(), + BackEdge, + FallThrough + ); + } + + public static bool operator ==( + AbstractBasicBlockEdge? left, + AbstractBasicBlockEdge? right) + { + if (left is null) + { + return right is null; + } + + return left.Equals(right); + } + + public static bool operator !=( + AbstractBasicBlockEdge? left, + AbstractBasicBlockEdge? right) + { + return !(left == right); + } + + public int CompareTo(T_SELF? other) + { + if (other is null) + { + return 1; + } + + int result = this.Type.CompareTo(other.Type); + + if (0 == result) + { + result = this.Source.CompareTo(other.Source); + } + + if (0 == result) + { + result = this.Target.CompareTo(other.Target); + } + + if (0 == result) + { + result = this.BackEdge.CompareTo(other.BackEdge); + } + + if (0 == result) + { + result = this.FallThrough.CompareTo(other.FallThrough); + } + + return result; + } + } + + public sealed class BasicBlockEdge : AbstractBasicBlockEdge + { + internal BasicBlockEdge( + BNBasicBlockEdge native , + BasicBlock source, + BasicBlock target , + bool outgoing + ) : base(native , source , target , outgoing) + { + + } + + internal static BasicBlockEdge FromNativeEx( + BNBasicBlockEdge native , + BasicBlock me, + bool outgoing + ) + { + if (outgoing) + { + return new BasicBlockEdge( + native, + me , + BasicBlock.MustNewFromHandle(native.target), + outgoing + ); + } + else + { + + return new BasicBlockEdge( + native, + BasicBlock.MustNewFromHandle(native.target) , + me, + outgoing + ); + } + } + } +} \ No newline at end of file diff --git a/Struct/BNBinaryDataNotification.cs b/Struct/BNBinaryDataNotification.cs new file mode 100644 index 0000000..a615944 --- /dev/null +++ b/Struct/BNBinaryDataNotification.cs @@ -0,0 +1,289 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNBinaryDataNotification + { + /// + /// void* context + /// + public IntPtr context; + + /// + /// void** notificationBarrier + /// + public IntPtr notificationBarrier; + + /// + /// void** dataWritten + /// + public IntPtr dataWritten; + + /// + /// void** dataInserted + /// + public IntPtr dataInserted; + + /// + /// void** dataRemoved + /// + public IntPtr dataRemoved; + + /// + /// void** functionAdded + /// + public IntPtr functionAdded; + + /// + /// void** functionRemoved + /// + public IntPtr functionRemoved; + + /// + /// void** functionUpdated + /// + public IntPtr functionUpdated; + + /// + /// void** functionUpdateRequested + /// + public IntPtr functionUpdateRequested; + + /// + /// void** dataVariableAdded + /// + public IntPtr dataVariableAdded; + + /// + /// void** dataVariableRemoved + /// + public IntPtr dataVariableRemoved; + + /// + /// void** dataVariableUpdated + /// + public IntPtr dataVariableUpdated; + + /// + /// void** dataMetadataUpdated + /// + public IntPtr dataMetadataUpdated; + + /// + /// void** tagTypeUpdated + /// + public IntPtr tagTypeUpdated; + + /// + /// void** tagAdded + /// + public IntPtr tagAdded; + + /// + /// void** tagRemoved + /// + public IntPtr tagRemoved; + + /// + /// void** tagUpdated + /// + public IntPtr tagUpdated; + + /// + /// void** symbolAdded + /// + public IntPtr symbolAdded; + + /// + /// void** symbolRemoved + /// + public IntPtr symbolRemoved; + + /// + /// void** symbolUpdated + /// + public IntPtr symbolUpdated; + + /// + /// void** stringFound + /// + public IntPtr stringFound; + + /// + /// void** stringRemoved + /// + public IntPtr stringRemoved; + + /// + /// void** typeDefined + /// + public IntPtr typeDefined; + + /// + /// void** typeUndefined + /// + public IntPtr typeUndefined; + + /// + /// void** typeReferenceChanged + /// + public IntPtr typeReferenceChanged; + + /// + /// void** typeFieldReferenceChanged + /// + public IntPtr typeFieldReferenceChanged; + + /// + /// void** segmentAdded + /// + public IntPtr segmentAdded; + + /// + /// void** segmentRemoved + /// + public IntPtr segmentRemoved; + + /// + /// void** segmentUpdated + /// + public IntPtr segmentUpdated; + + /// + /// void** sectionAdded + /// + public IntPtr sectionAdded; + + /// + /// void** sectionRemoved + /// + public IntPtr sectionRemoved; + + /// + /// void** sectionUpdated + /// + public IntPtr sectionUpdated; + + /// + /// void** componentNameUpdated + /// + public IntPtr componentNameUpdated; + + /// + /// void** componentAdded + /// + public IntPtr componentAdded; + + /// + /// void** componentMoved + /// + public IntPtr componentMoved; + + /// + /// void** componentRemoved + /// + public IntPtr componentRemoved; + + /// + /// void** componentFunctionAdded + /// + public IntPtr componentFunctionAdded; + + /// + /// void** componentFunctionRemoved + /// + public IntPtr componentFunctionRemoved; + + /// + /// void** componentDataVariableAdded + /// + public IntPtr componentDataVariableAdded; + + /// + /// void** componentDataVariableRemoved + /// + public IntPtr componentDataVariableRemoved; + + /// + /// void** externalLibraryAdded + /// + public IntPtr externalLibraryAdded; + + /// + /// void** externalLibraryUpdated + /// + public IntPtr externalLibraryUpdated; + + /// + /// void** externalLibraryRemoved + /// + public IntPtr externalLibraryRemoved; + + /// + /// void** externalLocationAdded + /// + public IntPtr externalLocationAdded; + + /// + /// void** externalLocationUpdated + /// + public IntPtr externalLocationUpdated; + + /// + /// void** externalLocationRemoved + /// + public IntPtr externalLocationRemoved; + + /// + /// void** typeArchiveAttached + /// + public IntPtr typeArchiveAttached; + + /// + /// void** typeArchiveDetached + /// + public IntPtr typeArchiveDetached; + + /// + /// void** typeArchiveConnected + /// + public IntPtr typeArchiveConnected; + + /// + /// void** typeArchiveDisconnected + /// + public IntPtr typeArchiveDisconnected; + + /// + /// void** undoEntryAdded + /// + public IntPtr undoEntryAdded; + + /// + /// void** undoEntryTaken + /// + public IntPtr undoEntryTaken; + + /// + /// void** redoEntryTaken + /// + public IntPtr redoEntryTaken; + + /// + /// void** rebased + /// + public IntPtr rebased; + } + + public class BinaryDataNotification + { + public BinaryDataNotification() + { + + } + } +} \ No newline at end of file diff --git a/Struct/BNBinaryViewEvent.cs b/Struct/BNBinaryViewEvent.cs new file mode 100644 index 0000000..49ee32d --- /dev/null +++ b/Struct/BNBinaryViewEvent.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNBinaryViewEvent + { + /// + /// BNBinaryViewEventType type + /// + public BinaryViewEventType type; + + /// + /// void** callback + /// + public IntPtr callback; + + /// + /// void* ctx + /// + public IntPtr ctx; + } + + public class BinaryViewEvent + { + + public BinaryViewEvent() + { + + } + } +} \ No newline at end of file diff --git a/Struct/BNBoolWithConfidence.cs b/Struct/BNBoolWithConfidence.cs new file mode 100644 index 0000000..089d192 --- /dev/null +++ b/Struct/BNBoolWithConfidence.cs @@ -0,0 +1,73 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNBoolWithConfidence + { + /// + /// bool value + /// + public bool value; + + /// + /// uint8_t confidence + /// + public byte confidence; + } + + public sealed class BoolWithConfidence + { + public bool Value { get; set; } = false; + + public byte Confidence { get; set; } = 0; + + public BoolWithConfidence() + { + + } + + public BoolWithConfidence(bool value = false , byte confidence = 0) + { + this.Value = value; + + this.Confidence = confidence; + } + + internal static BoolWithConfidence FromNative(BNBoolWithConfidence raw) + { + return new BoolWithConfidence() + { + Value = raw.value , + Confidence = raw.confidence + }; + } + + internal BNBoolWithConfidence ToNative() + { + return new BNBoolWithConfidence() + { + value = Value, + confidence = Confidence + }; + } + + public static implicit operator BoolWithConfidence(bool value) + { + return new BoolWithConfidence(value); + } + + public static implicit operator bool(BoolWithConfidence? kind) + { + if (kind == null) + { + return false; + } + + return kind.Value; + } + } +} \ No newline at end of file diff --git a/Struct/BNCallingConventionWithConfidence.cs b/Struct/BNCallingConventionWithConfidence.cs new file mode 100644 index 0000000..6b6992a --- /dev/null +++ b/Struct/BNCallingConventionWithConfidence.cs @@ -0,0 +1,61 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNCallingConventionWithConfidence + { + /// + /// BNCallingConvention* convention + /// + public IntPtr convention; + + /// + /// uint8_t confidence + /// + public byte confidence; + } + + public sealed class CallingConventionWithConfidence + { + public BinaryNinja.CallingConvention? Convention { get; set; } = null; + + public byte Confidence { get; set; } = 0; + + public CallingConventionWithConfidence() + { + + } + + public CallingConventionWithConfidence(BinaryNinja.CallingConvention? convention, byte confidence) + { + this.Convention = convention; + + this.Confidence = confidence; + } + + internal static CallingConventionWithConfidence FromNative(BNCallingConventionWithConfidence native) + { + return new CallingConventionWithConfidence( + + new BinaryNinja.CallingConvention( + NativeMethods.BNNewCallingConventionReference(native.convention) , + true + ) , + native.confidence + ); + } + + internal BNCallingConventionWithConfidence ToNative() + { + return new BNCallingConventionWithConfidence() + { + convention = null == this.Convention ? IntPtr.Zero : this.Convention.DangerousGetHandle(), + confidence = Confidence + }; + } + } +} \ No newline at end of file diff --git a/Struct/BNChangelogEntry.cs b/Struct/BNChangelogEntry.cs new file mode 100644 index 0000000..4f608b3 --- /dev/null +++ b/Struct/BNChangelogEntry.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNChangelogEntry + { + /// + /// BNVersionInfo version + /// + public BNVersionInfo version; + + /// + /// const char* notes + /// + public IntPtr notes; + + /// + /// uint64_t time + /// + public ulong time; + } + + public sealed class ChangelogEntry + { + public VersionInfo Version { get; set; } = new VersionInfo(); + + public string Notes { get; set; } = string.Empty; + + public ulong Time { get; set; } = 0; + + public ChangelogEntry() + { + + } + } +} \ No newline at end of file diff --git a/Struct/BNConstantReference.cs b/Struct/BNConstantReference.cs new file mode 100644 index 0000000..89dada8 --- /dev/null +++ b/Struct/BNConstantReference.cs @@ -0,0 +1,58 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNConstantReference + { + /// + /// int64_t value + /// + public long value; + + /// + /// uint64_t size + /// + public ulong size; + + /// + /// bool pointer + /// + public bool pointer; + + /// + /// bool intermediate + /// + public bool intermediate; + } + + public sealed class ConstantReference + { + public long Value { get; set; } = 0; + + public ulong Size { get; set; } = 0; + + public bool Pointer { get; set; } = false; + + public bool Intermediate { get; set; } = false; + + public ConstantReference() + { + + } + + internal static ConstantReference FromNative(BNConstantReference native) + { + return new ConstantReference() + { + Value = native.value , + Size = native.size , + Pointer = native.pointer , + Intermediate = native.intermediate + }; + } + } +} \ No newline at end of file diff --git a/Struct/BNCustomArchitecture.cs b/Struct/BNCustomArchitecture.cs new file mode 100644 index 0000000..4145c6f --- /dev/null +++ b/Struct/BNCustomArchitecture.cs @@ -0,0 +1,1570 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNCustomArchitecture + { + /// + /// void (*init)(void* context, BNArchitecture* obj); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate void InitDelegate( + IntPtr ctxt, + IntPtr arch + ); + + /// + /// BNEndianness (*getEndianness)(void* ctxt); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate Endianness GetEndiannessDelegate( + IntPtr ctxt + ); + + /// + /// size_t (*getAddressSize)(void* ctxt); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate ulong GetAddressSizeDelegate( + IntPtr ctxt + ); + + /// + /// size_t (*getDefaultIntegerSize)(void* ctxt); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate ulong GetDefaultIntegerSizeDelegate( + IntPtr ctxt + ); + + /// + /// size_t (*getInstructionAlignment)(void* ctxt); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate ulong GetInstructionAlignmentDelegate( + IntPtr ctxt + ); + + /// + /// size_t (*getMaxInstructionLength)(void* ctxt); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate ulong GetMaxInstructionLengthDelegate( + IntPtr ctxt + ); + + /// + /// size_t (*getOpcodeDisplayLength)(void* ctxt); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate ulong GetOpcodeDisplayLengthDelegate( + IntPtr ctxt + ); + + /// + /// BNArchitecture* (*getAssociatedArchitectureByAddress)(void* ctxt, uint64_t* addr); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate IntPtr GetAssociatedArchitectureByAddressDelegate( + IntPtr ctxtm, + IntPtr address + ); + + /// + /// bool (*getInstructionInfo)(void* ctxt, const uint8_t* data, uint64_t addr, size_t maxLen, BNInstructionInfo* result); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate bool GetInstructionInfoDelegate( + IntPtr ctxt, + IntPtr data, + ulong address, + ulong maxLen, + IntPtr result + ); + + /// + /// bool (*getInstructionText)(void* ctxt, const uint8_t* data, uint64_t addr, size_t* len,BNInstructionTextToken** result, size_t* count); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate bool GetInstructionTextDelegate( + IntPtr ctxt, + IntPtr data, + ulong address, + IntPtr length, + IntPtr result, + IntPtr count + ); + + /// + /// void (*freeInstructionText)(BNInstructionTextToken* tokens, size_t count); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate void FreeInstructionTextDelegate( + IntPtr tokens, + ulong count + ); + + /// + /// bool (*getInstructionLowLevelIL)(void* ctxt, const uint8_t* data, uint64_t addr, size_t* len, BNLowLevelILFunction* il); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate bool GetInstructionLowLevelILDelegate( + IntPtr ctxt, + IntPtr data, + ulong address, + IntPtr length, + IntPtr il + ); + + /// + /// char* (*getRegisterName)(void* ctxt, uint32_t reg); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate IntPtr GetRegisterNameDelegate( + IntPtr ctxt, + uint reg + ); + + /// + /// char* (*getFlagName)(void* ctxt, uint32_t flag); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate IntPtr getFlagNameDelegate( + IntPtr ctxt, + uint flag + ); + + /// + /// char* (*getFlagWriteTypeName)(void* ctxt, uint32_t flags); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate IntPtr GetFlagWriteTypeNameDelegate( + IntPtr ctxt, + uint flags + ); + + /// + /// char* (*getSemanticFlagClassName)(void* ctxt, uint32_t semClass); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate IntPtr GetSemanticFlagClassNameDelegate( + IntPtr ctxt, + uint semClass + ); + + /// + /// char* (*getSemanticFlagGroupName)(void* ctxt, uint32_t semGroup); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate IntPtr GetSemanticFlagGroupNameDelegate( + IntPtr ctxt, + uint semGroup + ); + + /// + /// uint32_t* (*getFullWidthRegisters)(void* ctxt, size_t* count); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate IntPtr GetFullWidthRegistersDelegate( + IntPtr ctxt, + IntPtr count + ); + + /// + /// uint32_t* (*getAllRegisters)(void* ctxt, size_t* count); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate IntPtr GetAllRegistersDelegate( + IntPtr ctxt, + IntPtr count + ); + + /// + /// uint32_t* (*getAllFlags)(void* ctxt, size_t* count); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate IntPtr GetAllFlagsDelegate( + IntPtr ctxt, + IntPtr count + ); + + /// + /// uint32_t* (*getAllFlagWriteTypes)(void* ctxt, size_t* count); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate IntPtr GetAllFlagWriteTypesDelegate( + IntPtr ctxt, + IntPtr count + ); + + /// + /// uint32_t* (*getAllSemanticFlagClasses)(void* ctxt, size_t* count); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate IntPtr GetAllSemanticFlagClassesDelegate( + IntPtr ctxt, + IntPtr count + ); + + /// + /// uint32_t* (*getAllSemanticFlagGroups)(void* ctxt, size_t* count); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate IntPtr GetAllSemanticFlagGroupsDelegate( + IntPtr ctxt, + IntPtr count + ); + + /// + /// BNFlagRole (*getFlagRole)(void* ctxt, uint32_t flag, uint32_t semClass); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate FlagRole GetFlagRoleDelegate( + IntPtr ctxt, + uint flag, + uint semClass + ); + + /// + /// uint32_t* (*getFlagsRequiredForFlagCondition)(void* ctxt, BNLowLevelILFlagCondition cond, uint32_t semClass, size_t* count); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate IntPtr GetFlagsRequiredForFlagConditionDelegate( + IntPtr ctxt, + LowLevelILFlagCondition cond, + uint semClass, + IntPtr count + ); + + /// + /// uint32_t* (*getFlagsRequiredForSemanticFlagGroup)(void* ctxt, uint32_t semGroup, size_t* count); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate IntPtr GetFlagsRequiredForSemanticFlagGroupDelegate( + IntPtr ctxt, + uint semGroup, + IntPtr count + ); + + /// + /// BNFlagConditionForSemanticClass* (*getFlagConditionsForSemanticFlagGroup)(void* ctxt, uint32_t semGroup, size_t* count); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate IntPtr GetFlagConditionsForSemanticFlagGroupDelegate( + IntPtr ctxt, + uint semGroup, + IntPtr count + ); + + /// + /// void (*freeFlagConditionsForSemanticFlagGroup)(void* ctxt, BNFlagConditionForSemanticClass* conditions); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate void FreeFlagConditionsForSemanticFlagGroupDelegate( + IntPtr ctxt, + IntPtr conditions + ); + + /// + /// uint32_t* (*getFlagsWrittenByFlagWriteType)(void* ctxt, uint32_t writeType, size_t* count); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate IntPtr GetFlagsWrittenByFlagWriteTypeDelegate( + IntPtr ctxt, + uint writeType, + IntPtr count + ); + + /// + /// uint32_t (*getSemanticClassForFlagWriteType)(void* ctxt, uint32_t writeType); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate uint GetSemanticClassForFlagWriteTypeDelegate( + IntPtr ctxt, + uint writeType + ); + + /// + /// size_t (*getFlagWriteLowLevelIL)(void* ctxt, BNLowLevelILOperation op, size_t size, uint32_t flagWriteType,uint32_t flag, BNRegisterOrConstant* operands, size_t operandCount, BNLowLevelILFunction* il); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate ulong GetFlagWriteLowLevelILDelegate( + IntPtr ctxt, + LowLevelILOperation op, + ulong size, + uint flagWriteType, + uint flag, + IntPtr operands, + ulong operandCount, + IntPtr il + ); + + /// + /// size_t (*getFlagConditionLowLevelIL)(void* ctxt, BNLowLevelILFlagCondition cond, uint32_t semClass, BNLowLevelILFunction* il); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate ulong GetFlagConditionLowLevelILDelegate( + IntPtr ctxt, + LowLevelILFlagCondition cond, + uint semClass, + IntPtr il + ); + + /// + /// size_t (*getSemanticFlagGroupLowLevelIL)(void* ctxt, uint32_t semGroup, BNLowLevelILFunction* il); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate ulong GetSemanticFlagGroupLowLevelILDelegate( + IntPtr ctxt, + uint semGroup, + IntPtr il + ); + + /// + /// void (*freeRegisterList)(void* ctxt, uint32_t* regs); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate void FreeRegisterListDelegate( + IntPtr ctxt, + IntPtr regs + ); + + /// + /// void (*getRegisterInfo)(void* ctxt, uint32_t reg, BNRegisterInfo* result); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate void GetRegisterInfoDelegate( + IntPtr ctxt , + uint reg, + IntPtr result + ); + + /// + /// uint32_t (*getStackPointerRegister)(void* ctxt); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate uint GetStackPointerRegisterDelegate( + IntPtr ctxt + ); + + /// + /// uint32_t (*getLinkRegister)(void* ctxt); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate uint GetLinkRegisterDelegate( + IntPtr ctxt + ); + + /// + /// uint32_t* (*getGlobalRegisters)(void* ctxt, size_t* count); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate IntPtr GetGlobalRegistersDelegate( + IntPtr ctxt , + IntPtr count + ); + + /// + /// uint32_t* (*getSystemRegisters)(void* ctxt, size_t* count); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate IntPtr GetSystemRegistersDelegate( + IntPtr ctxt , + IntPtr count + ); + + /// + /// char* (*getRegisterStackName)(void* ctxt, uint32_t regStack); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate IntPtr GetRegisterStackNameDelegate( + IntPtr ctxt , + uint regStack + ); + + /// + /// uint32_t* (*getAllRegisterStacks)(void* ctxt, size_t* count); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate uint GetAllRegisterStacksDelegate( + IntPtr ctxt , + IntPtr count + ); + + /// + /// void (*getRegisterStackInfo)(void* ctxt, uint32_t regStack, BNRegisterStackInfo* result); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate void GetRegisterStackInfoDelegate( + IntPtr ctxt , + uint regStack, + IntPtr result + ); + + /// + /// BNIntrinsicClass (*getIntrinsicClass)(void* ctxt, uint32_t intrinsic); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate IntrinsicClass GetIntrinsicClassDelegate( + IntPtr ctxt , + uint intrinsic + ); + + /// + /// char* (*getIntrinsicName)(void* ctxt, uint32_t intrinsic); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate IntPtr GetIntrinsicNameDelegate( + IntPtr ctxt , + uint intrinsic + ); + + /// + /// uint32_t* (*getAllIntrinsics)(void* ctxt, size_t* count); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate IntPtr GetAllIntrinsicsDelegate( + IntPtr ctxt , + IntPtr count + ); + + /// + /// BNNameAndType* (*getIntrinsicInputs)(void* ctxt, uint32_t intrinsic, size_t* count); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate IntPtr GetIntrinsicInputsDelegate( + IntPtr ctxt , + uint intrinsic, + IntPtr count + ); + + /// + /// void (*freeNameAndTypeList)(void* ctxt, BNNameAndType* nt, size_t count); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate void FreeNameAndTypeListDelegate( + IntPtr ctxt , + IntPtr nt, + ulong count + ); + + /// + /// BNTypeWithConfidence* (*getIntrinsicOutputs)(void* ctxt, uint32_t intrinsic, size_t* count); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate IntPtr GetIntrinsicOutputsDelegate( + IntPtr ctxt , + uint intrinsic, + IntPtr count + ); + + /// + /// void (*freeTypeList)(void* ctxt, BNTypeWithConfidence* types, size_t count); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate void FreeTypeListDelegate( + IntPtr ctxt , + IntPtr types, + ulong count + ); + + /// + /// bool (*canAssemble)(void* ctxt); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate bool CanAssembleDelegate( + IntPtr ctxt + ); + + /// + /// bool (*assemble)(void* ctxt, const char* code, uint64_t addr, BNDataBuffer* result, char** errors); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate bool AssembleDelegate( + IntPtr ctxt , + IntPtr code, + ulong address, + IntPtr result, + IntPtr errors + ); + + /// + /// bool (*isNeverBranchPatchAvailable)(void* ctxt, const uint8_t* data, uint64_t addr, size_t len); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate bool IsNeverBranchPatchAvailableDelegate( + IntPtr ctxt , + IntPtr data, + ulong address, + ulong length + ); + + /// + /// bool (*isAlwaysBranchPatchAvailable)(void* ctxt, const uint8_t* data, uint64_t addr, size_t len); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate bool IsAlwaysBranchPatchAvailableDelegate( + IntPtr ctxt , + IntPtr data, + ulong address, + ulong length + ); + + /// + /// bool (*isInvertBranchPatchAvailable)(void* ctxt, const uint8_t* data, uint64_t addr, size_t len); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate bool IsInvertBranchPatchAvailableDelegate( + IntPtr ctxt , + IntPtr data, + ulong address, + ulong length + ); + + /// + /// bool (*isSkipAndReturnZeroPatchAvailable)(void* ctxt, const uint8_t* data, uint64_t addr, size_t len); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate bool IsSkipAndReturnZeroPatchAvailableDelegate( + IntPtr ctxt , + IntPtr data, + ulong address, + ulong length + ); + + /// + /// bool (*isSkipAndReturnValuePatchAvailable)(void* ctxt, const uint8_t* data, uint64_t addr, size_t len); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate bool IsSkipAndReturnValuePatchAvailableDelegate( + IntPtr ctxt , + IntPtr data, + ulong address, + ulong length + ); + + /// + /// bool (*convertToNop)(void* ctxt, uint8_t* data, uint64_t addr, size_t len); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate bool ConvertToNopDelegate( + IntPtr ctxt, + IntPtr data, + ulong address, + ulong length + ); + + /// + /// bool (*alwaysBranch)(void* ctxt, uint8_t* data, uint64_t addr, size_t len); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate bool AlwaysBranchDelegate( + IntPtr ctxt, + IntPtr data, + ulong address, + ulong length + ); + + /// + /// bool (*invertBranch)(void* ctxt, uint8_t* data, uint64_t addr, size_t len); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate bool InvertBranchDelegate( + IntPtr ctxt, + IntPtr data, + ulong address, + ulong length + ); + + /// + /// bool (*skipAndReturnValue)(void* ctxt, uint8_t* data, uint64_t addr, size_t len, uint64_t value); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate bool SkipAndReturnValueDelegate( + IntPtr ctxt, + IntPtr data, + ulong address, + ulong length, + ulong value + ); + + /// + /// void* context + /// + public IntPtr context; + + /// + /// void* init + /// + public IntPtr init; + + /// + /// void* getEndianness + /// + public IntPtr getEndianness; + + /// + /// void* getAddressSize + /// + public IntPtr getAddressSize; + + /// + /// void* getDefaultIntegerSize + /// + public IntPtr getDefaultIntegerSize; + + /// + /// void* getInstructionAlignment + /// + public IntPtr getInstructionAlignment; + + /// + /// void* getMaxInstructionLength + /// + public IntPtr getMaxInstructionLength; + + /// + /// void* getOpcodeDisplayLength + /// + public IntPtr getOpcodeDisplayLength; + + /// + /// void* getAssociatedArchitectureByAddress + /// + public IntPtr getAssociatedArchitectureByAddress; + + /// + /// void* getInstructionInfo + /// + public IntPtr getInstructionInfo; + + /// + /// void* getInstructionText + /// + public IntPtr getInstructionText; + + /// + /// void* freeInstructionText + /// + public IntPtr freeInstructionText; + + /// + /// void* getInstructionLowLevelIL + /// + public IntPtr getInstructionLowLevelIL; + + /// + /// void* analyzeBasicBlocks + /// + public IntPtr analyzeBasicBlocks; + + /// + /// void* getRegisterName + /// + public IntPtr getRegisterName; + + /// + /// void* getFlagName + /// + public IntPtr getFlagName; + + /// + /// void* getFlagWriteTypeName + /// + public IntPtr getFlagWriteTypeName; + + /// + /// void* getSemanticFlagClassName + /// + public IntPtr getSemanticFlagClassName; + + /// + /// void* getSemanticFlagGroupName + /// + public IntPtr getSemanticFlagGroupName; + + /// + /// void* getFullWidthRegisters + /// + public IntPtr getFullWidthRegisters; + + /// + /// void* getAllRegisters + /// + public IntPtr getAllRegisters; + + /// + /// void* getAllFlags + /// + public IntPtr getAllFlags; + + /// + /// void* getAllFlagWriteTypes + /// + public IntPtr getAllFlagWriteTypes; + + /// + /// void* getAllSemanticFlagClasses + /// + public IntPtr getAllSemanticFlagClasses; + + /// + /// void* getAllSemanticFlagGroups + /// + public IntPtr getAllSemanticFlagGroups; + + /// + /// void* getFlagRole + /// + public IntPtr getFlagRole; + + /// + /// void* getFlagsRequiredForFlagCondition + /// + public IntPtr getFlagsRequiredForFlagCondition; + + /// + /// void* getFlagsRequiredForSemanticFlagGroup + /// + public IntPtr getFlagsRequiredForSemanticFlagGroup; + + /// + /// void* getFlagConditionsForSemanticFlagGroup + /// + public IntPtr getFlagConditionsForSemanticFlagGroup; + + /// + /// void* freeFlagConditionsForSemanticFlagGroup + /// + public IntPtr freeFlagConditionsForSemanticFlagGroup; + + /// + /// void* getFlagsWrittenByFlagWriteType + /// + public IntPtr getFlagsWrittenByFlagWriteType; + + /// + /// void* getSemanticClassForFlagWriteType + /// + public IntPtr getSemanticClassForFlagWriteType; + + /// + /// void* getFlagWriteLowLevelIL + /// + public IntPtr getFlagWriteLowLevelIL; + + /// + /// void* getFlagConditionLowLevelIL + /// + public IntPtr getFlagConditionLowLevelIL; + + /// + /// void* getSemanticFlagGroupLowLevelIL + /// + public IntPtr getSemanticFlagGroupLowLevelIL; + + /// + /// void* freeRegisterList + /// + public IntPtr freeRegisterList; + + /// + /// void* getRegisterInfo + /// + public IntPtr getRegisterInfo; + + /// + /// void* getStackPointerRegister + /// + public IntPtr getStackPointerRegister; + + /// + /// void* getLinkRegister + /// + public IntPtr getLinkRegister; + + /// + /// void* getGlobalRegisters + /// + public IntPtr getGlobalRegisters; + + /// + /// void* getSystemRegisters + /// + public IntPtr getSystemRegisters; + + /// + /// void* getRegisterStackName + /// + public IntPtr getRegisterStackName; + + /// + /// void* getAllRegisterStacks + /// + public IntPtr getAllRegisterStacks; + + /// + /// void* getRegisterStackInfo + /// + public IntPtr getRegisterStackInfo; + + /// + /// void* getIntrinsicClass + /// + public IntPtr getIntrinsicClass; + + /// + /// void* getIntrinsicName + /// + public IntPtr getIntrinsicName; + + /// + /// void* getAllIntrinsics + /// + public IntPtr getAllIntrinsics; + + /// + /// void* getIntrinsicInputs + /// + public IntPtr getIntrinsicInputs; + + /// + /// void* freeNameAndTypeList + /// + public IntPtr freeNameAndTypeList; + + /// + /// void* getIntrinsicOutputs + /// + public IntPtr getIntrinsicOutputs; + + /// + /// void* freeTypeList + /// + public IntPtr freeTypeList; + + /// + /// void* canAssemble + /// + public IntPtr canAssemble; + + /// + /// void* assemble + /// + public IntPtr assemble; + + /// + /// void* isNeverBranchPatchAvailable + /// + public IntPtr isNeverBranchPatchAvailable; + + /// + /// void* isAlwaysBranchPatchAvailable + /// + public IntPtr isAlwaysBranchPatchAvailable; + + /// + /// void* isInvertBranchPatchAvailable + /// + public IntPtr isInvertBranchPatchAvailable; + + /// + /// void** isSkipAndReturnZeroPatchAvailable + /// + public IntPtr isSkipAndReturnZeroPatchAvailable; + + /// + /// void* isSkipAndReturnValuePatchAvailable + /// + public IntPtr isSkipAndReturnValuePatchAvailable; + + /// + /// void* convertToNop + /// + public IntPtr convertToNop; + + /// + /// void* alwaysBranch + /// + public IntPtr alwaysBranch; + + /// + /// void* invertBranch + /// + public IntPtr invertBranch; + + /// + /// void* skipAndReturnValue + /// + public IntPtr skipAndReturnValue; + } + + public abstract class CustomArchitecture + { + internal delegate void InitDelegate( + Architecture arch + ); + + internal delegate Endianness GetEndiannessDelegate(); + + internal delegate ulong GetAddressSizeDelegate(); + + internal delegate ulong GetDefaultIntegerSizeDelegate(); + + internal delegate ulong GetInstructionAlignmentDelegate(); + + internal delegate ulong GetMaxInstructionLengthDelegate(); + + internal delegate ulong GetOpcodeDisplayLengthDelegate(); + + internal delegate Architecture? GetAssociatedArchitectureByAddressDelegate( + ref ulong address + ); + + internal delegate InstructionInfo? GetInstructionInfoDelegate( + byte[] data, + ulong address + ); + + internal delegate InstructionTextToken[] GetInstructionTextDelegate( + byte[] data, + ulong address, + out ulong length + ); + + internal delegate void FreeInstructionTextDelegate( + IntPtr tokens, + ulong count + ); + + internal delegate bool GetInstructionLowLevelILDelegate( + byte[] data, + ulong address, + out ulong length, + LowLevelILFunction il + ); + + internal delegate string GetRegisterNameDelegate( + RegisterIndex reg + ); + + internal delegate string getFlagNameDelegate( + FlagIndex flag + ); + + internal delegate string GetFlagWriteTypeNameDelegate( + uint flags + ); + + internal delegate string GetSemanticFlagClassNameDelegate( + uint semClass + ); + + internal delegate string GetSemanticFlagGroupNameDelegate( + uint semGroup + ); + + internal delegate uint[] GetFullWidthRegistersDelegate(); + + internal delegate uint[] GetAllRegistersDelegate(); + + internal delegate uint[] GetAllFlagsDelegate(); + + internal delegate uint[] GetAllFlagWriteTypesDelegate(); + + internal delegate uint[] GetAllSemanticFlagClassesDelegate(); + + internal delegate uint[] GetAllSemanticFlagGroupsDelegate(); + + internal delegate FlagRole GetFlagRoleDelegate( + uint flag, + uint semClass + ); + + internal delegate uint[] GetFlagsRequiredForFlagConditionDelegate( + LowLevelILFlagCondition cond, + uint semClass + ); + + internal delegate uint[] GetFlagsRequiredForSemanticFlagGroupDelegate( + uint semGroup + ); + + internal delegate FlagConditionForSemanticClass[] GetFlagConditionsForSemanticFlagGroupDelegate( + uint semGroup + ); + + internal delegate void FreeFlagConditionsForSemanticFlagGroupDelegate( + IntPtr conditions + ); + + internal delegate uint[] GetFlagsWrittenByFlagWriteTypeDelegate( + uint writeType + ); + + internal delegate uint GetSemanticClassForFlagWriteTypeDelegate( + uint writeType + ); + + internal delegate ulong GetFlagWriteLowLevelILDelegate( + LowLevelILOperation op, + ulong size, + uint flagWriteType, + uint flag, + RegisterOrConstant[] operands, + LowLevelILFunction il + ); + + internal delegate ulong GetFlagConditionLowLevelILDelegate( + LowLevelILFlagCondition cond, + uint semClass, + LowLevelILFunction il + ); + + internal delegate ulong GetSemanticFlagGroupLowLevelILDelegate( + uint semGroup, + LowLevelILFunction il + ); + + internal delegate void FreeRegisterListDelegate( + IntPtr regs + ); + + internal delegate RegisterInfo GetRegisterInfoDelegate( + uint reg + ); + + internal delegate uint GetStackPointerRegisterDelegate(); + + internal delegate uint GetLinkRegisterDelegate(); + + internal delegate uint[] GetGlobalRegistersDelegate(); + + internal delegate uint[] GetSystemRegistersDelegate(); + + internal delegate string GetRegisterStackNameDelegate( + uint regStack + ); + + internal unsafe delegate uint[] GetAllRegisterStacksDelegate(); + + internal unsafe delegate RegisterStackInfo GetRegisterStackInfoDelegate( + uint regStack + ); + + internal delegate IntrinsicClass GetIntrinsicClassDelegate( + uint intrinsic + ); + + internal delegate string GetIntrinsicNameDelegate( + uint intrinsic + ); + + internal delegate uint[] GetAllIntrinsicsDelegate(); + + internal delegate NameAndType[] GetIntrinsicInputsDelegate( + uint intrinsic + ); + + internal unsafe delegate void FreeNameAndTypeListDelegate( + IntPtr nt, + ulong count + ); + + internal delegate TypeWithConfidence[] GetIntrinsicOutputsDelegate( + uint intrinsic + ); + + internal delegate void FreeTypeListDelegate( + IntPtr types, + ulong count + ); + + internal delegate bool CanAssembleDelegate(); + + internal delegate byte[] AssembleDelegate( + string code, + ulong address + ); + + internal delegate bool IsNeverBranchPatchAvailableDelegate( + byte[] data, + ulong address + ); + + internal delegate bool IsAlwaysBranchPatchAvailableDelegate( + byte[] data, + ulong address + ); + + internal delegate bool IsInvertBranchPatchAvailableDelegate( + byte[] data, + ulong address + ); + + internal delegate bool IsSkipAndReturnZeroPatchAvailableDelegate( + byte[] data, + ulong address + ); + + internal delegate void IsSkipAndReturnValuePatchAvailableDelegate( + byte[] data, + ulong address + ); + + internal delegate bool ConvertToNopDelegate( + byte[] data, + ulong address + ); + + internal delegate bool AlwaysBranchDelegate( + byte[] data, + ulong address + ); + + internal delegate bool InvertBranchDelegate( + byte[] data, + ulong address + ); + + internal delegate bool SkipAndReturnValueDelegate( + byte[] data, + ulong address, + ulong value + ); + + public CustomArchitecture() + { + + } + + + + #region method + + public virtual void Init( + Architecture arch + ) + { + + } + + public virtual Endianness GetEndianness() + { + return Endianness.LittleEndian; + } + + public virtual ulong GetAddressSize() + { + return 0; + } + + public virtual ulong GetDefaultIntegerSize() + { + return 0; + } + + public virtual ulong GetInstructionAlignment() + { + return 0; + } + + public virtual ulong GetMaxInstructionLength() + { + return 0; + } + + public virtual ulong GetOpcodeDisplayLength() + { + return 0; + } + + public virtual Architecture? GetAssociatedArchitectureByAddress( + ref ulong address + ) + { + return null; + } + + public virtual InstructionInfo? GetInstructionInfo( + byte[] data , + ulong address + ) + { + return null; + } + + public virtual InstructionTextToken[] GetInstructionText( + byte[] data , + ulong address , + out ulong length + ) + { + length = 0; + + return Array.Empty(); + } + + public virtual void FreeInstructionText( + IntPtr tokens , + ulong count + ) + { + + } + + public virtual ulong? GetInstructionLowLevelIL( + byte[] data , + ulong address , + LowLevelILFunction il + ) + { + return null; + } + + public virtual string GetRegisterName( + RegisterIndex reg + ) + { + return string.Empty; + } + + public virtual string getFlagName( + FlagIndex flag + ) + { + return string.Empty; + } + + public virtual string GetFlagWriteTypeName( + uint flags + ) + { + return string.Empty; + } + + public virtual string GetSemanticFlagClassName( + uint semClass + ) + { + return string.Empty; + } + + public virtual string GetSemanticFlagGroupName( + uint semGroup + ) + { + return string.Empty; + } + + public virtual uint[] GetFullWidthRegisters() + { + return Array.Empty(); + } + + + public virtual uint[] GetAllRegisters() + { + return Array.Empty(); + } + + + public virtual uint[] GetAllFlags() + { + return Array.Empty(); + } + + + public virtual uint[] GetAllFlagWriteTypes() + { + return Array.Empty(); + } + + + public virtual uint[] GetAllSemanticFlagClasses() + { + return Array.Empty(); + } + + + public virtual uint[] GetAllSemanticFlagGroups() + { + return Array.Empty(); + } + + public virtual FlagRole GetFlagRole( + uint flag , + uint semClass + ) + { + return 0; + } + + public virtual uint[] GetFlagsRequiredForFlagCondition( + LowLevelILFlagCondition cond , + uint semClass + ) + { + return Array.Empty(); + } + + public virtual uint[] GetFlagsRequiredForSemanticFlagGroup( + uint semGroup + ) + { + return Array.Empty(); + } + + public virtual FlagConditionForSemanticClass[] GetFlagConditionsForSemanticFlagGroup( + uint semGroup + ) + { + return Array.Empty(); + } + + public virtual void FreeFlagConditionsForSemanticFlagGroup( + IntPtr conditions + ) + { + + } + + public virtual uint[] GetFlagsWrittenByFlagWriteType( + uint writeType + ) + { + return Array.Empty(); + } + + public virtual uint GetSemanticClassForFlagWriteType( + uint writeType + ) + { + return 0; + } + + public virtual ulong GetFlagWriteLowLevelIL( + LowLevelILOperation op , + ulong size , + uint flagWriteType , + uint flag , + RegisterOrConstant[] operands , + LowLevelILFunction il + ) + { + return 0; + } + + public virtual ulong GetFlagConditionLowLevelIL( + LowLevelILFlagCondition cond , + uint semClass , + LowLevelILFunction il + ) + { + return 0; + } + + public virtual ulong GetSemanticFlagGroupLowLevelIL( + uint semGroup , + LowLevelILFunction il + ) + { + return 0; + } + + public virtual void FreeRegisterList( + IntPtr regs + ) + { + + } + + public virtual RegisterInfo GetRegisterInfo( + uint reg + ) + { + return new RegisterInfo(); + } + + public virtual uint GetStackPointerRegister() + { + return 0; + } + + public virtual uint GetLinkRegister() + { + return 0; + } + + public virtual uint[] GetGlobalRegisters() + { + return Array.Empty(); + } + + public virtual uint[] GetSystemRegisters() + { + return Array.Empty(); + } + + public virtual string GetRegisterStackName( + uint regStack + ) + { + return string.Empty; + } + + public virtual uint[] GetAllRegisterStacks() + { + return Array.Empty(); + } + + public virtual RegisterStackInfo GetRegisterStackInfo( + uint regStack + ) + { + return new RegisterStackInfo(); + } + + public virtual IntrinsicClass GetIntrinsicClass( + uint intrinsic + ) + { + return 0; + } + + public virtual string GetIntrinsicName( + uint intrinsic + ) + { + return string.Empty; + } + + public virtual uint[] GetAllIntrinsics() + { + return Array.Empty(); + } + + public virtual NameAndType[] GetIntrinsicInputs( + uint intrinsic + ) + { + return Array.Empty(); + } + + public virtual void FreeNameAndTypeList( + IntPtr nt , + ulong count + ) + { + + } + + public virtual TypeWithConfidence[] GetIntrinsicOutputs( + uint intrinsic + ) + { + return Array.Empty(); + } + + public virtual void FreeTypeList( + IntPtr types , + ulong count + ) + { + + } + + public virtual bool CanAssemble() + { + return false; + } + + public virtual byte[] Assemble( + string code , + ulong address + ) + { + return Array.Empty(); + } + + public virtual bool IsNeverBranchPatchAvailable( + byte[] data , + ulong address + ) + { + return false; + } + + public virtual bool IsAlwaysBranchPatchAvailable( + byte[] data , + ulong address + ) + { + return false; + } + + public virtual bool IsInvertBranchPatchAvailable( + byte[] data , + ulong address + ) + { + return false; + } + + public virtual bool IsSkipAndReturnZeroPatchAvailable( + byte[] data , + ulong address + ) + { + return false; + } + + public virtual bool IsSkipAndReturnValuePatchAvailable( + byte[] data , + ulong address + ) + { + return false; + } + + public virtual bool ConvertToNop( + byte[] data , + ulong address + ) + { + return false; + } + + public virtual bool AlwaysBranch( + byte[] data , + ulong address + ) + { + return false; + } + + public virtual bool InvertBranch( + byte[] data , + ulong address + ) + { + return false; + } + + public virtual bool SkipAndReturnValue( + byte[] data , + ulong address , + ulong value + ) + { + return false; + } + + + #endregion + } +} \ No newline at end of file diff --git a/Struct/BNCustomBinaryView.cs b/Struct/BNCustomBinaryView.cs new file mode 100644 index 0000000..98b44f8 --- /dev/null +++ b/Struct/BNCustomBinaryView.cs @@ -0,0 +1,706 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNCustomBinaryView + { + // bool (*init)(void* ctxt); + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate bool InitDelegate( + IntPtr ctxt + ); + + // void (*freeObject)(void* ctxt); + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate void FreeObjectDelegate( + IntPtr ctxt + ); + + // void (*externalRefTaken)(void* ctxt); + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate void ExternalRefTakenDelegate( + IntPtr ctxt + ); + + // void (*externalRefReleased)(void* ctxt); + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate void ExternalRefReleasedDelegate( + IntPtr ctxt + ); + + // size_t (*read)(void* ctxt, void* dest, uint64_t offset, size_t len); + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate ulong ReadDelegate( + IntPtr ctxt, + IntPtr dest, + ulong offset, + ulong length + ); + + // size_t (*write)(void* ctxt, uint64_t offset, const void* src, size_t len); + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate ulong WriteDelegate( + IntPtr ctxt, + ulong offset, + IntPtr src, + ulong length + ); + + // size_t (*insert)(void* ctxt, uint64_t offset, const void* src, size_t len); + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate ulong InsertDelegate( + IntPtr ctxt, + ulong offset, + IntPtr src, + ulong length + ); + + // size_t (*remove)(void* ctxt, uint64_t offset, uint64_t len); + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate ulong RemoveDelegate( + IntPtr ctxt, + ulong offset, + ulong length + ); + + // BNModificationStatus (*getModification)(void* ctxt, uint64_t offset); + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate ModificationStatus GetModificationDelegate( + IntPtr ctxt, + ulong offset + ); + + // bool (*isValidOffset)(void* ctxt, uint64_t offset); + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate bool IsValidOffsetDelegate( + IntPtr ctxt , + ulong offset + ); + + // bool (*isOffsetReadable)(void* ctxt, uint64_t offset); + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate bool IsOffsetReadableDelegate( + IntPtr ctxt , + ulong offset + ); + + // bool (*isOffsetWritable)(void* ctxt, uint64_t offset); + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate bool IsOffsetWritableDelegate( + IntPtr ctxt, + ulong offset + ); + + // bool (*isOffsetExecutable)(void* ctxt, uint64_t offset); + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate bool IsOffsetExecutableDelegate( + IntPtr ctxt, + ulong offset + ); + + // bool (*isOffsetBackedByFile)(void* ctxt, uint64_t offset); + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate bool IsOffsetBackedByFileDelegate( + IntPtr ctxt, + ulong offset + ); + + // uint64_t (*getNextValidOffset)(void* ctxt, uint64_t offset); + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate ulong GetNextValidOffsetDelegate( + IntPtr ctxt, + ulong offset + ); + + // uint64_t (*getStart)(void* ctxt); + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate ulong GetStartDelegate( + IntPtr ctxt + ); + + + // uint64_t (*getLength)(void* ctxt); + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate ulong GetLengthDelegate( + IntPtr ctxt + ); + + // uint64_t (*getEntryPoint)(void* ctxt); + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate ulong GetEntryPointDelegate( + IntPtr ctxt + ); + + // bool (*isExecutable)(void* ctxt); + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate bool IsExecutableDelegate( + IntPtr ctxt + ); + + // BNEndianness (*getDefaultEndianness)(void* ctxt); + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate Endianness GetDefaultEndiannessDelegate( + IntPtr ctxt + ); + + // bool (*isRelocatable)(void* ctxt); + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate bool IsRelocatableDelegate( + IntPtr ctxt + ); + + // size_t (*getAddressSize)(void* ctxt); + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate ulong GetAddressSizeDelegate( + IntPtr ctxt + ); + + // bool (*save)(void* ctxt, BNFileAccessor* accessor); + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate bool SaveDelegate( + IntPtr ctxt, + IntPtr accessor + ); + + /// + /// void* context + /// + internal IntPtr context; + + /// + /// void* init + /// + internal IntPtr init; + + /// + /// void* freeObject + /// + internal IntPtr freeObject; + + /// + /// void* externalRefTaken + /// + internal IntPtr externalRefTaken; + + /// + /// void* externalRefReleased + /// + internal IntPtr externalRefReleased; + + /// + /// void* read + /// + internal IntPtr read; + + /// + /// void* write + /// + internal IntPtr write; + + /// + /// void* insert + /// + internal IntPtr insert; + + /// + /// void* remove + /// + internal IntPtr remove; + + /// + /// void* getModification + /// + internal IntPtr getModification; + + /// + /// void* isValidOffset + /// + internal IntPtr isValidOffset; + + /// + /// void* isOffsetReadable + /// + internal IntPtr isOffsetReadable; + + /// + /// void* isOffsetWritable + /// + internal IntPtr isOffsetWritable; + + /// + /// void* isOffsetExecutable + /// + internal IntPtr isOffsetExecutable; + + /// + /// void* isOffsetBackedByFile + /// + internal IntPtr isOffsetBackedByFile; + + /// + /// void* getNextValidOffset + /// + internal IntPtr getNextValidOffset; + + /// + /// void* getStart + /// + internal IntPtr getStart; + + /// + /// void* getLength + /// + internal IntPtr getLength; + + /// + /// void* getEntryPoint + /// + internal IntPtr getEntryPoint; + + /// + /// void* isExecutable + /// + internal IntPtr isExecutable; + + /// + /// void* getDefaultEndianness + /// + internal IntPtr getDefaultEndianness; + + /// + /// void* isRelocatable + /// + internal IntPtr isRelocatable; + + /// + /// void* getAddressSize + /// + internal IntPtr getAddressSize; + + /// + /// void* save + /// + internal IntPtr save; + } + + public abstract class CustomBinaryView + { + public CustomBinaryView() + { + + } + + public BNCustomBinaryView ToNative() + { + return new BNCustomBinaryView + { + context = IntPtr.Zero, + init = Marshal.GetFunctionPointerForDelegate(this.InitThunk), + freeObject = Marshal.GetFunctionPointerForDelegate(this.FreeObjectThunk), + externalRefTaken = Marshal.GetFunctionPointerForDelegate(this.ExternalRefTakenThunk), + externalRefReleased = Marshal.GetFunctionPointerForDelegate(this.ExternalRefReleasedThunk), + read = Marshal.GetFunctionPointerForDelegate(this.ReadThunk), + write = Marshal.GetFunctionPointerForDelegate(this.WriteThunk), + insert = Marshal.GetFunctionPointerForDelegate(this.InsertThunk), + remove = Marshal.GetFunctionPointerForDelegate(this.RemoveThunk), + getModification = Marshal.GetFunctionPointerForDelegate(this.GetModificationThunk), + isValidOffset = Marshal.GetFunctionPointerForDelegate(this.IsValidOffsetThunk), + isOffsetReadable = Marshal.GetFunctionPointerForDelegate(this.IsOffsetReadableThunk), + isOffsetWritable = Marshal.GetFunctionPointerForDelegate(this.IsOffsetWritableThunk), + isOffsetExecutable = Marshal.GetFunctionPointerForDelegate(this.IsOffsetExecutableThunk), + isOffsetBackedByFile = Marshal.GetFunctionPointerForDelegate(this.IsOffsetBackedByFileThunk), + getNextValidOffset = Marshal.GetFunctionPointerForDelegate(this.GetNextValidOffsetThunk), + getStart = Marshal.GetFunctionPointerForDelegate(this.GetStartThunk), + getLength = Marshal.GetFunctionPointerForDelegate(this.GetLengthThunk), + getEntryPoint = Marshal.GetFunctionPointerForDelegate(this.GetEntryPointThunk), + isExecutable = Marshal.GetFunctionPointerForDelegate(this.IsExecutableThunk), + getDefaultEndianness = Marshal.GetFunctionPointerForDelegate(this.GetDefaultEndiannessThunk), + isRelocatable = Marshal.GetFunctionPointerForDelegate(this.IsRelocatableThunk), + getAddressSize = Marshal.GetFunctionPointerForDelegate(this.GetAddressSizeThunk), + save = Marshal.GetFunctionPointerForDelegate(this.SaveThunk), + }; + } + + public BinaryView? CreateView( + string name, + BinaryView parent , + FileMetadata? file = null + ) + { + if (null == file) + { + file = parent.File; + } + + return BinaryView.TakeHandle( + NativeMethods.BNCreateCustomBinaryView( + name , + file.DangerousGetHandle() , + parent.DangerousGetHandle() , + this.ToNative() + ) + ); + } + + #region Thunk + + // bool (*init)(void* ctxt); + private bool InitThunk(IntPtr ctxt) + { + return this.Init(); + } + + // void (*freeObject)(void* ctxt); + private void FreeObjectThunk(IntPtr ctxt) + { + this.FreeObject(); + } + + + // void (*externalRefTaken)(void* ctxt); + private void ExternalRefTakenThunk(IntPtr ctxt) + { + this.ExternalRefTaken(); + } + + // void (*externalRefReleased)(void* ctxt); + private void ExternalRefReleasedThunk(IntPtr ctxt) + { + this.ExternalRefReleased(); + } + + // size_t (*read)(void* ctxt, void* dest, uint64_t offset, size_t len); + private ulong ReadThunk( + IntPtr ctxt , + IntPtr dest , + ulong offset , + ulong length + ) + { + if (0 == length) + { + return 0; + } + + byte[] data = this.Read(offset, length); + + if (0 != data.Length) + { + Marshal.Copy(data, 0, dest, data.Length); + } + + return (ulong)data.Length; + } + + // size_t (*write)(void* ctxt, uint64_t offset, const void* src, size_t len); + private ulong WriteThunk( + IntPtr ctxt , + ulong offset , + IntPtr src , + ulong length + ) + { + if (0 == length) + { + return 0; + } + + byte[] data = new byte[length]; + + Marshal.Copy(src , data ,0, data.Length); + + return (ulong)this.Write(offset, data); + } + + // size_t (*insert)(void* ctxt, uint64_t offset, const void* src, size_t len); + private ulong InsertThunk( + IntPtr ctxt , + ulong offset , + IntPtr src , + ulong length + ) + { + if (0 == length) + { + return 0; + } + + byte[] data = new byte[length]; + + Marshal.Copy(src , data ,0, data.Length); + + return (ulong)this.Insert(offset, data); + } + + // size_t (*remove)(void* ctxt, uint64_t offset, uint64_t len); + private ulong RemoveThunk( + IntPtr ctxt , + ulong offset , + ulong length + ) + { + return this.Remove(offset, length); + } + + // BNModificationStatus (*getModification)(void* ctxt, uint64_t offset); + private ModificationStatus GetModificationThunk( + IntPtr ctxt , + ulong offset + ) + { + return this.GetModification(offset); + } + + // bool (*isValidOffset)(void* ctxt, uint64_t offset); + private bool IsValidOffsetThunk( + IntPtr ctxt , + ulong offset + ) + { + return this.IsValidOffset(offset); + } + + // bool (*isOffsetReadable)(void* ctxt, uint64_t offset); + private bool IsOffsetReadableThunk( + IntPtr ctxt , + ulong offset + ) + { + return this.IsOffsetReadable(offset); + } + + // bool (*isOffsetWritable)(void* ctxt, uint64_t offset); + private bool IsOffsetWritableThunk( + IntPtr ctxt , + ulong offset + ) + { + return this.IsOffsetWritable(offset); + } + + // bool (*isOffsetExecutable)(void* ctxt, uint64_t offset); + private bool IsOffsetExecutableThunk( + IntPtr ctxt , + ulong offset + ) + { + return this.IsOffsetExecutable(offset); + } + + // bool (*isOffsetBackedByFile)(void* ctxt, uint64_t offset); + private bool IsOffsetBackedByFileThunk( + IntPtr ctxt , + ulong offset + ) + { + return this.IsOffsetBackedByFile(offset); + } + + // uint64_t (*getNextValidOffset)(void* ctxt, uint64_t offset); + private ulong GetNextValidOffsetThunk( + IntPtr ctxt , + ulong offset + ) + { + return this.GetNextValidOffset(offset); + } + + // uint64_t (*getStart)(void* ctxt); + private ulong GetStartThunk(IntPtr ctxt) + { + return this.Start; + } + + + // uint64_t (*getLength)(void* ctxt); + private ulong GetLengthThunk(IntPtr ctxt) + { + return this.Length; + } + + // uint64_t (*getEntryPoint)(void* ctxt); + private ulong GetEntryPointThunk(IntPtr ctxt) + { + return this.EntryPoint; + } + + // bool (*isExecutable)(void* ctxt); + private bool IsExecutableThunk(IntPtr ctxt) + { + return this.Executable; + } + + // BNEndianness (*getDefaultEndianness)(void* ctxt); + private Endianness GetDefaultEndiannessThunk(IntPtr ctxt) + { + return this.DefaultEndianness; + } + + // bool (*isRelocatable)(void* ctxt); + private bool IsRelocatableThunk(IntPtr ctxt) + { + return this.Relocatable; + } + + // size_t (*getAddressSize)(void* ctxt); + private ulong GetAddressSizeThunk(IntPtr ctxt) + { + return this.AddressSize; + } + + // bool (*save)(void* ctxt, BNFileAccessor* accessor); + private bool SaveThunk(IntPtr ctxt , IntPtr accessor) + { + return this.Save( + FileAccessor.MustFromNativePointer(accessor) + ); + } + + #endregion Thunk + + #region methods + + public virtual bool Init() + { + return true; + } + + public virtual void FreeObject() + { + + } + + public virtual void ExternalRefTaken() + { + + } + + public virtual void ExternalRefReleased() + { + + } + + + public virtual byte[] Read(ulong offset , ulong length) + { + return Array.Empty(); + } + + public virtual int Write(ulong offset , byte[] data) + { + return 0; + } + + public virtual int Insert(ulong offset , byte[] data) + { + return 0; + } + + public virtual ulong Remove(ulong offset , ulong length) + { + return 0; + } + + public virtual ModificationStatus GetModification(ulong offset) + { + return ModificationStatus.Original; + } + + public virtual bool IsValidOffset(ulong offset) + { + return false; + } + + public virtual bool IsOffsetReadable(ulong offset) + { + return false; + } + + public virtual bool IsOffsetWritable(ulong offset) + { + return false; + } + + public virtual bool IsOffsetExecutable(ulong offset) + { + return false; + } + + public virtual bool IsOffsetBackedByFile(ulong offset) + { + return false; + } + + public virtual ulong GetNextValidOffset(ulong offset) + { + return 0; + } + + public virtual ulong Start + { + get + { + return 0; + } + } + + public virtual ulong Length + { + get + { + return 0; + } + } + + public virtual ulong EntryPoint + { + get + { + return 0; + } + } + + public virtual bool Executable + { + get + { + return false; + } + } + + public virtual Endianness DefaultEndianness + { + get + { + return Endianness.LittleEndian; + } + } + + public virtual bool Relocatable + { + get + { + return false; + } + } + + public virtual ulong AddressSize + { + get + { + return 0; + } + } + + public virtual bool Save(FileAccessor accessor) + { + return false; + } + + #endregion methods + } +} \ No newline at end of file diff --git a/Struct/BNCustomBinaryViewType.cs b/Struct/BNCustomBinaryViewType.cs new file mode 100644 index 0000000..a8d3d57 --- /dev/null +++ b/Struct/BNCustomBinaryViewType.cs @@ -0,0 +1,271 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNCustomBinaryViewType + { + // BNBinaryView* (*create)(void* ctxt, BNBinaryView* data); + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate IntPtr CreateDelegate( + IntPtr ctxt, + IntPtr data + ); + + // BNBinaryView* (*parse)(void* ctxt, BNBinaryView* data); + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate IntPtr ParseDelegate( + IntPtr ctxt, + IntPtr data + ); + + // bool (*isValidForData)(void* ctxt, BNBinaryView* data); + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate bool IsValidForDataDelegate( + IntPtr ctxt, + IntPtr data + ); + + // bool (*isDeprecated)(void* ctxt); + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate bool IsDeprecatedDelegate( + IntPtr ctxt + ); + + // bool (*isForceLoadable)(void* ctxt); + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate bool IsForceLoadableDelegate( + IntPtr ctxt + ); + + // BNSettings* (*getLoadSettingsForData)(void* ctxt, BNBinaryView* data); + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate IntPtr GetLoadSettingsForDataDelegate( + IntPtr ctxt, + IntPtr data + ); + + /// + /// BNBinaryView* (*create)(void* ctxt, BNBinaryView* data); + /// + internal CreateDelegate m_create; + + /// + /// BNBinaryView* (*parse)(void* ctxt, BNBinaryView* data); + /// + internal ParseDelegate m_parse; + + /// + /// bool (*isValidForData)(void* ctxt, BNBinaryView* data); + /// + internal IsValidForDataDelegate m_isValidForData; + + /// + /// bool (*isDeprecated)(void* ctxt); + /// + internal IsDeprecatedDelegate m_isDeprecated; + + /// + /// bool (*isForceLoadable)(void* ctxt); + /// + internal IsForceLoadableDelegate m_isForceLoadable; + + /// + /// void* context + /// + internal IntPtr context; + + /// + /// void* create + /// + internal IntPtr create; + + /// + /// void* parse + /// + internal IntPtr parse; + + /// + /// void* isValidForData + /// + internal IntPtr isValidForData; + + /// + /// void* isDeprecated + /// + internal IntPtr isDeprecated; + + /// + /// void* isForceLoadable + /// + internal IntPtr isForceLoadable; + + /// + /// void* getLoadSettingsForData + /// + internal IntPtr getLoadSettingsForData; + } + + public abstract class CustomBinaryViewType : INativeWrapper + { + public CustomBinaryViewType() + { + + } + + public BNCustomBinaryViewType ToNative() + { + return new BNCustomBinaryViewType + { + context = IntPtr.Zero, + create = Marshal.GetFunctionPointerForDelegate(this.CreateThunk), + parse = Marshal.GetFunctionPointerForDelegate(this.ParseThunk), + isValidForData = Marshal.GetFunctionPointerForDelegate(this.IsValidForDataThunk), + isDeprecated = Marshal.GetFunctionPointerForDelegate(this.IsDeprecatedThunk), + isForceLoadable = Marshal.GetFunctionPointerForDelegate(this.IsForceLoadableThunk), + getLoadSettingsForData = Marshal.GetFunctionPointerForDelegate(this.GetLoadSettingsForDataThunk), + }; + } + + public BinaryViewType? RegisterBinaryViewType(string name , string longName) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + return BinaryViewType.FromHandle( + NativeMethods.BNRegisterBinaryViewType( + name , + longName , + allocator.AllocStruct(this.ToNative()) + ) + ); + } + } + + + #region thunk + + // BNBinaryView* (*create)(void* ctxt, BNBinaryView* data); + private unsafe IntPtr CreateThunk( + IntPtr ctxt, + IntPtr data + ) + { + BinaryView? view = this.Create( + new BinaryView(data , false) + ); + + if (view == null) + { + return IntPtr.Zero; + } + + return view.DangerousGetHandle(); + } + + // BNBinaryView* (*parse)(void* ctxt, BNBinaryView* data); + private unsafe IntPtr ParseThunk( + IntPtr ctxt , + IntPtr data + ) + { + BinaryView? view = this.Parse(new BinaryView(data , false)); + + if (view == null) + { + return IntPtr.Zero; + } + + return view.DangerousGetHandle(); + } + + // bool (*isValidForData)(void* ctxt, BNBinaryView* data); + private unsafe bool IsValidForDataThunk( + IntPtr ctxt , + IntPtr data + ) + { + return this.IsValidForData( + new BinaryView(data, false) + ); + } + + // bool (*isDeprecated)(void* ctxt); + private unsafe bool IsDeprecatedThunk( + IntPtr ctxt + ) + { + return this.Deprecated; + } + + // bool (*isForceLoadable)(void* ctxt); + private unsafe bool IsForceLoadableThunk(IntPtr ctxt) + { + return this.ForceLoadable; + } + + + // BNSettings* (*getLoadSettingsForData)(void* ctxt, BNBinaryView* data); + private unsafe IntPtr GetLoadSettingsForDataThunk( + IntPtr ctxt , + IntPtr data + ) + { + Settings? settings = this.GetLoadSettingsForData( + new BinaryView(data , false) + ); + + if (null == settings) + { + return IntPtr.Zero; + } + + return settings.DangerousGetHandle(); + } + + #endregion + + #region methods + + + public virtual BinaryView? Create(BinaryView data) + { + return null; + } + + public virtual BinaryView? Parse(BinaryView data) + { + return null; + } + + public virtual bool IsValidForData(BinaryView data) + { + return false; + } + + public virtual bool Deprecated + { + get + { + return false; + } + } + + public virtual bool ForceLoadable + { + get + { + return false; + } + } + + public virtual Settings? GetLoadSettingsForData(BinaryView data) + { + return null; + } + + #endregion methods + } +} \ No newline at end of file diff --git a/Struct/BNCustomCallingConvention.cs b/Struct/BNCustomCallingConvention.cs new file mode 100644 index 0000000..6cc2f86 --- /dev/null +++ b/Struct/BNCustomCallingConvention.cs @@ -0,0 +1,126 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNCustomCallingConvention + { + /// + /// void* context + /// + public IntPtr context; + + /// + /// void** freeObject + /// + public IntPtr freeObject; + + /// + /// void** getCallerSavedRegisters + /// + public IntPtr getCallerSavedRegisters; + + /// + /// void** getCalleeSavedRegisters + /// + public IntPtr getCalleeSavedRegisters; + + /// + /// void** getIntegerArgumentRegisters + /// + public IntPtr getIntegerArgumentRegisters; + + /// + /// void** getFloatArgumentRegisters + /// + public IntPtr getFloatArgumentRegisters; + + /// + /// void** freeRegisterList + /// + public IntPtr freeRegisterList; + + /// + /// void** areArgumentRegistersSharedIndex + /// + public IntPtr areArgumentRegistersSharedIndex; + + /// + /// void** isStackReservedForArgumentRegisters + /// + public IntPtr isStackReservedForArgumentRegisters; + + /// + /// void** isStackAdjustedOnReturn + /// + public IntPtr isStackAdjustedOnReturn; + + /// + /// void** isEligibleForHeuristics + /// + public IntPtr isEligibleForHeuristics; + + /// + /// void** getIntegerReturnValueRegister + /// + public IntPtr getIntegerReturnValueRegister; + + /// + /// void** getHighIntegerReturnValueRegister + /// + public IntPtr getHighIntegerReturnValueRegister; + + /// + /// void** getFloatReturnValueRegister + /// + public IntPtr getFloatReturnValueRegister; + + /// + /// void** getGlobalPointerRegister + /// + public IntPtr getGlobalPointerRegister; + + /// + /// void** getImplicitlyDefinedRegisters + /// + public IntPtr getImplicitlyDefinedRegisters; + + /// + /// void** getIncomingRegisterValue + /// + public IntPtr getIncomingRegisterValue; + + /// + /// void** getIncomingFlagValue + /// + public IntPtr getIncomingFlagValue; + + /// + /// void** getIncomingVariableForParameterVariable + /// + public IntPtr getIncomingVariableForParameterVariable; + + /// + /// void** getParameterVariableForIncomingVariable + /// + public IntPtr getParameterVariableForIncomingVariable; + + /// + /// void** areArgumentRegistersUsedForVarArgs + /// + public IntPtr areArgumentRegistersUsedForVarArgs; + + } + + public class CustomCallingConvention + { + + public CustomCallingConvention() + { + + } + } +} \ No newline at end of file diff --git a/Struct/BNCustomDataRenderer.cs b/Struct/BNCustomDataRenderer.cs new file mode 100644 index 0000000..69a1094 --- /dev/null +++ b/Struct/BNCustomDataRenderer.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNCustomDataRenderer + { + /// + /// void* context + /// + public IntPtr context; + + /// + /// void** freeObject + /// + public IntPtr freeObject; + + /// + /// void** isValidForData + /// + public IntPtr isValidForData; + + /// + /// void** getLinesForData + /// + public IntPtr getLinesForData; + + /// + /// void** freeLines + /// + public IntPtr freeLines; + } + + public class CustomDataRenderer + { + public CustomDataRenderer() + { + + } + } +} \ No newline at end of file diff --git a/Struct/BNCustomFlowGraph.cs b/Struct/BNCustomFlowGraph.cs new file mode 100644 index 0000000..b9ec893 --- /dev/null +++ b/Struct/BNCustomFlowGraph.cs @@ -0,0 +1,59 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNCustomFlowGraph + { + /// + /// void* context + /// + public IntPtr context; + + /// + /// void** prepareForLayout + /// + public IntPtr prepareForLayout; + + /// + /// void** populateNodes + /// + public IntPtr populateNodes; + + /// + /// void** completeLayout + /// + public IntPtr completeLayout; + + /// + /// void** update + /// + public IntPtr update; + + /// + /// void** freeObject + /// + public IntPtr freeObject; + + /// + /// void** externalRefTaken + /// + public IntPtr externalRefTaken; + + /// + /// void** externalRefReleased + /// + public IntPtr externalRefReleased; + } + + public class CustomFlowGraph + { + public CustomFlowGraph() + { + + } + } +} \ No newline at end of file diff --git a/Struct/BNCustomFlowGraphLayout.cs b/Struct/BNCustomFlowGraphLayout.cs new file mode 100644 index 0000000..f4e53b7 --- /dev/null +++ b/Struct/BNCustomFlowGraphLayout.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNCustomFlowGraphLayout + { + /// + /// void* context + /// + public IntPtr context; + + /// + /// void** layout + /// + public IntPtr layout; + } + + public class CustomFlowGraphLayout + { + public CustomFlowGraphLayout() + { + + } + } +} \ No newline at end of file diff --git a/Struct/BNCustomLanguageRepresentationFunction.cs b/Struct/BNCustomLanguageRepresentationFunction.cs new file mode 100644 index 0000000..676e2df --- /dev/null +++ b/Struct/BNCustomLanguageRepresentationFunction.cs @@ -0,0 +1,79 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNCustomLanguageRepresentationFunction + { + /// + /// void* context + /// + public IntPtr context; + + /// + /// void** freeObject + /// + public IntPtr freeObject; + + /// + /// void** externalRefTaken + /// + public IntPtr externalRefTaken; + + /// + /// void** externalRefReleased + /// + public IntPtr externalRefReleased; + + /// + /// void** initTokenEmitter + /// + public IntPtr initTokenEmitter; + + /// + /// void** getExprText + /// + public IntPtr getExprText; + + /// + /// void** beginLines + /// + public IntPtr beginLines; + + /// + /// void** endLines + /// + public IntPtr endLines; + + /// + /// void** getCommentStartString + /// + public IntPtr getCommentStartString; + + /// + /// void** getCommentEndString + /// + public IntPtr getCommentEndString; + + /// + /// void** getAnnotationStartString + /// + public IntPtr getAnnotationStartString; + + /// + /// void** getAnnotationEndString + /// + public IntPtr getAnnotationEndString; + } + + public class CustomLanguageRepresentationFunction + { + public CustomLanguageRepresentationFunction() + { + + } + } +} \ No newline at end of file diff --git a/Struct/BNCustomLanguageRepresentationFunctionType.cs b/Struct/BNCustomLanguageRepresentationFunctionType.cs new file mode 100644 index 0000000..011a709 --- /dev/null +++ b/Struct/BNCustomLanguageRepresentationFunctionType.cs @@ -0,0 +1,60 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNCustomLanguageRepresentationFunctionType + { + /// + /// void* context + /// + public IntPtr context; + + /// + /// void** create + /// + public IntPtr create; + + /// + /// void** isValid + /// + public IntPtr isValid; + + /// + /// void** getTypePrinter + /// + public IntPtr getTypePrinter; + + /// + /// void** getTypeParser + /// + public IntPtr getTypeParser; + + /// + /// void** getLineFormatter + /// + public IntPtr getLineFormatter; + + /// + /// void** getFunctionTypeTokens + /// + public IntPtr getFunctionTypeTokens; + + /// + /// void** freeLines + /// + public IntPtr freeLines; + } + + public class CustomLanguageRepresentationFunctionType + { + + public CustomLanguageRepresentationFunctionType() + { + + } + } +} \ No newline at end of file diff --git a/Struct/BNCustomLineFormatter.cs b/Struct/BNCustomLineFormatter.cs new file mode 100644 index 0000000..e9b8d5c --- /dev/null +++ b/Struct/BNCustomLineFormatter.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNCustomLineFormatter + { + /// + /// void* context + /// + public IntPtr context; + + /// + /// void** formatLines + /// + public IntPtr formatLines; + + /// + /// void** freeLines + /// + public IntPtr freeLines; + } + + public class CustomLineFormatter + { + public CustomLineFormatter() + { + + } + } +} \ No newline at end of file diff --git a/Struct/BNCustomPlatform.cs b/Struct/BNCustomPlatform.cs new file mode 100644 index 0000000..f3a5e93 --- /dev/null +++ b/Struct/BNCustomPlatform.cs @@ -0,0 +1,69 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNCustomPlatform + { + /// + /// void* context + /// + public IntPtr context; + + /// + /// void** _init + /// + public IntPtr _init; + + /// + /// void** viewInit + /// + public IntPtr viewInit; + + /// + /// void** getGlobalRegisters + /// + public IntPtr getGlobalRegisters; + + /// + /// void** freeRegisterList + /// + public IntPtr freeRegisterList; + + /// + /// void** getGlobalRegisterType + /// + public IntPtr getGlobalRegisterType; + + /// + /// void** getAddressSize + /// + public IntPtr getAddressSize; + + /// + /// void** adjustTypeParserInput + /// + public IntPtr adjustTypeParserInput; + + /// + /// void** freeTypeParserInput + /// + public IntPtr freeTypeParserInput; + + /// + /// void** getFallbackEnabled + /// + public IntPtr getFallbackEnabled; + } + + public class CustomPlatform + { + public CustomPlatform() + { + + } + } +} \ No newline at end of file diff --git a/Struct/BNCustomRelocationHandler.cs b/Struct/BNCustomRelocationHandler.cs new file mode 100644 index 0000000..8c48d79 --- /dev/null +++ b/Struct/BNCustomRelocationHandler.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNCustomRelocationHandler + { + /// + /// void* context + /// + public IntPtr context; + + /// + /// void** freeObject + /// + public IntPtr freeObject; + + /// + /// void** getRelocationInfo + /// + public IntPtr getRelocationInfo; + + /// + /// void** applyRelocation + /// + public IntPtr applyRelocation; + + /// + /// void** getOperandForExternalRelocation + /// + public IntPtr getOperandForExternalRelocation; + } + + public class CustomRelocationHandler + { + public CustomRelocationHandler() + { + + } + } +} \ No newline at end of file diff --git a/Struct/BNCustomTransform.cs b/Struct/BNCustomTransform.cs new file mode 100644 index 0000000..6b3bd62 --- /dev/null +++ b/Struct/BNCustomTransform.cs @@ -0,0 +1,336 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNCustomTransform + { + // BNTransformParameterInfo* (*getParameters)(void* ctxt, size_t* count); + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate IntPtr GetParametersDelegate( + IntPtr ctxt, + IntPtr count + ); + + // void (*freeParameters)(BNTransformParameterInfo* params, size_t count); + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate void FreeParametersDelegate( + IntPtr parameters, + ulong count + ); + + // bool (*decode)(void* ctxt, BNDataBuffer* input, BNDataBuffer* output, BNTransformParameter* params, size_t paramCount); + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate bool DecodeDelegate( + IntPtr ctxt, + IntPtr input, + IntPtr output, + IntPtr parameters, + ulong paramCount + ); + + // bool (*encode)(void* ctxt, BNDataBuffer* input, BNDataBuffer* output, BNTransformParameter* params, size_t paramCount); + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate bool EncodeDelegate( + IntPtr ctxt, + IntPtr input, + IntPtr output, + IntPtr parameters, + ulong paramCount + ); + + // bool (*decodeWithContext)(void* ctxt, BNTransformContext* context, BNTransformParameter* params, size_t paramCount); + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate bool DecodeWithContextDelegate( + IntPtr ctxt, + IntPtr context, + IntPtr parameters, + ulong paramCount + ); + + // bool (*canDecode)(void* ctxt, BNBinaryView* input); + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate bool CanDecodeDelegate( + IntPtr ctxt, + IntPtr input + ); + + /// + /// void* context + /// + internal IntPtr context; + + /// + /// void** getParameters + /// + internal IntPtr getParameters; + + /// + /// void** freeParameters + /// + internal IntPtr freeParameters; + + /// + /// void** decode + /// + internal IntPtr decode; + + /// + /// void** encode + /// + internal IntPtr encode; + + /// + /// void** decodeWithContext + /// + internal IntPtr decodeWithContext; + + /// + /// void** canDecode + /// + internal IntPtr canDecode; + } + + public class CustomTransform : INativeWrapper + { + public CustomTransform() + { + + } + + public Transform? RegisterTransformType( + TransformType type, + string name, + string longname, + string group + ) + { + return Transform.FromHandle( + + NativeMethods.BNRegisterTransformType( + type, + name, + longname, + group, + this.ToNative() + ) + ); + } + + public Transform? RegisterTransformTypeWithCapabilities( + TransformType type, + uint capabilities, + string name, + string longname, + string group + ) + { + return Transform.FromHandle( + + NativeMethods.BNRegisterTransformTypeWithCapabilities( + type, + capabilities, + name, + longname, + group, + this.ToNative() + ) + ); + } + + public BNCustomTransform ToNative() + { + return new BNCustomTransform() + { + context = IntPtr.Zero , + getParameters = Marshal.GetFunctionPointerForDelegate(this.GetParametersThunk) , + freeParameters = Marshal.GetFunctionPointerForDelegate(this.FreeParametersThunk) , + decode = Marshal.GetFunctionPointerForDelegate(this.DecodeThunk) , + encode = Marshal.GetFunctionPointerForDelegate(this.EncodeThunk) , + decodeWithContext = Marshal.GetFunctionPointerForDelegate(this.DecodeWithContextThunk) , + canDecode = Marshal.GetFunctionPointerForDelegate(this.CanDecodeThunk) , + }; + } + + + // BNTransformParameterInfo* (*getParameters)(void* ctxt, size_t* count); + private IntPtr GetParametersThunk( + IntPtr ctxt , + IntPtr count + ) + { + TransformParameterInfo[] parameters = this.GetParameters(); + + if (parameters.Length == 0) + { + return IntPtr.Zero; + } + + BNTransformParameterInfo[] natives = TransformParameterInfo.UnsafeToNativeArray( + parameters + ); + + return UnsafeUtils.AllocStructArray(natives); + } + + // void (*freeParameters)(BNTransformParameterInfo* params, size_t count); + private void FreeParametersThunk( + IntPtr parameters , + ulong parametersCount + ) + { + if (0 == parameters) + { + return; + } + + if (0 == parametersCount) + { + return; + } + + for (ulong i = 0; i < parametersCount; i++) + { + int offset = checked((int)(i * (ulong)Marshal.SizeOf())); + + IntPtr addressOfElement = IntPtr.Add(parameters, offset); + + BNTransformParameterInfo? parameter = Marshal.PtrToStructure( + addressOfElement + ); + + if (null != parameter) + { + BNTransformParameterInfo info = parameter.Value; + + if (IntPtr.Zero != info.name) + { + Marshal.FreeHGlobal(info.name); + } + + if (IntPtr.Zero != info.longName) + { + Marshal.FreeHGlobal(info.longName); + } + } + } + + Marshal.FreeHGlobal(parameters); + } + + // bool (*decode)(void* ctxt, BNDataBuffer* input, BNDataBuffer* output, BNTransformParameter* params, size_t paramCount); + private bool DecodeThunk( + IntPtr ctxt , + IntPtr input , + IntPtr output , + IntPtr rawParameters , + ulong paramCount + ) + { + TransformParameter[] parameters = UnsafeUtils.ReadStructArray( + rawParameters , + paramCount, + TransformParameter.FromNative + ); + + return this.Decode( + DataBuffer.MustBorrowHandle(input) , + DataBuffer.MustBorrowHandle(output) , + parameters + ); + } + + // bool (*encode)(void* ctxt, BNDataBuffer* input, BNDataBuffer* output, BNTransformParameter* params, size_t paramCount); + private bool EncodeThunk( + IntPtr ctxt , + IntPtr input , + IntPtr output , + IntPtr rawParameters , + ulong paramCount + ) + { + TransformParameter[] parameters = UnsafeUtils.ReadStructArray( + rawParameters , + paramCount, + TransformParameter.FromNative + ); + + return this.Encode( + DataBuffer.MustBorrowHandle(input) , + DataBuffer.MustBorrowHandle(output) , + parameters + ); + } + + // bool (*decodeWithContext)(void* ctxt, BNTransformContext* context, BNTransformParameter* params, size_t paramCount); + private bool DecodeWithContextThunk( + IntPtr ctxt , + IntPtr context , + IntPtr rawParameters , + ulong paramCount + ) + { + TransformParameter[] parameters = UnsafeUtils.ReadStructArray( + rawParameters , + paramCount, + TransformParameter.FromNative + ); + + return this.DecodeWithContext( + TransformContext.MustBorrowHandle(context), + parameters + ); + } + + // bool (*canDecode)(void* ctxt, BNBinaryView* input); + private bool CanDecodeThunk( + IntPtr ctxt , + IntPtr input + ) + { + return this.CanDecode( + BinaryView.MustBorrowHandle(input) + ); + } + + #region methods + + public virtual TransformParameterInfo[] GetParameters() + { + return Array.Empty(); + } + + public virtual bool Decode( + DataBuffer input , + DataBuffer output , + TransformParameter[] parameters + ) + { + return false; + } + + public virtual bool Encode( + DataBuffer input , + DataBuffer output , + TransformParameter[] parameters + ) + { + return false; + } + + public virtual bool DecodeWithContext(TransformContext context , TransformParameter[] parameters) + { + return false; + } + + public virtual bool CanDecode(BinaryView input) + { + return false; + } + + #endregion methods + } +} \ No newline at end of file diff --git a/Struct/BNDataVariable.cs b/Struct/BNDataVariable.cs new file mode 100644 index 0000000..beee4b7 --- /dev/null +++ b/Struct/BNDataVariable.cs @@ -0,0 +1,75 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNDataVariable + { + /// + /// uint64_t address + /// + internal ulong address; + + /// + /// BNType* type + /// + internal IntPtr type; + + /// + /// bool autoDiscovered + /// + internal bool autoDiscovered; + + /// + /// uint8_t typeConfidence + /// + internal byte typeConfidence; + } + + public sealed class DataVariable + { + public ulong Address { get; } = 0; + + public BinaryNinja.Type Type { get; } + + public bool AutoDiscovered { get; } = false; + + public byte TypeConfidence { get; } = 0; + + public DataVariable(BNDataVariable native) + { + this.Address = native.address; + this.Type = BinaryNinja.Type.MustNewFromHandle(native.type); + this.AutoDiscovered = native.autoDiscovered; + this.TypeConfidence = native.typeConfidence; + } + + internal static DataVariable FromNative(BNDataVariable native) + { + return new DataVariable(native); + } + + internal static DataVariable TakeNative(BNDataVariable native) + { + DataVariable target = DataVariable.FromNative(native); + + NativeMethods.BNFreeDataVariable(native); + + return target; + } + + internal BNDataVariable ToNative() + { + return new BNDataVariable() + { + address = this.Address , + type = this.Type.DangerousGetHandle() , + autoDiscovered = this.AutoDiscovered , + typeConfidence = this.TypeConfidence + }; + } + } +} \ No newline at end of file diff --git a/Struct/BNDataVariableAndName.cs b/Struct/BNDataVariableAndName.cs new file mode 100644 index 0000000..f8b01a6 --- /dev/null +++ b/Struct/BNDataVariableAndName.cs @@ -0,0 +1,90 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNDataVariableAndName + { + /// + /// uint64_t address + /// + internal ulong address; + + /// + /// BNType* type + /// + internal IntPtr type; + + /// + /// const char* name + /// + internal IntPtr name; + + /// + /// bool autoDiscovered + /// + internal bool autoDiscovered; + + /// + /// uint8_t typeConfidence + /// + internal byte typeConfidence; + } + + public class DataVariableAndName + { + public ulong Address { get; set; } = 0; + + public BinaryNinja.Type Type { get; set; } + + public string Name { get; set; } = string.Empty; + + public bool AutoDiscovered { get; set; } = false; + + public byte TypeConfidence { get; set; } = 0; + + public DataVariableAndName( + ulong address, + BinaryNinja.Type type, + string name, + bool autoDiscovered, + byte typeConfidence + ) + { + this.Address = address; + this.Type = type; + this.Name = name; + this.AutoDiscovered = autoDiscovered; + this.TypeConfidence = typeConfidence; + } + + public DataVariableAndName(BNDataVariableAndName native) + { + this.Address = native.address; + this.Type = BinaryNinja.Type.MustNewFromHandle(native.type); + this.Name = UnsafeUtils.ReadAnsiString(native.name); + this.AutoDiscovered = native.autoDiscovered; + this.TypeConfidence = native.typeConfidence; + } + + internal static DataVariableAndName FromNative(BNDataVariableAndName native) + { + return new DataVariableAndName(native); + } + + internal BNDataVariableAndName ToNative(ScopedAllocator allocator) + { + return new BNDataVariableAndName() + { + address = this.Address , + type = this.Type.DangerousGetHandle() , + name = allocator.AllocAnsiString(this.Name) , + autoDiscovered = this.AutoDiscovered , + typeConfidence = this.TypeConfidence + }; + } + } +} \ No newline at end of file diff --git a/Struct/BNDataVariableAndNameAndDebugParser.cs b/Struct/BNDataVariableAndNameAndDebugParser.cs new file mode 100644 index 0000000..2a3a5cf --- /dev/null +++ b/Struct/BNDataVariableAndNameAndDebugParser.cs @@ -0,0 +1,62 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNDataVariableAndNameAndDebugParser + { + /// + /// uint64_t address + /// + public ulong address; + + /// + /// BNType* type + /// + public IntPtr type; + + /// + /// const char* name + /// + public IntPtr name; + + /// + /// const char* parser + /// + public IntPtr parser; + + /// + /// bool autoDiscovered + /// + public bool autoDiscovered; + + /// + /// uint8_t typeConfidence + /// + public byte typeConfidence; + + } + + public class DataVariableAndNameAndDebugParser + { + public ulong Address { get; set; } = 0; + + public BinaryNinja.Type? Type { get; set; } = null; + + public string Name { get; set; } = string.Empty; + + public string Parser { get; set; } = string.Empty; + + public bool AutoDiscovered { get; set; } = false; + + public byte TypeConfidence { get; set; } = 0; + + public DataVariableAndNameAndDebugParser() + { + + } + } +} \ No newline at end of file diff --git a/Struct/BNDebugFunctionInfo.cs b/Struct/BNDebugFunctionInfo.cs new file mode 100644 index 0000000..573a279 --- /dev/null +++ b/Struct/BNDebugFunctionInfo.cs @@ -0,0 +1,85 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNDebugFunctionInfo + { + /// + /// const char* shortName + /// + public IntPtr shortName; + + /// + /// const char* fullName + /// + public IntPtr fullName; + + /// + /// const char* rawName + /// + public IntPtr rawName; + + /// + /// uint64_t address + /// + public ulong address; + + /// + /// BNType* type + /// + public IntPtr type; + + /// + /// BNPlatform* platform + /// + public IntPtr platform; + + /// + /// const char** components + /// + public IntPtr components; + + /// + /// uint64_t componentN + /// + public ulong componentN; + + /// + /// BNVariableNameAndType* localVariables + /// + public IntPtr localVariables; + + /// + /// uint64_t localVariableN + /// + public ulong localVariableN; + } + + public class DebugFunctionInfo + { + public string ShortName { get; set; } = string.Empty; + + public string FullName { get; set; } = string.Empty; + + public string RawName { get; set; } = string.Empty; + + public ulong Address { get; set; } = 0; + + public BinaryNinja.Type? Type { get; set; } = null; + + public Platform? Platform { get; set; } = null; + + public string[] Components { get; set; } = Array.Empty(); + + public VariableNameAndType[] LocalVariables { get; set; } = Array.Empty(); + + public DebugFunctionInfo() + { + + } + } +} \ No newline at end of file diff --git a/Struct/BNDemanglerCallbacks.cs b/Struct/BNDemanglerCallbacks.cs new file mode 100644 index 0000000..a512792 --- /dev/null +++ b/Struct/BNDemanglerCallbacks.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNDemanglerCallbacks + { + /// + /// void* context + /// + public IntPtr context; + + /// + /// void** isMangledString + /// + public IntPtr isMangledString; + + /// + /// void** demangle + /// + public IntPtr demangle; + + /// + /// void** freeVarName + /// + public IntPtr freeVarName; + } + + public class DemanglerCallbacks + { + public DemanglerCallbacks() + { + + } + } +} \ No newline at end of file diff --git a/Struct/BNDisassemblyTextLine.cs b/Struct/BNDisassemblyTextLine.cs new file mode 100644 index 0000000..dbaab92 --- /dev/null +++ b/Struct/BNDisassemblyTextLine.cs @@ -0,0 +1,222 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNDisassemblyTextLine + { + /// + /// uint64_t addr + /// + internal ulong addr; + + /// + /// uint64_t instrIndex + /// + internal ulong instrIndex; + + /// + /// BNInstructionTextToken* tokens + /// + internal IntPtr tokens; + + /// + /// uint64_t count + /// + internal ulong count; + + /// + /// BNHighlightColor highlight + /// + internal BNHighlightColor highlight; + + /// + /// BNTag** tags + /// + internal IntPtr tags; + + /// + /// uint64_t tagCount + /// + internal ulong tagCount; + + /// + /// BNDisassemblyTextLineTypeInfo typeInfo + /// + internal BNDisassemblyTextLineTypeInfo typeInfo; + } + + public sealed class DisassemblyTextLine : INativeWrapperEx, + IEquatable, + IComparable + { + public ulong Address { get; } = 0; + + public ulong InstructionIndex { get; } = 0; + + public InstructionTextToken[] Tokens { get; } = Array.Empty(); + + public HighlightColor Highlight { get; } = new HighlightColor(); + + public Tag[] Tags { get; } = Array.Empty(); + + public DisassemblyTextLineTypeInfo TypeInfo { get; } = new DisassemblyTextLineTypeInfo(); + + internal DisassemblyTextLine() + { + + } + + internal DisassemblyTextLine(BNDisassemblyTextLine native) + { + this.Address = native.addr; + this.InstructionIndex = native.instrIndex; + + this.Tokens = UnsafeUtils.ReadStructArray( + native.tokens , + native.count , + InstructionTextToken.FromNative + ); + + this.Highlight = HighlightColor.FromNative(native.highlight); + + this.Tags = UnsafeUtils.ReadHandleArray( + native.tags , + native.tagCount , + Tag.MustNewFromHandle + ); + + this.TypeInfo = DisassemblyTextLineTypeInfo.FromNative(native.typeInfo); + } + + internal static DisassemblyTextLine FromNative(BNDisassemblyTextLine native) + { + return new DisassemblyTextLine(native); + } + + public BNDisassemblyTextLine ToNativeEx(ScopedAllocator allocator) + { + return new BNDisassemblyTextLine + { + addr = this.Address , + instrIndex = this.InstructionIndex , + tokens = ( 0 == this.Tokens.Length ? + IntPtr.Zero : + allocator.AllocStructArray( + allocator.ConvertToNativeArrayEx(this.Tokens) + ) + ) , + highlight = this.Highlight.ToNative() , + tags = allocator.AllocHandleArray(this.Tags) , + typeInfo = this.TypeInfo.ToNative() + }; + } + + public override string ToString() + { + StringBuilder builder = new StringBuilder(); + + foreach (InstructionTextToken token in this.Tokens) + { + builder.Append(token.ToString()); + } + + return builder.ToString(); + } + + public override bool Equals(object? rawOther) + { + InstructionTextToken? other = rawOther as InstructionTextToken; + + if (other is null) + { + return false; + } + + return this.Equals(other); + } + + public bool Equals(DisassemblyTextLine? other) + { + if (other is null) + { + return false; + } + + if (ReferenceEquals(this , other)) + { + return true; + } + + if (this.Address != other.Address) + { + return false; + } + + if (this.InstructionIndex != other.InstructionIndex) + { + return false; + } + + if (this.Tokens.Length != other.Tokens.Length) + { + return false; + } + + for (int i = 0; i < this.Tokens.Length; i++) + { + if (!this.Tokens[i].Equals(other.Tokens[i])) + { + return false; + } + } + + return true; + } + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2218:OverrideGetHashCodeOnOverridingEquals")] + public override int GetHashCode() + { + return HashCode.Combine( + this.Address, + this.InstructionIndex + ); + } + + public static bool operator ==(DisassemblyTextLine? left, DisassemblyTextLine? right) + { + if (left is null) + { + return right is null; + } + + return left.Equals(right); + } + + public static bool operator !=(DisassemblyTextLine? left, DisassemblyTextLine? right) + { + return !(left == right); + } + + public int CompareTo(DisassemblyTextLine? other) + { + if (other is null) + { + return 1; + } + + int result = this.Address.CompareTo(other.Address); + + if (0 == result) + { + result = this.InstructionIndex.CompareTo(other.InstructionIndex); + } + + return result; + } + } +} \ No newline at end of file diff --git a/Struct/BNDisassemblyTextLineTypeInfo.cs b/Struct/BNDisassemblyTextLineTypeInfo.cs new file mode 100644 index 0000000..9850936 --- /dev/null +++ b/Struct/BNDisassemblyTextLineTypeInfo.cs @@ -0,0 +1,73 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNDisassemblyTextLineTypeInfo + { + /// + /// bool hasTypeInfo + /// + internal bool hasTypeInfo; + + /// + /// BNType* parentType + /// + internal IntPtr parentType; + + /// + /// uint64_t fieldIndex + /// + internal ulong fieldIndex; + + /// + /// uint64_t offset + /// + internal ulong offset; + } + + public sealed class DisassemblyTextLineTypeInfo + { + public bool HasTypeInfo { get; set; } = false; + + public BinaryNinja.Type? ParentType { get; set; } = null; + + public ulong FieldIndex { get; set; } = 0; + + public ulong Offset { get; set; } = 0; + + internal DisassemblyTextLineTypeInfo() + { + + } + + internal DisassemblyTextLineTypeInfo(BNDisassemblyTextLineTypeInfo native) + { + this.HasTypeInfo = native.hasTypeInfo; + this.ParentType = ( IntPtr.Zero == native.parentType ? null : BinaryNinja.Type.MustNewFromHandle(native.parentType) ); + this.FieldIndex = native.fieldIndex; + this.Offset = native.offset; + } + + internal static DisassemblyTextLineTypeInfo FromNative(BNDisassemblyTextLineTypeInfo native) + { + return new DisassemblyTextLineTypeInfo(native); + } + + internal BNDisassemblyTextLineTypeInfo ToNative() + { + return new BNDisassemblyTextLineTypeInfo() + { + hasTypeInfo = this.HasTypeInfo , + parentType = ( null == this.ParentType ? IntPtr.Zero : this.ParentType.DangerousGetHandle() ) , + fieldIndex = this.FieldIndex , + offset = this.Offset + }; + } + + + } +} \ No newline at end of file diff --git a/Struct/BNDownloadInstanceCallbacks.cs b/Struct/BNDownloadInstanceCallbacks.cs new file mode 100644 index 0000000..74c1474 --- /dev/null +++ b/Struct/BNDownloadInstanceCallbacks.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNDownloadInstanceCallbacks + { + /// + /// void* context + /// + public IntPtr context; + + /// + /// void** destroyInstance + /// + public IntPtr destroyInstance; + + /// + /// void** performRequest + /// + public IntPtr performRequest; + + /// + /// void** performCustomRequest + /// + public IntPtr performCustomRequest; + + /// + /// void** freeResponse + /// + public IntPtr freeResponse; + } + + public class DownloadInstanceCallbacks + { + public DownloadInstanceCallbacks() + { + + } + } +} \ No newline at end of file diff --git a/Struct/BNDownloadInstanceInputOutputCallbacks.cs b/Struct/BNDownloadInstanceInputOutputCallbacks.cs new file mode 100644 index 0000000..6d91ba5 --- /dev/null +++ b/Struct/BNDownloadInstanceInputOutputCallbacks.cs @@ -0,0 +1,49 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNDownloadInstanceInputOutputCallbacks + { + /// + /// void** readCallback + /// + public IntPtr readCallback; + + /// + /// void* readContext + /// + public IntPtr readContext; + + /// + /// void** writeCallback + /// + public IntPtr writeCallback; + + /// + /// void* writeContext + /// + public IntPtr writeContext; + + /// + /// void** progressCallback + /// + public IntPtr progressCallback; + + /// + /// void* progressContext + /// + public IntPtr progressContext; + } + + public class DownloadInstanceInputOutputCallbacks + { + public DownloadInstanceInputOutputCallbacks() + { + + } + } +} \ No newline at end of file diff --git a/Struct/BNDownloadInstanceOutputCallbacks.cs b/Struct/BNDownloadInstanceOutputCallbacks.cs new file mode 100644 index 0000000..8995169 --- /dev/null +++ b/Struct/BNDownloadInstanceOutputCallbacks.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNDownloadInstanceOutputCallbacks + { + /// + /// void** writeCallback + /// + public IntPtr writeCallback; + + /// + /// void* writeContext + /// + public IntPtr writeContext; + + /// + /// void** progressCallback + /// + public IntPtr progressCallback; + + /// + /// void* progressContext + /// + public IntPtr progressContext; + } + + public class DownloadInstanceOutputCallbacks + { + public DownloadInstanceOutputCallbacks() + { + + } + } +} \ No newline at end of file diff --git a/Struct/BNDownloadInstanceResponse.cs b/Struct/BNDownloadInstanceResponse.cs new file mode 100644 index 0000000..3b8451a --- /dev/null +++ b/Struct/BNDownloadInstanceResponse.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNDownloadInstanceResponse + { + /// + /// uint16_t statusCode + /// + public ushort statusCode; + + /// + /// uint64_t headerCount + /// + public ulong headerCount; + + /// + /// const char** headerKeys + /// + public IntPtr headerKeys; + + /// + /// const char** headerValues + /// + public IntPtr headerValues; + } + + public class DownloadInstanceResponse + { + public ushort StatusCode { get; set; } = 0; + + public ulong HeaderCount { get; set; } = 0; + + public string[] HeaderKeys { get; set; } = Array.Empty(); + + public string[] HeaderValues { get; set; } = Array.Empty(); + + public DownloadInstanceResponse() + { + + } + } +} \ No newline at end of file diff --git a/Struct/BNDownloadProviderCallbacks.cs b/Struct/BNDownloadProviderCallbacks.cs new file mode 100644 index 0000000..3d3b8ee --- /dev/null +++ b/Struct/BNDownloadProviderCallbacks.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNDownloadProviderCallbacks + { + /// + /// void* context + /// + public IntPtr context; + + /// + /// void** createInstance + /// + public IntPtr createInstance; + } + + public class DownloadProviderCallbacks + { + public DownloadProviderCallbacks() + { + + } + } +} \ No newline at end of file diff --git a/Struct/BNEdgeStyle.cs b/Struct/BNEdgeStyle.cs new file mode 100644 index 0000000..2870d67 --- /dev/null +++ b/Struct/BNEdgeStyle.cs @@ -0,0 +1,60 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNEdgeStyle + { + /// + /// BNEdgePenStyle style + /// + internal EdgePenStyle style; + + /// + /// uint64_t width + /// + internal ulong width; + + /// + /// BNThemeColor color + /// + internal ThemeColor color; + } + + public sealed class EdgeStyle : INativeWrapper + { + public EdgePenStyle Style { get; set; } = EdgePenStyle.NoPen; + + public ulong Width { get; set; } = 0; + + public ThemeColor Color { get; set; } = ThemeColor.AddressColor; + + public EdgeStyle() + { + + } + + internal static EdgeStyle FromNative(BNEdgeStyle raw) + { + return new EdgeStyle() + { + Style = raw.style , + Width = raw.width , + Color = raw.color + }; + } + + public BNEdgeStyle ToNative() + { + return new BNEdgeStyle + { + style = this.Style , + width = this.Width , + color = this.Color + }; + } + } +} \ No newline at end of file diff --git a/Struct/BNEnterpriseServerCallbacks.cs b/Struct/BNEnterpriseServerCallbacks.cs new file mode 100644 index 0000000..b02d4d9 --- /dev/null +++ b/Struct/BNEnterpriseServerCallbacks.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNEnterpriseServerCallbacks + { + /// + /// void* context + /// + public IntPtr context; + + /// + /// void** licenseStatusChanged + /// + public IntPtr licenseStatusChanged; + } + + public class EnterpriseServerCallbacks + { + public EnterpriseServerCallbacks() + { + + } + } +} \ No newline at end of file diff --git a/Struct/BNEnumerationMember.cs b/Struct/BNEnumerationMember.cs new file mode 100644 index 0000000..ac56068 --- /dev/null +++ b/Struct/BNEnumerationMember.cs @@ -0,0 +1,67 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNEnumerationMember + { + /// + /// const char* name + /// + public IntPtr name; + + /// + /// uint64_t value + /// + public ulong value; + + /// + /// bool isDefault + /// + public bool isDefault; + } + + public class EnumerationMember + { + public string Name { get; set; } = string.Empty; + + public ulong Value { get; set; } = 0; + + public bool IsDefault { get; set; } = false; + + public EnumerationMember(string name, ulong value , bool isDefault = false) + { + this.Name = name; + this.Value = value; + this.IsDefault = isDefault; + } + + internal static EnumerationMember FromNative(BNEnumerationMember raw) + { + return new EnumerationMember( + UnsafeUtils.ReadAnsiString(raw.name), + raw.value, + raw.isDefault + ); + } + + internal BNEnumerationMember ToNative(ScopedAllocator allocator) + { + return new BNEnumerationMember() + { + name = allocator.AllocAnsiString(this.Name), + value = this.Value, + isDefault = this.IsDefault + }; + } + + public override string ToString() + { + return $"{this.Name} = {this.Value}"; + } + + } +} \ No newline at end of file diff --git a/Struct/BNExprMapInfo.cs b/Struct/BNExprMapInfo.cs new file mode 100644 index 0000000..5d0b2af --- /dev/null +++ b/Struct/BNExprMapInfo.cs @@ -0,0 +1,61 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNExprMapInfo + { + /// + /// uint64_t lowerIndex + /// + public ulong lowerIndex; + + /// + /// uint64_t higherIndex + /// + public ulong higherIndex; + + /// + /// bool mapLowerToHigher + /// + public bool mapLowerToHigher; + + /// + /// bool mapHigherToLower + /// + public bool mapHigherToLower; + + /// + /// bool lowerToHigherDirect + /// + public bool lowerToHigherDirect; + + /// + /// bool higherToLowerDirect + /// + public bool higherToLowerDirect; + } + + public class ExprMapInfo + { + public ulong LowerIndex { get; set; } = 0; + + public ulong HigherIndex { get; set; } = 0; + + public bool MapLowerToHigher { get; set; } = false; + + public bool MapHigherToLower { get; set; } = false; + + public bool LowerToHigherDirect { get; set; } = false; + + public bool HigherToLowerDirect { get; set; } = false; + + public ExprMapInfo() + { + + } + } +} \ No newline at end of file diff --git a/Struct/BNFileAccessor.cs b/Struct/BNFileAccessor.cs new file mode 100644 index 0000000..ff70d71 --- /dev/null +++ b/Struct/BNFileAccessor.cs @@ -0,0 +1,319 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNFileAccessor + { + // uint64_t (*getLength)(void* ctxt); + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate ulong GetLengthDelegate( + IntPtr ctxt + ); + + // size_t (*read)(void* ctxt, void* dest, uint64_t offset, size_t len); + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate ulong ReadDelegate( + IntPtr ctxt, + IntPtr dest, + ulong offset, + ulong length + ); + + // size_t (*write)(void* ctxt, uint64_t offset, const void* src, size_t len); + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate ulong WriteDelegate( + IntPtr ctxt, + ulong offset, + IntPtr data, + ulong length + ); + + /// + /// void* context + /// + internal IntPtr context; + + /// + /// void** getLength + /// + internal IntPtr getLength; + + /// + /// void** read + /// + internal IntPtr read; + + /// + /// void** write + /// + internal IntPtr write; + } + + public sealed class FileAccessor : INativeWrapper + { + public delegate ulong GetLengthDelegate(); + + public delegate byte[] ReadDelegate( + ulong offset, + ulong length + ); + + public delegate ulong WriteDelegate( + ulong offset, + byte[] data + ); + + public GetLengthDelegate? GetLength { get; set; } = null; + + public ReadDelegate? Read { get; set; } = null; + + public WriteDelegate? Write { get; set; } = null; + + // bridge + private BNFileAccessor.GetLengthDelegate? m_getLength = null; + + private BNFileAccessor.ReadDelegate? m_read = null; + + private BNFileAccessor.WriteDelegate? m_write = null; + + public FileAccessor() + { + + } + + internal static FileAccessor FromNative(BNFileAccessor native) + { + FileAccessor accessor = new FileAccessor(); + + if (IntPtr.Zero != native.getLength) + { + accessor.m_getLength = Marshal.GetDelegateForFunctionPointer( + native.getLength + ); + + accessor.GetLength = accessor.GetLengthBridge; + } + + if (IntPtr.Zero != native.read) + { + accessor.m_read = Marshal.GetDelegateForFunctionPointer( + native.read + ); + + accessor.Read = accessor.ReadBridge; + } + + if (IntPtr.Zero != native.write) + { + accessor.m_write = Marshal.GetDelegateForFunctionPointer( + native.write + ); + + accessor.Write = accessor.WriteBridge; + } + + return accessor; + } + + internal static FileAccessor MustFromNativePointer(IntPtr pointer) + { + if (IntPtr.Zero == pointer) + { + throw new NullReferenceException(nameof(pointer)); + } + + return FileAccessor.FromNative(Marshal.PtrToStructure(pointer)); + } + + public BNFileAccessor ToNative() + { + return new BNFileAccessor() + { + context = IntPtr.Zero , + getLength = + ( null == this.m_getLength ? IntPtr.Zero : + Marshal.GetFunctionPointerForDelegate(this.m_getLength) ) , + read = ( null == this.m_read ? IntPtr.Zero + : Marshal.GetFunctionPointerForDelegate(this.m_read) ) , + write = ( null == this.m_write ? IntPtr.Zero + : Marshal.GetFunctionPointerForDelegate(this.m_write) ) + }; + } + + private ulong GetLengthBridge() + { + if (null == this.m_getLength) + { + throw new NullReferenceException(); + } + + // uint64_t (*getLength)(void* ctxt); + return this.m_getLength( + IntPtr.Zero + ); + } + + private byte[] ReadBridge(ulong offset , ulong length) + { + if (null == this.m_read) + { + throw new NullReferenceException(); + } + + byte[] buffer = new byte[length]; + + + // size_t (*read)(void* ctxt, void* dest, uint64_t offset, size_t len); + + ulong readed = 0; + + unsafe + { + fixed (byte* ptrBuffer = buffer) + { + readed = this.m_read( + IntPtr.Zero, + ( IntPtr)ptrBuffer, + offset, + length + ); + } + } + + if (readed < length) + { + if (0 == readed) + { + return Array.Empty(); + } + + byte[] data = new byte[readed]; + + Array.Copy( + buffer, + data, + (int)readed + ); + + return data; + } + + return buffer; + } + + private ulong WriteBridge(ulong offset , byte[] data) + { + if (null == this.m_write) + { + throw new NullReferenceException(); + } + + unsafe + { + fixed (byte* ptrData = data) + { + // size_t (*write)(void* ctxt, uint64_t offset, const void* src, size_t len); + return this.m_write( + IntPtr.Zero, + offset, + (IntPtr)ptrData, + (ulong)data.Length + ); + } + } + } + } + + public abstract class CustomFileAccessor : INativeWrapper + { + public CustomFileAccessor() + { + + } + + public BNFileAccessor ToNative() + { + return new BNFileAccessor() + { + context = IntPtr.Zero , + getLength = Marshal.GetFunctionPointerForDelegate(this.GetLengthThunk) , + read = Marshal.GetFunctionPointerForDelegate(this.ReadThunk) , + write = Marshal.GetFunctionPointerForDelegate(this.WriteThunk) , + }; + } + + #region thunk + + // uint64_t (*getLength)(void* ctxt); + private ulong GetLengthThunk(IntPtr ctxt) + { + return this.GetLength(); + } + + // size_t (*read)(void* ctxt, void* dest, uint64_t offset, size_t len); + private ulong ReadThunk( + IntPtr ctxt , + IntPtr dest , + ulong offset , + ulong length + ) + { + byte[] data = this.Read(offset, length); + + Marshal.Copy( + data, + 0, + dest, + data.Length + ); + + return (ulong)data.Length; + } + + // size_t (*write)(void* ctxt, uint64_t offset, const void* src, size_t len); + private ulong WriteThunk( + IntPtr ctxt , + ulong offset , + IntPtr data , + ulong length + ) + { + byte[] buffer = new byte[length]; + + Marshal.Copy( + data, + buffer, + 0, + (int)length + ); + + return this.Write(offset, buffer); + } + + #endregion thunk + + #region methods + + public virtual ulong GetLength( ) + { + return 0; + } + + public virtual byte[] Read(ulong offset , ulong length) + { + return Array.Empty(); + } + + public virtual ulong Write(ulong offset , byte[] data) + { + return 0; + } + + #endregion methods + } + +} \ No newline at end of file diff --git a/Struct/BNFirmwareNinjaDevice.cs b/Struct/BNFirmwareNinjaDevice.cs new file mode 100644 index 0000000..36a283a --- /dev/null +++ b/Struct/BNFirmwareNinjaDevice.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNFirmwareNinjaDevice + { + /// + /// const char* name + /// + public IntPtr name; + + /// + /// uint64_t start + /// + public ulong start; + + /// + /// uint64_t end + /// + public ulong end; + + /// + /// const char* info + /// + public IntPtr info; + } + + public class FirmwareNinjaDevice + { + public string Name { get; set; } = string.Empty; + + public ulong Start { get; set; } = 0; + + public ulong End { get; set; } = 0; + + public string Info { get; set; } = string.Empty; + + public FirmwareNinjaDevice() + { + + } + } +} \ No newline at end of file diff --git a/Struct/BNFirmwareNinjaDeviceAccesses.cs b/Struct/BNFirmwareNinjaDeviceAccesses.cs new file mode 100644 index 0000000..40eb1c6 --- /dev/null +++ b/Struct/BNFirmwareNinjaDeviceAccesses.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNFirmwareNinjaDeviceAccesses + { + /// + /// const char* name + /// + public IntPtr name; + + /// + /// uint64_t total + /// + public ulong total; + + /// + /// uint64_t unique + /// + public ulong unique; + } + + public class FirmwareNinjaDeviceAccesses + { + public string Name { get; set; } = string.Empty; + + public ulong Total { get; set; } = 0; + + public ulong Unique { get; set; } = 0; + + public FirmwareNinjaDeviceAccesses() + { + + } + } +} \ No newline at end of file diff --git a/Struct/BNFirmwareNinjaFunctionMemoryAccesses.cs b/Struct/BNFirmwareNinjaFunctionMemoryAccesses.cs new file mode 100644 index 0000000..e60c719 --- /dev/null +++ b/Struct/BNFirmwareNinjaFunctionMemoryAccesses.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNFirmwareNinjaFunctionMemoryAccesses + { + /// + /// uint64_t start + /// + public ulong start; + + /// + /// uint64_t count + /// + public ulong count; + + /// + /// BNFirmwareNinjaMemoryAccess** accesses + /// + public IntPtr accesses; + } + + public class FirmwareNinjaFunctionMemoryAccesses + { + public ulong Start { get; set; } = 0; + + public ulong Count { get; set; } = 0; + + public IntPtr Accesses { get; set; } = IntPtr.Zero; + + public FirmwareNinjaFunctionMemoryAccesses() + { + + } + } +} \ No newline at end of file diff --git a/Struct/BNFirmwareNinjaMemoryAccess.cs b/Struct/BNFirmwareNinjaMemoryAccess.cs new file mode 100644 index 0000000..aaade39 --- /dev/null +++ b/Struct/BNFirmwareNinjaMemoryAccess.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNFirmwareNinjaMemoryAccess + { + /// + /// uint64_t instrAddress + /// + public ulong instrAddress; + + /// + /// BNRegisterValue memAddress + /// + public BNRegisterValue memAddress; + + /// + /// BNFirmwareNinjaMemoryHeuristic heuristic + /// + public FirmwareNinjaMemoryHeuristic heuristic; + + /// + /// BNFirmwareNinjaMemoryAccessType type + /// + public FirmwareNinjaMemoryAccessType type; + + /// + /// BNRegisterValue _value + /// + public BNRegisterValue _value; + } + + public class FirmwareNinjaMemoryAccess + { + public ulong InstrAddress { get; set; } = 0; + + public RegisterValue MemAddress { get; set; } = new RegisterValue(); + + public FirmwareNinjaMemoryHeuristic Heuristic { get; set; } = new FirmwareNinjaMemoryHeuristic(); + + public FirmwareNinjaMemoryAccessType Type { get; set; } = new FirmwareNinjaMemoryAccessType(); + + public RegisterValue Value { get; set; } = new RegisterValue(); + + public FirmwareNinjaMemoryAccess() + { + + } + } +} \ No newline at end of file diff --git a/Struct/BNFirmwareNinjaSection.cs b/Struct/BNFirmwareNinjaSection.cs new file mode 100644 index 0000000..bf7b564 --- /dev/null +++ b/Struct/BNFirmwareNinjaSection.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNFirmwareNinjaSection + { + /// + /// BNFirmwareNinjaSectionType type + /// + public FirmwareNinjaSectionType type; + + /// + /// uint64_t start + /// + public ulong start; + + /// + /// uint64_t end + /// + public ulong end; + + /// + /// float entropy + /// + public float entropy; + } + + public class FirmwareNinjaSection + { + public FirmwareNinjaSectionType Type { get; set; } = new FirmwareNinjaSectionType(); + + public ulong Start { get; set; } = 0; + + public ulong End { get; set; } = 0; + + public float Entropy { get; set; } = 0; + + public FirmwareNinjaSection() + { + + } + } +} \ No newline at end of file diff --git a/Struct/BNFlagConditionForSemanticClass.cs b/Struct/BNFlagConditionForSemanticClass.cs new file mode 100644 index 0000000..af9a3c9 --- /dev/null +++ b/Struct/BNFlagConditionForSemanticClass.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNFlagConditionForSemanticClass + { + /// + /// uint32_t semanticClass + /// + internal uint semanticClass; + + /// + /// BNLowLevelILFlagCondition condition + /// + internal LowLevelILFlagCondition condition; + } + + public sealed class FlagConditionForSemanticClass : INativeWrapper + { + public uint SemanticClass { get; } = 0; + + public LowLevelILFlagCondition Condition { get; } = LowLevelILFlagCondition.LLFC_E; + + public FlagConditionForSemanticClass(BNFlagConditionForSemanticClass native) + { + this.SemanticClass = native.semanticClass; + this.Condition = native.condition; + } + + internal static FlagConditionForSemanticClass FromNative(BNFlagConditionForSemanticClass native) + { + return new FlagConditionForSemanticClass(native); + } + + public BNFlagConditionForSemanticClass ToNative() + { + return new BNFlagConditionForSemanticClass() + { + semanticClass = this.SemanticClass , + condition = this.Condition + }; + } + } +} \ No newline at end of file diff --git a/Struct/BNFlowGraphEdge.cs b/Struct/BNFlowGraphEdge.cs new file mode 100644 index 0000000..02258f8 --- /dev/null +++ b/Struct/BNFlowGraphEdge.cs @@ -0,0 +1,89 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNFlowGraphEdge + { + /// + /// BNBranchType type + /// + internal BranchType type; + + /// + /// BNFlowGraphNode* target + /// + internal IntPtr target; + + /// + /// BNPoint* points + /// + internal IntPtr points; + + /// + /// uint64_t pointCount + /// + internal ulong pointCount; + + /// + /// bool backEdge + /// + internal bool backEdge; + + /// + /// BNEdgeStyle style + /// + internal BNEdgeStyle style; + } + + public abstract class AbstractFlowGraphEdge : INativeWrapperEx + where T_FLOW_GRAPH_NODE : FlowGraphNode + { + public BranchType Type { get; set; } = new BranchType(); + + public T_FLOW_GRAPH_NODE? Target { get; set; } = null; + + public Point[] Points { get; set; } = Array.Empty(); + + public bool BackEdge { get; set; } = false; + + public EdgeStyle Style { get; set; } = new EdgeStyle(); + + public AbstractFlowGraphEdge(BNFlowGraphEdge native , T_FLOW_GRAPH_NODE? target ) + { + this.Type = native.type ; + + this.Target = target ; + + this.Points = UnsafeUtils.ReadStructArray( + native.points , + native.pointCount , + Point.FromNative + ); + this.BackEdge = native.backEdge; + this.Style = EdgeStyle.FromNative(native.style) ; + } + + public BNFlowGraphEdge ToNativeEx(ScopedAllocator allocator) + { + return new BNFlowGraphEdge() + { + type = this.Type , + target = ( null == this.Target ? IntPtr.Zero : this.Target.DangerousGetHandle() ) , + points = ( + 0 == this.Points.Length + ? IntPtr.Zero + : allocator.AllocStructArray( + UnsafeUtils.ConvertToNativeArray(this.Points) + ) + ) , + pointCount = (ulong)this.Points.Length, + backEdge = this.BackEdge, + style = this.Style.ToNative(), + }; + } + } +} \ No newline at end of file diff --git a/Struct/BNFormInputField.cs b/Struct/BNFormInputField.cs new file mode 100644 index 0000000..c91c058 --- /dev/null +++ b/Struct/BNFormInputField.cs @@ -0,0 +1,143 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNFormInputField + { + /// + /// BNFormInputFieldType type + /// + internal FormInputFieldType type; + + /// + /// const char* prompt + /// + internal IntPtr prompt; + + /// + /// BNBinaryView* view + /// + internal IntPtr view; + + /// + /// uint64_t currentAddress + /// + internal ulong currentAddress; + + /// + /// const char** choices + /// + internal IntPtr choices; + + /// + /// uint64_t count + /// + internal ulong count; + + /// + /// const char* ext + /// + internal IntPtr ext; + + /// + /// const char* defaultName + /// + internal IntPtr defaultName; + + /// + /// int64_t intResult + /// + internal long intResult; + + /// + /// uint64_t addressResult + /// + internal ulong addressResult; + + /// + /// const char* stringResult + /// + internal IntPtr stringResult; + + /// + /// uint64_t indexResult + /// + internal ulong indexResult; + + /// + /// bool hasDefault + /// + internal bool hasDefault; + + /// + /// int64_t intDefault + /// + internal long intDefault; + + /// + /// uint64_t addressDefault + /// + internal ulong addressDefault; + + /// + /// const char* stringDefault + /// + internal IntPtr stringDefault; + + /// + /// uint64_t indexDefault + /// + internal ulong indexDefault; + } + + /* + public class FormInputField + { + public FormInputFieldType Type { get; set; } = FormInputFieldType.LabelFormField; + + public string Prompt { get; set; } = string.Empty; + + public BinaryView? View { get; set; } = null; + + public ulong CurrentAddress { get; set; } = 0; + + public string[] Choices { get; set; } = Array.Empty(); + + public string Ext { get; set; } = string.Empty; + + public string DefaultName { get; set; } = string.Empty; + + public long IntResult { get; set; } = 0; + + public ulong AddressResult { get; set; } = 0; + + public string StringResult { get; set; } = string.Empty; + + public ulong IndexResult { get; set; } = 0; + + public bool HasDefault { get; set; } = false; + + public long IntDefault { get; set; } = 0; + + public ulong AddressDefault { get; set; } = 0; + + public string StringDefault { get; set; } = string.Empty; + + public ulong IndexDefault { get; set; } = 0; + + public FormInputField() + { + + } + } + */ + + public abstract class AbstractFormInputField + { + public abstract BNFormInputField ToNativeEx(ScopedAllocator allocator); + } +} \ No newline at end of file diff --git a/Struct/BNFunctionParameter.cs b/Struct/BNFunctionParameter.cs new file mode 100644 index 0000000..912cefd --- /dev/null +++ b/Struct/BNFunctionParameter.cs @@ -0,0 +1,82 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNFunctionParameter + { + /// + /// const char* name + /// + internal IntPtr name; + + /// + /// BNType* type + /// + internal IntPtr type; + + /// + /// uint8_t typeConfidence + /// + internal byte typeConfidence; + + /// + /// bool defaultLocation + /// + internal bool defaultLocation; + + /// + /// BNVariable location + /// + internal BNVariable location; + } + + public class FunctionParameter : INativeWrapperEx + { + public string Name { get; set; } = string.Empty; + + public BinaryNinja.Type Type { get; set; } + + public byte TypeConfidence { get; set; } = 0; + + public bool DefaultLocation { get; set; } = false; + + public CoreVariable Location { get; set; } + + internal FunctionParameter(BNFunctionParameter native) + { + this.Name = UnsafeUtils.ReadAnsiString(native.name); + + this.Type = new BinaryNinja.Type( + NativeMethods.BNNewTypeReference(native.type ) , + true + ); + + this.TypeConfidence = native.typeConfidence; + + this.DefaultLocation = native.defaultLocation; + + this.Location = new CoreVariable( native.location); + } + + internal static FunctionParameter FromNative(BNFunctionParameter native) + { + return new FunctionParameter(native); + } + + public BNFunctionParameter ToNativeEx(ScopedAllocator allocator) + { + return new BNFunctionParameter() + { + name = allocator.AllocAnsiString(this.Name), + type = this.Type.DangerousGetHandle(), + typeConfidence = this.TypeConfidence, + defaultLocation = this.DefaultLocation, + location = this.Location.ToNative() + }; + } + } +} \ No newline at end of file diff --git a/Struct/BNFunctionRecognizer.cs b/Struct/BNFunctionRecognizer.cs new file mode 100644 index 0000000..08acf92 --- /dev/null +++ b/Struct/BNFunctionRecognizer.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNFunctionRecognizer + { + /// + /// void* context + /// + public IntPtr context; + + /// + /// void** recognizeLowLevelIL + /// + public IntPtr recognizeLowLevelIL; + + /// + /// void** recognizeMediumLevelIL + /// + public IntPtr recognizeMediumLevelIL; + } + + public class FunctionRecognizer + { + public FunctionRecognizer() + { + + } + } +} \ No newline at end of file diff --git a/Struct/BNFunctionViewType.cs b/Struct/BNFunctionViewType.cs new file mode 100644 index 0000000..0dc0f4f --- /dev/null +++ b/Struct/BNFunctionViewType.cs @@ -0,0 +1,57 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNFunctionViewType + { + /// + /// BNFunctionGraphType type + /// + internal FunctionGraphType type; + + /// + /// const char* name + /// + internal IntPtr name; + } + + public sealed class FunctionViewType : INativeWrapperEx + { + public FunctionGraphType Type { get; set; } = FunctionGraphType.NormalFunctionGraph; + + public string Name { get; set; } = string.Empty; + + public FunctionViewType() + { + + } + + public FunctionViewType(FunctionGraphType type, string name = "") + { + this.Type = type; + this.Name = name; + } + + static FunctionViewType FromNative(BNFunctionViewType native) + { + return new FunctionViewType() + { + Type = native.type , + Name = UnsafeUtils.ReadAnsiString(native.name) + }; + } + + public BNFunctionViewType ToNativeEx(ScopedAllocator allocator) + { + return new BNFunctionViewType() + { + type = this.Type , + name = allocator.AllocAnsiString(this.Name) , + }; + } + } +} \ No newline at end of file diff --git a/Struct/BNHighLevelILInstruction.cs b/Struct/BNHighLevelILInstruction.cs new file mode 100644 index 0000000..d6e5eca --- /dev/null +++ b/Struct/BNHighLevelILInstruction.cs @@ -0,0 +1,1533 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNHighLevelILInstruction + { + /// + /// BNHighLevelILOperation operation + /// + internal HighLevelILOperation operation; + + /// + /// uint32_t attributes + /// + internal uint attributes; + + /// + /// uint32_t sourceOperand + /// + internal uint sourceOperand; + + /// + /// uint64_t size + /// + internal ulong size; + + /// + /// uint64_t[5] operands + /// + internal fixed ulong operands[5]; + + /// + /// uint64_t address + /// + internal ulong address; + + /// + /// uint64_t parent + /// + internal ulong parent; + } + + public abstract class HighLevelILInstruction : + INativeWrapper , + IEquatable, + IComparable + { + public HighLevelILOperation Operation { get; set; } = HighLevelILOperation.HLIL_NOP; + + public uint Attributes { get; } = 0; + + public ulong Size { get; } = 0; + + public ulong RawParent { get; } = 0; + + public OperandIndex SourceOperand { get; } = 0; + + public ulong Address { get; } = 0; + + public ulong[] RawOperands { get; } = Array.Empty(); + + internal HighLevelILFunction ILFunction { get; } + + public HighLevelILExpressionIndex ExpressionIndex { get; } = 0; + + private static Dictionary OperationOperands = new Dictionary { + { HighLevelILOperation.HLIL_NOP, 0 }, + + { HighLevelILOperation.HLIL_BLOCK, 1 }, // stmtList + { HighLevelILOperation.HLIL_IF, 3 }, // cond, trueBlock, falseBlock + { HighLevelILOperation.HLIL_WHILE, 2 }, // cond, body + { HighLevelILOperation.HLIL_DO_WHILE, 2 }, // body, cond + { HighLevelILOperation.HLIL_FOR, 4 }, // init, cond, update, body + { HighLevelILOperation.HLIL_SWITCH, 3 }, // expr, caseList, default + { HighLevelILOperation.HLIL_CASE, 2 }, // valueList, body + { HighLevelILOperation.HLIL_BREAK, 0 }, + { HighLevelILOperation.HLIL_CONTINUE, 0 }, + { HighLevelILOperation.HLIL_JUMP, 1 }, // dest + { HighLevelILOperation.HLIL_RET, 1 }, // values(list) + { HighLevelILOperation.HLIL_NORET, 0 }, + { HighLevelILOperation.HLIL_GOTO, 1 }, // label + { HighLevelILOperation.HLIL_LABEL, 1 }, // labelId + + { HighLevelILOperation.HLIL_VAR_DECLARE, 1 }, // var + { HighLevelILOperation.HLIL_VAR_INIT, 2 }, // var, value + { HighLevelILOperation.HLIL_ASSIGN, 2 }, // dst, src + { HighLevelILOperation.HLIL_ASSIGN_UNPACK, 2 }, // dstList, src + { HighLevelILOperation.HLIL_FORCE_VER, 1 }, // var + { HighLevelILOperation.HLIL_ASSERT, 1 }, // cond + + { HighLevelILOperation.HLIL_VAR, 1 }, // var + { HighLevelILOperation.HLIL_STRUCT_FIELD, 2 }, // base, fieldOffset/index + { HighLevelILOperation.HLIL_ARRAY_INDEX, 2 }, // base, index + { HighLevelILOperation.HLIL_SPLIT, 2 }, // hi, lo + { HighLevelILOperation.HLIL_DEREF, 1 }, // addr + { HighLevelILOperation.HLIL_DEREF_FIELD, 2 }, // addr, fieldOffset/index + { HighLevelILOperation.HLIL_ADDRESS_OF, 1 }, // var/expr + + { HighLevelILOperation.HLIL_CONST, 1 }, // value + { HighLevelILOperation.HLIL_CONST_DATA, 2 }, // state,value (RegisterValue) + { HighLevelILOperation.HLIL_CONST_PTR, 1 }, // ptr + { HighLevelILOperation.HLIL_EXTERN_PTR, 2 }, // base, offset + { HighLevelILOperation.HLIL_FLOAT_CONST, 1 }, // fpBits + { HighLevelILOperation.HLIL_IMPORT, 1 }, // symbol/id + + { HighLevelILOperation.HLIL_ADD, 2 }, + { HighLevelILOperation.HLIL_ADC, 2 }, + { HighLevelILOperation.HLIL_SUB, 2 }, + { HighLevelILOperation.HLIL_SBB, 2 }, + { HighLevelILOperation.HLIL_AND, 2 }, + { HighLevelILOperation.HLIL_OR, 2 }, + { HighLevelILOperation.HLIL_XOR, 2 }, + { HighLevelILOperation.HLIL_LSL, 2 }, + { HighLevelILOperation.HLIL_LSR, 2 }, + { HighLevelILOperation.HLIL_ASR, 2 }, + { HighLevelILOperation.HLIL_ROL, 2 }, + { HighLevelILOperation.HLIL_RLC, 2 }, + { HighLevelILOperation.HLIL_ROR, 2 }, + { HighLevelILOperation.HLIL_RRC, 2 }, + { HighLevelILOperation.HLIL_MUL, 2 }, + { HighLevelILOperation.HLIL_MULU_DP, 2 }, + { HighLevelILOperation.HLIL_MULS_DP, 2 }, + { HighLevelILOperation.HLIL_DIVU, 2 }, + { HighLevelILOperation.HLIL_DIVU_DP, 2 }, + { HighLevelILOperation.HLIL_DIVS, 2 }, + { HighLevelILOperation.HLIL_DIVS_DP, 2 }, + { HighLevelILOperation.HLIL_MODU, 2 }, + { HighLevelILOperation.HLIL_MODU_DP, 2 }, + { HighLevelILOperation.HLIL_MODS, 2 }, + { HighLevelILOperation.HLIL_MODS_DP, 2 }, + { HighLevelILOperation.HLIL_NEG, 1 }, + { HighLevelILOperation.HLIL_NOT, 1 }, + { HighLevelILOperation.HLIL_SX, 2 }, // value, fromSize/type + { HighLevelILOperation.HLIL_ZX, 2 }, // value, fromSize/type + { HighLevelILOperation.HLIL_LOW_PART, 2 }, // value, toSize/type + + { HighLevelILOperation.HLIL_CALL, 3 }, // dest, params(list), outputs(list) + + { HighLevelILOperation.HLIL_CMP_E, 2 }, + { HighLevelILOperation.HLIL_CMP_NE, 2 }, + { HighLevelILOperation.HLIL_CMP_SLT, 2 }, + { HighLevelILOperation.HLIL_CMP_ULT, 2 }, + { HighLevelILOperation.HLIL_CMP_SLE, 2 }, + { HighLevelILOperation.HLIL_CMP_ULE, 2 }, + { HighLevelILOperation.HLIL_CMP_SGE, 2 }, + { HighLevelILOperation.HLIL_CMP_UGE, 2 }, + { HighLevelILOperation.HLIL_CMP_SGT, 2 }, + { HighLevelILOperation.HLIL_CMP_UGT, 2 }, + { HighLevelILOperation.HLIL_TEST_BIT, 2 }, + { HighLevelILOperation.HLIL_BOOL_TO_INT, 1 }, + { HighLevelILOperation.HLIL_ADD_OVERFLOW, 2 }, + + { HighLevelILOperation.HLIL_SYSCALL, 2 }, // params(list), outputs(list) + { HighLevelILOperation.HLIL_TAILCALL, 2 }, // dest, params(list) + { HighLevelILOperation.HLIL_INTRINSIC, 3 }, // intrinsicId, params(list), outputs(list) + { HighLevelILOperation.HLIL_BP, 0 }, + { HighLevelILOperation.HLIL_TRAP, 1 }, // code + { HighLevelILOperation.HLIL_UNDEF, 0 }, + { HighLevelILOperation.HLIL_UNIMPL, 0 }, + { HighLevelILOperation.HLIL_UNIMPL_MEM, 1 }, // addr + + { HighLevelILOperation.HLIL_FADD, 2 }, + { HighLevelILOperation.HLIL_FSUB, 2 }, + { HighLevelILOperation.HLIL_FMUL, 2 }, + { HighLevelILOperation.HLIL_FDIV, 2 }, + { HighLevelILOperation.HLIL_FSQRT, 1 }, + { HighLevelILOperation.HLIL_FNEG, 1 }, + { HighLevelILOperation.HLIL_FABS, 1 }, + { HighLevelILOperation.HLIL_FLOAT_TO_INT, 2 }, // value, mode/size + { HighLevelILOperation.HLIL_INT_TO_FLOAT, 2 }, // value, mode/size + { HighLevelILOperation.HLIL_FLOAT_CONV, 2 }, // value, toType + { HighLevelILOperation.HLIL_ROUND_TO_INT, 2 }, // value, mode + { HighLevelILOperation.HLIL_FLOOR, 1 }, + { HighLevelILOperation.HLIL_CEIL, 1 }, + { HighLevelILOperation.HLIL_FTRUNC, 1 }, + { HighLevelILOperation.HLIL_FCMP_E, 2 }, + { HighLevelILOperation.HLIL_FCMP_NE, 2 }, + { HighLevelILOperation.HLIL_FCMP_LT, 2 }, + { HighLevelILOperation.HLIL_FCMP_LE, 2 }, + { HighLevelILOperation.HLIL_FCMP_GE, 2 }, + { HighLevelILOperation.HLIL_FCMP_GT, 2 }, + { HighLevelILOperation.HLIL_FCMP_O, 2 }, + { HighLevelILOperation.HLIL_FCMP_UO, 2 }, + + { HighLevelILOperation.HLIL_UNREACHABLE, 0 }, + + { HighLevelILOperation.HLIL_WHILE_SSA, 2 }, // cond, body + { HighLevelILOperation.HLIL_DO_WHILE_SSA, 2 }, // body, cond + { HighLevelILOperation.HLIL_FOR_SSA, 4 }, // init, cond, update, body + { HighLevelILOperation.HLIL_VAR_INIT_SSA, 2 }, // var(versioned), value + { HighLevelILOperation.HLIL_ASSIGN_MEM_SSA, 3 }, // dst(addr), src, dstMem + { HighLevelILOperation.HLIL_ASSIGN_UNPACK_MEM_SSA, 3 }, // dstList, src, dstMem + { HighLevelILOperation.HLIL_FORCE_VER_SSA, 2 }, // var, newVersion + { HighLevelILOperation.HLIL_ASSERT_SSA, 2 }, // cond, mem/reg ver + + { HighLevelILOperation.HLIL_VAR_SSA, 2 }, // var, version + { HighLevelILOperation.HLIL_ARRAY_INDEX_SSA, 3 }, // base, index, srcMem + { HighLevelILOperation.HLIL_DEREF_SSA, 2 }, // addr, srcMem + { HighLevelILOperation.HLIL_DEREF_FIELD_SSA, 3 }, // addr, field, srcMem + + { HighLevelILOperation.HLIL_CALL_SSA, 4 }, // dest, params(list), outputs(list), srcMem + { HighLevelILOperation.HLIL_SYSCALL_SSA, 3 }, // params(list), outputs(list), srcMem + { HighLevelILOperation.HLIL_INTRINSIC_SSA, 4 }, // intrinsicId, params(list), outputs(list), srcMem + + { HighLevelILOperation.HLIL_VAR_PHI, 1 }, // varVersions(list) + { HighLevelILOperation.HLIL_MEM_PHI, 1 }, // memVersions(list) + }; + + + internal HighLevelILInstruction( + HighLevelILFunction ilFunction , + HighLevelILExpressionIndex expressionIndex + ) : this( + ilFunction , + expressionIndex , + NativeMethods.BNGetHighLevelILByIndex( + ilFunction.DangerousGetHandle() , + expressionIndex, + false + ) + ) + { + + } + + internal HighLevelILInstruction( + HighLevelILFunction ilFunction, + HighLevelILExpressionIndex expressionIndex , + BNHighLevelILInstruction native + ) + { + this.Operation = native.operation ; + this.Attributes = native.attributes ; + this.Size = native.size ; + this.RawParent = native.parent; + this.Address = native.address ; + this.SourceOperand = (OperandIndex)native.sourceOperand; + + HighLevelILInstruction.OperationOperands.TryGetValue( + this.Operation , + out int operandCount + ); + + if (0 == operandCount) + { + this.RawOperands = Array.Empty(); + } + else + { + this.RawOperands = new ulong[operandCount]; + + for (int i = 0; i < operandCount; i++) + { + unsafe + { + this.RawOperands[i] = native.operands[i] ; + } + } + } + + this.ILFunction = ilFunction; + + this.ExpressionIndex = expressionIndex; + } + + public BNHighLevelILInstruction ToNative() + { + BNHighLevelILInstruction native = new BNHighLevelILInstruction() + { + operation = this.Operation , + attributes = this.Attributes , + sourceOperand = (uint)this.SourceOperand , + size = this.Size , + address = this.Address , + parent = this.RawParent + }; + + int count = Math.Min(this.RawOperands?.Length ?? 0, 5); + + if (this.RawOperands?.Length >= count) + { + for (int i = 0; i < count; i++) + { + unsafe + { + native.operands[i] = this.RawOperands[i]; + } + } + } + + return native; + } + + internal static HighLevelILInstruction FromExpressionIndex( + HighLevelILFunction ilFunction , + HighLevelILExpressionIndex expressionIndex, + bool asFullAst = true + ) + { + BNHighLevelILInstruction native = NativeMethods.BNGetHighLevelILByIndex( + ilFunction.DangerousGetHandle() , + expressionIndex, + asFullAst + ); + + switch (native.operation) + { + case HighLevelILOperation.HLIL_NOP: + { + return new HLILNop(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_BLOCK: + { + return new HLILBlock(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_IF: + { + return new HLILIf(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_WHILE: + { + return new HLILWhile(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_DO_WHILE: + { + return new HLILDoWhile(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_FOR: + { + return new HLILFor(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_SWITCH: + { + return new HLILSwitch(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_CASE: + { + return new HLILCase(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_BREAK: + { + return new HLILBreak(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_CONTINUE: + { + return new HLILContinue(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_JUMP: + { + return new HLILJump(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_RET: + { + return new HLILReturn(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_NORET: + { + return new HLILNoReturn(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_GOTO: + { + return new HLILGoto(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_LABEL: + { + return new HLILLabel(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_VAR_DECLARE: + { + return new HLILVariableDeclare(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_VAR_INIT: + { + return new HLILVariableInit(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_ASSIGN: + { + return new HLILAssign(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_ASSIGN_UNPACK: + { + return new HLILAssignUnpack(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_FORCE_VER: + { + return new HLILForceVersion(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_ASSERT: + { + return new HLILAssert(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_VAR: + { + return new HLILVariable(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_STRUCT_FIELD: + { + return new HLILStructField(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_ARRAY_INDEX: + { + return new HLILArrayIndex(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_SPLIT: + { + return new HLILSplit(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_DEREF: + { + return new HLILDeref(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_DEREF_FIELD: + { + return new HLILDerefField(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_ADDRESS_OF: + { + return new HLILAddressOf(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_CONST: + { + return new HLILConst(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_CONST_DATA: + { + return new HLILConstData(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_CONST_PTR: + { + return new HLILConstPointer(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_EXTERN_PTR: + { + return new HLILExternPointer(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_FLOAT_CONST: + { + return new HLILFloatConst(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_IMPORT: + { + return new HLILImport(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_ADD: + { + return new HLILAdd(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_ADC: + { + return new HLILAddCarry(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_SUB: + { + return new HLILSub(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_SBB: + { + return new HLILSubBorrow(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_AND: + { + return new HLILAnd(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_OR: + { + return new HLILOr(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_XOR: + { + return new HLILXor(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_LSL: + { + return new HLILLogicalShiftLef(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_LSR: + { + return new HLILLogicalShiftRight(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_ASR: + { + return new HlilArithmeticShiftRight(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_ROL: + { + return new HLILRotateLeft(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_RLC: + { + return new HLILRotateLeftCarry(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_ROR: + { + return new HLILRotateRight(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_RRC: + { + return new HLILRotateRightCarry(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_MUL: + { + return new HLILMul(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_MULU_DP: + { + // HLILMulDp + return new HLILMulUnsignedDoublePrecision(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_MULS_DP: + { + return new HLILMulSignedDoublePrecision(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_DIVU: + { + return new HLILDivUnsigned(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_DIVU_DP: + { + return new HLILDivUnsignedDoublePrecision(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_DIVS: + { + return new HLILDivSigned(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_DIVS_DP: + { + return new HLILDivSignedDoublePrecision(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_MODU: + { + return new HLILModUnsigned(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_MODU_DP: + { + return new HLILModUnsignedDoublePrecision(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_MODS: + { + return new HlilModSigned(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_MODS_DP: + { + return new HLILModSignedDoublePrecision(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_NEG: + { + return new HLILNeg(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_NOT: + { + return new HLILNot(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_SX: + { + return new HLILSignExtend(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_ZX: + { + return new HLILZeroExtend(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_LOW_PART: + { + return new HLILLowPart(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_CALL: + { + return new HLILCall(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_CMP_E: + { + return new HLILEqual(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_CMP_NE: + { + return new HLILNotEqual(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_CMP_SLT: + { + return new HLILSignedLessThan(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_CMP_ULT: + { + return new HLILUnsignedLessThan(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_CMP_SLE: + { + return new HLILSignedLessEqual(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_CMP_ULE: + { + return new HLILUnsignedLessEqual(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_CMP_SGE: + { + return new HLILSignedGreaterEqual(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_CMP_UGE: + { + return new HLILUnsignedLessEqual(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_CMP_SGT: + { + return new HLILSignedGreaterThan(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_CMP_UGT: + { + return new HLILUnsignedGreaterThan(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_TEST_BIT: + { + return new HLILTestBit(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_BOOL_TO_INT: + { + return new HLILBoolToInt(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_ADD_OVERFLOW: + { + return new HLILAddOverflow(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_SYSCALL: + { + return new HLILSysCall(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_TAILCALL: + { + return new HLILTailCall(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_INTRINSIC: + { + return new HLILIntrinsic(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_BP: + { + return new HLILBreakpoint(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_TRAP: + { + return new HLILTrap(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_UNDEF: + { + return new HLILUndefined(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_UNIMPL: + { + return new HLILUnimplemented(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_UNIMPL_MEM: + { + return new HLILUnimplementedMemory(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_FADD: + { + return new HLILFloatAdd(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_FSUB: + { + return new HLILFloatSub(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_FMUL: + { + return new HLILFloatMul(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_FDIV: + { + return new HLILFloatDiv(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_FSQRT: + { + return new HLILFloatSquareRoot(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_FNEG: + { + return new HLILFloatNeg(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_FABS: + { + return new HLILFloatAbs(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_FLOAT_TO_INT: + { + return new HLILFloatToInt(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_INT_TO_FLOAT: + { + return new HLILIntToFloat(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_FLOAT_CONV: + { + return new HLILFloatConvert(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_ROUND_TO_INT: + { + return new HLILRoundToInt(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_FLOOR: + { + return new HLILFloor(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_CEIL: + { + return new HLILCeil(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_FTRUNC: + { + return new HLILFloatTrunc(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_FCMP_E: + { + return new HLILFloatEqual(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_FCMP_NE: + { + return new HLILFloatNotEqual(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_FCMP_LT: + { + return new HLILFloatLessThan(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_FCMP_LE: + { + return new HLILFloatLessEqual(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_FCMP_GE: + { + return new HLILFloatGreaterThan(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_FCMP_GT: + { + return new HLILFloatGreaterThan(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_FCMP_O: + { + return new HLILFloatCompareOrdered(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_FCMP_UO: + { + return new HLILFloatCompareUnordered(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_UNREACHABLE: + { + return new HLILUnreachable(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_WHILE_SSA: + { + return new HLILWhileSSA(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_DO_WHILE_SSA: + { + return new HLILDoWhileSSA(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_FOR_SSA: + { + return new HLILForSSA(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_VAR_INIT_SSA: + { + return new HLILVariableInitSSA(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_ASSIGN_MEM_SSA: + { + return new HLILAssignMemorySSA(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_ASSIGN_UNPACK_MEM_SSA: + { + return new HLILAssignUnpackMemorySSA(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_FORCE_VER_SSA: + { + return new HLILForceVersionSSA(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_ASSERT_SSA: + { + return new HLILAssertSSA(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_VAR_SSA: + { + return new HLILVariableSSA(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_ARRAY_INDEX_SSA: + { + return new HLILArrayIndexSSA(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_DEREF_SSA: + { + return new HLILDerefSSA(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_DEREF_FIELD_SSA: + { + return new HLILDerefFieldSSA(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_CALL_SSA: + { + return new HLILCallSSA(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_SYSCALL_SSA: + { + return new HLILSysCallSSA(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_INTRINSIC_SSA: + { + return new HLILIntrinsicSSA(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_VAR_PHI: + { + return new HLILVariablePhi(ilFunction, expressionIndex , native); + } + case HighLevelILOperation.HLIL_MEM_PHI: + { + return new HLILMemoryPhi(ilFunction, expressionIndex , native); + } + default: + { + throw new NotSupportedException("not supported operation"); + } + } + } + + public override string ToString() + { + return this.ExpressionText; + } + + public override bool Equals(object? other) + { + return Equals(other as HighLevelILInstruction); + } + + public bool Equals(HighLevelILInstruction? other) + { + if (other is null) + { + return false; + } + + if (ReferenceEquals(this , other)) + { + return true; + } + + if (this.ILFunction != other.ILFunction) + { + return false; + } + + return this.ExpressionIndex == other.ExpressionIndex; + } + + public override int GetHashCode() + { + return HashCode.Combine( + this.ILFunction.GetHashCode(), + (ulong)this.ExpressionIndex + ); + } + + public static bool operator ==(HighLevelILInstruction? left, HighLevelILInstruction? right) + { + if (left is null) + { + return right is null; + } + + return left.Equals(right); + } + + public static bool operator !=(HighLevelILInstruction? left, HighLevelILInstruction? right) + { + return !(left == right); + } + + public int CompareTo(HighLevelILInstruction? other) + { + if (other is null) + { + return 1; + } + + int result = this.ILFunction.CompareTo(other.ILFunction); + + if (0 == result) + { + result = this.ExpressionIndex.CompareTo(other.ExpressionIndex); + } + + return result; + } + + public T[] GetOperandAsIntegerArray(OperandIndex operand) + where T : unmanaged + { + IntPtr arrayPointer = NativeMethods.BNHighLevelILGetOperandList( + this.ILFunction.DangerousGetHandle() , + this.ExpressionIndex , + (ulong)this.RawOperands[(ulong)operand] , + out ulong arrayLength + ); + + return UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNHighLevelILFreeOperandList + ); + } + + public IDictionary GetOperandAsIntegerMap(OperandIndex operand) + where T : unmanaged + { + IntPtr arrayPointer = NativeMethods.BNHighLevelILGetOperandList( + this.ILFunction.DangerousGetHandle() , + this.ExpressionIndex , + (ulong)operand , + out ulong arrayLength + ); + + ulong[] keyAndValues = UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNHighLevelILFreeOperandList + ); + + Dictionary target = new Dictionary(); + + for (int i = 0; i < keyAndValues.Length; i += 2) + { + T key = UnsafeUtils.ForceConvert( + keyAndValues[i] + ); + + T value = UnsafeUtils.ForceConvert( + keyAndValues[i+1] + ); + + target[key] = value; + } + + return target; + } + + public float GetOperandAsFloat(OperandIndex operand) + { + return (float)BitConverter.UInt32BitsToSingle( + (uint)this.RawOperands[(ulong)operand] + ); + } + + public double GetOperandAsDouble(OperandIndex operand) + { + return BitConverter.UInt64BitsToDouble(this.RawOperands[(ulong)operand]); + } + + public RegisterValue GetOperandAsConstantData( + OperandIndex operand1 , + OperandIndex operand2 + ) + { + return new RegisterValue() + { + State = (RegisterValueType)this.RawOperands[(ulong)operand1] , + Value = (long)this.RawOperands[(ulong)operand2] , + Offset = 0 , + Size = this.Size + }; + } + + public HighLevelILLabel GetOperandAsLabel(OperandIndex operand) + { + return new HighLevelILLabel( + this.ILFunction , + this.RawOperands[(ulong)operand] + ); + } + + public HighLevelILVariable GetOperandAsVariable(OperandIndex operand) + { + return HighLevelILVariable.FromIdentifierEx( + this.ILFunction , + this.RawOperands[(ulong)operand] + ); + } + + public HighLevelILVariable[] GetOperandAsVariableList(OperandIndex operand1) + { + IntPtr arrayPointer = NativeMethods.BNHighLevelILGetOperandList( + this.ILFunction.DangerousGetHandle() , + this.ExpressionIndex , + (ulong)operand1 , + out ulong arrayLength + ); + + ulong[] identifiers = UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNHighLevelILFreeOperandList + ); + + List variables = new List(); + + foreach (ulong identifier in identifiers) + { + variables.Add( + HighLevelILVariable.FromIdentifierEx(this.ILFunction ,identifier) + ); + } + + return variables.ToArray(); + } + + public HighLevelILSSAVariable GetOperandAsSSAVariable( + OperandIndex operand1, + OperandIndex operand2 + ) + { + HighLevelILVariable ilVariable = HighLevelILVariable.FromIdentifierEx( + this.ILFunction , + this.RawOperands[(ulong)operand1] + ); + + return new HighLevelILSSAVariable( + ilVariable , + this.RawOperands[(ulong)operand2] + ); + } + + public HighLevelILSSAVariable[] GetOperandAsSSAVariableList(OperandIndex operand1) + { + IntPtr arrayPointer = NativeMethods.BNHighLevelILGetOperandList( + this.ILFunction.DangerousGetHandle() , + this.ExpressionIndex , + (ulong)operand1 , + out ulong arrayLength + ); + + ulong[] identifierAndVersions = UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNHighLevelILFreeOperandList + ); + + List variables = new List(); + + for (int i = 0; i < identifierAndVersions.Length; i += 2) + { + ulong identifier = identifierAndVersions[i]; + ulong version = identifierAndVersions[i + 1]; + + HighLevelILVariable variable = HighLevelILVariable.FromIdentifierEx(this.ILFunction ,identifier); + + variables.Add( + new HighLevelILSSAVariable(variable ,version ) + ); + } + + return variables.ToArray(); + } + + public Intrinsic GetOperandAsIntrinsic(OperandIndex operand) + { + return new Intrinsic( + this.ILFunction.OwnerFunction.Architecture , + (IntrinsicIndex)this.RawOperands[(ulong)operand] + ); + } + + public PossibleValueSet GetOperandAsPossibleValueSet(OperandIndex operand) + { + return PossibleValueSet.TakeNative( + NativeMethods.BNGetCachedHighLevelILPossibleValueSet( + this.ILFunction.DangerousGetHandle() , + this.RawOperands[(ulong)operand] + ) + ); + } + + public HighLevelILInstruction GetOperandAsExpression(OperandIndex operand) + { + return HighLevelILInstruction.FromExpressionIndex( + this.ILFunction , + (HighLevelILExpressionIndex)this.RawOperands[(ulong)operand] + ); + } + + public HighLevelILInstruction[] GetOperandAsExpressionList( + OperandIndex operand + ) + { + IntPtr arrayPointer = NativeMethods.BNHighLevelILGetOperandList( + this.ILFunction.DangerousGetHandle() , + this.ExpressionIndex , + (ulong)operand , + out ulong arrayLength + ); + + HighLevelILExpressionIndex[] expressionIndexes = UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNHighLevelILFreeOperandList + ); + + List expressions = new List(); + + foreach (HighLevelILExpressionIndex expressionIndex in expressionIndexes) + { + expressions.Add( + HighLevelILInstruction.FromExpressionIndex( + this.ILFunction , + expressionIndex + ) + ); + } + + return expressions.ToArray(); + } + + public DisassemblyTextLine[] ExpressionLines + { + get + { + DisassemblySettings settings = DisassemblySettings.DefaultLinear(); + + settings.SetOption(DisassemblyOption.HighLevelILLinearDisassembly , true); + settings.SetOption(DisassemblyOption.IndentHLILBody , true); + + return this.GetExpressionText( + false, + settings + ); + } + } + + public string ExpressionText + { + get + { + StringBuilder builder = new StringBuilder(); + + foreach (DisassemblyTextLine line in this.ExpressionLines) + { + builder.Append(line.ToString()); + } + + return builder.ToString(); + } + } + + public DisassemblyTextLine[] GetExpressionText( + bool asFullAst = false, + DisassemblySettings? settings = null + ) + { + IntPtr arrayPointer = NativeMethods.BNGetHighLevelILExprText( + this.ILFunction.DangerousGetHandle() , + this.ExpressionIndex, + asFullAst, + out ulong arrayLength, + null == settings ? IntPtr.Zero : settings.DangerousGetHandle() + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength, + DisassemblyTextLine.FromNative, + NativeMethods.BNFreeDisassemblyTextLines + ); + } + + public HighLevelILInstructionIndex InstructionIndex + { + get + { + return NativeMethods.BNGetHighLevelILInstructionForExpr( + this.ILFunction.DangerousGetHandle() , + this.ExpressionIndex + ); + } + } + + public HighLevelILInstruction? SSAExpression + { + get + { + HighLevelILExpressionIndex index = NativeMethods.BNGetHighLevelILSSAExprIndex( + this.ILFunction.DangerousGetHandle(), + this.ExpressionIndex + ); + + if ((ulong)index >= this.ILFunction.ExpressionCount) + { + return null; + } + + return this.ILFunction.GetExpression((HighLevelILExpressionIndex)index); + } + } + + public HighLevelILInstruction? NonSSAExpression + { + get + { + HighLevelILExpressionIndex index = NativeMethods.BNGetHighLevelILNonSSAExprIndex( + this.ILFunction.DangerousGetHandle(), + this.ExpressionIndex + ); + + if ((ulong)index >= this.ILFunction.ExpressionCount) + { + return null; + } + + return this.ILFunction.GetExpression((HighLevelILExpressionIndex)index); + } + } + + public HighLevelILInstruction? SSAInstruction + { + get + { + HighLevelILInstructionIndex? index = NativeMethods.BNGetHighLevelILSSAInstructionIndex( + this.ILFunction.DangerousGetHandle(), + this.InstructionIndex + ); + + if ((ulong)index >= this.ILFunction.InstructionCount) + { + return null; + } + + return this.ILFunction.GetInstruction((HighLevelILInstructionIndex)index); + } + } + + + public HighLevelILInstruction? NonSSAInstruction + { + get + { + HighLevelILInstructionIndex? index = NativeMethods.BNGetHighLevelILNonSSAInstructionIndex( + this.ILFunction.DangerousGetHandle(), + this.InstructionIndex + ); + + if ((ulong)index >= this.ILFunction.InstructionCount) + { + return null; + } + + return this.ILFunction.GetInstruction((HighLevelILInstructionIndex)index); + } + } + + public MediumLevelILInstruction? MediumLevelIL + { + get + { + MediumLevelILExpressionIndex index = NativeMethods.BNGetMediumLevelILExprIndexFromHighLevelIL( + this.ILFunction.DangerousGetHandle() , + this.ExpressionIndex + ); + + if (null == this.ILFunction.MediumLevelIL) + { + return null; + } + + if ((ulong)index >= this.ILFunction.MediumLevelIL.ExpressionCount) + { + return null; + } + + return this.ILFunction.MediumLevelIL?.GetExpression( + (MediumLevelILExpressionIndex)index + ); + } + } + + public MediumLevelILInstruction[] MediumLevelILs + { + get + { + MediumLevelILFunction? mediumLevelIl = this.ILFunction.MediumLevelIL; + + if (null == mediumLevelIl) + { + return Array.Empty(); + } + + IntPtr arrayPointer = NativeMethods.BNGetMediumLevelILExprIndexesFromHighLevelIL( + this.ILFunction.DangerousGetHandle() , + this.ExpressionIndex, + out ulong arrayLength + ); + + ulong[] indexes = UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNFreeILInstructionList + ); + + List targets = new List(); + + foreach (MediumLevelILExpressionIndex index in indexes) + { + targets.Add(mediumLevelIl.MustGetExpression(index)); + } + + return targets.ToArray(); + } + } + + public DisassemblyTextLine[] GetLanguageRepresentationLinearLines( + DisassemblySettings? settings = null , + string language = "Pseudo C", + bool asFullAst = false + ) + { + LanguageRepresentationFunction? pseudo = this.ILFunction.GetLanguageRepresentation(language); + + if (null == pseudo) + { + return Array.Empty(); + } + + IntPtr arrayPointer = NativeMethods.BNGetLanguageRepresentationFunctionLinearLines( + pseudo.DangerousGetHandle() , + this.ILFunction.DangerousGetHandle() , + this.ExpressionIndex , + null == settings ? IntPtr.Zero : settings.DangerousGetHandle() , + asFullAst , + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + DisassemblyTextLine.FromNative , + NativeMethods.BNFreeDisassemblyTextLines + ); + } + + public DisassemblyTextLine[] PseudoCLinearLines + { + get + { + return this.GetLanguageRepresentationLinearLines(); + } + } + + public string PseudoCLinearText + { + get + { + StringBuilder builder = new StringBuilder(); + + foreach (DisassemblyTextLine line in this.PseudoCLinearLines) + { + builder.AppendLine(line.ToString()); + } + + return builder.ToString(); + } + } + + public DisassemblyTextLine[] GetLanguageRepresentationExpressionLines( + DisassemblySettings? settings = null, + bool asFullAst = false, + OperatorPrecedence precedence = OperatorPrecedence.TopLevelOperatorPrecedence, + bool statement = false, + string language = "Pseudo C" + ) + { + LanguageRepresentationFunction? pseudo = this.ILFunction.GetLanguageRepresentation(language); + + if (null == pseudo) + { + return Array.Empty(); + } + + ulong arrayLength = 0; + + IntPtr arrayPointer = NativeMethods.BNGetLanguageRepresentationFunctionExprText( + pseudo.DangerousGetHandle() , + this.ILFunction.DangerousGetHandle() , + this.ExpressionIndex , + null == settings ? IntPtr.Zero : settings.DangerousGetHandle() , + asFullAst , + precedence , + statement , + out arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength , + DisassemblyTextLine.FromNative , + NativeMethods.BNFreeDisassemblyTextLines + ); + } + + public DisassemblyTextLine[] PseudoCExpressionLines + { + get + { + return this.GetLanguageRepresentationExpressionLines(); + } + } + + public string PseudoCExpressionText + { + get + { + StringBuilder builder = new StringBuilder(); + + foreach (DisassemblyTextLine line in this.PseudoCExpressionLines) + { + builder.AppendLine(line.ToString()); + } + + return builder.ToString(); + } + } + + public HighLevelILBasicBlock? BasicBlock + { + get + { + return HighLevelILBasicBlock.TakeHandleEx( + this.ILFunction, + NativeMethods.BNGetHighLevelILBasicBlockForInstruction( + this.ILFunction.DangerousGetHandle() , + this.InstructionIndex + ) + ); + } + } + + public RegisterValue Value + { + get + { + if (null == this.MediumLevelIL) + { + return new RegisterValue(); + } + + return this.MediumLevelIL.Value; + } + } + + public PossibleValueSet PossibleValues + { + get + { + if (null == this.MediumLevelIL) + { + return new PossibleValueSet(); + } + + return this.MediumLevelIL.PossibleValues; + } + } + + public PossibleValueSet GetPossibleValues(DataFlowQueryOption[] options) + { + if (null == this.MediumLevelIL) + { + return new PossibleValueSet(); + } + + return this.MediumLevelIL.GetPossibleValues(options); + } + + public TypeWithConfidence Type + { + get + { + return TypeWithConfidence.FromNative( + NativeMethods.BNGetHighLevelILExprType( + this.ILFunction.DangerousGetHandle() , + this.ExpressionIndex + ) + ); + } + + set + { + NativeMethods.BNSetHighLevelILExprType( + this.ILFunction.DangerousGetHandle(), + this.ExpressionIndex, + value.ToNative() + ); + } + } + + public ulong SSAMemoryVersion + { + get + { + return NativeMethods.BNGetHighLevelILSSAMemoryVersionAtILInstruction( + this.ILFunction.DangerousGetHandle(), + this.InstructionIndex + ); + } + } + + public ulong GetSSAVariableVersion(Variable variable) + { + return NativeMethods.BNGetHighLevelILSSAVarVersionAtILInstruction( + this.ILFunction.DangerousGetHandle() , + variable.ToNative() , + this.InstructionIndex + ); + } + + public bool HasSideEffects + { + get + { + return NativeMethods.BNHighLevelILHasSideEffects( + this.ILFunction.DangerousGetHandle(), + this.ExpressionIndex + ); + } + } + + + } +} \ No newline at end of file diff --git a/Struct/BNHighlightColor.cs b/Struct/BNHighlightColor.cs new file mode 100644 index 0000000..dd3dd3c --- /dev/null +++ b/Struct/BNHighlightColor.cs @@ -0,0 +1,105 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNHighlightColor + { + /// + /// BNHighlightColorStyle style + /// + internal HighlightColorStyle style; + + /// + /// BNHighlightStandardColor color + /// + internal HighlightStandardColor color; + + /// + /// BNHighlightStandardColor mixColor + /// + internal HighlightStandardColor mixColor; + + /// + /// uint8_t mix + /// + internal byte mix; + + /// + /// uint8_t r + /// + internal byte r; + + /// + /// uint8_t g + /// + internal byte g; + + /// + /// uint8_t b + /// + internal byte b; + + /// + /// uint8_t alpha + /// + internal byte alpha; + } + + public sealed class HighlightColor : INativeWrapper + { + public HighlightColorStyle Style { get; set; } = HighlightColorStyle.StandardHighlightColor; + + public HighlightStandardColor Color { get; set; } = HighlightStandardColor.NoHighlightColor; + + public HighlightStandardColor MixColor { get; set; } = HighlightStandardColor.NoHighlightColor; + + public byte Mix { get; set; } = 0; + + public byte R { get; set; } = 0; + + public byte G { get; set; } = 0; + + public byte B { get; set; } = 0; + + public byte Alpha { get; set; } = 0; + + public HighlightColor() + { + + } + + internal static HighlightColor FromNative(BNHighlightColor native) + { + return new HighlightColor() + { + Style = native.style , + Color = native.color , + MixColor = native.mixColor , + Mix = native.mix , + R = native.r , + G = native.g , + B = native.b , + Alpha = native.alpha + }; + } + + public BNHighlightColor ToNative() + { + return new BNHighlightColor + { + style = this.Style, + color = this.Color, + mixColor = this.MixColor, + mix = this.Mix, + r = this.R, + g = this.G, + b = this.B, + alpha = this.Alpha + }; + } + } +} \ No newline at end of file diff --git a/Struct/BNILBranchInstructionAndDependence.cs b/Struct/BNILBranchInstructionAndDependence.cs new file mode 100644 index 0000000..24d26aa --- /dev/null +++ b/Struct/BNILBranchInstructionAndDependence.cs @@ -0,0 +1,51 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNILBranchInstructionAndDependence + { + /// + /// uint64_t branch + /// + internal ulong branch; + + /// + /// BNILBranchDependence dependence + /// + internal ILBranchDependence dependence; + } + + public sealed class ILBranchInstructionAndDependence : INativeWrapper + { + public ulong Branch { get; set; } = 0; + + public ILBranchDependence Dependence { get; set; } = ILBranchDependence.NotBranchDependent; + + public ILBranchInstructionAndDependence() + { + + } + + internal static ILBranchInstructionAndDependence FromNative(BNILBranchInstructionAndDependence native) + { + return new ILBranchInstructionAndDependence() + { + Branch = native.branch , + Dependence = native.dependence + }; + } + + public BNILBranchInstructionAndDependence ToNative() + { + return new BNILBranchInstructionAndDependence() + { + branch = this.Branch , + dependence = this.Dependence + }; + } + } +} \ No newline at end of file diff --git a/Struct/BNILIndexRange.cs b/Struct/BNILIndexRange.cs new file mode 100644 index 0000000..a1e4b31 --- /dev/null +++ b/Struct/BNILIndexRange.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNILIndexRange + { + /// + /// uint64_t start + /// + public ulong start; + + /// + /// uint64_t end + /// + public ulong end; + } + + public sealed class ILIndexRange + { + public ulong Start { get; set; } = 0; + + public ulong End { get; set; } = 0; + + public ILIndexRange() + { + + } + + internal static ILIndexRange FromNative(BNILIndexRange raw) + { + return new ILIndexRange() + { + Start = raw.start , End = raw.end + }; + } + } +} \ No newline at end of file diff --git a/Struct/BNILReferenceSource.cs b/Struct/BNILReferenceSource.cs new file mode 100644 index 0000000..574b0c2 --- /dev/null +++ b/Struct/BNILReferenceSource.cs @@ -0,0 +1,78 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNILReferenceSource + { + /// + /// BNFunction* func + /// + internal IntPtr func; + + /// + /// BNArchitecture* arch + /// + internal IntPtr arch; + + /// + /// uint64_t addr + /// + internal ulong addr; + + /// + /// BNFunctionGraphType type + /// + internal FunctionGraphType type; + + /// + /// uint64_t exprId + /// + internal ulong exprId; + } + + public class ILReferenceSource : INativeWrapper + { + public Function? Function { get; set; } = null; + + public Architecture? Architecture { get; set; } = null; + + public ulong Address { get; set; } = 0; + + public FunctionGraphType Type { get; set; } = FunctionGraphType.NormalFunctionGraph; + + public ulong ExprId { get; set; } = 0; + + public ILReferenceSource() + { + + } + + internal static ILReferenceSource FromNative(BNILReferenceSource native) + { + return new ILReferenceSource() + { + Function = Function.NewFromHandle(native.func) , + Architecture = Architecture.FromHandle(native.arch) , + Address = native.addr , + Type = native.type , + ExprId = native.exprId + }; + } + + public BNILReferenceSource ToNative() + { + return new BNILReferenceSource() + { + func = ( null == this.Function ? IntPtr.Zero : this.Function.DangerousGetHandle() ) , + arch = ( null == this.Architecture ? IntPtr.Zero : this.Architecture.DangerousGetHandle() ) , + addr = this.Address , + type = this.Type , + exprId = this.ExprId + }; + } + } +} \ No newline at end of file diff --git a/Struct/BNIndirectBranchInfo.cs b/Struct/BNIndirectBranchInfo.cs new file mode 100644 index 0000000..009eda3 --- /dev/null +++ b/Struct/BNIndirectBranchInfo.cs @@ -0,0 +1,75 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNIndirectBranchInfo + { + /// + /// BNArchitecture* sourceArch + /// + public IntPtr sourceArch; + + /// + /// uint64_t sourceAddr + /// + public ulong sourceAddr; + + /// + /// BNArchitecture* destArch + /// + public IntPtr destArch; + + /// + /// uint64_t destAddr + /// + public ulong destAddr; + + /// + /// bool autoDefined + /// + public bool autoDefined; + } + + public sealed class IndirectBranchInfo + { + public Architecture SourceArchitecture { get; set; } + + public ulong SourceAddress { get; set; } = 0; + + public Architecture DestArchitecture { get; set; } + + public ulong DestAddress { get; set; } = 0; + + public bool AutoDefined { get; set; } = false; + + public IndirectBranchInfo( + Architecture sourceArch, + ulong sourceAddress, + Architecture destArch, + ulong destAddress, + bool autoDefined + ) + { + this.SourceArchitecture = sourceArch; + this.SourceAddress = sourceAddress; + this.DestArchitecture = destArch; + this.DestAddress = destAddress; + this.AutoDefined = autoDefined; + } + + internal static IndirectBranchInfo FromNative(BNIndirectBranchInfo native) + { + return new IndirectBranchInfo( + Architecture.MustFromHandle(native.sourceArch) , + native.sourceAddr , + Architecture.MustFromHandle(native.destArch) , + native.destAddr , + native.autoDefined + ); + } + } +} \ No newline at end of file diff --git a/Struct/BNInheritedStructureMember.cs b/Struct/BNInheritedStructureMember.cs new file mode 100644 index 0000000..a931bc3 --- /dev/null +++ b/Struct/BNInheritedStructureMember.cs @@ -0,0 +1,60 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + using MemberIndex = ulong; + + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNInheritedStructureMember + { + /// + /// BNNamedTypeReference* _base + /// + public IntPtr _base; + + /// + /// uint64_t baseOffset + /// + public ulong baseOffset; + + /// + /// BNStructureMember member + /// + public BNStructureMember member; + + /// + /// uint64_t memberIndex + /// + public ulong memberIndex; + } + + public sealed class InheritedStructureMember + { + public NamedTypeReference BaseType { get; set; } + + public ulong BaseOffset { get; set; } = 0; + + public StructureMember Member { get; set; } + + public MemberIndex MemberIndex { get; set; } = 0; + + public InheritedStructureMember( + NamedTypeReference baseType, + ulong baseOffset, + StructureMember member, + MemberIndex memberIndex + ) + { + this.BaseType = baseType; + + this.BaseOffset = baseOffset; + + this.Member = member; + + this.MemberIndex = memberIndex; + } + } +} \ No newline at end of file diff --git a/Struct/BNInstructionInfo.cs b/Struct/BNInstructionInfo.cs new file mode 100644 index 0000000..44897cd --- /dev/null +++ b/Struct/BNInstructionInfo.cs @@ -0,0 +1,148 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNInstructionInfo + { + /// + /// + /// uint64_t length + /// + internal ulong length; + + /// + /// + /// uint64_t branchCount + /// + internal ulong branchCount; + + /// + /// + /// bool archTransitionByTargetAddr + /// + internal bool archTransitionByTargetAddr; + + /// + /// + /// uint8_t delaySlots + /// + internal byte delaySlots; + + /// + /// + /// BNBranchType[3] branchType + /// + internal fixed uint branchType[3]; + + /// + /// + /// uint64_t[3] branchTarget + /// + internal fixed ulong branchTarget[3]; + + /// + /// + /// BNArchitecture*[3] branchArch + /// + internal IntPtr branchArch_0; + internal IntPtr branchArch_1; + internal IntPtr branchArch_2; + } + + public sealed class InstructionInfo + { + public ulong Length { get;} = 0; + + public ulong BranchCount { get;} = 0; + + public bool ArchTransitionByTargetAddr { get;} = false; + + public byte DelaySlots { get; } = 0; + + public BranchType[] BranchType { get;} = Array.Empty(); + + public ulong[] BranchTarget { get;} = Array.Empty(); + + public Architecture[] BranchArch { get;} = Array.Empty(); + + public InstructionInfo() + { + + } + + public InstructionInfo(BNInstructionInfo native) + { + this.Length = native.length; + + this.BranchCount = native.branchCount; + + this.ArchTransitionByTargetAddr = native.archTransitionByTargetAddr; + + this.DelaySlots = native.delaySlots; + + // BranchType + List branchTypes = new List(); + + for (ulong i = 0; i < this.BranchCount; i++) + { + unsafe + { + branchTypes.Add( (BranchType)native.branchType[i] ); + } + } + + this.BranchType = branchTypes.ToArray(); + + // BranchTarget + List branchTargets = new List(); + + for (ulong i = 0; i < this.BranchCount; i++) + { + unsafe + { + branchTargets.Add( native.branchTarget[i] ); + } + } + + this.BranchTarget = branchTargets.ToArray(); + + // BranchArch + List branchArches = new List(); + + if (this.BranchCount >= 1) + { + if (IntPtr.Zero != native.branchArch_0) + { + branchArches.Add( new Architecture( native.branchArch_0 ) ); + } + } + + if (this.BranchCount >= 2) + { + if (IntPtr.Zero != native.branchArch_1) + { + branchArches.Add( new Architecture( native.branchArch_1 ) ); + } + } + + if (this.BranchCount >= 3) + { + if (IntPtr.Zero != native.branchArch_2) + { + branchArches.Add( new Architecture( native.branchArch_2 ) ); + } + } + + this.BranchArch = branchArches.ToArray(); + } + + internal static InstructionInfo FromNative(BNInstructionInfo native) + { + return new InstructionInfo(native); + } + } +} \ No newline at end of file diff --git a/Struct/BNInstructionTextLine.cs b/Struct/BNInstructionTextLine.cs new file mode 100644 index 0000000..331e882 --- /dev/null +++ b/Struct/BNInstructionTextLine.cs @@ -0,0 +1,49 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNInstructionTextLine + { + /// + /// BNInstructionTextToken* tokens + /// + public IntPtr tokens; + + /// + /// uint64_t count + /// + public ulong count; + } + + public sealed class InstructionTextLine + { + public InstructionTextToken[] Tokens { get; } = Array.Empty(); + + public InstructionTextLine() + { + + } + + public InstructionTextLine(InstructionTextToken[] tokens) + { + this.Tokens = tokens; + } + + public override string ToString() + { + StringBuilder builder = new StringBuilder(); + + foreach (InstructionTextToken token in Tokens) + { + builder.Append(token.Text); + } + + return builder.ToString(); + } + } +} \ No newline at end of file diff --git a/Struct/BNInstructionTextToken.cs b/Struct/BNInstructionTextToken.cs new file mode 100644 index 0000000..f221027 --- /dev/null +++ b/Struct/BNInstructionTextToken.cs @@ -0,0 +1,322 @@ + +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNInstructionTextToken + { + /// + /// + /// BNInstructionTextTokenType type + /// + internal InstructionTextTokenType type; + + /// + /// + /// const char* text + /// + internal IntPtr text; + + /// + /// + /// uint64_t value + /// + internal ulong value; + + /// + /// + /// uint64_t width + /// + internal ulong width; + + /// + /// + /// uint64_t size + /// + internal ulong size; + + /// + /// + /// uint64_t operand + /// + internal ulong operand; + + /// + /// + /// BNInstructionTextTokenContext context + /// + internal InstructionTextTokenContext context; + + /// + /// + /// uint8_t confidence + /// + internal byte confidence; + + /// + /// + /// uint64_t address + /// + internal ulong address; + + /// + /// + /// const char** typeNames + /// + internal IntPtr typeNames; + + /// + /// + /// uint64_t namesCount + /// + internal ulong namesCount; + + /// + /// + /// uint64_t exprIndex + /// + internal ulong exprIndex; + } + + /// + /// + /// + public sealed class InstructionTextToken + : INativeWrapperEx, + IEquatable, + IComparable + { + public InstructionTextTokenType Type { get; } = InstructionTextTokenType.TextToken; + + public string Text { get; } = string.Empty; + + public ulong Value { get; } = 0; + + public ulong Width { get; } = 0; + + public ulong Size { get; } = 0; + + public ulong Operand { get; } = 0; + + public InstructionTextTokenContext Context { get; } = InstructionTextTokenContext.NoTokenContext; + + public byte Confidence { get; } = 0; + + public ulong Address { get; } = 0; + + public string[] TypeNames { get; } = Array.Empty(); + + public ulong ExpressionIndex { get; } = 0; + + public InstructionTextToken( ) + { + + } + + public InstructionTextToken( BNInstructionTextToken native) + { + this.Type = native.type; + + this.Text = UnsafeUtils.ReadUtf8String(native.text); + + this.Value = native.value; + + this.Width = native.width; + + this.Size = native.size; + + this.Operand = native.operand; + + this.Context = native.context; + + this.Confidence = native.confidence; + + this.Address = native.address; + + this.TypeNames = UnsafeUtils.ReadAnsiStringArray(native.typeNames , native.namesCount); + + this.ExpressionIndex = native.exprIndex; + } + + internal static InstructionTextToken FromNative(BNInstructionTextToken native) + { + return new InstructionTextToken(native); + } + + public BNInstructionTextToken ToNativeEx(ScopedAllocator allocator) + { + return new BNInstructionTextToken() + { + type = this.Type, + + text = allocator.AllocAnsiString(this.Text), + + value = this.Value, + + width = this.Width, + + size = this.Size, + + operand = this.Operand, + + context = this.Context, + + confidence = this.Confidence, + + address = this.Address, + + typeNames = ( 0 == this.TypeNames.Length ? IntPtr.Zero : allocator.AllocAnsiStringArray(this.TypeNames) ) , + + namesCount = (ulong)this.TypeNames.Length, + + exprIndex = this.ExpressionIndex + }; + } + + public override string ToString() + { + return this.Text; + } + + public override bool Equals(object? rawOther) + { + InstructionTextToken? other = rawOther as InstructionTextToken; + + if (other is null) + { + return false; + } + + return this.Equals(other); + } + + public bool Equals(InstructionTextToken? other) + { + if (other is null) + { + return false; + } + + if (ReferenceEquals(this , other)) + { + return true; + } + + if (this.Text != other.Text) + { + return false; + } + + if (this.Value != other.Value) + { + return false; + } + + if (this.Width != other.Width) + { + return false; + } + + if (this.Size != other.Size) + { + return false; + } + + if (this.Operand != other.Operand) + { + return false; + } + + if (this.Context != other.Context) + { + return false; + } + + if (this.Confidence != other.Confidence) + { + return false; + } + + if (this.Address != other.Address) + { + return false; + } + + if (this.TypeNames.Length != other.TypeNames.Length) + { + return false; + } + + for (int i = 0; i < this.TypeNames.Length; i++) + { + if (this.TypeNames[i] != other.TypeNames[i]) + { + return false; + } + } + + return this.ExpressionIndex == other.ExpressionIndex; + } + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2218:OverrideGetHashCodeOnOverridingEquals")] + public override int GetHashCode() + { + return HashCode.Combine( + this.Text.GetHashCode(), + this.Value, + this.Width, + this.Size, + this.Operand, + (uint)this.Context, + this.Address, + this.ExpressionIndex + ); + } + + public static bool operator ==(InstructionTextToken? left, InstructionTextToken? right) + { + if (left is null) + { + return right is null; + } + + return left.Equals(right); + } + + public static bool operator !=(InstructionTextToken? left, InstructionTextToken? right) + { + return !(left == right); + } + + public int CompareTo(InstructionTextToken? other) + { + if (other is null) + { + return 1; + } + + int result = this.Address.CompareTo(other.Address); + + if (0 == result) + { + result = this.ExpressionIndex.CompareTo(other.ExpressionIndex); + } + + if (0 == result) + { + result = this.Operand.CompareTo(other.Operand); + } + + if (0 == result) + { + result = this.Size.CompareTo(other.Size); + } + + return result; + } + } +} \ No newline at end of file diff --git a/Struct/BNInteractionHandlerCallbacks.cs b/Struct/BNInteractionHandlerCallbacks.cs new file mode 100644 index 0000000..718b36e --- /dev/null +++ b/Struct/BNInteractionHandlerCallbacks.cs @@ -0,0 +1,114 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNInteractionHandlerCallbacks + { + /// + /// void* context + /// + public IntPtr context; + + /// + /// void** showPlainTextReport + /// + public IntPtr showPlainTextReport; + + /// + /// void** showMarkdownReport + /// + public IntPtr showMarkdownReport; + + /// + /// void** showHTMLReport + /// + public IntPtr showHTMLReport; + + /// + /// void** showGraphReport + /// + public IntPtr showGraphReport; + + /// + /// void** showReportCollection + /// + public IntPtr showReportCollection; + + /// + /// void** getTextLineInput + /// + public IntPtr getTextLineInput; + + /// + /// void** getIntegerInput + /// + public IntPtr getIntegerInput; + + /// + /// void** getAddressInput + /// + public IntPtr getAddressInput; + + /// + /// void** getChoiceInput + /// + public IntPtr getChoiceInput; + + /// + /// void** getLargeChoiceInput + /// + public IntPtr getLargeChoiceInput; + + /// + /// void** getOpenFileNameInput + /// + public IntPtr getOpenFileNameInput; + + /// + /// void** getSaveFileNameInput + /// + public IntPtr getSaveFileNameInput; + + /// + /// void** getDirectoryNameInput + /// + public IntPtr getDirectoryNameInput; + + /// + /// void** getCheckboxInput + /// + public IntPtr getCheckboxInput; + + /// + /// void** getFormInput + /// + public IntPtr getFormInput; + + /// + /// void** showMessageBox + /// + public IntPtr showMessageBox; + + /// + /// void** openUrl + /// + public IntPtr openUrl; + + /// + /// void** runProgressDialog + /// + public IntPtr runProgressDialog; + } + + public class InteractionHandlerCallbacks + { + public InteractionHandlerCallbacks() + { + + } + } +} \ No newline at end of file diff --git a/Struct/BNLineFormatterSettings.cs b/Struct/BNLineFormatterSettings.cs new file mode 100644 index 0000000..34f0d61 --- /dev/null +++ b/Struct/BNLineFormatterSettings.cs @@ -0,0 +1,96 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNLineFormatterSettings + { + /// + /// BNHighLevelILFunction* highLevelIL + /// + public IntPtr highLevelIL; + + /// + /// uint64_t desiredLineLength + /// + public ulong desiredLineLength; + + /// + /// uint64_t minimumContentLength + /// + public ulong minimumContentLength; + + /// + /// uint64_t tabWidth + /// + public ulong tabWidth; + + /// + /// uint64_t maximumAnnotationLength + /// + public ulong maximumAnnotationLength; + + /// + /// uint64_t stringWrappingWidth + /// + public ulong stringWrappingWidth; + + /// + /// const char* languageName + /// + public IntPtr languageName; + + /// + /// const char* commentStartString + /// + public IntPtr commentStartString; + + /// + /// const char* commentEndString + /// + public IntPtr commentEndString; + + /// + /// const char* annotationStartString + /// + public IntPtr annotationStartString; + + /// + /// const char* annotationEndString + /// + public IntPtr annotationEndString; + } + + public sealed class LineFormatterSettings + { + public HighLevelILFunction? HighLevelIL { get; set; } = null; + + public ulong DesiredLineLength { get; set; } = 0; + + public ulong MinimumContentLength { get; set; } = 0; + + public ulong TabWidth { get; set; } = 0; + + public ulong MaximumAnnotationLength { get; set; } = 0; + + public ulong StringWrappingWidth { get; set; } = 0; + + public string LanguageName { get; set; } = string.Empty; + + public string CommentStartString { get; set; } = string.Empty; + + public string CommentEndString { get; set; } = string.Empty; + + public string AnnotationStartString { get; set; } = string.Empty; + + public string AnnotationEndString { get; set; } = string.Empty; + + public LineFormatterSettings() + { + + } + } +} \ No newline at end of file diff --git a/Struct/BNLinearDisassemblyLine.cs b/Struct/BNLinearDisassemblyLine.cs new file mode 100644 index 0000000..dac2448 --- /dev/null +++ b/Struct/BNLinearDisassemblyLine.cs @@ -0,0 +1,168 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNLinearDisassemblyLine + { + /// + /// BNLinearDisassemblyLineType type + /// + internal LinearDisassemblyLineType type; + + /// + /// BNFunction* function + /// + internal IntPtr function; + + /// + /// BNBasicBlock* block + /// + internal IntPtr block; + + /// + /// BNDisassemblyTextLine contents + /// + internal BNDisassemblyTextLine contents; + } + + public sealed class LinearDisassemblyLine + : INativeWrapperEx, + IEquatable, + IComparable + { + public LinearDisassemblyLineType Type { get; } = LinearDisassemblyLineType.BlankLineType; + + public Function? Function { get; } = null; + + public BasicBlock? Block { get; } = null; + + public DisassemblyTextLine Contents { get; } = new DisassemblyTextLine(); + + public LinearDisassemblyLine() + { + + } + + internal static LinearDisassemblyLine MustFromNativePointer(IntPtr pointer) + { + if (IntPtr.Zero == pointer) + { + throw new NullReferenceException(nameof(pointer)); + } + + return LinearDisassemblyLine.FromNative(Marshal.PtrToStructure(pointer)); + } + + internal static LinearDisassemblyLine FromNative(BNLinearDisassemblyLine native) + { + return new LinearDisassemblyLine(native); + } + + internal LinearDisassemblyLine(BNLinearDisassemblyLine native) + { + this.Type = native.type; + this.Function = ( IntPtr.Zero == native.function ? null : Function.MustNewFromHandle(native.function) ); + this.Block = ( IntPtr.Zero == native.block ? null : BasicBlock.MustNewFromHandle(native.block) ); + this.Contents = DisassemblyTextLine.FromNative(native.contents); + } + + public BNLinearDisassemblyLine ToNativeEx(ScopedAllocator allocator) + { + return new BNLinearDisassemblyLine() + { + type = this.Type , + function = ( null == this.Function ? IntPtr.Zero : this.Function.DangerousGetHandle() ) , + block = ( null == this.Block ? IntPtr.Zero : this.Block.DangerousGetHandle() ) , + contents = this.Contents.ToNativeEx(allocator), + }; + } + + public override string ToString() + { + return this.Contents.ToString(); + } + + public override bool Equals(object? rawOther) + { + InstructionTextToken? other = rawOther as InstructionTextToken; + + if (other is null) + { + return false; + } + + return this.Equals(other); + } + + public bool Equals(LinearDisassemblyLine? other) + { + if (other is null) + { + return false; + } + + if (ReferenceEquals(this , other)) + { + return true; + } + + if (null != this.Function && null != other.Function) + { + if (this.Function != other.Function) + { + return false; + } + } + + if (null != this.Block && null != other.Block) + { + if (this.Block != other.Block) + { + return false; + } + } + + if (this.Type != other.Type) + { + return false; + } + + return this.Contents.Equals(other.Contents); + } + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Usage", "CA2218:OverrideGetHashCodeOnOverridingEquals")] + public override int GetHashCode() + { + return this.Contents.GetHashCode(); + } + + public static bool operator ==(LinearDisassemblyLine? left, LinearDisassemblyLine? right) + { + if (left is null) + { + return right is null; + } + + return left.Equals(right); + } + + public static bool operator !=(LinearDisassemblyLine? left, LinearDisassemblyLine? right) + { + return !(left == right); + } + + public int CompareTo(LinearDisassemblyLine? other) + { + if (other is null) + { + return 1; + } + + return this.Contents.CompareTo(other.Contents); + } + } +} \ No newline at end of file diff --git a/Struct/BNLinearViewObjectIdentifier.cs b/Struct/BNLinearViewObjectIdentifier.cs new file mode 100644 index 0000000..8fa3b46 --- /dev/null +++ b/Struct/BNLinearViewObjectIdentifier.cs @@ -0,0 +1,89 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNLinearViewObjectIdentifier + { + /// + /// const char* name + /// + internal IntPtr name; + + /// + /// BNLinearViewObjectIdentifierType type + /// + internal LinearViewObjectIdentifierType type; + + /// + /// uint64_t start + /// + internal ulong start; + + /// + /// uint64_t end + /// + internal ulong end; + } + + public sealed class LinearViewObjectIdentifier : INativeWrapperEx + { + public string Name { get; set; } = string.Empty; + + public LinearViewObjectIdentifierType Type { get; set; } = LinearViewObjectIdentifierType.SingleLinearViewObject; + + public ulong Start { get; set; } = 0; + + public ulong End { get; set; } = 0; + + public LinearViewObjectIdentifier() + { + + } + + internal static LinearViewObjectIdentifier FromNativeStructPtr(IntPtr rawPtr) + { + if (IntPtr.Zero == rawPtr) + { + throw new ArgumentNullException(nameof(rawPtr)); + } + + return LinearViewObjectIdentifier.FromNative(Marshal.PtrToStructure(rawPtr)); + } + + internal static LinearViewObjectIdentifier FromNative(BNLinearViewObjectIdentifier raw) + { + return new LinearViewObjectIdentifier() + { + Name = UnsafeUtils.ReadAnsiString(raw.name), + Type = raw.type, + Start = raw.start, + End = raw.end + }; + } + + internal static LinearViewObjectIdentifier TakeNativeStruct(BNLinearViewObjectIdentifier raw) + { + LinearViewObjectIdentifier target = LinearViewObjectIdentifier.FromNative(raw); + + NativeMethods.BNFreeLinearViewObjectIdentifier(raw); + + return target; + } + + public BNLinearViewObjectIdentifier ToNativeEx(ScopedAllocator allocator) + { + return new BNLinearViewObjectIdentifier() + { + name = allocator.AllocAnsiString(this.Name) , + type = this.Type , + start = this.Start , + end = this.End + }; + } + + } +} \ No newline at end of file diff --git a/Struct/BNLogListener.cs b/Struct/BNLogListener.cs new file mode 100644 index 0000000..c1a8c6d --- /dev/null +++ b/Struct/BNLogListener.cs @@ -0,0 +1,416 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + /// + /// + /// + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNLogListener + { + /// + /// void (*log)(void* ctxt, size_t sessionId, BNLogLevel level, const char* msg, const char* logger_name, size_t tid); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate void LogDelegate( + IntPtr ctxt, + ulong sessionId, + LogLevel level, + IntPtr msg, + IntPtr loggerName, + ulong tid + ); + + /// + /// void (*logWithStackTrace)(void* ctxt, size_t sessionId, BNLogLevel level, const char* stackTrace,const char* msg, const char* logger_name, size_t tid); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate void LogWithStackTraceDelegate( + IntPtr ctxt, + ulong sessionId, + LogLevel level, + IntPtr stackTrace, + IntPtr msg, + IntPtr loggerName, + ulong tid + ); + + /// + /// void (*close)(void* ctxt); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate void LogCloseDelegate(IntPtr ctxt); + + /// + /// BNLogLevel (*getLogLevel)(void* ctxt); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate LogLevel GetLogLevelDelegate(IntPtr ctxt); + + + /// + /// void* context + /// + internal IntPtr context; + + /// + /// void (*log)(void* ctxt, size_t sessionId, BNLogLevel level, const char* msg, const char* logger_name, size_t tid); + /// + internal IntPtr log; + + /// + /// void (*logWithStackTrace)(void* ctxt, size_t sessionId, BNLogLevel level, const char* stackTrace,const char* msg, const char* logger_name, size_t tid); + /// + internal IntPtr logWithStackTrace; + + /// + /// void (*close)(void* ctxt); + /// + internal IntPtr close; + + /// + /// BNLogLevel (*getLogLevel)(void* ctxt); + /// + internal IntPtr getLogLevel; + } + + public sealed class LogListener + { + public delegate void LogDelegate( + ulong sessionId, + LogLevel level, + string msg, + string loggerName, + ulong tid + ); + + public delegate void LogWithStackTraceDelegate( + ulong sessionId, + LogLevel level, + string stackTrace, + string msg, + string loggerName, + ulong tid + ); + + public delegate void LogCloseDelegate(); + + public delegate LogLevel GetLogLevelDelegate(); + + public LogDelegate? Log { get; private set; } = null; + + public LogWithStackTraceDelegate? LogWithStackTrace { get; private set; } = null; + + public LogCloseDelegate? LogClose { get; private set; } = null; + + public GetLogLevelDelegate? GetLogLevel { get; private set; } = null; + + + // keep ref to delegate + private BNLogListener.LogDelegate? m_log = null; + + private BNLogListener.LogWithStackTraceDelegate? m_logWithStackTrace = null; + + private BNLogListener.LogCloseDelegate? m_logClose = null; + + private BNLogListener.GetLogLevelDelegate? m_getLogLevel = null; + + public LogListener() + { + + } + + internal static LogListener FromNative(BNLogListener native) + { + LogListener listener = new LogListener(); + + if (IntPtr.Zero != native.log) + { + listener.m_log = Marshal.GetDelegateForFunctionPointer( + native.log + ); + + listener.Log = listener.BridgeLog; + } + + if (IntPtr.Zero != native.logWithStackTrace) + { + listener.m_logWithStackTrace = + Marshal.GetDelegateForFunctionPointer( + native.logWithStackTrace + ); + + listener.LogWithStackTrace = listener.BridgeLogWithStackTrace; + } + + if (IntPtr.Zero != native.close) + { + listener.m_logClose = Marshal.GetDelegateForFunctionPointer( + native.log + ); + + listener.LogClose = listener.BridgeLogClose; + } + + if (IntPtr.Zero != native.getLogLevel) + { + listener.m_getLogLevel = Marshal.GetDelegateForFunctionPointer( + native.log + ); + + listener.GetLogLevel = listener.BridgeGetLogLevel; + } + + return listener; + } + + private void BridgeLog( + ulong sessionId , + LogLevel level , + string msg , + string loggerName , + ulong tid) + { + if (null == this.m_log) + { + throw new NullReferenceException(); + } + + using (ScopedAllocator allocator = new ScopedAllocator()) + { + this.m_log( + IntPtr.Zero, + sessionId, + level, + allocator.AllocAnsiString(msg), + allocator.AllocAnsiString(loggerName), + tid + ); + } + } + + private void BridgeLogWithStackTrace( + ulong sessionId, + LogLevel level, + string stackTrace, + string msg, + string loggerName, + ulong tid) + { + if (null == this.m_logWithStackTrace) + { + throw new NullReferenceException(); + } + + using (ScopedAllocator allocator = new ScopedAllocator()) + { + this.m_logWithStackTrace( + IntPtr.Zero, + sessionId, + level, + allocator.AllocAnsiString(stackTrace), + allocator.AllocAnsiString(msg), + allocator.AllocAnsiString(loggerName), + tid + ); + } + } + + private void BridgeLogClose() + { + if (null == this.m_logClose) + { + throw new NullReferenceException(); + } + + this.m_logClose(IntPtr.Zero); + } + + private LogLevel BridgeGetLogLevel() + { + if (null == this.m_getLogLevel) + { + throw new NullReferenceException(); + } + + return this.m_getLogLevel(IntPtr.Zero); + } + } + + public abstract class CustomLogListener : IDisposable + { + private bool m_disposed = false; + + private bool m_registered = false; + + private IntPtr m_pointer = IntPtr.Zero; + + public CustomLogListener() + { + this.m_pointer = Marshal.AllocHGlobal( + Marshal.SizeOf() + ); + + Marshal.StructureToPtr( + this.ToNative(), + this.m_pointer, + false + ); + } + + ~CustomLogListener() + { + Dispose(false); + } + + public void Dispose() + { + Dispose(true); + + GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool disposing) + { + if (this.m_disposed) + { + return; + } + + this.m_disposed = true; + + if (this.m_registered) + { + this.m_registered = false; + + NativeMethods.BNUnregisterLogListener(this.m_pointer); + } + + if (this.m_pointer != IntPtr.Zero) + { + Marshal.DestroyStructure(this.m_pointer); + + Marshal.FreeHGlobal(this.m_pointer); + + this.m_pointer = IntPtr.Zero; + } + } + + public BNLogListener ToNative() + { + return new BNLogListener() + { + context = IntPtr.Zero , + log = Marshal.GetFunctionPointerForDelegate(this.LogThunk) , + logWithStackTrace = Marshal.GetFunctionPointerForDelegate(this.LogWithStackTraceThunk) , + close = Marshal.GetFunctionPointerForDelegate(this.CloseLogThunk) , + getLogLevel = Marshal.GetFunctionPointerForDelegate(this.GetLogLevelThunk) , + }; + } + + public void Register() + { + if (this.m_disposed) + { + return; + } + + if (this.m_registered) + { + return; + } + + NativeMethods.BNRegisterLogListener(this.m_pointer); + + this.m_registered = true; + } + + #region thunk + + private void LogThunk( + IntPtr ctxt , + ulong sessionId , + LogLevel level , + IntPtr msg , + IntPtr loggerName , + ulong tid + ) + { + this.Log( + (ulong)sessionId, + level, + UnsafeUtils.ReadAnsiString(msg), + UnsafeUtils.ReadAnsiString(loggerName), + (ulong)tid + ); + } + + private void LogWithStackTraceThunk( + IntPtr ctxt, + ulong sessionId, + LogLevel level, + IntPtr stackTrace, + IntPtr msg, + IntPtr loggerName, + ulong tid) + { + + this.LogWithStackTrace( + (ulong)sessionId, + level, + UnsafeUtils.ReadAnsiString(stackTrace), + UnsafeUtils.ReadAnsiString(msg), + UnsafeUtils.ReadAnsiString(loggerName), + (ulong)tid + ); + } + + private void CloseLogThunk(IntPtr ctxt) + { + this.CloseLog(); + } + + private LogLevel GetLogLevelThunk(IntPtr ctxt) + { + return this.GetLogLevel(); + } + + #endregion thunk + + public virtual void Log( + ulong sessionId , + LogLevel level , + string msg , + string loggerName , + ulong tid) + { + + } + + public virtual void LogWithStackTrace( + ulong sessionId, + LogLevel level, + string stackTrace, + string msg, + string loggerName, + ulong tid) + { + + } + + public virtual void CloseLog() + { + + } + + public virtual LogLevel GetLogLevel() + { + return LogLevel.InfoLog; + } + + } + +} \ No newline at end of file diff --git a/Struct/BNLookupTableEntry.cs b/Struct/BNLookupTableEntry.cs new file mode 100644 index 0000000..b017ec1 --- /dev/null +++ b/Struct/BNLookupTableEntry.cs @@ -0,0 +1,64 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNLookupTableEntry + { + /// + /// int64_t* fromValues + /// + internal IntPtr fromValues; + + /// + /// uint64_t fromCount + /// + internal ulong fromCount; + + /// + /// int64_t toValue + /// + internal long toValue; + } + + public sealed class LookupTableEntry : INativeWrapperEx + { + public long[] FromValues { get; set; } = Array.Empty(); + + public long ToValue { get; set; } = 0; + + public LookupTableEntry() + { + + } + + internal static LookupTableEntry FromNative(BNLookupTableEntry native) + { + return new LookupTableEntry() + { + FromValues = UnsafeUtils.ReadNumberArray( + native.fromValues , + native.fromCount + ) , + ToValue = native.toValue + }; + } + + public BNLookupTableEntry ToNativeEx(ScopedAllocator allocator) + { + return new BNLookupTableEntry() + { + fromValues = ( + 0 == this.FromValues.Length ? IntPtr.Zero : + allocator.AllocIntegerArray(this.FromValues) + ), + fromCount = (ulong)this.FromValues.Length, + toValue = this.ToValue + }; + } + + } +} \ No newline at end of file diff --git a/Struct/BNLowLevelILInstruction.cs b/Struct/BNLowLevelILInstruction.cs new file mode 100644 index 0000000..0a17425 --- /dev/null +++ b/Struct/BNLowLevelILInstruction.cs @@ -0,0 +1,2070 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNLowLevelILInstruction + { + /// + /// BNLowLevelILOperation operation + /// + internal LowLevelILOperation operation; + + /// + /// uint32_t attributes + /// + internal uint attributes; + + /// + /// uint64_t size + /// + internal ulong size; + + /// + /// uint32_t flags + /// + internal uint flags; + + /// + /// uint32_t sourceOperand + /// + internal uint sourceOperand; + + /// + /// uint64_t[4] operands + /// + internal fixed ulong operands[4]; + + /// + /// uint64_t address + /// + internal ulong address; + } + + public abstract class LowLevelILInstruction + : INativeWrapper, + IEquatable, + IComparable + { + public LowLevelILOperation Operation { get; } = LowLevelILOperation.LLIL_NOP; + + public uint Attributes { get; } = 0; + + public ulong Size { get; } = 0; + + public uint Flags { get; } = 0; + + public OperandIndex SourceOperand { get; } = 0; + + public ulong Address { get; } = 0; + + public ulong[] RawOperands { get; } = Array.Empty(); + + // related + internal LowLevelILFunction ILFunction { get; } + + public LowLevelILExpressionIndex ExpressionIndex { get; } = 0; + + private static Dictionary OperationOperands = new Dictionary { + { LowLevelILOperation.LLIL_NOP, 0 }, + + { LowLevelILOperation.LLIL_SET_REG, 2 }, // dstReg, src + { LowLevelILOperation.LLIL_SET_REG_SPLIT, 3 }, // dstHi, dstLo, src + { LowLevelILOperation.LLIL_SET_FLAG, 2 }, // flag, src + { LowLevelILOperation.LLIL_SET_REG_STACK_REL, 3 }, // dstRegStack, rel, src + { LowLevelILOperation.LLIL_REG_STACK_PUSH, 2 }, // regStack, src + + { LowLevelILOperation.LLIL_ASSERT, 1 }, // cond + { LowLevelILOperation.LLIL_FORCE_VER, 1 }, // var/version + + { LowLevelILOperation.LLIL_LOAD, 2 }, // size, addr + { LowLevelILOperation.LLIL_STORE, 3 }, // size, addr, value + + { LowLevelILOperation.LLIL_PUSH, 2 }, // size, src + { LowLevelILOperation.LLIL_POP, 1 }, // size + + { LowLevelILOperation.LLIL_REG, 1 }, // reg + { LowLevelILOperation.LLIL_REG_SPLIT, 2 }, // regHi, regLo + { LowLevelILOperation.LLIL_REG_STACK_REL, 2 }, // regStack, rel + { LowLevelILOperation.LLIL_REG_STACK_POP, 2 }, // regStack, size + { LowLevelILOperation.LLIL_REG_STACK_FREE_REG, 1 }, // reg + { LowLevelILOperation.LLIL_REG_STACK_FREE_REL, 2 }, // regStack, rel + + { LowLevelILOperation.LLIL_CONST, 2 }, // size, value + { LowLevelILOperation.LLIL_CONST_PTR, 2 }, // size, addr + { LowLevelILOperation.LLIL_EXTERN_PTR, 3 }, // size, base, offset + { LowLevelILOperation.LLIL_FLOAT_CONST, 2 }, // size, fpBits + + { LowLevelILOperation.LLIL_FLAG, 1 }, // flag + { LowLevelILOperation.LLIL_FLAG_BIT, 1 }, // flagBit + + { LowLevelILOperation.LLIL_ADD, 3 }, // size, left, right + { LowLevelILOperation.LLIL_ADC, 3 }, // size, left, right + { LowLevelILOperation.LLIL_SUB, 3 }, // size, left, right + { LowLevelILOperation.LLIL_SBB, 3 }, // size, left, right + { LowLevelILOperation.LLIL_AND, 3 }, // size, left, right + { LowLevelILOperation.LLIL_OR, 3 }, // size, left, right + { LowLevelILOperation.LLIL_XOR, 3 }, // size, left, right + { LowLevelILOperation.LLIL_LSL, 3 }, // size, left, right + { LowLevelILOperation.LLIL_LSR, 3 }, // size, left, right + { LowLevelILOperation.LLIL_ASR, 3 }, // size, left, right + { LowLevelILOperation.LLIL_ROL, 3 }, // size, left, right + { LowLevelILOperation.LLIL_RLC, 3 }, // size, left, right + { LowLevelILOperation.LLIL_ROR, 3 }, // size, left, right + { LowLevelILOperation.LLIL_RRC, 3 }, // size, left, right + { LowLevelILOperation.LLIL_MUL, 3 }, // size, left, right + { LowLevelILOperation.LLIL_MULU_DP, 3 }, // size, left, right + { LowLevelILOperation.LLIL_MULS_DP, 3 }, // size, left, right + { LowLevelILOperation.LLIL_DIVU, 3 }, // size, left, right + { LowLevelILOperation.LLIL_DIVU_DP, 3 }, // size, left, right + { LowLevelILOperation.LLIL_DIVS, 3 }, // size, left, right + { LowLevelILOperation.LLIL_DIVS_DP, 3 }, // size, left, right + { LowLevelILOperation.LLIL_MODU, 3 }, // size, left, right + { LowLevelILOperation.LLIL_MODU_DP, 3 }, // size, left, right + { LowLevelILOperation.LLIL_MODS, 3 }, // size, left, right + { LowLevelILOperation.LLIL_MODS_DP, 3 }, // size, left, right + + { LowLevelILOperation.LLIL_NEG, 2 }, // size, src + { LowLevelILOperation.LLIL_NOT, 2 }, // size, src + { LowLevelILOperation.LLIL_SX, 3 }, // toSize, fromSize, src + { LowLevelILOperation.LLIL_ZX, 3 }, // toSize, fromSize, src + { LowLevelILOperation.LLIL_LOW_PART, 2 }, // toSize, src + + { LowLevelILOperation.LLIL_JUMP, 1 }, // dest + { LowLevelILOperation.LLIL_JUMP_TO, 3 }, // dest, table, targetReg + { LowLevelILOperation.LLIL_CALL, 1 }, // dest + { LowLevelILOperation.LLIL_CALL_STACK_ADJUST, 2 }, // adjust, callExpr + { LowLevelILOperation.LLIL_TAILCALL, 1 }, // dest + { LowLevelILOperation.LLIL_RET, 1 }, // src(list) + { LowLevelILOperation.LLIL_NORET, 0 }, // noreturn + + { LowLevelILOperation.LLIL_IF, 3 }, // cond, true, false (blocks) + { LowLevelILOperation.LLIL_GOTO, 1 }, // target block + { LowLevelILOperation.LLIL_FLAG_COND, 1 }, // cond + { LowLevelILOperation.LLIL_FLAG_GROUP, 1 }, // group + + { LowLevelILOperation.LLIL_CMP_E, 3 }, // size, left, right + { LowLevelILOperation.LLIL_CMP_NE, 3 }, // size, left, right + { LowLevelILOperation.LLIL_CMP_SLT, 3 }, // size, left, right + { LowLevelILOperation.LLIL_CMP_ULT, 3 }, // size, left, right + { LowLevelILOperation.LLIL_CMP_SLE, 3 }, // size, left, right + { LowLevelILOperation.LLIL_CMP_ULE, 3 }, // size, left, right + { LowLevelILOperation.LLIL_CMP_SGE, 3 }, // size, left, right + { LowLevelILOperation.LLIL_CMP_UGE, 3 }, // size, left, right + { LowLevelILOperation.LLIL_CMP_SGT, 3 }, // size, left, right + { LowLevelILOperation.LLIL_CMP_UGT, 3 }, // size, left, right + { LowLevelILOperation.LLIL_TEST_BIT, 3 }, // size, left, right(bit) + { LowLevelILOperation.LLIL_BOOL_TO_INT, 2 }, // size, src + { LowLevelILOperation.LLIL_ADD_OVERFLOW, 3 }, // size, left, right + + { LowLevelILOperation.LLIL_SYSCALL, 1 }, // params(list) + { LowLevelILOperation.LLIL_BP, 0 }, // breakpoint + { LowLevelILOperation.LLIL_TRAP, 1 }, // code + { LowLevelILOperation.LLIL_INTRINSIC, 3 }, // intrinsicId, params(list), outputs(list) + { LowLevelILOperation.LLIL_UNDEF, 0 }, // undefined + { LowLevelILOperation.LLIL_UNIMPL, 0 }, // unimplemented + { LowLevelILOperation.LLIL_UNIMPL_MEM, 1 }, // addr + + { LowLevelILOperation.LLIL_FADD, 3 }, // size, left, right + { LowLevelILOperation.LLIL_FSUB, 3 }, // size, left, right + { LowLevelILOperation.LLIL_FMUL, 3 }, // size, left, right + { LowLevelILOperation.LLIL_FDIV, 3 }, // size, left, right + { LowLevelILOperation.LLIL_FSQRT, 2 }, // size, src + { LowLevelILOperation.LLIL_FNEG, 2 }, // size, src + { LowLevelILOperation.LLIL_FABS, 2 }, // size, src + { LowLevelILOperation.LLIL_FLOAT_TO_INT, 3 }, // toSize, fromSize, src + { LowLevelILOperation.LLIL_INT_TO_FLOAT, 3 }, // toSize, fromSize, src + { LowLevelILOperation.LLIL_FLOAT_CONV, 3 }, // toSize, fromSize, src + { LowLevelILOperation.LLIL_ROUND_TO_INT, 2 }, // size, src + { LowLevelILOperation.LLIL_FLOOR, 2 }, // size, src + { LowLevelILOperation.LLIL_CEIL, 2 }, // size, src + { LowLevelILOperation.LLIL_FTRUNC, 2 }, // size, src + { LowLevelILOperation.LLIL_FCMP_E, 3 }, // size, left, right + { LowLevelILOperation.LLIL_FCMP_NE, 3 }, // size, left, right + { LowLevelILOperation.LLIL_FCMP_LT, 3 }, // size, left, right + { LowLevelILOperation.LLIL_FCMP_LE, 3 }, // size, left, right + { LowLevelILOperation.LLIL_FCMP_GE, 3 }, // size, left, right + { LowLevelILOperation.LLIL_FCMP_GT, 3 }, // size, left, right + { LowLevelILOperation.LLIL_FCMP_O, 3 }, // size, left, right + { LowLevelILOperation.LLIL_FCMP_UO, 3 }, // size, left, right + + { LowLevelILOperation.LLIL_SET_REG_SSA, 3 }, // dstReg, version, src + { LowLevelILOperation.LLIL_SET_REG_SSA_PARTIAL, 3 }, // dstReg, version, src + { LowLevelILOperation.LLIL_SET_REG_SPLIT_SSA, 4 }, // dstHi, verHi, dstLo, verLo, src + { LowLevelILOperation.LLIL_SET_REG_STACK_REL_SSA, 4 }, // regStack, version, rel, src + { LowLevelILOperation.LLIL_SET_REG_STACK_ABS_SSA, 3 }, // regStack, index, src + { LowLevelILOperation.LLIL_REG_SPLIT_DEST_SSA, 4 }, // regHi, verHi, regLo, verLo + { LowLevelILOperation.LLIL_REG_STACK_DEST_SSA, 3 }, // regStack, index, size + { LowLevelILOperation.LLIL_REG_SSA, 2 }, // reg, version + { LowLevelILOperation.LLIL_REG_SSA_PARTIAL, 2 }, // reg, version + { LowLevelILOperation.LLIL_REG_SPLIT_SSA, 4 }, // regHi, verHi, regLo, verLo + { LowLevelILOperation.LLIL_REG_STACK_REL_SSA, 3 }, // regStack, version, rel + { LowLevelILOperation.LLIL_REG_STACK_ABS_SSA, 2 }, // regStack, index + { LowLevelILOperation.LLIL_REG_STACK_FREE_REL_SSA, 3 }, // regStack, version, rel + { LowLevelILOperation.LLIL_REG_STACK_FREE_ABS_SSA, 2 }, // regStack, index + { LowLevelILOperation.LLIL_SET_FLAG_SSA, 3 }, // flag, version, src + { LowLevelILOperation.LLIL_ASSERT_SSA, 2 }, // cond, memVer/regVer + { LowLevelILOperation.LLIL_FORCE_VER_SSA, 2 }, // var, newVersion + { LowLevelILOperation.LLIL_FLAG_SSA, 2 }, // flag, version + { LowLevelILOperation.LLIL_FLAG_BIT_SSA, 2 }, // flagBit, version + + { LowLevelILOperation.LLIL_CALL_SSA, 4 }, // dest, params(list), outputs(list), srcMem + { LowLevelILOperation.LLIL_SYSCALL_SSA, 3 }, // params(list), outputs(list), srcMem + { LowLevelILOperation.LLIL_TAILCALL_SSA, 3 }, // dest, params(list), srcMem + { LowLevelILOperation.LLIL_CALL_PARAM, 2 }, // paramLoc, src + { LowLevelILOperation.LLIL_CALL_STACK_SSA, 2 }, // stackVersionIn, stackVersionOut + { LowLevelILOperation.LLIL_CALL_OUTPUT_SSA, 3 }, // outputLoc, srcExpr, dstMem + { LowLevelILOperation.LLIL_SEPARATE_PARAM_LIST_SSA, 2 }, // intParams(list), floatParams(list) + { LowLevelILOperation.LLIL_SHARED_PARAM_SLOT_SSA, 2 }, // slot, size + { LowLevelILOperation.LLIL_MEMORY_INTRINSIC_OUTPUT_SSA, 3 }, // dest, size, dstMem + { LowLevelILOperation.LLIL_LOAD_SSA, 2 }, // addr, srcMem + { LowLevelILOperation.LLIL_STORE_SSA, 3 }, // addr, value, dstMem + { LowLevelILOperation.LLIL_INTRINSIC_SSA, 4 }, // intrinsicId, params(list), outputs(list), srcMem + { LowLevelILOperation.LLIL_MEMORY_INTRINSIC_SSA, 4 }, // dest, src, size, dstMem + + { LowLevelILOperation.LLIL_REG_PHI, 1 }, // regVersions(list) + { LowLevelILOperation.LLIL_REG_STACK_PHI, 1 }, // regStackVersions(list) + { LowLevelILOperation.LLIL_FLAG_PHI, 1 }, // flagVersions(list) + { LowLevelILOperation.LLIL_MEM_PHI, 1 }, // memVersions(list) + }; + + + + internal LowLevelILInstruction( + LowLevelILFunction function , + LowLevelILExpressionIndex expressionIndex + ) : this( + function , + expressionIndex , + NativeMethods.BNGetLowLevelILByIndex( + function.DangerousGetHandle() , + expressionIndex + ) + ) + { + + } + + internal LowLevelILInstruction( + LowLevelILFunction function, + LowLevelILExpressionIndex expressionIndex , + BNLowLevelILInstruction native + ) + { + this.Operation = native.operation ; + this.Attributes = native.attributes ; + this.SourceOperand = (OperandIndex)native.sourceOperand; + this.Size = native.size ; + this.Address = native.address ; + + LowLevelILInstruction.OperationOperands.TryGetValue( + this.Operation , + out int operandCount + ); + + if (0 == operandCount) + { + this.RawOperands = Array.Empty(); + } + else + { + this.RawOperands = new ulong[operandCount]; + + for (int i = 0; i < operandCount; i++) + { + unsafe + { + this.RawOperands[i] = native.operands[i] ; + } + } + } + + this.ILFunction = function; + + this.ExpressionIndex = expressionIndex; + } + + public BNLowLevelILInstruction ToNative() + { + BNLowLevelILInstruction native = new BNLowLevelILInstruction() + { + operation = this.Operation , + attributes = this.Attributes , + sourceOperand = (uint)this.SourceOperand , + size = this.Size , + address = this.Address , + }; + + int count = Math.Min(this.RawOperands?.Length ?? 0, 5); + + if (this.RawOperands?.Length >= count) + { + for (int i = 0; i < count; i++) + { + unsafe + { + native.operands[i] = this.RawOperands[i]; + } + } + } + + return native; + } + + + public override bool Equals(object? other) + { + return Equals(other as LowLevelILInstruction); + } + + public bool Equals(LowLevelILInstruction? other) + { + if (other is null) + { + return false; + } + + if (ReferenceEquals(this , other)) + { + return true; + } + + if (this.ILFunction != other.ILFunction) + { + return false; + } + + return this.ExpressionIndex == other.ExpressionIndex; + } + + public override int GetHashCode() + { + return HashCode.Combine( + this.ILFunction.GetHashCode(), + (ulong)this.ExpressionIndex + ); + } + + public static bool operator ==(LowLevelILInstruction? left, LowLevelILInstruction? right) + { + if (left is null) + { + return right is null; + } + + return left.Equals(right); + } + + public static bool operator !=(LowLevelILInstruction? left, LowLevelILInstruction? right) + { + return !(left == right); + } + + public int CompareTo(LowLevelILInstruction? other) + { + if (other is null) + { + return 1; + } + + int result = this.ILFunction.CompareTo(other.ILFunction); + + if (0 == result) + { + result = this.ExpressionIndex.CompareTo(other.ExpressionIndex); + } + + return result; + } + + public SourceLocation Location + { + get + { + return new SourceLocation(this.Address , this.SourceOperand); + } + } + + public static LowLevelILInstruction FromExpressionIndex( + LowLevelILFunction ilFunction , + LowLevelILExpressionIndex expression + ) + { + BNLowLevelILInstruction native = NativeMethods.BNGetLowLevelILByIndex( + ilFunction.DangerousGetHandle() , + (LowLevelILExpressionIndex)expression + ); + + switch (native.operation) + { + case LowLevelILOperation.LLIL_NOP: + { + return new LLILNop(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_SET_REG: + { + return new LLILSetRegister(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_SET_REG_SPLIT: + { + return new LLILSetRegisterSplit(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_SET_FLAG: + { + return new LLILSetFlag(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_SET_REG_STACK_REL: + { + return new LLILSetRegisterStackRel(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_REG_STACK_PUSH: + { + return new LLILRegisterStackPush(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_ASSERT: + { + return new LLILAssert(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_FORCE_VER: + { + return new LLILForceVersion(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_LOAD: + { + return new LLILLoad(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_STORE: + { + return new LLILStore(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_PUSH: + { + return new LLILPush(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_POP: + { + return new LLILPop(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_REG: + { + return new LLILRegister(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_REG_SPLIT: + { + return new LLILRegisterSplit(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_REG_STACK_REL: + { + return new LLILRegisterStackRelative(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_REG_STACK_POP: + { + return new LLILRegisterStackPop(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_REG_STACK_FREE_REG: + { + return new LLILRegisterStackFreeRegister(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_REG_STACK_FREE_REL: + { + return new LLILRegisterStackFreeRel(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_CONST: + { + return new LLILConst(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_CONST_PTR: + { + return new LLILConstPointer(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_EXTERN_PTR: + { + return new LLILExternPointer(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_FLOAT_CONST: + { + return new LLILFloatConst(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_FLAG: + { + return new LLILFlag(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_FLAG_BIT: + { + return new LLILFlagBit(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_ADD: + { + return new LLILAdd(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_ADC: + { + return new LLILAddCarry(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_SUB: + { + return new LLILSub(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_SBB: + { + return new LLILSubBorrow(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_AND: + { + return new LLILAnd(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_OR: + { + return new LLILOr(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_XOR: + { + return new LLILXor(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_LSL: + { + return new LLILLogicalShiftLeft(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_LSR: + { + return new LLILLogicalShiftRight(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_ASR: + { + return new LLILArithmeticShiftRight(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_ROL: + { + return new LLILRotateLeft(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_RLC: + { + return new LLILRotateLeftCarry(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_ROR: + { + return new LLILRotateRight(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_RRC: + { + return new LLILRotateRightCarry(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_MUL: + { + return new LLILMul(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_MULU_DP: + { + return new LLILMulUnsignedDoublePrecision(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_MULS_DP: + { + return new LLILMulSignedDoublePrecision(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_DIVU: + { + return new LLILDivUnsigned(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_DIVU_DP: + { + return new LLILDivUnsignedDoublePrecision(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_DIVS: + { + return new LLILDivSigned(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_DIVS_DP: + { + return new LLILDivSignedDoublePrecision(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_MODU: + { + return new LLILModUnsigned(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_MODU_DP: + { + return new LLILModUnsignedDoublePrecision(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_MODS: + { + return new LLILModSigned(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_MODS_DP: + { + return new LLILModSignedDoublePrecision(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_NEG: + { + return new LLILNeg(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_NOT: + { + return new LLILNot(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_SX: + { + return new LLILSignExtend(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_ZX: + { + return new LLILZeroExtend(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_LOW_PART: + { + return new LLILLowPart(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_JUMP: + { + return new LLILJump(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_JUMP_TO: + { + return new LLILJumpTo(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_CALL: + { + return new LLILCall(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_CALL_STACK_ADJUST: + { + return new LLILCallStackAdjust(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_TAILCALL: + { + return new LLILTailCall(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_RET: + { + return new LLILReturn(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_NORET: + { + return new LLILNoReturn(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_IF: + { + return new LLILIf(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_GOTO: + { + return new LLILGoto(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_FLAG_COND: + { + return new LLILFlagCond(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_FLAG_GROUP: + { + return new LLILFlagGroup(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_CMP_E: + { + return new LLILEqual(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_CMP_NE: + { + return new LLILNotEqual(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_CMP_SLT: + { + return new LLILSignedLessThan(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_CMP_ULT: + { + return new LLILUnsignedLessThan(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_CMP_SLE: + { + return new LLILSignedLessEqual(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_CMP_ULE: + { + return new LLILUnsignedLessEqual(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_CMP_SGE: + { + return new LLILSignedGreaterEqual(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_CMP_UGE: + { + return new LLILUnsignedGreaterEqual(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_CMP_SGT: + { + return new LLILSignedGreaterThan(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_CMP_UGT: + { + return new LLILUnsignedGreaterThan(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_TEST_BIT: + { + return new LLILTestBit(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_BOOL_TO_INT: + { + return new LLILBoolToInt(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_ADD_OVERFLOW: + { + return new LLILAddOverflow(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_SYSCALL: + { + return new LLILSysCall(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_BP: + { + return new LLILBreakpoint(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_TRAP: + { + return new LLILTrap(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_INTRINSIC: + { + return new LLILIntrinsic(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_UNDEF: + { + return new LLILUndefined(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_UNIMPL: + { + return new LLILUnimplemented(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_UNIMPL_MEM: + { + return new LLILUnimplementedMemory(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_FADD: + { + return new LLILFloatAdd(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_FSUB: + { + return new LLILFloatSub(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_FMUL: + { + return new LLILFloatMul(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_FDIV: + { + return new LLILFloatDiv(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_FSQRT: + { + return new LLILFloatSquareRoot(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_FNEG: + { + return new LLILFloatNeg(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_FABS: + { + return new LLILFloatAbs(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_FLOAT_TO_INT: + { + return new LLILFloatToInt(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_INT_TO_FLOAT: + { + return new LLILIntToFloat(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_FLOAT_CONV: + { + return new LLILFloatConvert(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_ROUND_TO_INT: + { + return new LLILRoundToInt(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_FLOOR: + { + return new LLILFloor(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_CEIL: + { + return new LLILCeil(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_FTRUNC: + { + return new LLILFloatTrunc(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_FCMP_E: + { + return new LLILFloatEqual(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_FCMP_NE: + { + return new LLILFloatNotEqual(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_FCMP_LT: + { + return new LLILFloatLessThan(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_FCMP_LE: + { + return new LLILFloatLessEqual(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_FCMP_GE: + { + return new LLILFloatGreaterEqual(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_FCMP_GT: + { + return new LLILFloatGreaterThan(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_FCMP_O: + { + return new LLILFloatCompareOrdered(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_FCMP_UO: + { + return new LLILFloatCompareUnordered(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_SET_REG_SSA: + { + return new LLILSetRegisterSSA(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_SET_REG_SSA_PARTIAL: + { + return new LLILSetRegisterSSAPartial(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_SET_REG_SPLIT_SSA: + { + return new LLILSetRegisterSplitSSA(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_SET_REG_STACK_REL_SSA: + { + return new LLILSetRegisterStackRelativeSSA(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_SET_REG_STACK_ABS_SSA: + { + return new LLILSetRegisterStackAbsSSA(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_REG_SPLIT_DEST_SSA: + { + return new LLILRegisterSplitDestinationSSA(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_REG_STACK_DEST_SSA: + { + return new LLILRegisterStackDestinationSSA(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_REG_SSA: + { + return new LLILRegisterSSA(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_REG_SSA_PARTIAL: + { + return new LLILRegisterSSAPartial(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_REG_SPLIT_SSA: + { + return new LLILRegisterSplitSSA(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_REG_STACK_REL_SSA: + { + return new LLILRegisterStackRelativeSSA(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_REG_STACK_ABS_SSA: + { + return new LLILRegisterStackAbsSSA(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_REG_STACK_FREE_REL_SSA: + { + return new LLILRegisterStackFreeRelativeSSA(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_REG_STACK_FREE_ABS_SSA: + { + return new LLILRegisterStackFreeAbsSSA(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_SET_FLAG_SSA: + { + return new LLILSetFlagSSA(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_ASSERT_SSA: + { + return new LLILAssertSSA(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_FORCE_VER_SSA: + { + return new LLILForceVersionSSA(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_FLAG_SSA: + { + return new LLILFlagSSA(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_FLAG_BIT_SSA: + { + return new LLILFlagBitSSA(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_CALL_SSA: + { + return new LLILCallSSA(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_SYSCALL_SSA: + { + return new LLILSysCallSSA(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_TAILCALL_SSA: + { + return new LLILTailCallSSA(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_CALL_PARAM: + { + return new LLILCallParameter(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_CALL_STACK_SSA: + { + return new LLILCallStackSSA(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_CALL_OUTPUT_SSA: + { + return new LLILCallOutputSSA(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_SEPARATE_PARAM_LIST_SSA: + { + return new LLILSeparateParamListSSA(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_SHARED_PARAM_SLOT_SSA: + { + return new LLILSharedParamSlotSSA(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_MEMORY_INTRINSIC_OUTPUT_SSA: + { + return new LLILMemoryIntrinsicOutputSSA(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_LOAD_SSA: + { + return new LLILLoadSSA(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_STORE_SSA: + { + return new LLILStoreSSA(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_INTRINSIC_SSA: + { + return new LLILIntrinsicSSA(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_MEMORY_INTRINSIC_SSA: + { + return new LLILMemoryIntrinsicSSA(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_REG_PHI: + { + return new LLILRegisterPhi(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_REG_STACK_PHI: + { + return new LLILRegisterStackPhi(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_FLAG_PHI: + { + return new LLILFlagPhi(ilFunction , expression , native ); + } + case LowLevelILOperation.LLIL_MEM_PHI: + { + return new LLILMemoryPhi(ilFunction , expression , native ); + } + default: + { + throw new NotSupportedException("not supported operation"); + } + } + } + + public override string ToString() + { + StringBuilder builder = new StringBuilder(); + + foreach (InstructionTextToken token in this.ExpressionTextTokens) + { + builder.Append(token.Text); + } + + return builder.ToString(); + } + + public T[] GetOperandAsIntegerArray(OperandIndex operand) + where T : unmanaged + { + IntPtr arrayPointer = NativeMethods.BNLowLevelILGetOperandList( + this.ILFunction.DangerousGetHandle() , + this.ExpressionIndex , + this.RawOperands[(ulong)operand] , + out ulong arrayLength + ); + + return UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNLowLevelILFreeOperandList + ); + } + + public IDictionary GetOperandAsIntegerDict(OperandIndex operand) + where T : unmanaged + { + IntPtr arrayPointer = NativeMethods.BNLowLevelILGetOperandList( + this.ILFunction.DangerousGetHandle() , + this.ExpressionIndex , + (ulong)operand , + out ulong arrayLength + ); + + ulong[] keyAndValues = UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNLowLevelILFreeOperandList + ); + + Dictionary target = new Dictionary(); + + for (int i = 0; i < keyAndValues.Length; i += 2) + { + T key = UnsafeUtils.ForceConvert( + keyAndValues[i] + ); + + T value = UnsafeUtils.ForceConvert( + keyAndValues[i+1] + ); + + target[key] = value; + } + + return target; + } + + public float GetOperandAsFloat(OperandIndex operand) + { + return (float)BitConverter.UInt32BitsToSingle( + (uint)this.RawOperands[(ulong)operand] + ); + } + + public double GetOperandAsDouble(OperandIndex operand) + { + return BitConverter.UInt64BitsToDouble(this.RawOperands[(ulong)operand]); + } + + public RegisterValue GetOperandAsConstantData( + OperandIndex operand1 , + OperandIndex operand2 + ) + { + return new RegisterValue() + { + State = (RegisterValueType)this.RawOperands[(ulong)operand1] , + Value = (long)this.RawOperands[(ulong)operand2] , + Offset = 0 , + Size = this.Size + }; + } + + public LowLevelILVariable GetOperandAsVariable(OperandIndex operand) + { + return LowLevelILVariable.FromIdentifier( + this.ILFunction , + this.RawOperands[(ulong)operand] + ); + } + + public LowLevelILVariable[] GetOperandAsVariableList(OperandIndex operand1) + { + IntPtr arrayPointer = NativeMethods.BNLowLevelILGetOperandList( + this.ILFunction.DangerousGetHandle() , + this.ExpressionIndex , + (ulong)operand1 , + out ulong arrayLength + ); + + ulong[] identifiers = UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNLowLevelILFreeOperandList + ); + + List variables = new List(); + + foreach (ulong identifier in identifiers) + { + variables.Add( + LowLevelILVariable.FromIdentifier(this.ILFunction ,identifier) + ); + } + + return variables.ToArray(); + } + + public LowLevelILSSAVariable GetOperandAsSSAVariable( + OperandIndex operand1, + OperandIndex operand2 + ) + { + LowLevelILVariable ilVariable = LowLevelILVariable.FromIdentifier( + this.ILFunction , + this.RawOperands[(ulong)operand1] + ); + + return new LowLevelILSSAVariable( + ilVariable , + this.RawOperands[(ulong)operand2] + ); + } + + public LowLevelILSSAVariable[] GetOperandAsSSAVariableList(OperandIndex operand1) + { + IntPtr arrayPointer = NativeMethods.BNLowLevelILGetOperandList( + this.ILFunction.DangerousGetHandle() , + this.ExpressionIndex , + (ulong)operand1 , + out ulong arrayLength + ); + + ulong[] identifierAndVersions = UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNLowLevelILFreeOperandList + ); + + List variables = new List(); + + for (int i = 0; i < identifierAndVersions.Length; i += 2) + { + ulong identifier = identifierAndVersions[i]; + ulong version = identifierAndVersions[i + 1]; + + LowLevelILVariable variable = LowLevelILVariable.FromIdentifier(this.ILFunction ,identifier); + + variables.Add( + new LowLevelILSSAVariable(variable ,version ) + ); + } + + return variables.ToArray(); + } + + public Intrinsic GetOperandAsIntrinsic(OperandIndex operand) + { + return new Intrinsic( + this.ILFunction.OwnerFunction.Architecture , + (IntrinsicIndex)this.RawOperands[(ulong)operand] + ); + } + + public LowLevelILFlagCondition GetOperandAsFlagCondition(OperandIndex operand) + { + return (LowLevelILFlagCondition)(this.RawOperands[(ulong)operand]); + } + + public SemanticFlagClass GetOperandAsSemanticFlagClass(OperandIndex operand) + { + return new SemanticFlagClass( + this.ILFunction.OwnerFunction.Architecture , + (SemanticFlagClassIndex)this.RawOperands[(ulong)operand] + ); + } + + public SemanticFlagGroup GetOperandAsSemanticFlagGroup(OperandIndex operand) + { + return new SemanticFlagGroup( + this.ILFunction.OwnerFunction.Architecture , + (SemanticFlagGroupIndex)this.RawOperands[(ulong)operand] + ); + } + + public ILFlag GetOperandAsFlag(OperandIndex operand) + { + return new ILFlag( + this.ILFunction.OwnerFunction.Architecture , + (FlagIndex)this.RawOperands[(ulong)operand] + ); + } + + public LowLevelILSSAFlag GetOperandAsSSAFlag( + OperandIndex operand1, + OperandIndex operand2 + ) + { + return new LowLevelILSSAFlag( + this.ILFunction, + this.GetOperandAsFlag(operand1) , + this.RawOperands[(ulong)operand2] + ); + } + + public LowLevelILSSAFlag[] GetOperandAsSSAFlagList(OperandIndex operand) + { + IntPtr arrayPointer = NativeMethods.BNLowLevelILGetOperandList( + this.ILFunction.DangerousGetHandle() , + this.ExpressionIndex , + (ulong)operand , + out ulong arrayLength + ); + + ulong[] indexAndVersions = UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNLowLevelILFreeOperandList + ); + + List flags = new List(); + + for (int i = 0; i < indexAndVersions.Length; i += 2) + { + FlagIndex index = (FlagIndex)indexAndVersions[i]; + ulong version = indexAndVersions[i + 1]; + + ILFlag register = new ILFlag( + this.ILFunction.OwnerFunction.Architecture , + index + ); + + flags.Add( + new LowLevelILSSAFlag(this.ILFunction, register ,version ) + ); + } + + return flags.ToArray(); + } + + public ILRegister GetOperandAsRegister(OperandIndex operand) + { + return new ILRegister( + this.ILFunction.OwnerFunction.Architecture , + (RegisterIndex)this.RawOperands[(ulong)operand] + ); + } + + public LowLevelILSSARegister GetOperandAsSSARegister( + OperandIndex operand1, + OperandIndex operand2 + ) + { + return new LowLevelILSSARegister( + this.ILFunction, + this.GetOperandAsRegister(operand1) , + this.RawOperands[(ulong)operand2] + ); + } + + public LowLevelILSSARegister[] GetOperandAsSSARegisterList(OperandIndex operand) + { + IntPtr arrayPointer = NativeMethods.BNLowLevelILGetOperandList( + this.ILFunction.DangerousGetHandle() , + this.ExpressionIndex , + (ulong)operand , + out ulong arrayLength + ); + + ulong[] indexAndVersions = UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNLowLevelILFreeOperandList + ); + + List registers = new List(); + + for (int i = 0; i < indexAndVersions.Length; i += 2) + { + RegisterIndex index = (RegisterIndex)indexAndVersions[i]; + ulong version = indexAndVersions[i + 1]; + + ILRegister register = new ILRegister( + this.ILFunction.OwnerFunction.Architecture , + index + ); + + registers.Add( + new LowLevelILSSARegister(this.ILFunction, register ,version ) + ); + } + + return registers.ToArray(); + } + + public RegisterStack GetOperandAsRegisterStack(OperandIndex operand) + { + return new RegisterStack( + this.ILFunction.OwnerFunction.Architecture , + (RegisterStackIndex)this.RawOperands[(ulong)operand] + ); + } + + public SSARegisterStack GetOperandAsSSARegisterStack( + OperandIndex operand1, + OperandIndex operand2 + ) + { + return new SSARegisterStack( + this.GetOperandAsRegisterStack(operand1) , + this.RawOperands[(ulong)operand2] + ); + } + + public SSARegisterStack[] GetOperandAsSSARegisterStackList(OperandIndex operand) + { + IntPtr arrayPointer = NativeMethods.BNLowLevelILGetOperandList( + this.ILFunction.DangerousGetHandle() , + this.ExpressionIndex , + (ulong)operand , + out ulong arrayLength + ); + + ulong[] indexAndVersions = UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNLowLevelILFreeOperandList + ); + + List regStacks = new List(); + + for (int i = 0; i < indexAndVersions.Length; i += 2) + { + RegisterStackIndex index = (RegisterStackIndex)indexAndVersions[i]; + + ulong version = indexAndVersions[i + 1]; + + RegisterStack regStack = new RegisterStack( + this.ILFunction.OwnerFunction.Architecture , + index + ); + + regStacks.Add( + new SSARegisterStack(regStack ,version ) + ); + } + + return regStacks.ToArray(); + } + + public IDictionary GetOperandAsRegisterStackDict(OperandIndex operand) + { + IntPtr arrayPointer = NativeMethods.BNLowLevelILGetOperandList( + this.ILFunction.DangerousGetHandle() , + this.ExpressionIndex , + (ulong)operand , + out ulong arrayLength + ); + + ulong[] paires = UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNLowLevelILFreeOperandList + ); + + Dictionary target = new Dictionary(); + + for (int i = 0; i < paires.Length; i += 2) + { + RegisterStackIndex key = (RegisterStackIndex)( paires[i] ); + + ulong adjust = paires[i+1]; + + if ( 0 != (adjust & 0x80000000) ) + { + adjust |= ~0x80000000; + } + + target[key] = adjust; + } + + return target; + } + + public PossibleValueSet GetOperandAsPossibleValueSet(OperandIndex operand) + { + return PossibleValueSet.TakeNative( + NativeMethods.BNGetCachedLowLevelILPossibleValueSet( + this.ILFunction.DangerousGetHandle() , + (LowLevelILPossibleValueSetCacheIndex)this.RawOperands[(ulong)operand] + ) + ); + } + + public LowLevelILInstruction GetOperandAsExpression(OperandIndex operand) + { + return LowLevelILInstruction.FromExpressionIndex( + this.ILFunction , + (LowLevelILExpressionIndex)this.RawOperands[(ulong)operand] + ); + } + + public LowLevelILInstruction[] GetOperandAsExpressionList(OperandIndex operand1) + { + IntPtr arrayPointer = NativeMethods.BNLowLevelILGetOperandList( + this.ILFunction.DangerousGetHandle() , + this.ExpressionIndex , + (ulong)operand1 , + out ulong arrayLength + ); + + LowLevelILExpressionIndex[] expressionIndexes = UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNLowLevelILFreeOperandList + ); + + List expressions = new List(); + + foreach (LowLevelILExpressionIndex expressionIndex in expressionIndexes) + { + expressions.Add( + LowLevelILInstruction.FromExpressionIndex( + this.ILFunction , + expressionIndex + ) + ); + } + + return expressions.ToArray(); + } + + + public FlagOrRegister[] GetOperandAsFlagOrRegisterList(OperandIndex operand1) + { + IntPtr arrayPointer = NativeMethods.BNLowLevelILGetOperandList( + this.ILFunction.DangerousGetHandle() , + this.ExpressionIndex , + (ulong)operand1 , + out ulong arrayLength + ); + + ulong[] values = UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNLowLevelILFreeOperandList + ); + + List targets = new List(); + + foreach (ulong value in values) + { + if (0 != ( value & ( 1UL << 32 ) )) + { + ILFlag flag = new ILFlag( + this.ILFunction.OwnerFunction.Architecture , + (FlagIndex)( value & 0xffffffff ) + ); + + targets.Add( new FlagOrRegister(flag) ); + } + else + { + ILRegister register = new ILRegister( + this.ILFunction.OwnerFunction.Architecture , + (RegisterIndex)( value & 0xffffffff ) + ); + + targets.Add( new FlagOrRegister(register) ); + } + } + + return targets.ToArray(); + } + + public SSAFlagOrRegister[] GetOperandAsSSAFlagOrRegisterList(OperandIndex operand1) + { + IntPtr arrayPointer = NativeMethods.BNLowLevelILGetOperandList( + this.ILFunction.DangerousGetHandle() , + this.ExpressionIndex , + (ulong)operand1 , + out ulong arrayLength + ); + + ulong[] paires = UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNLowLevelILFreeOperandList + ); + + List targets = new List(); + + for (int i = 0; i < paires.Length; i += 2) + { + RegisterStackIndex key = (RegisterStackIndex)( paires[i] ); + + ulong version = paires[i+1]; + + if (0 != ( paires[i] & ( 1UL << 32 ) )) + { + ILFlag flag = new ILFlag( + this.ILFunction.OwnerFunction.Architecture , + (FlagIndex)( paires[i] & 0xffffffff ) + ); + + FlagOrRegister item = new FlagOrRegister(flag); + + targets.Add( new SSAFlagOrRegister(item , version) ); + } + else + { + ILRegister register = new ILRegister( + this.ILFunction.OwnerFunction.Architecture , + (RegisterIndex)( paires[i] & 0xffffffff ) + ); + + FlagOrRegister item = new FlagOrRegister(register); + + targets.Add( new SSAFlagOrRegister(item , version) ); + } + } + + return targets.ToArray(); + } + + public InstructionTextToken[] ExpressionTextTokens + { + get + { + return this.GetExpressionTextTokens(); + } + } + + public InstructionTextToken[] GetExpressionTextTokens( + Architecture? arch = null, + DisassemblySettings? settings = null + ) + { + if (null == arch) + { + arch = this.ILFunction.OwnerFunction.Architecture; + } + + if (null == settings) + { + settings = DisassemblySettings.DefaultLinear(); + } + + bool ok = NativeMethods.BNGetLowLevelILExprText( + this.ILFunction.DangerousGetHandle() , + null == arch ? IntPtr.Zero : arch.DangerousGetHandle(), + this.ExpressionIndex, + null == settings ? IntPtr.Zero : settings.DangerousGetHandle(), + out IntPtr arrayPointer, + out ulong arrayLength + ); + + if (!ok) + { + return Array.Empty(); + } + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength, + InstructionTextToken.FromNative, + NativeMethods.BNFreeInstructionText + ); + } + + public InstructionTextToken[] InstructionTextTokens + { + get + { + return this.GetInstructionTextTokens(); + } + } + + public InstructionTextToken[] GetInstructionTextTokens( + Architecture? arch = null, + DisassemblySettings? settings = null + ) + { + if (null == arch) + { + arch = this.ILFunction.OwnerFunction.Architecture; + } + + if (null == settings) + { + settings = DisassemblySettings.DefaultLinear(); + } + + bool ok = NativeMethods.BNGetLowLevelILInstructionText( + this.ILFunction.DangerousGetHandle() , + this.ILFunction.OwnerFunction.DangerousGetHandle(), + null == arch ? IntPtr.Zero : arch.DangerousGetHandle(), + this.InstructionIndex, + null == settings ? IntPtr.Zero : settings.DangerousGetHandle(), + out IntPtr arrayPointer, + out ulong arrayLength + ); + + if (!ok) + { + return Array.Empty(); + } + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength, + InstructionTextToken.FromNative, + NativeMethods.BNFreeInstructionText + ); + } + + public LowLevelILInstructionIndex InstructionIndex + { + get + { + return NativeMethods.BNGetLowLevelILInstructionForExpr( + this.ILFunction.DangerousGetHandle() , + this.ExpressionIndex + ); + } + } + + public LowLevelILInstructionIndex SSAInstructionIndex + { + get + { + if (this.ILFunction.IsSSAForm) + { + return this.InstructionIndex; + } + else + { + return NativeMethods.BNGetLowLevelILSSAInstructionIndex( + this.ILFunction.DangerousGetHandle() , + this.InstructionIndex + ); + } + } + } + + public LowLevelILInstructionIndex NonSSAInstructionIndex + { + get + { + if (this.ILFunction.IsSSAForm) + { + return NativeMethods.BNGetLowLevelILNonSSAInstructionIndex( + this.ILFunction.DangerousGetHandle() , + this.InstructionIndex + ); + } + else + { + return this.InstructionIndex; + } + } + } + + + public LowLevelILBasicBlock? BasicBlock + { + get + { + return LowLevelILBasicBlock.TakeHandleEx( + this.ILFunction, + NativeMethods.BNGetLowLevelILBasicBlockForInstruction( + this.ILFunction.DangerousGetHandle() , + this.InstructionIndex + ) + ); + } + } + + + public LowLevelILInstruction? SSAForm + { + get + { + if (this.ILFunction.IsSSAForm) + { + return this; + } + + LowLevelILExpressionIndex index = NativeMethods.BNGetLowLevelILSSAExprIndex( + this.ILFunction.DangerousGetHandle(), + this.ExpressionIndex + ); + + if ((ulong)index != this.ILFunction.ExpressionCount) + { + return null; + } + + return LowLevelILInstruction.FromExpressionIndex( + this.ILFunction.SSAForm , + index + ); + } + } + + public LowLevelILInstruction? NonSSAForm + { + get + { + if (this.ILFunction.IsSSAForm) + { + LowLevelILExpressionIndex index = NativeMethods.BNGetLowLevelILNonSSAExprIndex( + this.ILFunction.DangerousGetHandle(), + this.ExpressionIndex + ); + + if ((ulong)index != this.ILFunction.ExpressionCount) + { + return null; + } + + return LowLevelILInstruction.FromExpressionIndex( + this.ILFunction.NonSSAForm , + index + ); + } + else + { + return this; + } + } + } + + public RegisterValue Value + { + get + { + return RegisterValue.FromNative( + NativeMethods.BNGetLowLevelILExprValue( + this.ILFunction.DangerousGetHandle() , + this.ExpressionIndex + ) + ); + } + } + + public PossibleValueSet GetPossibleValues(DataFlowQueryOption[] options) + { + return PossibleValueSet.TakeNative( + NativeMethods.BNGetLowLevelILPossibleExprValues( + this.ILFunction.DangerousGetHandle() , + this.ExpressionIndex, + options, + (ulong)options.Length + ) + ); + } + + public PossibleValueSet PossibleValues + { + get + { + return this.GetPossibleValues(Array.Empty()); + } + } + + public MediumLevelILInstruction? MediumLevelILExpression + { + get + { + return this.ILFunction.GetMediumLevelILExpression( + this.ExpressionIndex + ); + } + } + + public MediumLevelILInstruction? MediumLevelILInstruction + { + get + { + return this.ILFunction.GetMediumLevelILInstruction( + this.InstructionIndex + ); + } + } + + public MediumLevelILInstruction[] MediumLevelILExpressions + { + get + { + return this.ILFunction.GetMediumLevelILExpressions(this.ExpressionIndex); + } + } + + public MediumLevelILInstruction? MappedMediumLevelILExpression + { + get + { + return this.ILFunction.GetMappedMediumLevelILExpression( + this.ExpressionIndex + ); + } + } + + public MediumLevelILInstruction? MappedMediumLevelILInstruction + { + get + { + return this.ILFunction.GetMappedMediumLevelILInstruction( + this.InstructionIndex + ); + } + } + + public HighLevelILInstruction? HighLevelILExpression + { + get + { + return this.ILFunction.GetHighLevelILExpression( + this.ExpressionIndex + ); + } + } + + public HighLevelILInstruction[] HighLevelILExpressions + { + get + { + return this.ILFunction.GetHighLevelILExpressions( + this.ExpressionIndex + ); + } + } + + public HighLevelILInstruction? HighLevelILInstruction + { + get + { + return this.ILFunction.GetHighLevelILInstruction( + this.InstructionIndex + ); + } + } + + public RegisterValue GetRegisterValue(RegisterIndex register) + { + return RegisterValue.FromNative( + NativeMethods.BNGetLowLevelILRegisterValueAtInstruction( + this.ILFunction.DangerousGetHandle() , + register, + this.InstructionIndex + ) + ); + } + + public RegisterValue GetRegisterValueAfter(uint registerIndex) + { + return RegisterValue.FromNative( + NativeMethods.BNGetLowLevelILRegisterValueAfterInstruction( + this.ILFunction.DangerousGetHandle() , + registerIndex, + this.InstructionIndex + ) + ); + } + + public PossibleValueSet GetRegisterPossibleValues( + RegisterIndex register , + DataFlowQueryOption[] options + ) + { + return PossibleValueSet.TakeNative( + NativeMethods.BNGetLowLevelILPossibleRegisterValuesAtInstruction( + this.ILFunction.DangerousGetHandle() , + register, + this.InstructionIndex, + options, + (ulong)options.Length + ) + ); + } + + public PossibleValueSet GetRegisterPossibleValuesAfter( + RegisterIndex register , + DataFlowQueryOption[] options + ) + { + return PossibleValueSet.TakeNative( + NativeMethods.BNGetLowLevelILPossibleRegisterValuesAfterInstruction( + this.ILFunction.DangerousGetHandle() , + register, + this.InstructionIndex, + options, + (ulong)options.Length + ) + ); + } + + public RegisterValue GetFlagValue(FlagIndex flag) + { + return RegisterValue.FromNative( + NativeMethods.BNGetLowLevelILFlagValueAtInstruction( + this.ILFunction.DangerousGetHandle() , + flag, + this.InstructionIndex + ) + ); + } + + public RegisterValue GetFlagValueAfter(FlagIndex flag) + { + return RegisterValue.FromNative( + NativeMethods.BNGetLowLevelILFlagValueAfterInstruction( + this.ILFunction.DangerousGetHandle() , + flag, + this.InstructionIndex + ) + ); + } + + public PossibleValueSet GetPossibleFlagValues( + FlagIndex flag , + DataFlowQueryOption[] options + ) + { + return PossibleValueSet.TakeNative( + NativeMethods.BNGetLowLevelILPossibleFlagValuesAtInstruction( + this.ILFunction.DangerousGetHandle() , + flag, + this.InstructionIndex, + options, + (ulong)options.Length + ) + ); + } + + public PossibleValueSet GetPossibleFlagValuesAfter( + FlagIndex flag , + DataFlowQueryOption[] options + ) + { + return PossibleValueSet.TakeNative( + NativeMethods.BNGetLowLevelILPossibleFlagValuesAfterInstruction( + this.ILFunction.DangerousGetHandle() , + flag, + this.InstructionIndex, + options, + (ulong)options.Length + ) + ); + } + + public RegisterValue GetStackContents(long offset , ulong length) + { + return RegisterValue.FromNative( + NativeMethods.BNGetLowLevelILStackContentsAtInstruction( + this.ILFunction.DangerousGetHandle() , + offset, + length, + this.InstructionIndex + ) + ); + } + + public RegisterValue GetStackContentsAfter(long offset , ulong length) + { + return RegisterValue.FromNative( + NativeMethods.BNGetLowLevelILStackContentsAfterInstruction( + this.ILFunction.DangerousGetHandle() , + offset, + length, + this.InstructionIndex + ) + ); + } + + public PossibleValueSet GetPossibleStackContents( + long offset , + ulong length, + DataFlowQueryOption[]? options = null + ) + { + if (null == options) + { + options = Array.Empty(); + } + + return PossibleValueSet.TakeNative( + NativeMethods.BNGetLowLevelILPossibleStackContentsAtInstruction( + this.ILFunction.DangerousGetHandle() , + offset, + length, + this.InstructionIndex, + options, + (ulong)options.Length + ) + ); + } + + public PossibleValueSet GetPossibleStackContentsAfter( + long offset , + ulong length, + DataFlowQueryOption[]? options = null + ) + { + if (null == options) + { + options = Array.Empty(); + } + + return PossibleValueSet.TakeNative( + NativeMethods.BNGetLowLevelILPossibleStackContentsAfterInstruction( + this.ILFunction.DangerousGetHandle() , + offset, + length, + this.InstructionIndex, + options, + (ulong)options.Length + ) + ); + } + + public LowLevelILInstruction[] Exits + { + get + { + IntPtr arrayPointer = NativeMethods.BNLowLevelILGetExitsForInstruction( + this.ILFunction.DangerousGetHandle() , + this.InstructionIndex, + out ulong arrayLength + ); + + ulong[] indexes = UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNFreeILInstructionList + ); + + List instructions = new List(); + + foreach (LowLevelILInstructionIndex index in indexes) + { + instructions.Add(this.ILFunction.MustGetInstruction(index)); + } + + return instructions.ToArray(); + } + } + + public LowLevelILLabel? Label + { + get + { + return LowLevelILLabel.FromNativePointer( + NativeMethods.BNGetLabelForLowLevelILSourceInstruction( + this.ILFunction.DangerousGetHandle() , + this.InstructionIndex + ) + ); + } + } + + public void SetSourceOperand(uint operand) + { + NativeMethods.BNLowLevelILSetExprSourceOperand( + this.ILFunction.DangerousGetHandle(), + this.ExpressionIndex, + operand + ); + } + } +} \ No newline at end of file diff --git a/Struct/BNLowLevelILLabel.cs b/Struct/BNLowLevelILLabel.cs new file mode 100644 index 0000000..d698268 --- /dev/null +++ b/Struct/BNLowLevelILLabel.cs @@ -0,0 +1,85 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNLowLevelILLabel + { + /// + /// bool resolved + /// + internal bool resolved; + + /// + /// uint64_t _ref + /// + internal ulong reference; + + /// + /// uint64_t operand + /// + internal ulong operand; + } + + public sealed class LowLevelILLabel : INativeWrapper + { + public bool Resolved { get; set; } = false; + + public ulong Reference { get; set; } = 0; + + public ulong Operand { get; set; } = 0; + + public LowLevelILLabel() + { + BNLowLevelILLabel native = new BNLowLevelILLabel(); + + NativeMethods.BNLowLevelILInitLabel(ref native); + + this.Resolved = native.resolved; + + this.Reference = native.reference; + + this.Operand = native.operand; + } + + internal LowLevelILLabel(BNLowLevelILLabel native) + { + this.Resolved = native.resolved; + this.Reference = native.reference; + this.Operand = native.operand; + } + + internal static LowLevelILLabel? FromNativePointer(IntPtr pointer) + { + if (IntPtr.Zero == pointer) + { + return null; + } + + return LowLevelILLabel.FromNative(Marshal.PtrToStructure(pointer)); + } + + internal static LowLevelILLabel FromNative(BNLowLevelILLabel native) + { + return new LowLevelILLabel() + { + Resolved = native.resolved , + Reference = native.reference , + Operand = native.operand + }; + } + + public BNLowLevelILLabel ToNative() + { + return new BNLowLevelILLabel() + { + resolved = this.Resolved , + reference = this.Reference , + operand = this.Operand + }; + } + } +} \ No newline at end of file diff --git a/Struct/BNMainThreadCallbacks.cs b/Struct/BNMainThreadCallbacks.cs new file mode 100644 index 0000000..e463085 --- /dev/null +++ b/Struct/BNMainThreadCallbacks.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNMainThreadCallbacks + { + /// + /// void* context + /// + public IntPtr context; + + /// + /// void** addAction + /// + public IntPtr addAction; + } + + public class MainThreadCallbacks + { + public MainThreadCallbacks() + { + + } + } +} \ No newline at end of file diff --git a/Struct/BNMediumLevelILInstruction.cs b/Struct/BNMediumLevelILInstruction.cs new file mode 100644 index 0000000..c81bd1f --- /dev/null +++ b/Struct/BNMediumLevelILInstruction.cs @@ -0,0 +1,1411 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNMediumLevelILInstruction + { + /// + /// BNMediumLevelILOperation operation + /// + internal MediumLevelILOperation operation; + + /// + /// uint32_t attributes + /// + internal uint attributes; + + /// + /// uint32_t sourceOperand + /// + internal uint sourceOperand; + + /// + /// uint64_t size + /// + internal ulong size; + + /// + /// uint64_t[5] operands + /// + internal fixed ulong operands[5]; + + /// + /// uint64_t address + /// + internal ulong address; + } + + public abstract class MediumLevelILInstruction + : INativeWrapper, + IEquatable, + IComparable + { + public MediumLevelILOperation Operation { get; } = MediumLevelILOperation.MLIL_NOP; + + public uint Attributes { get; } = 0; + + public ulong Size { get; } = 0; + + public OperandIndex SourceOperand { get; } = 0; + + public ulong Address { get; } = 0; + + public ulong[] RawOperands { get; }= Array.Empty(); + + // extra fields + internal MediumLevelILFunction ILFunction { get; } + + public MediumLevelILExpressionIndex ExpressionIndex { get; } = 0; + + private static Dictionary OperationOperands = new Dictionary { + + { MediumLevelILOperation.MLIL_NOP, 0 }, + { MediumLevelILOperation.MLIL_SET_VAR, 2 }, + { MediumLevelILOperation.MLIL_SET_VAR_FIELD, 3 }, + { MediumLevelILOperation.MLIL_SET_VAR_SPLIT, 3 }, + { MediumLevelILOperation.MLIL_ASSERT, 1 }, + { MediumLevelILOperation.MLIL_FORCE_VER, 1 }, + { MediumLevelILOperation.MLIL_LOAD, 1 }, + { MediumLevelILOperation.MLIL_LOAD_STRUCT, 2 }, + { MediumLevelILOperation.MLIL_STORE, 2 }, + { MediumLevelILOperation.MLIL_STORE_STRUCT, 3 }, + { MediumLevelILOperation.MLIL_VAR, 1 }, + { MediumLevelILOperation.MLIL_VAR_FIELD, 2 }, + { MediumLevelILOperation.MLIL_VAR_SPLIT, 2 }, + { MediumLevelILOperation.MLIL_ADDRESS_OF, 1 }, + { MediumLevelILOperation.MLIL_ADDRESS_OF_FIELD, 2 }, + { MediumLevelILOperation.MLIL_CONST, 1 }, + { MediumLevelILOperation.MLIL_CONST_DATA, 2 }, + { MediumLevelILOperation.MLIL_CONST_PTR, 1 }, + { MediumLevelILOperation.MLIL_EXTERN_PTR, 2 }, + { MediumLevelILOperation.MLIL_FLOAT_CONST, 1 }, + { MediumLevelILOperation.MLIL_IMPORT, 1 }, + { MediumLevelILOperation.MLIL_ADD, 2 }, + { MediumLevelILOperation.MLIL_ADC, 2 }, + { MediumLevelILOperation.MLIL_SUB, 2 }, + { MediumLevelILOperation.MLIL_SBB, 2 }, + { MediumLevelILOperation.MLIL_AND, 2 }, + { MediumLevelILOperation.MLIL_OR, 2 }, + { MediumLevelILOperation.MLIL_XOR, 2 }, + { MediumLevelILOperation.MLIL_LSL, 2 }, + { MediumLevelILOperation.MLIL_LSR, 2 }, + { MediumLevelILOperation.MLIL_ASR, 2 }, + { MediumLevelILOperation.MLIL_ROL, 2 }, + { MediumLevelILOperation.MLIL_RLC, 2 }, + { MediumLevelILOperation.MLIL_ROR, 2 }, + { MediumLevelILOperation.MLIL_RRC, 2 }, + { MediumLevelILOperation.MLIL_MUL, 2 }, + { MediumLevelILOperation.MLIL_MULU_DP, 2 }, + { MediumLevelILOperation.MLIL_MULS_DP, 2 }, + { MediumLevelILOperation.MLIL_DIVU, 2 }, + { MediumLevelILOperation.MLIL_DIVU_DP, 2 }, + { MediumLevelILOperation.MLIL_DIVS, 2 }, + { MediumLevelILOperation.MLIL_DIVS_DP, 2 }, + { MediumLevelILOperation.MLIL_MODU, 2 }, + { MediumLevelILOperation.MLIL_MODU_DP, 2 }, + { MediumLevelILOperation.MLIL_MODS, 2 }, + { MediumLevelILOperation.MLIL_MODS_DP, 2 }, + { MediumLevelILOperation.MLIL_NEG, 1 }, + { MediumLevelILOperation.MLIL_NOT, 1 }, + { MediumLevelILOperation.MLIL_SX, 2 }, // value, fromSize + { MediumLevelILOperation.MLIL_ZX, 2 }, // value, fromSize + { MediumLevelILOperation.MLIL_LOW_PART, 2 }, // value, toSize + { MediumLevelILOperation.MLIL_JUMP, 1 }, + { MediumLevelILOperation.MLIL_JUMP_TO, 2 }, // target, switchVar + { MediumLevelILOperation.MLIL_RET_HINT, 0 }, + { MediumLevelILOperation.MLIL_CALL, 3 }, // dest, params(list), outputs(list) + { MediumLevelILOperation.MLIL_CALL_UNTYPED, 3 }, // dest, params(list), outputs(list) + { MediumLevelILOperation.MLIL_CALL_OUTPUT, 2 }, // outputLoc, sourceExpr + { MediumLevelILOperation.MLIL_CALL_PARAM, 2 }, // paramLoc, sourceExpr + { MediumLevelILOperation.MLIL_SEPARATE_PARAM_LIST, 2 }, // intParams(list), floatParams(list) + { MediumLevelILOperation.MLIL_SHARED_PARAM_SLOT, 2 }, // slot, size + { MediumLevelILOperation.MLIL_RET, 1 }, // retVals(list) + { MediumLevelILOperation.MLIL_NORET, 0 }, + { MediumLevelILOperation.MLIL_IF, 3 }, // cond, true, false (block refs) + { MediumLevelILOperation.MLIL_GOTO, 1 }, // target block + { MediumLevelILOperation.MLIL_CMP_E, 2 }, + { MediumLevelILOperation.MLIL_CMP_NE, 2 }, + { MediumLevelILOperation.MLIL_CMP_SLT, 2 }, + { MediumLevelILOperation.MLIL_CMP_ULT, 2 }, + { MediumLevelILOperation.MLIL_CMP_SLE, 2 }, + { MediumLevelILOperation.MLIL_CMP_ULE, 2 }, + { MediumLevelILOperation.MLIL_CMP_SGE, 2 }, + { MediumLevelILOperation.MLIL_CMP_UGE, 2 }, + { MediumLevelILOperation.MLIL_CMP_SGT, 2 }, + { MediumLevelILOperation.MLIL_CMP_UGT, 2 }, + { MediumLevelILOperation.MLIL_TEST_BIT, 2 }, + { MediumLevelILOperation.MLIL_BOOL_TO_INT, 1 }, + { MediumLevelILOperation.MLIL_ADD_OVERFLOW, 2 }, + { MediumLevelILOperation.MLIL_SYSCALL, 2 }, // params(list), outputs(list) + { MediumLevelILOperation.MLIL_SYSCALL_UNTYPED, 2 }, // params(list), outputs(list) + { MediumLevelILOperation.MLIL_TAILCALL, 2 }, // dest, params(list) + { MediumLevelILOperation.MLIL_TAILCALL_UNTYPED, 2 }, // dest, params(list) + { MediumLevelILOperation.MLIL_INTRINSIC, 3 }, // intrinsicId, params(list), outputs(list) + { MediumLevelILOperation.MLIL_FREE_VAR_SLOT, 1 }, // var + { MediumLevelILOperation.MLIL_BP, 0 }, + { MediumLevelILOperation.MLIL_TRAP, 1 }, // code + { MediumLevelILOperation.MLIL_UNDEF, 0 }, + { MediumLevelILOperation.MLIL_UNIMPL, 0 }, + { MediumLevelILOperation.MLIL_UNIMPL_MEM, 1 }, // addr + { MediumLevelILOperation.MLIL_FADD, 2 }, + { MediumLevelILOperation.MLIL_FSUB, 2 }, + { MediumLevelILOperation.MLIL_FMUL, 2 }, + { MediumLevelILOperation.MLIL_FDIV, 2 }, + { MediumLevelILOperation.MLIL_FSQRT, 1 }, + { MediumLevelILOperation.MLIL_FNEG, 1 }, + { MediumLevelILOperation.MLIL_FABS, 1 }, + { MediumLevelILOperation.MLIL_FLOAT_TO_INT, 2 }, // value, mode/size + { MediumLevelILOperation.MLIL_INT_TO_FLOAT, 2 }, // value, mode/size + { MediumLevelILOperation.MLIL_FLOAT_CONV, 2 }, // value, toType + { MediumLevelILOperation.MLIL_ROUND_TO_INT, 2 }, // value, mode + { MediumLevelILOperation.MLIL_FLOOR, 1 }, + { MediumLevelILOperation.MLIL_CEIL, 1 }, + { MediumLevelILOperation.MLIL_FTRUNC, 1 }, + { MediumLevelILOperation.MLIL_FCMP_E, 2 }, + { MediumLevelILOperation.MLIL_FCMP_NE, 2 }, + { MediumLevelILOperation.MLIL_FCMP_LT, 2 }, + { MediumLevelILOperation.MLIL_FCMP_LE, 2 }, + { MediumLevelILOperation.MLIL_FCMP_GE, 2 }, + { MediumLevelILOperation.MLIL_FCMP_GT, 2 }, + { MediumLevelILOperation.MLIL_FCMP_O, 2 }, + { MediumLevelILOperation.MLIL_FCMP_UO, 2 }, + + { MediumLevelILOperation.MLIL_SET_VAR_SSA, 2 }, + { MediumLevelILOperation.MLIL_SET_VAR_SSA_FIELD, 3 }, + { MediumLevelILOperation.MLIL_SET_VAR_SPLIT_SSA, 3 }, + { MediumLevelILOperation.MLIL_SET_VAR_ALIASED, 2 }, + { MediumLevelILOperation.MLIL_SET_VAR_ALIASED_FIELD, 3 }, + { MediumLevelILOperation.MLIL_VAR_SSA, 2 }, // var, version + { MediumLevelILOperation.MLIL_VAR_SSA_FIELD, 3 }, // var, version, offset/size + { MediumLevelILOperation.MLIL_VAR_ALIASED, 1 }, + { MediumLevelILOperation.MLIL_VAR_ALIASED_FIELD, 2 }, + { MediumLevelILOperation.MLIL_VAR_SPLIT_SSA, 3 }, // varLo, verLo, varHi/verHi + { MediumLevelILOperation.MLIL_ASSERT_SSA, 2 }, + { MediumLevelILOperation.MLIL_FORCE_VER_SSA, 2 }, + { MediumLevelILOperation.MLIL_CALL_SSA, 4 }, // dest, params(list), outputs(list), srcMem + { MediumLevelILOperation.MLIL_CALL_UNTYPED_SSA, 4 }, // dest, params, outputs, srcMem + { MediumLevelILOperation.MLIL_SYSCALL_SSA, 3 }, // params(list), outputs(list), srcMem + { MediumLevelILOperation.MLIL_SYSCALL_UNTYPED_SSA, 3 }, // params, outputs, srcMem + { MediumLevelILOperation.MLIL_TAILCALL_SSA, 3 }, // dest, params(list), srcMem + { MediumLevelILOperation.MLIL_TAILCALL_UNTYPED_SSA, 3 }, // dest, params, srcMem + { MediumLevelILOperation.MLIL_CALL_PARAM_SSA, 3 }, // paramLoc, sourceExpr, srcMem + { MediumLevelILOperation.MLIL_CALL_OUTPUT_SSA, 3 }, // outputLoc, sourceExpr, dstMem + { MediumLevelILOperation.MLIL_MEMORY_INTRINSIC_OUTPUT_SSA, 3 }, // dest, size, dstMem + { MediumLevelILOperation.MLIL_LOAD_SSA, 2 }, // addr, srcMem + { MediumLevelILOperation.MLIL_LOAD_STRUCT_SSA, 3 }, // addr, offset, srcMem + { MediumLevelILOperation.MLIL_STORE_SSA, 3 }, // addr, value, dstMem + { MediumLevelILOperation.MLIL_STORE_STRUCT_SSA, 4 }, // addr, offset, value, dstMem + { MediumLevelILOperation.MLIL_INTRINSIC_SSA, 4 }, // intrinsicId, params(list), outputs(list), srcMem + { MediumLevelILOperation.MLIL_MEMORY_INTRINSIC_SSA, 4 }, // dest, src, size, dstMem + { MediumLevelILOperation.MLIL_FREE_VAR_SLOT_SSA, 2 }, // var, version + { MediumLevelILOperation.MLIL_VAR_PHI, 1 }, // vars(list pairs) + { MediumLevelILOperation.MLIL_MEM_PHI, 1 }, // memVersions(list) + }; + + internal MediumLevelILInstruction( + MediumLevelILFunction ilFunction , + MediumLevelILExpressionIndex expressionIndex + ) : this( + ilFunction , + expressionIndex , + NativeMethods.BNGetMediumLevelILByIndex( + ilFunction.DangerousGetHandle() , + expressionIndex + ) + ) + { + + } + + internal MediumLevelILInstruction( + MediumLevelILFunction ilFunction, + MediumLevelILExpressionIndex expressionIndex , + BNMediumLevelILInstruction native + ) + { + this.ILFunction = ilFunction; + + this.ExpressionIndex = expressionIndex; + + this.Operation = native.operation ; + this.Attributes = native.attributes ; + this.SourceOperand = (OperandIndex)native.sourceOperand; + this.Size = native.size ; + this.Address = native.address ; + + MediumLevelILInstruction.OperationOperands.TryGetValue( + this.Operation , + out int operandCount + ); + + if (0 == operandCount) + { + this.RawOperands = Array.Empty(); + } + else + { + this.RawOperands = new ulong[operandCount]; + + for (int i = 0; i < operandCount; i++) + { + unsafe + { + this.RawOperands[i] = native.operands[i] ; + } + } + } + } + + internal static MediumLevelILInstruction FromExpressionIndex( + MediumLevelILFunction ilFunction , + MediumLevelILExpressionIndex expressionIndex) + { + BNMediumLevelILInstruction native = NativeMethods.BNGetMediumLevelILByIndex( + ilFunction.DangerousGetHandle() , + (MediumLevelILExpressionIndex)expressionIndex + ); + + switch (native.operation) + { + case MediumLevelILOperation.MLIL_NOP: + { + return new MLILNop(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_SET_VAR: + { + return new MLILSetVariable(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_SET_VAR_FIELD: + { + return new MLILSetVariableField(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_SET_VAR_SPLIT: + { + return new MLILSetVariableSplit(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_ASSERT: + { + return new MLILAssert(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_FORCE_VER: + { + return new MLILForceVersion(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_LOAD: + { + return new MLILLoad(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_LOAD_STRUCT: + { + return new MLILLoadStruct(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_STORE: + { + return new MLILStore(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_STORE_STRUCT: + { + return new MLILStoreStruct(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_VAR: + { + return new MLILVariable(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_VAR_FIELD: + { + return new MLILVariableField(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_VAR_SPLIT: + { + return new MLILVariableSplit(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_ADDRESS_OF: + { + return new MLILAddressOf(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_ADDRESS_OF_FIELD: + { + return new MLILAddressOfField(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_CONST: + { + return new MLILConst(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_CONST_DATA: + { + return new MLILConstData(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_CONST_PTR: + { + return new MLILConstPointer(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_EXTERN_PTR: + { + return new MLILExternPointer(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_FLOAT_CONST: + { + return new MLILFloatConst(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_IMPORT: + { + return new MLILImport(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_ADD: + { + return new MLILAdd(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_ADC: + { + return new MLILAddCarry(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_SUB: + { + return new MLILSub(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_SBB: + { + return new MLILSubBorrow(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_AND: + { + return new MLILAnd(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_OR: + { + return new MLILOr(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_XOR: + { + return new MLILXor(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_LSL: + { + return new MLILLogicalShiftLeft(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_LSR: + { + return new MLILLogicalShiftRight(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_ASR: + { + return new MLILArithmeticShiftRight(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_ROL: + { + return new MLILRotateLeft(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_RLC: + { + return new MLILRotateLeftCarry(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_ROR: + { + return new MLILRotateRight(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_RRC: + { + return new MLILRotateRightCarry(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_MUL: + { + return new MLILMul(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_MULU_DP: + { + return new MLILMulUnsignedDoublePrecision(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_MULS_DP: + { + return new MLILMulSignedDoublePrecision(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_DIVU: + { + return new MLILDivUnsigned(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_DIVU_DP: + { + return new MLILDivUnsignedDoublePrecision(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_DIVS: + { + return new MLILDivSigned(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_DIVS_DP: + { + return new MLILDivSignedDoublePrecision(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_MODU: + { + return new MLILModUnsigned(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_MODU_DP: + { + return new MLILModUnsignedDoublePrecision(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_MODS: + { + return new MLILModSigned(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_MODS_DP: + { + return new MLILModSignedDoublePrecision(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_NEG: + { + return new MLILNeg(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_NOT: + { + return new MLILNot(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_SX: + { + return new MLILSignExtend(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_ZX: + { + return new MLILZeroExtend(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_LOW_PART: + { + return new MLILLowPart(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_JUMP: + { + return new MLILJump(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_JUMP_TO: + { + return new MLILJumpTo(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_RET_HINT: + { + return new MLILReturnHint(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_CALL: + { + return new MLILCall(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_CALL_UNTYPED: + { + return new MLILCallUntyped(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_CALL_OUTPUT: + { + return new MLILCallOutput(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_CALL_PARAM: + { + return new MLILCallParam(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_SEPARATE_PARAM_LIST: + { + return new MLILSeparateParamList(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_SHARED_PARAM_SLOT: + { + return new MLILSharedParamSlot(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_RET: + { + return new MLILReturn(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_NORET: + { + return new MLILNoReturn(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_IF: + { + return new MLILIf(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_GOTO: + { + return new MLILGoto(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_CMP_E: + { + return new MLILEqual(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_CMP_NE: + { + return new MLILNotEqual(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_CMP_SLT: + { + return new MLILSignedLessThan(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_CMP_ULT: + { + return new MLILUnsignedLessThan(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_CMP_SLE: + { + return new MLILSignedLessOrEqual(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_CMP_ULE: + { + return new MLILUnsignedLessOrEqual(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_CMP_SGE: + { + return new MLILSignedGreaterOrEqual(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_CMP_UGE: + { + return new MLILUnsignedGreaterOrEqual(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_CMP_SGT: + { + return new MLILSignedGreaterThan(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_CMP_UGT: + { + return new MLILUnsignedGreaterThan(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_TEST_BIT: + { + return new MLILTestBit(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_BOOL_TO_INT: + { + return new MLILBoolToInt(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_ADD_OVERFLOW: + { + return new MLILAddOverflow(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_SYSCALL: + { + return new MLILSysCall(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_SYSCALL_UNTYPED: + { + return new MLILSysCallUntyped(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_TAILCALL: + { + return new MLILTailCall(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_TAILCALL_UNTYPED: + { + return new MLILTailCallUntyped(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_INTRINSIC: + { + return new MLILIntrinsic(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_FREE_VAR_SLOT: + { + return new MLILFreeVariableSlot(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_BP: + { + return new MLILBreakpoint(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_TRAP: + { + return new MLILTrap(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_UNDEF: + { + return new MLILUndefine(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_UNIMPL: + { + return new MLILUnimplemented(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_UNIMPL_MEM: + { + return new MLILUnimplementedMemory(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_FADD: + { + return new MLILFloatAdd(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_FSUB: + { + return new MLILFloatSub(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_FMUL: + { + return new MLILFloatMul(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_FDIV: + { + return new MLILFloatDiv(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_FSQRT: + { + return new MLILFloatSquareRoot(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_FNEG: + { + return new MLILFloatNeg(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_FABS: + { + return new MLILFloatAbs(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_FLOAT_TO_INT: + { + return new MLILFloatToInt(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_INT_TO_FLOAT: + { + return new MLILIntToFloat(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_FLOAT_CONV: + { + return new MLILFloatConvert(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_ROUND_TO_INT: + { + return new MLILRoundToInt(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_FLOOR: + { + return new MLILFloor(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_CEIL: + { + return new MLILCeil(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_FTRUNC: + { + return new MLILFloatTruncate(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_FCMP_E: + { + return new MLILFloatEqual(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_FCMP_NE: + { + return new MLILFloatNotEqual(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_FCMP_LT: + { + return new MLILFloatLessThan(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_FCMP_LE: + { + return new MLILFloatLessThanOrEqual(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_FCMP_GE: + { + return new MLILFloatGreaterOrEqual(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_FCMP_GT: + { + return new MLILFloatGreaterThan(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_FCMP_O: + { + return new MLILFloatCompareOrdered(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_FCMP_UO: + { + return new MLILFloatCompareUnordered(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_SET_VAR_SSA: + { + return new MLILSetVariableSSA(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_SET_VAR_SSA_FIELD: + { + return new MLILSetVariableSSAField(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_SET_VAR_SPLIT_SSA: + { + return new MLILSetVariableSplitSSA(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_SET_VAR_ALIASED: + { + return new MLILSetVariableAliased(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_SET_VAR_ALIASED_FIELD: + { + return new MLILSetVariableAliasedField(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_VAR_SSA: + { + return new MLILVariableSSA(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_VAR_SSA_FIELD: + { + return new MLILVariableSSAField(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_VAR_ALIASED: + { + return new MLILVariableAliased(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_VAR_ALIASED_FIELD: + { + return new MLILVariableAliasedField(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_VAR_SPLIT_SSA: + { + return new MLILVariableSplitSSA(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_ASSERT_SSA: + { + return new MLILAssertSSA(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_FORCE_VER_SSA: + { + return new MLILForceVersionSSA(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_CALL_SSA: + { + return new MLILCallSSA(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_CALL_UNTYPED_SSA: + { + return new MLILCallUntypedSSA(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_SYSCALL_SSA: + { + return new MLILSysCallSSA(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_SYSCALL_UNTYPED_SSA: + { + return new MLILSysCallUntypedSSA(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_TAILCALL_SSA: + { + return new MLILTailCallSSA(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_TAILCALL_UNTYPED_SSA: + { + return new MLILTailCallUntypedSSA(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_CALL_PARAM_SSA: + { + return new MLILCallParamSSA(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_CALL_OUTPUT_SSA: + { + return new MLILCallOutputSSA(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_MEMORY_INTRINSIC_OUTPUT_SSA: + { + return new MLILMemoryIntrinsicOutputSSA(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_LOAD_SSA: + { + return new MLILLoadSSA(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_LOAD_STRUCT_SSA: + { + return new MLILLoadStructSSA(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_STORE_SSA: + { + return new MLILStoreSSA(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_STORE_STRUCT_SSA: + { + return new MLILStoreStructSSA(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_INTRINSIC_SSA: + { + return new MLILIntrinsicSSA(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_MEMORY_INTRINSIC_SSA: + { + return new MLILMemoryIntrinsicSSA(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_FREE_VAR_SLOT_SSA: + { + return new MLILFreeVariableSlotSSA(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_VAR_PHI: + { + return new MLILVariablePhi(ilFunction , expressionIndex , native); + } + case MediumLevelILOperation.MLIL_MEM_PHI: + { + return new MLILMemoryPhi(ilFunction , expressionIndex , native); + } + default: + { + throw new NotSupportedException("not supported operation"); + } + } + } + + public BNMediumLevelILInstruction ToNative() + { + BNMediumLevelILInstruction native = new BNMediumLevelILInstruction() + { + operation = this.Operation , + attributes = this.Attributes , + sourceOperand = (uint)this.SourceOperand , + size = this.Size , + address = this.Address , + }; + + int count = Math.Min(this.RawOperands?.Length ?? 0, 5); + + if (this.RawOperands?.Length >= count) + { + for (int i = 0; i < count; i++) + { + unsafe + { + native.operands[i] = this.RawOperands[i]; + } + } + } + + return native; + } + + public override string ToString() + { + StringBuilder builder = new StringBuilder(); + + foreach (InstructionTextToken token in this.Tokens) + { + builder.Append(token.Text); + } + + return builder.ToString(); + } + + + public override bool Equals(object? other) + { + return Equals(other as MediumLevelILInstruction); + } + + public bool Equals(MediumLevelILInstruction? other) + { + if (other is null) + { + return false; + } + + if (ReferenceEquals(this , other)) + { + return true; + } + + if (this.ILFunction != other.ILFunction) + { + return false; + } + + return this.ExpressionIndex == other.ExpressionIndex; + } + + public override int GetHashCode() + { + return HashCode.Combine( + this.ILFunction.GetHashCode(), + (ulong)this.ExpressionIndex + ); + } + + public static bool operator ==(MediumLevelILInstruction? left, MediumLevelILInstruction? right) + { + if (left is null) + { + return right is null; + } + + return left.Equals(right); + } + + public static bool operator !=(MediumLevelILInstruction? left, MediumLevelILInstruction? right) + { + return !(left == right); + } + + public int CompareTo(MediumLevelILInstruction? other) + { + if (other is null) + { + return 1; + } + + int result = this.ILFunction.CompareTo(other.ILFunction); + + if (0 == result) + { + result = this.ExpressionIndex.CompareTo(other.ExpressionIndex); + } + + return result; + } + + + public virtual MediumLevelILVariable[] VariablesRead + { + get + { + return Array.Empty(); + } + } + + public virtual MediumLevelILVariable[] VariablesWrite + { + get + { + return Array.Empty(); + } + } + + public virtual MediumLevelILSSAVariable[] SSAVariablesRead + { + get + { + return Array.Empty(); + } + } + + public virtual MediumLevelILSSAVariable[] SSAVariablesWrite + { + get + { + return Array.Empty(); + } + } + + public T[] GetOperandAsIntegerArray(OperandIndex operand) + where T : unmanaged + { + IntPtr arrayPointer = NativeMethods.BNMediumLevelILGetOperandList( + this.ILFunction.DangerousGetHandle() , + this.ExpressionIndex , + this.RawOperands[(ulong)operand] , + out ulong arrayLength + ); + + return UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNMediumLevelILFreeOperandList + ); + } + + public IDictionary GetOperandAsIntegerMap(OperandIndex operand) + where T : unmanaged + { + IntPtr arrayPointer = NativeMethods.BNMediumLevelILGetOperandList( + this.ILFunction.DangerousGetHandle() , + this.ExpressionIndex , + (ulong)operand , + out ulong arrayLength + ); + + ulong[] keyAndValues = UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNMediumLevelILFreeOperandList + ); + + Dictionary target = new Dictionary(); + + for (int i = 0; i < keyAndValues.Length; i += 2) + { + T key = UnsafeUtils.ForceConvert( + keyAndValues[i] + ); + + T value = UnsafeUtils.ForceConvert( + keyAndValues[i+1] + ); + + target[key] = value; + } + + return target; + } + + public float GetOperandAsFloat(OperandIndex operand) + { + return (float)BitConverter.UInt32BitsToSingle( + (uint)this.RawOperands[(ulong)operand] + ); + } + + public double GetOperandAsDouble(OperandIndex operand) + { + return BitConverter.UInt64BitsToDouble(this.RawOperands[(ulong)operand]); + } + + public RegisterValue GetOperandAsConstantData( + OperandIndex operand1 , + OperandIndex operand2 + ) + { + return new RegisterValue() + { + State = (RegisterValueType)this.RawOperands[(ulong)operand1] , + Value = (long)this.RawOperands[(ulong)operand2] , + Offset = 0 , + Size = this.Size + }; + } + + public MediumLevelILVariable GetOperandAsVariable(OperandIndex operand) + { + return MediumLevelILVariable.FromIdentifier( + this.ILFunction , + this.RawOperands[(ulong)operand] + ); + } + + public MediumLevelILVariable[] GetOperandAsVariableList(OperandIndex operand1) + { + IntPtr arrayPointer = NativeMethods.BNMediumLevelILGetOperandList( + this.ILFunction.DangerousGetHandle() , + this.ExpressionIndex , + (ulong)operand1 , + out ulong arrayLength + ); + + ulong[] identifiers = UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNMediumLevelILFreeOperandList + ); + + List variables = new List(); + + foreach (ulong identifier in identifiers) + { + variables.Add( + MediumLevelILVariable.FromIdentifier(this.ILFunction ,identifier) + ); + } + + return variables.ToArray(); + } + + public MediumLevelILSSAVariable GetOperandAsSSAVariable( + OperandIndex operand1, + OperandIndex operand2 + ) + { + MediumLevelILVariable ilVariable = MediumLevelILVariable.FromIdentifier( + this.ILFunction , + this.RawOperands[(ulong)operand1] + ); + + return new MediumLevelILSSAVariable( + ilVariable , + this.RawOperands[(ulong)operand2] + ); + } + + public MediumLevelILSSAVariable[] GetOperandAsSSAVariableList(OperandIndex operand1) + { + IntPtr arrayPointer = NativeMethods.BNMediumLevelILGetOperandList( + this.ILFunction.DangerousGetHandle() , + this.ExpressionIndex , + (ulong)operand1 , + out ulong arrayLength + ); + + ulong[] identifierAndVersions = UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNMediumLevelILFreeOperandList + ); + + List variables = new List(); + + for (int i = 0; i < identifierAndVersions.Length; i += 2) + { + ulong identifier = identifierAndVersions[i]; + ulong version = identifierAndVersions[i + 1]; + + MediumLevelILVariable variable = MediumLevelILVariable.FromIdentifier(this.ILFunction ,identifier); + + variables.Add( + new MediumLevelILSSAVariable(variable ,version ) + ); + } + + return variables.ToArray(); + } + + public Intrinsic GetOperandAsIntrinsic(OperandIndex operand) + { + return new Intrinsic( + this.ILFunction.OwnerFunction.Architecture , + (IntrinsicIndex)this.RawOperands[(ulong)operand] + ); + } + + public PossibleValueSet GetOperandAsPossibleValueSet(OperandIndex operand) + { + return PossibleValueSet.TakeNative( + NativeMethods.BNGetCachedMediumLevelILPossibleValueSet( + this.ILFunction.DangerousGetHandle() , + this.RawOperands[(ulong)operand] + ) + ); + } + + public MediumLevelILInstruction GetOperandAsExpression(OperandIndex operand) + { + return MediumLevelILInstruction.FromExpressionIndex( + this.ILFunction , + (MediumLevelILExpressionIndex)this.RawOperands[(ulong)operand] + ); + } + + public MediumLevelILInstruction[] GetOperandAsExpressionList( + OperandIndex operand1 + ) + { + IntPtr arrayPointer = NativeMethods.BNMediumLevelILGetOperandList( + this.ILFunction.DangerousGetHandle() , + this.ExpressionIndex , + (ulong)operand1 , + out ulong arrayLength + ); + + MediumLevelILExpressionIndex[] expressionIndexes = UnsafeUtils.TakeNumberArray( + arrayPointer , + arrayLength , + NativeMethods.BNMediumLevelILFreeOperandList + ); + + List expressions = new List(); + + foreach (MediumLevelILExpressionIndex expressionIndex in expressionIndexes) + { + expressions.Add( + MediumLevelILInstruction.FromExpressionIndex( + this.ILFunction , + expressionIndex + ) + ); + } + + return expressions.ToArray(); + } + + public InstructionTextToken[] GetTokens( + Architecture? arch = null, + DisassemblySettings? settings = null + ) + { + if (null == arch) + { + arch = this.ILFunction.OwnerFunction.Architecture; + } + + bool ok = NativeMethods.BNGetMediumLevelILExprText( + this.ILFunction.DangerousGetHandle() , + null == arch ? IntPtr.Zero : arch.DangerousGetHandle(), + this.ExpressionIndex, + out IntPtr arrayPointer, + out ulong arrayLength, + null == settings ? IntPtr.Zero : settings.DangerousGetHandle() + ); + + if (!ok) + { + return Array.Empty(); + } + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer , + arrayLength, + InstructionTextToken.FromNative, + NativeMethods.BNFreeInstructionText + ); + } + + public MediumLevelILInstructionIndex InstructionIndex + { + get + { + return NativeMethods.BNGetMediumLevelILInstructionForExpr( + this.ILFunction.DangerousGetHandle() , + this.ExpressionIndex + ); + } + } + + public InstructionTextToken[] Tokens + { + get + { + return this.GetTokens(); + } + } + + public MediumLevelILBasicBlock? MediumLevelILBasicBlock + { + get + { + return MediumLevelILBasicBlock.TakeHandleEx( + this.ILFunction, + NativeMethods.BNGetMediumLevelILBasicBlockForInstruction( + this.ILFunction.DangerousGetHandle() , + this.InstructionIndex + ) + ); + } + } + + public MediumLevelILExpressionIndex SSAExpressionIndex + { + get + { + return NativeMethods.BNGetMediumLevelILSSAExprIndex( + this.ILFunction.DangerousGetHandle(), + this.ExpressionIndex + ); + } + } + + public MediumLevelILInstruction SSAForm + { + get + { + return MediumLevelILInstruction.FromExpressionIndex( + this.ILFunction.SSAForm , + this.SSAExpressionIndex + ); + } + } + + public MediumLevelILExpressionIndex NonSSAExpressionIndex + { + get + { + return NativeMethods.BNGetMediumLevelILNonSSAExprIndex( + this.ILFunction.DangerousGetHandle(), + this.ExpressionIndex + ); + } + } + + public MediumLevelILInstruction NonSSAForm + { + get + { + return MediumLevelILInstruction.FromExpressionIndex( + this.ILFunction.NonSSAForm , + this.NonSSAExpressionIndex + ); + } + } + + public RegisterValue Value + { + get + { + return RegisterValue.FromNative( + NativeMethods.BNGetMediumLevelILExprValue( + this.ILFunction.DangerousGetHandle() , + this.ExpressionIndex + ) + ); + } + } + + public PossibleValueSet PossibleValues + { + get + { + return PossibleValueSet.TakeNative( + NativeMethods.BNGetMediumLevelILPossibleExprValues( + this.ILFunction.DangerousGetHandle() , + this.ExpressionIndex, + Array.Empty(), + 0 + ) + ); + } + } + + public PossibleValueSet GetPossibleValues(DataFlowQueryOption[] options) + { + return PossibleValueSet.TakeNative( + NativeMethods.BNGetMediumLevelILPossibleExprValues( + this.ILFunction.DangerousGetHandle() , + this.ExpressionIndex, + options, + (ulong)options.Length + ) + ); + } + + public MediumLevelILLabel? Label + { + get + { + return MediumLevelILLabel.FromNativePointer( + NativeMethods.BNGetLabelForMediumLevelILSourceInstruction( + this.ILFunction.DangerousGetHandle() , + this.InstructionIndex + ) + ); + } + } + + public LowLevelILInstruction? LowLevelILExpression + { + get + { + return this.ILFunction.GetLowLevelILExpression(this.ExpressionIndex); + } + } + + public LowLevelILInstruction[] LowLevelILExpressions + { + get + { + return this.ILFunction.GetLowLevelILExpressions(this.ExpressionIndex); + } + } + + public LowLevelILInstruction? LowLevelILInstruction + { + get + { + return this.ILFunction.GetLowLevelILInstruction(this.InstructionIndex); + } + } + + // high + public HighLevelILInstruction? HighLevelILExpression + { + get + { + return this.ILFunction.GetHighLevelILExpression(this.ExpressionIndex); + } + } + + public HighLevelILInstruction[] HighLevelILExpressions + { + get + { + return this.ILFunction.GetHighLevelILExpressions(this.ExpressionIndex); + } + } + + public HighLevelILInstruction? HighLevelILInstruction + { + get + { + return this.ILFunction.GetHighLevelILInstruction(this.InstructionIndex); + } + } + + } + +} diff --git a/Struct/BNMediumLevelILLabel.cs b/Struct/BNMediumLevelILLabel.cs new file mode 100644 index 0000000..4f4df35 --- /dev/null +++ b/Struct/BNMediumLevelILLabel.cs @@ -0,0 +1,78 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNMediumLevelILLabel + { + /// + /// bool resolved + /// + internal bool resolved; + + /// + /// uint64_t _ref + /// + internal ulong reference; + + /// + /// uint64_t operand + /// + internal ulong operand; + } + + public sealed class MediumLevelILLabel : INativeWrapper + { + public bool Resolved { get; set; } = false; + + public ulong Reference { get; set; } = 0; + + public ulong Operand { get; set; } = 0; + + public MediumLevelILLabel() + { + BNMediumLevelILLabel native = new BNMediumLevelILLabel(); + + NativeMethods.BNMediumLevelILInitLabel(ref native); + + this.Resolved = native.resolved; + this.Reference = native.reference; + this.Operand = native.operand; + } + + internal MediumLevelILLabel(BNMediumLevelILLabel native) + { + this.Resolved = native.resolved; + this.Reference = native.reference; + this.Operand = native.operand; + } + + internal static MediumLevelILLabel FromNative(BNMediumLevelILLabel native) + { + return new MediumLevelILLabel(native); + } + + internal static MediumLevelILLabel? FromNativePointer(IntPtr pointer) + { + if (IntPtr.Zero == pointer) + { + return null; + } + + return MediumLevelILLabel.FromNative(Marshal.PtrToStructure(pointer)); + } + + public BNMediumLevelILLabel ToNative() + { + return new BNMediumLevelILLabel() + { + resolved = this.Resolved , + reference = this.Reference , + operand = this.Operand , + }; + } + } +} \ No newline at end of file diff --git a/Struct/BNMemoryUsageInfo.cs b/Struct/BNMemoryUsageInfo.cs new file mode 100644 index 0000000..72bb9c7 --- /dev/null +++ b/Struct/BNMemoryUsageInfo.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNMemoryUsageInfo + { + /// + /// const char* name + /// + public IntPtr name; + + /// + /// uint64_t _value + /// + public ulong _value; + } + + public sealed class MemoryUsageInfo + { + public string Name { get; set; } = string.Empty; + + public ulong Value { get; set; } = 0; + + public MemoryUsageInfo() + { + + } + } +} \ No newline at end of file diff --git a/Struct/BNMergedVariable.cs b/Struct/BNMergedVariable.cs new file mode 100644 index 0000000..f06ffdc --- /dev/null +++ b/Struct/BNMergedVariable.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNMergedVariable + { + /// + /// BNVariable target + /// + public BNVariable target; + + /// + /// BNVariable* sources + /// + public IntPtr sources; + + /// + /// uint64_t sourceCount + /// + public ulong sourceCount; + } + + public class MergedVariable + { + public CoreVariable? Target { get; set; } = null; + + public CoreVariable[] Sources { get; set; } = Array.Empty(); + + public MergedVariable() + { + + } + } +} \ No newline at end of file diff --git a/Struct/BNMetadataValueStore.cs b/Struct/BNMetadataValueStore.cs new file mode 100644 index 0000000..8d12dd4 --- /dev/null +++ b/Struct/BNMetadataValueStore.cs @@ -0,0 +1,90 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNMetadataValueStore + { + /// + /// uint64_t size + /// + internal ulong size; + + /// + /// const char** keys + /// + internal IntPtr keys; + + /// + /// BNMetadata** values + /// + internal IntPtr values; + } + + public sealed class MetadataValueStore + { + public string[] Keys { get; set; } = Array.Empty(); + + public Metadata[] Values { get; set; } = Array.Empty(); + + public MetadataValueStore() + { + + } + + internal static MetadataValueStore MustFromNativePointer(IntPtr pointer) + { + if (IntPtr.Zero == pointer) + { + throw new ArgumentNullException(nameof(pointer)); + } + + return MetadataValueStore.FromNative(Marshal.PtrToStructure(pointer)); + } + + internal static MetadataValueStore FromNative(BNMetadataValueStore native) + { + return new MetadataValueStore() + { + Keys = UnsafeUtils.ReadAnsiStringArray(native.keys , (ulong)native.size) , + Values = UnsafeUtils.ReadHandleArray( + native.values , + (ulong)native.size, + Metadata.MustNewFromHandle + ) + }; + } + + public Dictionary ToDictionary() + { + Dictionary target = new Dictionary(); + + if (0 == this.Keys.Length) + { + return target; + } + + if (0 == this.Values.Length) + { + return target; + } + + if (this.Keys.Length != this.Values.Length) + { + throw new ArgumentException("Keys and Values must have the same length."); + } + + for (int i = 0; i < this.Keys.Length; i++) + { + target[ this.Keys[i]] = Metadata.MustNewFromHandle( + this.Values[i].DangerousGetHandle() + ); + } + + return target; + } + } +} \ No newline at end of file diff --git a/Struct/BNNameAndType.cs b/Struct/BNNameAndType.cs new file mode 100644 index 0000000..921f115 --- /dev/null +++ b/Struct/BNNameAndType.cs @@ -0,0 +1,60 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNNameAndType + { + /// + /// const char* name + /// + internal IntPtr name; + + /// + /// BNType* type + /// + internal IntPtr type; + + /// + /// uint8_t typeConfidence + /// + internal byte typeConfidence; + } + + public sealed class NameAndType + { + public string Name { get; } = string.Empty; + + public BinaryNinja.Type Type { get; } + + public byte TypeConfidence { get; } = 0; + + public NameAndType( + string name, + BinaryNinja.Type type, + byte typeConfidence + ) + { + this.Name = name; + this.Type = type; + this.TypeConfidence = typeConfidence; + } + + internal NameAndType(BNNameAndType native) + { + this.Name = UnsafeUtils.ReadAnsiString(native.name); + + this.Type = BinaryNinja.Type.MustNewFromHandle(native.type); + + this.TypeConfidence = native.typeConfidence; + } + + internal static NameAndType FromNative(BNNameAndType native) + { + return new NameAndType(native); + } + } +} \ No newline at end of file diff --git a/Struct/BNNameList.cs b/Struct/BNNameList.cs new file mode 100644 index 0000000..d49e027 --- /dev/null +++ b/Struct/BNNameList.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNNameList + { + /// + /// const char** name + /// + public IntPtr name; + + /// + /// const char* _join + /// + public IntPtr _join; + + /// + /// uint64_t nameCount + /// + public ulong nameCount; + } + + public sealed class NameList + { + public string[] Name { get; set; } = Array.Empty(); + + public string Join { get; set; } = string.Empty; + + public NameList() + { + + } + } +} \ No newline at end of file diff --git a/Struct/BNNameSpace.cs b/Struct/BNNameSpace.cs new file mode 100644 index 0000000..bec2da4 --- /dev/null +++ b/Struct/BNNameSpace.cs @@ -0,0 +1,91 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + /// + /// + /// + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNNameSpace + { + /// + /// + /// const char** name + /// + internal IntPtr name; + + /// + /// + /// const char* join + /// + internal IntPtr join; + + /// + /// + /// uint64_t nameCount + /// + internal ulong nameCount; + } + + public sealed class NameSpace : INativeWrapperEx + { + public string[] Name { get; set; } = Array.Empty(); + + public string Join { get; set; } = ""; + + internal NameSpace() + { + + } + + internal static NameSpace MustFromNativePointer(IntPtr rawPtr) + { + return NameSpace.FromNative(Marshal.PtrToStructure(rawPtr)); + } + + internal static NameSpace FromNative(BNNameSpace native) + { + return new NameSpace() + { + Name = UnsafeUtils.ReadAnsiStringArray(native.name , native.nameCount) , + Join = UnsafeUtils.ReadAnsiString(native.join) + }; + } + + internal static NameSpace TakeNative(BNNameSpace native) + { + NameSpace target = new NameSpace() + { + Name = UnsafeUtils.ReadAnsiStringArray(native.name , native.nameCount) , + Join = UnsafeUtils.ReadAnsiString(native.join) + }; + + NativeMethods.BNFreeNameSpace(native); + + return target; + } + + public BNNameSpace ToNativeEx(ScopedAllocator allocator) + { + return new BNNameSpace() + { + name = allocator.AllocAnsiStringArray(this.Name) , + nameCount = (ulong)this.Name.Length, + join = allocator.AllocAnsiString(this.Join), + }; + } + + public static NameSpace Internal() + { + return NameSpace.TakeNative(NativeMethods.BNGetInternalNameSpace()); + } + + public static NameSpace External() + { + return NameSpace.TakeNative(NativeMethods.BNGetExternalNameSpace()); + } + } +} \ No newline at end of file diff --git a/Struct/BNNavigationHandler.cs b/Struct/BNNavigationHandler.cs new file mode 100644 index 0000000..b20939b --- /dev/null +++ b/Struct/BNNavigationHandler.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNNavigationHandler + { + /// + /// void* context + /// + public IntPtr context; + + /// + /// void** getCurrentView + /// + public IntPtr getCurrentView; + + /// + /// void** getCurrentOffset + /// + public IntPtr getCurrentOffset; + + /// + /// void** navigate + /// + public IntPtr navigate; + } + + public class NavigationHandler + { + public NavigationHandler() + { + + } + } +} \ No newline at end of file diff --git a/Struct/BNObjectDestructionCallbacks.cs b/Struct/BNObjectDestructionCallbacks.cs new file mode 100644 index 0000000..6eabddb --- /dev/null +++ b/Struct/BNObjectDestructionCallbacks.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNObjectDestructionCallbacks + { + /// + /// void* context + /// + public IntPtr context; + + /// + /// void** destructBinaryView + /// + public IntPtr destructBinaryView; + + /// + /// void** destructFileMetadata + /// + public IntPtr destructFileMetadata; + + /// + /// void** destructFunction + /// + public IntPtr destructFunction; + } + + public class ObjectDestructionCallbacks + { + public ObjectDestructionCallbacks() + { + + } + } +} \ No newline at end of file diff --git a/Struct/BNOffsetWithConfidence.cs b/Struct/BNOffsetWithConfidence.cs new file mode 100644 index 0000000..1031181 --- /dev/null +++ b/Struct/BNOffsetWithConfidence.cs @@ -0,0 +1,53 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNOffsetWithConfidence + { + /// + /// int64_t value + /// + internal long value; + + /// + /// uint8_t confidence + /// + internal byte confidence; + } + + public sealed class OffsetWithConfidence : INativeWrapper + { + public long Value { get; set; } = 0; + + public byte Confidence { get; set; } = 0; + + public OffsetWithConfidence() + { + + } + + public OffsetWithConfidence(long value, byte confidence) + { + this.Value = value; + this.Confidence = confidence; + } + + internal static OffsetWithConfidence FromNative(BNOffsetWithConfidence raw) + { + return new OffsetWithConfidence(raw.value , raw.confidence); + } + + public BNOffsetWithConfidence ToNative() + { + return new BNOffsetWithConfidence() + { + value = this.Value , + confidence = this.Confidence + }; + } + } +} \ No newline at end of file diff --git a/Struct/BNParameterVariablesWithConfidence.cs b/Struct/BNParameterVariablesWithConfidence.cs new file mode 100644 index 0000000..13c2989 --- /dev/null +++ b/Struct/BNParameterVariablesWithConfidence.cs @@ -0,0 +1,59 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNParameterVariablesWithConfidence + { + /// + /// BNVariable* vars + /// + internal IntPtr variables; + + /// + /// uint64_t count + /// + internal ulong count; + + /// + /// uint8_t confidence + /// + internal byte confidence; + } + + public class ParameterVariablesWithConfidence + { + public Variable[] Variables { get; set; } = Array.Empty(); + + public byte Confidence { get; set; } = 0; + + internal ParameterVariablesWithConfidence( + Function function, + BNParameterVariablesWithConfidence native) + { + this.Variables = UnsafeUtils.ReadStructArray( + native.variables , + native.count , + ( _variable) => { return Variable.FromNativeEx(function , _variable);} + ); + + this.Confidence = native.confidence; + } + + public BNParameterVariablesWithConfidence ToNativeEx(ScopedAllocator allocator) + { + return new BNParameterVariablesWithConfidence() + { + variables = allocator.AllocStructArray( + UnsafeUtils.ConvertToNativeArray( + this.Variables + )) , + count = (ulong)this.Variables.Length , + confidence = this.Confidence + }; + } + } +} \ No newline at end of file diff --git a/Struct/BNParsedType.cs b/Struct/BNParsedType.cs new file mode 100644 index 0000000..2f38f4a --- /dev/null +++ b/Struct/BNParsedType.cs @@ -0,0 +1,60 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNParsedType + { + /// + /// BNQualifiedName name + /// + internal BNQualifiedName name; + + /// + /// BNType* type + /// + internal IntPtr type; + + /// + /// bool isUser + /// + internal bool isUser; + } + + public sealed class ParsedType : INativeWrapperEx + { + public QualifiedName Name { get; set; } = new QualifiedName(); + + public BinaryNinja.Type? Type { get; set; } = null; + + public bool IsUser { get; set; } = false; + + public ParsedType() + { + + } + + internal static ParsedType FromNative(BNParsedType native) + { + return new ParsedType() + { + Name = QualifiedName.FromNative(native.name) , + Type = BinaryNinja.Type.NewFromHandle(native.type), + IsUser = native.isUser + }; + } + + public BNParsedType ToNativeEx(ScopedAllocator allocator) + { + return new BNParsedType() + { + name = this.Name.ToNativeEx(allocator) , + type = ( null == this.Type ? IntPtr.Zero : this.Type.DangerousGetHandle() ) , + isUser = this.IsUser + }; + } + } +} \ No newline at end of file diff --git a/Struct/BNPendingBasicBlockEdge.cs b/Struct/BNPendingBasicBlockEdge.cs new file mode 100644 index 0000000..e7bf522 --- /dev/null +++ b/Struct/BNPendingBasicBlockEdge.cs @@ -0,0 +1,61 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNPendingBasicBlockEdge + { + /// + /// BNBranchType type + /// + public BranchType type; + + /// + /// BNArchitecture* arch + /// + public IntPtr arch; + + /// + /// uint64_t target + /// + public ulong target; + + /// + /// bool fallThrough + /// + public bool fallThrough; + } + + public sealed class PendingBasicBlockEdge + { + public BranchType Type { get; set; } = BranchType.UnconditionalBranch; + + public Architecture? Architecture { get; set; } = null; + + public ulong Target { get; set; } = 0; + + public bool FallThrough { get; set; } = false; + + internal PendingBasicBlockEdge(BNPendingBasicBlockEdge native) + { + this.Type = native.type; + + if (IntPtr.Zero != native.arch) + { + this.Architecture = new Architecture(native.arch); + } + + this.Target = native.target; + + this.FallThrough = native.fallThrough; + } + + internal static PendingBasicBlockEdge FromNative(BNPendingBasicBlockEdge native) + { + return new PendingBasicBlockEdge(native); + } + } +} \ No newline at end of file diff --git a/Struct/BNPerformanceInfo.cs b/Struct/BNPerformanceInfo.cs new file mode 100644 index 0000000..7d474a3 --- /dev/null +++ b/Struct/BNPerformanceInfo.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNPerformanceInfo + { + + /// + /// const char* name + /// + public IntPtr name; + + /// + /// double seconds + /// + public double seconds; + + } + + public sealed class PerformanceInfo + { + + /// + /// const char* name + /// + public string Name { get; set; } = string.Empty; + + /// + /// double seconds + /// + public double Seconds { get; set; } = 0; + + + public PerformanceInfo() + { + + } + } +} \ No newline at end of file diff --git a/Struct/BNPluginCommand.cs b/Struct/BNPluginCommand.cs new file mode 100644 index 0000000..5b5c794 --- /dev/null +++ b/Struct/BNPluginCommand.cs @@ -0,0 +1,2573 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNPluginCommand + { + /// + /// void (*defaultCommand)(void* ctxt, BNBinaryView* view); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate void DefaultCommandDelegate( + IntPtr ctxt, + IntPtr view + ); + + /// + /// void (*addressCommand)(void* ctxt, BNBinaryView* view, uint64_t addr); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate void AddressCommandDelegate( + IntPtr ctxt, + IntPtr view, + ulong address + ); + + /// + /// void (*rangeCommand)(void* ctxt, BNBinaryView* view, uint64_t addr, uint64_t len); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate void RangeCommandDelegate( + IntPtr ctxt, + IntPtr view, + ulong address, + ulong length + ); + + /// + /// void (*functionCommand)(void* ctxt, BNBinaryView* view, BNFunction* func); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate void FunctionCommandDelegate( + IntPtr ctxt, + IntPtr view, + IntPtr function + ); + + /// + /// void (*lowLevelILFunctionCommand)(void* ctxt, BNBinaryView* view, BNLowLevelILFunction* func); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate void LowLevelILFunctionCommandDelegate( + IntPtr ctxt, + IntPtr view, + IntPtr function + ); + + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate bool LowLevelILFunctionIsValidDelegate( + IntPtr ctxt, + IntPtr view, + IntPtr function + ); + + /// + /// void (*lowLevelILInstructionCommand)(void* ctxt, BNBinaryView* view, BNLowLevelILFunction* func, size_t instr); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate void LowLevelILInstructionCommandDelegate( + IntPtr ctxt, + IntPtr view, + IntPtr function, + ulong instruction + ); + + /// + /// void (*mediumLevelILFunctionCommand)(void* ctxt, BNBinaryView* view, BNMediumLevelILFunction* func); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate void MediumLevelILFunctionCommandDelegate( + IntPtr ctxt, + IntPtr view, + IntPtr function + ); + + /// + /// void (*mediumLevelILInstructionCommand)(void* ctxt, BNBinaryView* view, BNMediumLevelILFunction* func); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate void MediumLevelILInstructionCommandDelegate( + IntPtr ctxt, + IntPtr view, + IntPtr function, + ulong instruction + ); + + /// + /// void (*highLevelILFunctionCommand)(void* ctxt, BNBinaryView* view, BNHighLevelILFunction* func); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate void HighLevelILFunctionCommandDelegate( + IntPtr ctxt, + IntPtr view, + IntPtr function + ); + + /// + /// void (*highLevelILInstructionCommand)(void* ctxt, BNBinaryView* view, BNHighLevelILFunction* func, size_t instr); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate void HighLevelILInstructionCommandDelegate( + IntPtr ctxt, + IntPtr view, + IntPtr function, + ulong instruction + ); + + /// + /// void (*projectCommand)(void* ctxt, BNProject* view); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate void ProjectCommandDelegate( + IntPtr ctxt, + IntPtr view + ); + + /// + /// bool (*defaultIsValid)(void* ctxt, BNBinaryView* view); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate bool DefaultIsValidDelegate( + IntPtr ctxt, + IntPtr view + ); + + /// + /// bool (*addressIsValid)(void* ctxt, BNBinaryView* view, uint64_t addr); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate bool AddressIsValidDelegate( + IntPtr ctxt, + IntPtr view, + ulong address + ); + + /// + /// bool (*rangeIsValid)(void* ctxt, BNBinaryView* view, uint64_t addr, uint64_t len); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate bool RangeIsValidDelegate( + IntPtr ctxt, + IntPtr view, + ulong address, + ulong length + ); + + /// + /// bool (*functionIsValid)(void* ctxt, BNBinaryView* view, BNFunction* func); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate bool FunctionIsValidDelegate( + IntPtr ctxt, + IntPtr view, + IntPtr function + ); + + /// + /// bool (*lowLevelILFunctionIsValid)(void* ctxt, BNBinaryView* view, BNLowLevelILFunction* func); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate bool LowLevelILFunctionIsValiddDelegate( + IntPtr ctxt, + IntPtr view, + IntPtr function + ); + + /// + /// bool (*lowLevelILInstructionIsValid)(void* ctxt, BNBinaryView* view, BNLowLevelILFunction* func, size_t instr); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate bool LowLevelILInstructionIsValidDelegate( + IntPtr ctxt, + IntPtr view, + IntPtr function, + ulong instruction + ); + + /// + /// bool (*mediumLevelILFunctionIsValid)(void* ctxt, BNBinaryView* view, BNMediumLevelILFunction* func); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate bool MediumLevelILFunctionIsValidDelegate( + IntPtr ctxt, + IntPtr view, + IntPtr function + ); + + /// + /// bool (*mediumLevelILInstructionIsValid)(void* ctxt, BNBinaryView* view, BNMediumLevelILFunction* func, size_t instr); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate bool MediumLevelILInstructionIsValidDelegate( + IntPtr ctxt, + IntPtr view, + IntPtr function, + ulong instruction + ); + + /// + /// bool (*highLevelILFunctionIsValid)(void* ctxt, BNBinaryView* view, BNHighLevelILFunction* func) + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate bool HighLevelILFunctionIsValidDelegate( + IntPtr ctxt, + IntPtr view, + IntPtr function + ); + + /// + /// bool (*highLevelILInstructionIsValid)(void* ctxt, BNBinaryView* view, BNHighLevelILFunction* func, size_t instr); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate bool HighLevelILInstructionIsValidDelegate( + IntPtr ctxt, + IntPtr view, + IntPtr function, + ulong instruction + ); + + /// + /// bool (*projectIsValid)(void* ctxt, BNProject* view); + /// + [UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)] + internal unsafe delegate bool ProjectIsValidDelegate( + IntPtr ctxt, + IntPtr view + ); + + /// + /// const char* name + /// + internal IntPtr name; + + /// + /// const char* description + /// + internal IntPtr description; + + /// + /// BNPluginCommandType type + /// + internal PluginCommandType type; + + /// + /// void* context + /// + internal IntPtr context; + + /// + /// void* defaultCommand + /// + internal IntPtr defaultCommand; + + /// + /// void* addressCommand + /// + internal IntPtr addressCommand; + + /// + /// void* rangeCommand + /// + internal IntPtr rangeCommand; + + /// + /// void* functionCommand + /// + internal IntPtr functionCommand; + + /// + /// void* lowLevelILFunctionCommand + /// + internal IntPtr lowLevelILFunctionCommand; + + /// + /// void* lowLevelILInstructionCommand + /// + internal IntPtr lowLevelILInstructionCommand; + + /// + /// void* mediumLevelILFunctionCommand + /// + internal IntPtr mediumLevelILFunctionCommand; + + /// + /// void* mediumLevelILInstructionCommand + /// + internal IntPtr mediumLevelILInstructionCommand; + + /// + /// void* highLevelILFunctionCommand + /// + internal IntPtr highLevelILFunctionCommand; + + /// + /// void* highLevelILInstructionCommand + /// + internal IntPtr highLevelILInstructionCommand; + + /// + /// void* projectCommand + /// + internal IntPtr projectCommand; + + /// + /// void* defaultIsValid + /// + internal IntPtr defaultIsValid; + + /// + /// void* addressIsValid + /// + internal IntPtr addressIsValid; + + /// + /// void* rangeIsValid + /// + internal IntPtr rangeIsValid; + + /// + /// void* functionIsValid + /// + internal IntPtr functionIsValid; + + /// + /// void* lowLevelILFunctionIsValid + /// + internal IntPtr lowLevelILFunctionIsValid; + + /// + /// void* lowLevelILInstructionIsValid + /// + internal IntPtr lowLevelILInstructionIsValid; + + /// + /// void* mediumLevelILFunctionIsValid + /// + internal IntPtr mediumLevelILFunctionIsValid; + + /// + /// void* mediumLevelILInstructionIsValid + /// + internal IntPtr mediumLevelILInstructionIsValid; + + /// + /// void* highLevelILFunctionIsValid + /// + internal IntPtr highLevelILFunctionIsValid; + + /// + /// void* highLevelILInstructionIsValid + /// + internal IntPtr highLevelILInstructionIsValid; + + /// + /// void* projectIsValid + /// + internal IntPtr projectIsValid; + } + + public sealed class PluginCommand + { + public delegate void DefaultCommandDelegate( + BinaryView view + ); + + public delegate void AddressCommandDelegate( + BinaryView view, + ulong address + ); + + public delegate void RangeCommandDelegate( + BinaryView view, + ulong address, + ulong length + ); + + public delegate void FunctionCommandDelegate( + BinaryView view, + Function function + ); + + public delegate void LowLevelILFunctionCommandDelegate( + BinaryView view, + LowLevelILFunction function + ); + + public delegate void LowLevelILInstructionCommandDelegate( + BinaryView view, + LowLevelILFunction function, + ulong instruction + ); + + public delegate void MediumLevelILFunctionCommandDelegate( + BinaryView view, + MediumLevelILFunction function + ); + + public delegate void MediumLevelILInstructionCommandDelegate( + BinaryView view, + MediumLevelILFunction function, + ulong instruction + ); + + public delegate void HighLevelILFunctionCommandDelegate( + BinaryView view, + HighLevelILFunction function + ); + + public delegate void HighLevelILInstructionCommandDelegate( + BinaryView view, + HighLevelILFunction function, + ulong instruction + ); + + public delegate void ProjectCommandDelegate( + Project project + ); + + public delegate bool DefaultIsValidDelegate( + BinaryView view + ); + + public delegate bool AddressIsValidDelegate( + BinaryView view, + ulong address + ); + + public delegate bool RangeIsValidDelegate( + BinaryView view, + ulong address, + ulong length + ); + + public delegate bool FunctionIsValidDelegate( + BinaryView view, + Function function + ); + + public delegate bool LowLevelILFunctionIsValidDelegate( + BinaryView view, + LowLevelILFunction function + ); + + public delegate bool LowLevelILInstructionIsValidDelegate( + BinaryView view, + LowLevelILFunction function, + ulong instruction + ); + + public delegate bool MediumLevelILFunctionIsValidDelegate( + BinaryView view, + MediumLevelILFunction function + ); + + public delegate bool MediumLevelILInstructionIsValidDelegate( + BinaryView view, + MediumLevelILFunction function, + ulong instruction + ); + + public delegate bool HighLevelILFunctionIsValidDelegate( + BinaryView view, + HighLevelILFunction function + ); + + public delegate bool HighLevelILInstructionIsValidDelegate( + BinaryView view, + HighLevelILFunction function, + ulong instruction + ); + + public delegate bool ProjectIsValidDelegate( + Project project + ); + + public string Name { get; private set; } = string.Empty; + + public string Description { get; private set; } = string.Empty; + + public PluginCommandType Type { get; private set; } = PluginCommandType.DefaultPluginCommand; + + public DefaultCommandDelegate? DefaultCommand { get; private set; } = null; + + public AddressCommandDelegate? AddressCommand{ get; private set; } = null; + + public RangeCommandDelegate? RangeCommand{ get; private set; } = null; + + public FunctionCommandDelegate? FunctionCommand{ get; private set; } = null; + + public LowLevelILFunctionCommandDelegate? LowLevelILFunctionCommand{ get; private set; } = null; + + public LowLevelILInstructionCommandDelegate? LowLevelILInstructionCommand{ get; private set; } = null; + + public MediumLevelILFunctionCommandDelegate? MediumLevelILFunctionCommand{ get; private set; } = null; + + public MediumLevelILInstructionCommandDelegate? MediumLevelILInstructionCommand{ get; private set; } = null; + + public HighLevelILFunctionCommandDelegate? HighLevelILFunctionCommand{ get; private set; } = null; + + public HighLevelILInstructionCommandDelegate? HighLevelILInstructionCommand{ get; private set; } = null; + + public ProjectCommandDelegate? ProjectCommand{ get; private set; } = null; + + public DefaultIsValidDelegate? DefaultIsValid{ get; private set; } = null; + + public AddressIsValidDelegate? AddressIsValid{ get; private set; } = null; + + public RangeIsValidDelegate? RangeIsValid{ get; private set; } = null; + + public FunctionIsValidDelegate? FunctionIsValid{ get; private set; } = null; + + public LowLevelILFunctionIsValidDelegate? LowLevelILFunctionIsValid{ get; private set; } = null; + + public LowLevelILInstructionIsValidDelegate? LowLevelILInstructionIsValid{ get; private set; } = null; + + public MediumLevelILFunctionIsValidDelegate? MediumLevelILFunctionIsValid{ get; private set; } = null; + + public MediumLevelILInstructionIsValidDelegate? MediumLevelILInstructionIsValid{ get; private set; } = null; + + public HighLevelILFunctionIsValidDelegate? HighLevelILFunctionIsValid{ get; private set; } = null; + + public HighLevelILInstructionIsValidDelegate? HighLevelILInstructionIsValid{ get; private set; } = null; + + public ProjectIsValidDelegate? ProjectIsValid{ get; private set; } = null; + + #region native + + /// + /// void* defaultCommand + /// + private BNPluginCommand.DefaultCommandDelegate? m_defaultCommand; + + /// + /// void* addressCommand + /// + private BNPluginCommand.AddressCommandDelegate? m_addressCommand; + + /// + /// void* rangeCommand + /// + private BNPluginCommand.RangeCommandDelegate? m_rangeCommand; + + /// + /// void* functionCommand + /// + private BNPluginCommand.FunctionCommandDelegate? m_functionCommand; + + /// + /// void* lowLevelILFunctionCommand + /// + private BNPluginCommand.LowLevelILFunctionCommandDelegate? m_lowLevelILFunctionCommand; + + /// + /// void* lowLevelILInstructionCommand + /// + private BNPluginCommand.LowLevelILInstructionCommandDelegate? m_lowLevelILInstructionCommand; + + /// + /// void* mediumLevelILFunctionCommand + /// + private BNPluginCommand.MediumLevelILFunctionCommandDelegate? m_mediumLevelILFunctionCommand; + + /// + /// void* mediumLevelILInstructionCommand + /// + private BNPluginCommand.MediumLevelILInstructionCommandDelegate? m_mediumLevelILInstructionCommand; + + /// + /// void* highLevelILFunctionCommand + /// + private BNPluginCommand.HighLevelILFunctionCommandDelegate? m_highLevelILFunctionCommand; + + /// + /// void* highLevelILInstructionCommand + /// + private BNPluginCommand.HighLevelILInstructionCommandDelegate? m_highLevelILInstructionCommand; + + /// + /// void* projectCommand + /// + private BNPluginCommand.ProjectCommandDelegate? m_projectCommand; + + /// + /// void* defaultIsValid + /// + private BNPluginCommand.DefaultIsValidDelegate? m_defaultIsValid; + + /// + /// void* addressIsValid + /// + private BNPluginCommand.AddressIsValidDelegate? m_addressIsValid; + + /// + /// void* rangeIsValid + /// + private BNPluginCommand.RangeIsValidDelegate? m_rangeIsValid; + + /// + /// void* functionIsValid + /// + private BNPluginCommand.FunctionIsValidDelegate? m_functionIsValid; + + /// + /// void* lowLevelILFunctionIsValid + /// + private BNPluginCommand.LowLevelILFunctionIsValiddDelegate? m_lowLevelILFunctionIsValid; + + /// + /// void* lowLevelILInstructionIsValid + /// + private BNPluginCommand.LowLevelILInstructionIsValidDelegate? m_lowLevelILInstructionIsValid; + + /// + /// void* mediumLevelILFunctionIsValid + /// + private BNPluginCommand.MediumLevelILFunctionIsValidDelegate? m_mediumLevelILFunctionIsValid; + + /// + /// void* mediumLevelILInstructionIsValid + /// + private BNPluginCommand.MediumLevelILInstructionIsValidDelegate? m_mediumLevelILInstructionIsValid; + + /// + /// void* highLevelILFunctionIsValid + /// + private BNPluginCommand.HighLevelILFunctionIsValidDelegate? m_highLevelILFunctionIsValid; + + /// + /// void* highLevelILInstructionIsValid + /// + private BNPluginCommand.HighLevelILInstructionIsValidDelegate? m_highLevelILInstructionIsValid; + + /// + /// void* projectIsValid + /// + private BNPluginCommand.ProjectIsValidDelegate? m_projectIsValid; + + #endregion native + + public PluginCommand() + { + + } + + internal static PluginCommand FromNative(BNPluginCommand native) + { + PluginCommand command = new PluginCommand() + { + Name = UnsafeUtils.ReadAnsiString(native.name) , + Description = UnsafeUtils.ReadAnsiString(native.description) , + Type = native.type + }; + + if (PluginCommandType.DefaultPluginCommand == native.type) + { + if (IntPtr.Zero != native.defaultCommand) + { + command.m_defaultCommand = Marshal.GetDelegateForFunctionPointer( + native.defaultCommand + ); + + command.DefaultCommand = command.DefaultCommandBridge; + } + + if (IntPtr.Zero != native.defaultIsValid) + { + command.m_defaultIsValid = + Marshal.GetDelegateForFunctionPointer( + native.defaultIsValid + ); + + command.DefaultIsValid = command.DefaultIsValidBridge; + } + } + + if (PluginCommandType.AddressPluginCommand == native.type) + { + + if ( IntPtr.Zero != native.addressCommand ) + { + command.m_addressCommand = Marshal.GetDelegateForFunctionPointer( + native.addressCommand + ); + + command.AddressCommand = command.AddressCommandBridge; + } + + if ( IntPtr.Zero != native.addressIsValid ) + { + command.m_addressIsValid = + Marshal.GetDelegateForFunctionPointer( + native.addressIsValid + ); + + command.AddressIsValid = command.AddressIsValidBridge; + } + } + else if (PluginCommandType.RangePluginCommand == native.type) + { + + if ( IntPtr.Zero != native.rangeCommand ) + { + command.m_rangeCommand = Marshal.GetDelegateForFunctionPointer( + native.rangeCommand + ); + + command.RangeCommand = command.RangeCommandBridge; + } + + if ( IntPtr.Zero != native.rangeIsValid ) + { + command.m_rangeIsValid = + Marshal.GetDelegateForFunctionPointer( + native.rangeIsValid + ); + + command.RangeIsValid = command.RangeIsValidBridge; + } + } + else if (PluginCommandType.FunctionPluginCommand == native.type) + { + if ( IntPtr.Zero != native.functionCommand ) + { + command.m_functionCommand = + Marshal.GetDelegateForFunctionPointer( + native.functionCommand + ); + + command.FunctionCommand = command.FunctionCommandBridge; + } + + if ( IntPtr.Zero != native.functionIsValid ) + { + command.m_functionIsValid = + Marshal.GetDelegateForFunctionPointer( + native.functionIsValid + ); + + command.FunctionIsValid = command.FunctionIsValidBridge; + } + } + else if (PluginCommandType.LowLevelILFunctionPluginCommand == native.type) + { + if ( IntPtr.Zero != native.lowLevelILFunctionCommand ) + { + command.m_lowLevelILFunctionCommand = Marshal.GetDelegateForFunctionPointer( + native.lowLevelILFunctionCommand + ); + + command.LowLevelILFunctionCommand = command.LowLevelILFunctionCommandBridge; + } + + if ( IntPtr.Zero != native.lowLevelILFunctionIsValid ) + { + command.m_lowLevelILFunctionIsValid = Marshal + .GetDelegateForFunctionPointer( + native.lowLevelILFunctionIsValid + ); + + command.LowLevelILFunctionIsValid = command.LowLevelILFunctionIsValidBridge; + } + } + else if (PluginCommandType.LowLevelILInstructionPluginCommand == native.type) + { + if ( IntPtr.Zero != native.lowLevelILInstructionCommand ) + { + command.m_lowLevelILInstructionCommand = Marshal + .GetDelegateForFunctionPointer( + native.lowLevelILInstructionCommand + ); + + command.LowLevelILInstructionCommand = command.LowLevelILInstructionCommandBridge; + } + + if ( IntPtr.Zero != native.lowLevelILInstructionIsValid ) + { + command.m_lowLevelILInstructionIsValid = Marshal + .GetDelegateForFunctionPointer( + native.lowLevelILInstructionIsValid + ); + + command.LowLevelILInstructionIsValid = command.LowLevelILInstructionIsValidBridge; + } + } + else if (PluginCommandType.MediumLevelILFunctionPluginCommand == native.type) + { + if ( IntPtr.Zero != native.mediumLevelILFunctionCommand ) + { + command.m_mediumLevelILFunctionCommand = Marshal + .GetDelegateForFunctionPointer( + native.mediumLevelILFunctionCommand + ); + + command.MediumLevelILFunctionCommand = command.MediumLevelILFunctionCommandBridge; + } + + if ( IntPtr.Zero != native.mediumLevelILFunctionIsValid ) + { + command.m_mediumLevelILFunctionIsValid = Marshal + .GetDelegateForFunctionPointer( + native.mediumLevelILFunctionIsValid + ); + + command.MediumLevelILFunctionIsValid = command.MediumLevelILFunctionIsValidBridge; + } + } + else if (PluginCommandType.MediumLevelILInstructionPluginCommand == native.type) + { + if ( IntPtr.Zero != native.mediumLevelILInstructionCommand ) + { + command.m_mediumLevelILInstructionCommand = Marshal + .GetDelegateForFunctionPointer( + native.mediumLevelILInstructionCommand + ); + + command.MediumLevelILInstructionCommand = command.MediumLevelILInstructionCommandBridge; + } + + if ( IntPtr.Zero != native.mediumLevelILInstructionIsValid ) + { + command.m_mediumLevelILInstructionIsValid = Marshal + .GetDelegateForFunctionPointer( + native.mediumLevelILInstructionIsValid + ); + + command.MediumLevelILInstructionIsValid = command.MediumLevelILInstructionIsValidBridge; + } + } + else if (PluginCommandType.HighLevelILFunctionPluginCommand == native.type) + { + if ( IntPtr.Zero != native.highLevelILFunctionCommand ) + { + command.m_highLevelILFunctionCommand = Marshal + .GetDelegateForFunctionPointer( + native.highLevelILFunctionCommand + ); + + command.HighLevelILFunctionCommand = command.HighLevelILFunctionCommandBridge; + } + + if ( IntPtr.Zero != native.highLevelILFunctionIsValid ) + { + command.m_highLevelILFunctionIsValid = Marshal + .GetDelegateForFunctionPointer( + native.highLevelILFunctionIsValid + ); + + command.HighLevelILFunctionIsValid = command.HighLevelILFunctionIsValidBridge; + } + } + else if (PluginCommandType.HighLevelILInstructionPluginCommand == native.type) + { + if ( IntPtr.Zero != native.highLevelILInstructionCommand ) + { + command.m_highLevelILInstructionCommand = Marshal + .GetDelegateForFunctionPointer( + native.highLevelILInstructionCommand + ); + + command.HighLevelILInstructionCommand = command.HighLevelILInstructionCommandBridge; + } + + if ( IntPtr.Zero != native.highLevelILInstructionIsValid ) + { + command.m_highLevelILInstructionIsValid = Marshal + .GetDelegateForFunctionPointer( + native.highLevelILInstructionIsValid + ); + + command.HighLevelILInstructionIsValid = command.HighLevelILInstructionIsValidBridge; + } + + } + else if (PluginCommandType.ProjectPluginCommand == native.type) + { + if ( IntPtr.Zero != native.projectCommand ) + { + command.m_projectCommand = + Marshal.GetDelegateForFunctionPointer( + native.projectCommand + ); + + command.ProjectCommand = command.ProjectCommandBridge; + } + + if ( IntPtr.Zero != native.projectIsValid ) + { + command.m_projectIsValid = + Marshal.GetDelegateForFunctionPointer( + native.projectIsValid + ); + + command.ProjectIsValid = command.ProjectIsValidBridge; + } + } + + return command; + } + + + private void DefaultCommandBridge( + BinaryView view + ) + { + if (null == this.m_defaultCommand) + { + throw new ArgumentNullException(nameof(this.m_defaultCommand)); + } + + // void (*defaultCommand)(void* ctxt, BNBinaryView* view); + this.m_defaultCommand( + IntPtr.Zero, + view.DangerousGetHandle() + ); + } + + + private void AddressCommandBridge( + BinaryView view , + ulong address + ) + { + if (null == this.m_addressCommand) + { + throw new ArgumentNullException(nameof(this.m_addressCommand)); + } + + // void (*addressCommand)(void* ctxt, BNBinaryView* view, uint64_t addr); + this.m_addressCommand( + IntPtr.Zero, + view.DangerousGetHandle(), + address + ); + } + + private void RangeCommandBridge( + BinaryView view , + ulong address , + ulong length + ) + { + if (null == this.m_rangeCommand) + { + throw new ArgumentNullException(nameof(this.m_rangeCommand)); + } + + // void (*rangeCommand)(void* ctxt, BNBinaryView* view, uint64_t addr, uint64_t len); + this.m_rangeCommand( + IntPtr.Zero, + view.DangerousGetHandle(), + address, + length + ); + } + + + private void FunctionCommandBridge( + BinaryView view , + Function function + ) + { + if (null == this.m_functionCommand) + { + throw new ArgumentNullException(nameof(this.m_functionCommand)); + } + + // void (*functionCommand)(void* ctxt, BNBinaryView* view, BNFunction* func); + this.m_functionCommand( + IntPtr.Zero, + view.DangerousGetHandle(), + function.DangerousGetHandle() + ); + } + + private void LowLevelILFunctionCommandBridge( + BinaryView view , + LowLevelILFunction function + ) + { + if (null == this.m_lowLevelILFunctionCommand) + { + throw new ArgumentNullException(nameof(this.m_lowLevelILFunctionCommand)); + } + + // void (*lowLevelILFunctionCommand)(void* ctxt, BNBinaryView* view, BNLowLevelILFunction* func); + this.m_lowLevelILFunctionCommand( + IntPtr.Zero, + view.DangerousGetHandle(), + function.DangerousGetHandle() + ); + } + + private void LowLevelILInstructionCommandBridge( + BinaryView view , + LowLevelILFunction function , + ulong instruction + ) + { + if (null == this.m_lowLevelILInstructionCommand) + { + throw new ArgumentNullException(nameof(this.m_lowLevelILInstructionCommand)); + } + + // void (*lowLevelILInstructionCommand)(void* ctxt, BNBinaryView* view, BNLowLevelILFunction* func, size_t instr); + this.m_lowLevelILInstructionCommand( + IntPtr.Zero, + view.DangerousGetHandle(), + function.DangerousGetHandle(), + instruction + ); + } + + private void MediumLevelILFunctionCommandBridge( + BinaryView view , + MediumLevelILFunction function + ) + { + if (null == this.m_mediumLevelILFunctionCommand) + { + throw new ArgumentNullException(nameof(this.m_mediumLevelILFunctionCommand)); + } + + // void (*mediumLevelILFunctionCommand)(void* ctxt, BNBinaryView* view, BNMediumLevelILFunction* func); + this.m_mediumLevelILFunctionCommand( + IntPtr.Zero, + view.DangerousGetHandle(), + function.DangerousGetHandle() + ); + } + + private void MediumLevelILInstructionCommandBridge( + BinaryView view , + MediumLevelILFunction function , + ulong instruction + ) + { + if (null == this.m_mediumLevelILInstructionCommand) + { + throw new ArgumentNullException(nameof(this.m_mediumLevelILInstructionCommand)); + } + + // void (*mediumLevelILInstructionCommand)(void* ctxt, BNBinaryView* view, BNMediumLevelILFunction* func); + this.m_mediumLevelILInstructionCommand( + IntPtr.Zero, + view.DangerousGetHandle(), + function.DangerousGetHandle(), + instruction + ); + } + + private void HighLevelILFunctionCommandBridge( + BinaryView view , + HighLevelILFunction function + ) + { + if (null == this.m_highLevelILFunctionCommand) + { + throw new ArgumentNullException(nameof(this.m_highLevelILFunctionCommand)); + } + + // void (*highLevelILFunctionCommand)(void* ctxt, BNBinaryView* view, BNHighLevelILFunction* func); + this.m_highLevelILFunctionCommand( + IntPtr.Zero, + view.DangerousGetHandle(), + function.DangerousGetHandle() + ); + } + + private void HighLevelILInstructionCommandBridge( + BinaryView view , + HighLevelILFunction function , + ulong instruction + ) + { + if (null == this.m_highLevelILInstructionCommand) + { + throw new ArgumentNullException(nameof(this.m_highLevelILInstructionCommand)); + } + + // void (*highLevelILInstructionCommand)(void* ctxt, BNBinaryView* view, BNHighLevelILFunction* func, size_t instr); + this.m_highLevelILInstructionCommand( + IntPtr.Zero, + view.DangerousGetHandle(), + function.DangerousGetHandle(), + instruction + ); + } + + private void ProjectCommandBridge( + Project project + ) + { + if (null == this.m_projectCommand) + { + throw new ArgumentNullException(nameof(this.m_projectCommand)); + } + + // void (*projectCommand)(void* ctxt, BNProject* view); + this.m_projectCommand( + IntPtr.Zero, + project.DangerousGetHandle() + ); + } + + + private bool DefaultIsValidBridge( + BinaryView view + ) + { + if (null == this.m_defaultIsValid) + { + throw new ArgumentNullException(nameof(this.m_defaultIsValid)); + } + + // bool (*defaultIsValid)(void* ctxt, BNBinaryView* view); + return this.m_defaultIsValid( + IntPtr.Zero, + view.DangerousGetHandle() + ); + } + + private bool AddressIsValidBridge( + BinaryView view , + ulong address + ) + { + if (null == this.m_addressIsValid) + { + throw new ArgumentNullException(nameof(this.m_addressIsValid)); + } + + // bool (*addressIsValid)(void* ctxt, BNBinaryView* view, uint64_t addr); + return this.m_addressIsValid( + IntPtr.Zero, + view.DangerousGetHandle(), + address + ); + } + + private bool RangeIsValidBridge( + BinaryView view , + ulong address , + ulong length + ) + { + if (null == this.m_rangeIsValid) + { + throw new ArgumentNullException(nameof(this.m_rangeIsValid)); + } + + // bool (*rangeIsValid)(void* ctxt, BNBinaryView* view, uint64_t addr, uint64_t len); + return this.m_rangeIsValid( + IntPtr.Zero, + view.DangerousGetHandle(), + address, + length + ); + } + + private bool FunctionIsValidBridge( + BinaryView view , + Function function + ) + { + if (null == this.m_functionIsValid) + { + throw new ArgumentNullException(nameof(this.m_functionIsValid)); + } + + // bool (*functionIsValid)(void* ctxt, BNBinaryView* view, BNFunction* func); + return this.m_functionIsValid( + IntPtr.Zero, + view.DangerousGetHandle(), + function.DangerousGetHandle() + ); + } + + + private bool LowLevelILFunctionIsValidBridge( + BinaryView view , + LowLevelILFunction function + ) + { + if (null == this.m_lowLevelILFunctionIsValid) + { + throw new ArgumentNullException(nameof(this.m_lowLevelILFunctionIsValid)); + } + + // bool (*lowLevelILFunctionIsValid)(void* ctxt, BNBinaryView* view, BNLowLevelILFunction* func); + return this.m_lowLevelILFunctionIsValid( + IntPtr.Zero, + view.DangerousGetHandle(), + function.DangerousGetHandle() + ); + } + + private bool LowLevelILInstructionIsValidBridge( + BinaryView view , + LowLevelILFunction function , + ulong instruction + ) + { + if (null == this.m_lowLevelILInstructionIsValid) + { + throw new ArgumentNullException(nameof(this.m_lowLevelILInstructionIsValid)); + } + + // bool (*lowLevelILInstructionIsValid)(void* ctxt, BNBinaryView* view, BNLowLevelILFunction* func, size_t instr); + return this.m_lowLevelILInstructionIsValid( + IntPtr.Zero, + view.DangerousGetHandle(), + function.DangerousGetHandle(), + instruction + ); + } + + private bool MediumLevelILFunctionIsValidBridge( + BinaryView view , + MediumLevelILFunction function + ) + { + if (null == this.m_mediumLevelILFunctionIsValid) + { + throw new ArgumentNullException(nameof(this.m_mediumLevelILFunctionIsValid)); + } + + // bool (*mediumLevelILFunctionIsValid)(void* ctxt, BNBinaryView* view, BNMediumLevelILFunction* func); + return this.m_mediumLevelILFunctionIsValid( + IntPtr.Zero, + view.DangerousGetHandle(), + function.DangerousGetHandle() + ); + } + + private bool MediumLevelILInstructionIsValidBridge( + BinaryView view , + MediumLevelILFunction function , + ulong instruction + ) + { + if (null == this.m_mediumLevelILInstructionIsValid) + { + throw new ArgumentNullException(nameof(this.m_mediumLevelILInstructionIsValid)); + } + + // bool (*mediumLevelILInstructionIsValid)(void* ctxt, BNBinaryView* view, BNMediumLevelILFunction* func, size_t instr); + return this.m_mediumLevelILInstructionIsValid( + IntPtr.Zero, + view.DangerousGetHandle(), + function.DangerousGetHandle(), + instruction + ); + } + + private bool HighLevelILFunctionIsValidBridge( + BinaryView view , + HighLevelILFunction function + ) + { + if (null == this.m_highLevelILFunctionIsValid) + { + throw new ArgumentNullException(nameof(this.m_highLevelILFunctionIsValid)); + } + + // bool (*highLevelILFunctionIsValid)(void* ctxt, BNBinaryView* view, BNHighLevelILFunction* func) + return this.m_highLevelILFunctionIsValid( + IntPtr.Zero, + view.DangerousGetHandle(), + function.DangerousGetHandle() + ); + } + + private bool HighLevelILInstructionIsValidBridge( + BinaryView view , + HighLevelILFunction function , + ulong instruction + ) + { + if (null == this.m_highLevelILInstructionIsValid) + { + throw new ArgumentNullException(nameof(this.m_highLevelILInstructionIsValid)); + } + + // bool (*highLevelILInstructionIsValid)(void* ctxt, BNBinaryView* view, BNHighLevelILFunction* func, size_t instr); + return this.m_highLevelILInstructionIsValid( + IntPtr.Zero, + view.DangerousGetHandle(), + function.DangerousGetHandle(), + instruction + ); + } + + private bool ProjectIsValidBridge(Project project) + { + if (null == this.m_projectIsValid) + { + throw new ArgumentNullException(nameof(this.m_projectIsValid)); + } + + // bool (*projectIsValid)(void* ctxt, BNProject* view); + return this.m_projectIsValid( + IntPtr.Zero, + project.DangerousGetHandle() + ); + } + + public static void RegisterPluginCommand( + string name, + string description, + DefaultCommandDelegate command, + DefaultIsValidDelegate isValid + ) + { + BNPluginCommand.DefaultCommandDelegate commandAdapter = (ctxt , view) => + { + command( new BinaryView(view , false)); + }; + + BNPluginCommand.DefaultIsValidDelegate isValidAdapter = bool (ctxt , view) => + { + return isValid( new BinaryView(view , false)); + }; + + NativeMethods.BNRegisterPluginCommand( + name, + description, + Marshal.GetFunctionPointerForDelegate(commandAdapter), + Marshal.GetFunctionPointerForDelegate(isValidAdapter), + IntPtr.Zero + ); + } + + public static void RegisterForAddress( + string name, + string description, + AddressCommandDelegate command, + AddressIsValidDelegate isValid + ) + { + BNPluginCommand.AddressCommandDelegate commandAdapter = (ctxt , view , address) => + { + command( new BinaryView(view , false) , address); + }; + + BNPluginCommand.AddressIsValidDelegate isValidAdapter = bool (ctxt , view , address) => + { + return isValid( new BinaryView(view , false) , address); + }; + + NativeMethods.BNRegisterPluginCommandForAddress( + name, + description, + Marshal.GetFunctionPointerForDelegate(commandAdapter), + Marshal.GetFunctionPointerForDelegate(isValidAdapter), + IntPtr.Zero + ); + } + + public static void RegisterForRange( + string name, + string description, + RangeCommandDelegate command, + RangeIsValidDelegate isValid + ) + { + BNPluginCommand.RangeCommandDelegate commandAdapter = (ctxt , view , address , length) => + { + command( new BinaryView(view , false) , address , length); + }; + + BNPluginCommand.RangeIsValidDelegate isValidAdapter = bool (ctxt , view , address , length) => + { + return isValid( new BinaryView(view , false) , address , length); + }; + + NativeMethods.BNRegisterPluginCommandForRange( + name, + description, + Marshal.GetFunctionPointerForDelegate(commandAdapter), + Marshal.GetFunctionPointerForDelegate(isValidAdapter), + IntPtr.Zero + ); + } + + public static void RegisterForFunction( + string name, + string description, + FunctionCommandDelegate command, + FunctionIsValidDelegate isValid + ) + { + BNPluginCommand.FunctionCommandDelegate commandAdapter = (ctxt , view , function) => + { + command( + new BinaryView(view , false) , + new Function(function , false) + ); + }; + + BNPluginCommand.FunctionIsValidDelegate isValidAdapter = bool (ctxt , view , function) => + { + return isValid( + new BinaryView(view , false) , + new Function(function , false) + ); + }; + + NativeMethods.BNRegisterPluginCommandForFunction( + name, + description, + Marshal.GetFunctionPointerForDelegate(commandAdapter), + Marshal.GetFunctionPointerForDelegate(isValidAdapter), + IntPtr.Zero + ); + } + + public static void RegisterForLowLevelILFunction( + string name, + string description, + LowLevelILFunctionCommandDelegate command, + LowLevelILFunctionIsValidDelegate isValid + ) + { + BNPluginCommand.LowLevelILFunctionCommandDelegate commandAdapter = (ctxt , view , function) => + { + command( + new BinaryView(view , false) , + new LowLevelILFunction(function , false) + ); + }; + + BNPluginCommand.LowLevelILFunctionIsValidDelegate isValidAdapter = bool (ctxt , view , function) => + { + return isValid( + new BinaryView(view , false) , + new LowLevelILFunction(function , false) + ); + }; + + NativeMethods.BNRegisterPluginCommandForLowLevelILFunction( + name, + description, + Marshal.GetFunctionPointerForDelegate(commandAdapter), + Marshal.GetFunctionPointerForDelegate(isValidAdapter), + IntPtr.Zero + ); + } + + public static void RegisterForLowLevelILInstruction( + string name, + string description, + LowLevelILInstructionCommandDelegate command, + LowLevelILInstructionIsValidDelegate isValid + ) + { + BNPluginCommand.LowLevelILInstructionCommandDelegate commandAdapter = (ctxt , view , function , instruction) => + { + command( + new BinaryView(view , false) , + new LowLevelILFunction(function , false), + instruction + ); + }; + + BNPluginCommand.LowLevelILInstructionIsValidDelegate isValidAdapter = bool (ctxt , view , function , instruction) => + { + return isValid( + new BinaryView(view , false) , + new LowLevelILFunction(function , false), + instruction + ); + }; + + NativeMethods.BNRegisterPluginCommandForLowLevelILInstruction( + name, + description, + Marshal.GetFunctionPointerForDelegate(commandAdapter), + Marshal.GetFunctionPointerForDelegate(isValidAdapter), + IntPtr.Zero + ); + } + + public static void RegisterForMediumLevelILFunction( + string name, + string description, + MediumLevelILFunctionCommandDelegate command, + MediumLevelILFunctionIsValidDelegate isValid + ) + { + BNPluginCommand.MediumLevelILFunctionCommandDelegate commandAdapter = (ctxt , view , function) => + { + command( + new BinaryView(view , false) , + new MediumLevelILFunction(function , false) + ); + }; + + BNPluginCommand.MediumLevelILFunctionIsValidDelegate isValidAdapter = bool (ctxt , view , function) => + { + return isValid( + new BinaryView(view , false) , + new MediumLevelILFunction(function , false) + ); + }; + + NativeMethods.BNRegisterPluginCommandForMediumLevelILFunction( + name, + description, + Marshal.GetFunctionPointerForDelegate(commandAdapter), + Marshal.GetFunctionPointerForDelegate(isValidAdapter), + IntPtr.Zero + ); + } + + + public static void RegisterForMediumLevelILInstruction( + string name, + string description, + MediumLevelILInstructionCommandDelegate command, + MediumLevelILInstructionIsValidDelegate isValid + ) + { + BNPluginCommand.MediumLevelILInstructionCommandDelegate commandAdapter = (ctxt , view , function , instruction) => + { + command( + new BinaryView(view , false) , + new MediumLevelILFunction(function , false), + instruction + ); + }; + + BNPluginCommand.MediumLevelILInstructionIsValidDelegate isValidAdapter = bool (ctxt , view , function , instruction) => + { + return isValid( + new BinaryView(view , false) , + new MediumLevelILFunction(function , false), + instruction + ); + }; + + NativeMethods.BNRegisterPluginCommandForMediumLevelILInstruction( + name, + description, + Marshal.GetFunctionPointerForDelegate(commandAdapter), + Marshal.GetFunctionPointerForDelegate(isValidAdapter), + IntPtr.Zero + ); + } + + public static void RegisterForHighLevelILFunction( + string name, + string description, + HighLevelILFunctionCommandDelegate command, + HighLevelILFunctionIsValidDelegate isValid + ) + { + BNPluginCommand.HighLevelILFunctionCommandDelegate commandAdapter = (ctxt , view , function) => + { + command( + new BinaryView(view , false) , + new HighLevelILFunction(function , false) + ); + }; + + BNPluginCommand.HighLevelILFunctionIsValidDelegate isValidAdapter = bool (ctxt , view , function) => + { + return isValid( + new BinaryView(view , false) , + new HighLevelILFunction(function , false) + ); + }; + + NativeMethods.BNRegisterPluginCommandForHighLevelILFunction( + name, + description, + Marshal.GetFunctionPointerForDelegate(commandAdapter), + Marshal.GetFunctionPointerForDelegate(isValidAdapter), + IntPtr.Zero + ); + } + + public static void RegisterForHighLevelILInstruction( + string name, + string description, + HighLevelILInstructionCommandDelegate command, + HighLevelILInstructionIsValidDelegate isValid + ) + { + BNPluginCommand.HighLevelILInstructionCommandDelegate commandAdapter = (ctxt , view , function , instruction) => + { + command( + new BinaryView(view , false) , + new HighLevelILFunction(function , false), + instruction + ); + }; + + BNPluginCommand.HighLevelILInstructionIsValidDelegate isValidAdapter = bool (ctxt , view , function , instruction) => + { + return isValid( + new BinaryView(view , false) , + new HighLevelILFunction(function , false), + instruction + ); + }; + + + NativeMethods.BNRegisterPluginCommandForHighLevelILInstruction( + name, + description, + Marshal.GetFunctionPointerForDelegate(commandAdapter), + Marshal.GetFunctionPointerForDelegate(isValidAdapter), + IntPtr.Zero + ); + } + + public static void RegisterForProject( + string name, + string description, + ProjectCommandDelegate command, + ProjectIsValidDelegate isValid + ) + { + BNPluginCommand.ProjectCommandDelegate commandAdapter = (ctxt , project) => + { + command( + new Project(project , false) + ); + }; + + BNPluginCommand.ProjectIsValidDelegate isValidAdapter = bool (ctxt , project) => + { + return isValid( + new Project(project , false) + ); + }; + + NativeMethods.BNRegisterPluginCommandForProject( + name, + description, + Marshal.GetFunctionPointerForDelegate(commandAdapter), + Marshal.GetFunctionPointerForDelegate(isValidAdapter), + IntPtr.Zero + ); + } + + public static PluginCommand[] GetAllPluginCommands() + { + IntPtr arrayPointer = NativeMethods.BNGetAllPluginCommands( + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArray( + arrayPointer , + arrayLength , + PluginCommand.FromNative , + NativeMethods.BNFreePluginCommandList + ); + } + + public static PluginCommand[] GetValidPluginCommands(BinaryView view) + { + IntPtr arrayPointer = NativeMethods.BNGetValidPluginCommands( + view.DangerousGetHandle(), + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArray( + arrayPointer , + arrayLength , + PluginCommand.FromNative , + NativeMethods.BNFreePluginCommandList + ); + } + + public static PluginCommand[] GetValidPluginCommandsForAddress( + BinaryView view, + ulong address) + { + + IntPtr arrayPointer = NativeMethods.BNGetValidPluginCommandsForAddress( + view.DangerousGetHandle(), + address, + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArray( + arrayPointer , + arrayLength , + PluginCommand.FromNative , + NativeMethods.BNFreePluginCommandList + ); + } + + public static PluginCommand[] GetValidPluginCommandsForRange( + BinaryView view, + ulong address, + ulong length + ) + { + + IntPtr arrayPointer = NativeMethods.BNGetValidPluginCommandsForRange( + view.DangerousGetHandle(), + address, + length, + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArray( + arrayPointer , + arrayLength , + PluginCommand.FromNative , + NativeMethods.BNFreePluginCommandList + ); + } + + public static PluginCommand[] GetValidPluginCommandsForFunction( + BinaryView view, + Function function) + { + IntPtr arrayPointer = NativeMethods.BNGetValidPluginCommandsForFunction( + view.DangerousGetHandle(), + function.DangerousGetHandle(), + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArray( + arrayPointer , + arrayLength , + PluginCommand.FromNative , + NativeMethods.BNFreePluginCommandList + ); + } + + public static PluginCommand[] GetValidPluginCommandsForLowLevelILFunction( + BinaryView view, + LowLevelILFunction function) + { + IntPtr arrayPointer = NativeMethods.BNGetValidPluginCommandsForLowLevelILFunction( + view.DangerousGetHandle(), + function.DangerousGetHandle(), + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArray( + arrayPointer , + arrayLength , + PluginCommand.FromNative , + NativeMethods.BNFreePluginCommandList + ); + } + + public static PluginCommand[] GetValidPluginCommandsForLowLevelILInstruction( + BinaryView view, + LowLevelILFunction function, + ulong instruction + ) + { + IntPtr arrayPointer = NativeMethods.BNGetValidPluginCommandsForLowLevelILInstruction( + view.DangerousGetHandle(), + function.DangerousGetHandle(), + instruction, + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArray( + arrayPointer , + arrayLength , + PluginCommand.FromNative , + NativeMethods.BNFreePluginCommandList + ); + } + + + public static PluginCommand[] GetValidPluginCommandsForMediumLevelILFunction( + BinaryView view, + MediumLevelILFunction function) + { + IntPtr arrayPointer = NativeMethods.BNGetValidPluginCommandsForMediumLevelILFunction( + view.DangerousGetHandle(), + function.DangerousGetHandle(), + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArray( + arrayPointer , + arrayLength , + PluginCommand.FromNative , + NativeMethods.BNFreePluginCommandList + ); + } + + public static PluginCommand[] GetValidPluginCommandsForMediumLevelILInstruction( + BinaryView view, + MediumLevelILFunction function, + ulong instruction + ) + { + IntPtr arrayPointer = NativeMethods.BNGetValidPluginCommandsForMediumLevelILInstruction( + view.DangerousGetHandle(), + function.DangerousGetHandle(), + instruction, + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArray( + arrayPointer , + arrayLength , + PluginCommand.FromNative , + NativeMethods.BNFreePluginCommandList + ); + } + + public static PluginCommand[] GetValidPluginCommandsForHighLevelILFunction( + BinaryView view, + HighLevelILFunction function) + { + IntPtr arrayPointer = NativeMethods.BNGetValidPluginCommandsForHighLevelILFunction( + view.DangerousGetHandle(), + function.DangerousGetHandle(), + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArray( + arrayPointer , + arrayLength , + PluginCommand.FromNative , + NativeMethods.BNFreePluginCommandList + ); + } + + public static PluginCommand[] GetValidPluginCommandsForHighLevelILInstruction( + BinaryView view, + HighLevelILFunction function, + ulong instruction + ) + { + IntPtr arrayPointer = NativeMethods.BNGetValidPluginCommandsForHighLevelILInstruction( + view.DangerousGetHandle(), + function.DangerousGetHandle(), + instruction, + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArray( + arrayPointer , + arrayLength , + PluginCommand.FromNative , + NativeMethods.BNFreePluginCommandList + ); + } + } + + public abstract class CustomPluginCommand + where TSelf : CustomPluginCommand + { + public CustomPluginCommand() + { + + } + + public TSelf Register( + string name, + string description = "" + ) + { + NativeMethods.BNRegisterPluginCommand( + name, + description, + Marshal.GetFunctionPointerForDelegate(this.CommandThunk), + Marshal.GetFunctionPointerForDelegate(this.IsValidThunk), + IntPtr.Zero + ); + + return (TSelf)this; + } + + public static void ClearInstances() + { + + } + + private void CommandThunk( + IntPtr ctxt , + IntPtr view + ) + { + this.Command( + new BinaryView(view , false) + ); + } + + private bool IsValidThunk( + IntPtr ctxt , + IntPtr view + ) + { + return this.IsValid( + new BinaryView(view , false) + ); + } + + public virtual void Command(BinaryView view) + { + + } + + public virtual bool IsValid(BinaryView view) + { + return false; + } + } + + public abstract class CustomAddressCommand + { + public CustomAddressCommand() + { + + } + + public void RegisterForAddress( + string name, + string description = "" + ) + { + NativeMethods.BNRegisterPluginCommandForAddress( + name, + description, + Marshal.GetFunctionPointerForDelegate(this.AddressCommandThunk), + Marshal.GetFunctionPointerForDelegate(this.AddressIsValidThunk), + IntPtr.Zero + ); + } + + private void AddressCommandThunk( + IntPtr ctxt , + IntPtr view , + ulong address + ) + { + this.AddressCommand( + new BinaryView(view , false) , + address + ); + } + + private bool AddressIsValidThunk( + IntPtr ctxt , + IntPtr view , + ulong address + ) + { + return this.AddressIsValid( + new BinaryView(view , false), + address + ); + } + + public virtual void AddressCommand( + BinaryView view , + ulong address + ) + { + + } + + public virtual bool AddressIsValid( + BinaryView view , + ulong address + ) + { + return false; + } + } + + public abstract class CustomRangeCommand + { + public CustomRangeCommand() + { + + } + + public void RegisterPluginCommandForRange( + string name, + string description = "" + ) + { + NativeMethods.BNRegisterPluginCommandForRange( + name, + description, + Marshal.GetFunctionPointerForDelegate(this.RangeCommandThunk), + Marshal.GetFunctionPointerForDelegate(this.RangeIsValidThunk), + IntPtr.Zero + ); + } + + private void RangeCommandThunk( + IntPtr ctxt , + IntPtr view , + ulong address , + ulong length + ) + { + this.RangeCommand( + new BinaryView(view , false) , + address , + length + ); + } + + private bool RangeIsValidThunk( + IntPtr ctxt , + IntPtr view , + ulong address , + ulong length + ) + { + return this.RangeIsValid( + new BinaryView( + view , + false + ) , + address, + length + ); + } + + public virtual void RangeCommand( + BinaryView view , + ulong address , + ulong length + ) + { + + } + + public virtual bool RangeIsValid( + BinaryView view , + ulong address , + ulong length + ) + { + return false; + } + } + + + public abstract class CustomFunctionCommand + where TSelf : CustomFunctionCommand + { + public CustomFunctionCommand() + { + + } + + public TSelf RegisterForFunction( + string name, + string description = "" + ) + { + NativeMethods.BNRegisterPluginCommandForFunction( + name, + description, + Marshal.GetFunctionPointerForDelegate(this.CommandThunk), + Marshal.GetFunctionPointerForDelegate(this.IsValidThunk), + IntPtr.Zero + ); + + return (TSelf)this; + } + + private void CommandThunk( + IntPtr ctxt , + IntPtr view , + IntPtr function + ) + { + this.Command( + new BinaryView(view , false) , + new Function(function,false) + ); + } + + private bool IsValidThunk( + IntPtr ctxt , + IntPtr view , + IntPtr function + ) + { + return this.IsValid( + new BinaryView(view , false) , + new Function(function,false) + ); + } + + public virtual void Command( + BinaryView view , + Function function + ) + { + + } + + public virtual bool IsValid( + BinaryView view , + Function function + ) + { + return false; + } + } + + + + public abstract class CustomLowLevelILFunctionCommand + { + public CustomLowLevelILFunctionCommand() + { + + } + + public void RegisterForLowLevelILFunction( + string name, + string description = "" + ) + { + NativeMethods.BNRegisterPluginCommandForLowLevelILFunction( + name, + description, + Marshal.GetFunctionPointerForDelegate(this.CommandThunk), + Marshal.GetFunctionPointerForDelegate(this.LowLevelILFunctionIsValidThunk), + IntPtr.Zero + ); + } + + private void CommandThunk( + IntPtr ctxt , + IntPtr view , + IntPtr function + ) + { + this.Command( + new BinaryView(view , false) , + new LowLevelILFunction(function,false) + ); + } + + private bool LowLevelILFunctionIsValidThunk( + IntPtr ctxt , + IntPtr view , + IntPtr function + ) + { + return this.IsValid( + new BinaryView(view , false) , + new LowLevelILFunction(function,false) + ); + } + + public virtual void Command( + BinaryView view , + LowLevelILFunction function + ) + { + + } + + public virtual bool IsValid( + BinaryView view , + LowLevelILFunction function + ) + { + return false; + } + } + + + public abstract class CustomLowLevelILInstructionCommand + { + public CustomLowLevelILInstructionCommand() + { + + } + + public void RegisterForLowLevelIlInstruction( + string name, + string description = "" + ) + { + NativeMethods.BNRegisterPluginCommandForLowLevelILInstruction( + name, + description, + Marshal.GetFunctionPointerForDelegate(this.CommandThunk), + Marshal.GetFunctionPointerForDelegate(this.IsValidThunk), + IntPtr.Zero + ); + } + + private void CommandThunk( + IntPtr ctxt , + IntPtr view , + IntPtr function , + ulong instruction + ) + { + this.Command( + new BinaryView(view , false) , + new LowLevelILFunction(function,false), + instruction + ); + } + + private bool IsValidThunk( + IntPtr ctxt , + IntPtr view , + IntPtr function , + ulong instruction + ) + { + return this.IsValid( + new BinaryView(view , false) , + new LowLevelILFunction(function,false), + instruction + ); + } + + public virtual void Command( + BinaryView view , + LowLevelILFunction function , + ulong instruction + ) + { + + } + + public virtual bool IsValid( + BinaryView view , + LowLevelILFunction function , + ulong instruction + ) + { + return false; + } + } + + public abstract class CustomMediumLevelILFunctionCommand + { + + public CustomMediumLevelILFunctionCommand() + { + + } + + public void RegisterForMediumLevelILFunction( + string name, + string description = "" + ) + { + NativeMethods.BNRegisterPluginCommandForMediumLevelILFunction( + name, + description, + Marshal.GetFunctionPointerForDelegate(this.CommandThunk), + Marshal.GetFunctionPointerForDelegate(this.IsValidThunk), + IntPtr.Zero + ); + } + + private void CommandThunk( + IntPtr ctxt , + IntPtr view , + IntPtr function + ) + { + this.Command( + new BinaryView(view , false) , + new MediumLevelILFunction(function,false) + ); + } + + private bool IsValidThunk( + IntPtr ctxt , + IntPtr view , + IntPtr function + ) + { + return this.IsValid( + new BinaryView(view , false) , + new MediumLevelILFunction(function,false) + ); + } + + public virtual void Command( + BinaryView view , + MediumLevelILFunction function + ) + { + + } + + public virtual bool IsValid( + BinaryView view , + MediumLevelILFunction function + ) + { + return false; + } + } + + + public abstract class CustomMediumLevelILInstructionCommand + { + public CustomMediumLevelILInstructionCommand() + { + + } + + public void RegisterForMediumLevelILInstruction( + string name, + string description = "" + ) + { + NativeMethods.BNRegisterPluginCommandForMediumLevelILInstruction( + name, + description, + Marshal.GetFunctionPointerForDelegate(this.CommandThunk), + Marshal.GetFunctionPointerForDelegate(this.IsValidThunk), + IntPtr.Zero + ); + } + + private void CommandThunk( + IntPtr ctxt , + IntPtr view , + IntPtr function , + ulong instruction + ) + { + this.Command( + new BinaryView(view , false) , + new MediumLevelILFunction(function,false), + instruction + ); + } + + private bool IsValidThunk( + IntPtr ctxt , + IntPtr view , + IntPtr function , + ulong instruction + ) + { + return this.IsValid( + new BinaryView(view , false) , + new MediumLevelILFunction(function,false), + instruction + ); + } + + public virtual void Command( + BinaryView view , + MediumLevelILFunction function , + ulong instruction + ) + { + + } + + public virtual bool IsValid( + BinaryView view , + MediumLevelILFunction function , + ulong instruction + ) + { + return false; + } + } + + public abstract class CustomHighLevelILFunctionCommand + { + public CustomHighLevelILFunctionCommand() + { + + } + + public void RegisterPluginCommandForHighLevelILFunction( + string name, + string description = "" + ) + { + NativeMethods.BNRegisterPluginCommandForHighLevelILFunction( + name, + description, + Marshal.GetFunctionPointerForDelegate(this.CommandThunk), + Marshal.GetFunctionPointerForDelegate(this.IsValidThunk), + IntPtr.Zero + ); + } + + private void CommandThunk( + IntPtr ctxt , + IntPtr view , + IntPtr function + ) + { + this.Command( + new BinaryView(view , false) , + new HighLevelILFunction(function,false) + ); + } + + private bool IsValidThunk( + IntPtr ctxt , + IntPtr view , + IntPtr function + ) + { + return this.IsValid( + new BinaryView(view , false) , + new HighLevelILFunction(function,false) + ); + } + + public virtual void Command( + BinaryView view , + HighLevelILFunction function + ) + { + + } + + public virtual bool IsValid( + BinaryView view , + HighLevelILFunction function + ) + { + return false; + } + } + + public abstract class CustomHighLevelILInstructionCommand + { + public CustomHighLevelILInstructionCommand() + { + + } + + public void RegisterForHighLevelILInstruction( + string name, + string description = "" + ) + { + NativeMethods.BNRegisterPluginCommandForHighLevelILInstruction( + name, + description, + Marshal.GetFunctionPointerForDelegate(this.CommandThunk), + Marshal.GetFunctionPointerForDelegate(this.IsValidThunk), + IntPtr.Zero + ); + } + + private void CommandThunk( + IntPtr ctxt , + IntPtr view , + IntPtr function , + ulong instruction + ) + { + this.Command( + new BinaryView(view , false) , + new HighLevelILFunction(function,false), + instruction + ); + } + + private bool IsValidThunk( + IntPtr ctxt , + IntPtr view , + IntPtr function , + ulong instruction + ) + { + return this.IsValid( + new BinaryView(view , false) , + new HighLevelILFunction(function,false), + instruction + ); + } + + public virtual void Command( + BinaryView view , + HighLevelILFunction function , + ulong instruction + ) + { + + } + + public virtual bool IsValid( + BinaryView view , + HighLevelILFunction function , + ulong instruction + ) + { + return false; + } + } + + + public abstract class CustomProjectCommand + { + public CustomProjectCommand() + { + + } + + public void RegisterForProject( + string name, + string description = "" + ) + { + NativeMethods.BNRegisterPluginCommandForProject( + name, + description, + Marshal.GetFunctionPointerForDelegate(this.CommandThunk), + Marshal.GetFunctionPointerForDelegate(this.IsValidThunk), + IntPtr.Zero + ); + } + + private void CommandThunk( + IntPtr ctxt , + IntPtr view + ) + { + this.Command( + new Project(view , false) + ); + } + + private bool IsValidThunk( + IntPtr ctxt , + IntPtr view + ) + { + return this.IsValid( + new Project(view , false) + ); + } + + public virtual void Command(Project project) + { + + } + + public virtual bool IsValid(Project project) + { + return false; + } + } +} \ No newline at end of file diff --git a/Struct/BNPoint.cs b/Struct/BNPoint.cs new file mode 100644 index 0000000..529f89f --- /dev/null +++ b/Struct/BNPoint.cs @@ -0,0 +1,52 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNPoint + { + /// + /// float x + /// + internal float x; + + /// + /// float y + /// + internal float y; + } + + public sealed class Point : INativeWrapper + { + public float X { get; set; } = 0; + + public float Y { get; set; } = 0; + + public Point() + { + + } + + internal static Point FromNative(BNPoint raw) + { + return new Point() + { + X = raw.x , + Y = raw.y + }; + } + + public BNPoint ToNative() + { + return new BNPoint() + { + x = this.X , + y = this.Y + }; + } + + } +} \ No newline at end of file diff --git a/Struct/BNPossibleValueSet.cs b/Struct/BNPossibleValueSet.cs new file mode 100644 index 0000000..9922ec7 --- /dev/null +++ b/Struct/BNPossibleValueSet.cs @@ -0,0 +1,140 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNPossibleValueSet + { + /// + /// BNRegisterValueType state + /// + internal RegisterValueType state; + + /// + /// int64_t value + /// + internal long value; + + /// + /// int64_t offset + /// + internal long offset; + + /// + /// uint64_t size + /// + internal ulong size; + + /// + /// BNValueRange* ranges + /// + internal IntPtr ranges; + + /// + /// int64_t* valueSet + /// + internal IntPtr valueSet; + + /// + /// BNLookupTableEntry* table + /// + internal IntPtr table; + + /// + /// uint64_t count + /// + internal ulong count; + } + + public sealed class PossibleValueSet : INativeWrapperEx + { + public RegisterValueType State { get; set; } = RegisterValueType.UndeterminedValue; + + public long Value { get; set; } = 0; + + public long Offset { get; set; } = 0; + + public ulong Size { get; set; } = 0; + + public ValueRange[] Ranges { get; set; } = Array.Empty(); + + public ulong[] ValueSet { get; set; } = Array.Empty(); + + public LookupTableEntry[] Table { get; set; } = Array.Empty(); + + public PossibleValueSet() + { + + } + + internal static PossibleValueSet FromNative(BNPossibleValueSet native) + { + return new PossibleValueSet() + { + State = native.state , + Value = native.value , + Offset = native.offset , + Size = native.size , + Ranges = UnsafeUtils.ReadStructArray( + native.ranges , + native.count , + ValueRange.FromNative + ), + ValueSet = UnsafeUtils.ReadNumberArray( + native.valueSet , + native.count + ), + Table = UnsafeUtils.ReadStructArray( + native.table , + native.count , + LookupTableEntry.FromNative + ), + }; + } + + internal static PossibleValueSet TakeNative(BNPossibleValueSet native) + { + PossibleValueSet valueSet = PossibleValueSet.FromNative(native); + + NativeMethods.BNFreePossibleValueSet(native); + + return valueSet; + } + + public BNPossibleValueSet ToNativeEx(ScopedAllocator allocator) + { + return new BNPossibleValueSet() + { + state = this.State , + value = this.Value , + offset = this.Offset , + size = this.Size , + ranges = ( + 0 == this.Ranges.Length + ? IntPtr.Zero + : allocator.AllocStructArray( + UnsafeUtils.ConvertToNativeArray(this.Ranges) + ) + ) , + valueSet = ( + 0 == this.ValueSet.Length ? IntPtr.Zero : allocator.AllocIntegerArray(this.ValueSet) + ) , + table = ( + 0 == this.Table.Length + ? IntPtr.Zero + : allocator.AllocStructArray( + allocator.ConvertToNativeArrayEx(this.Table) + ) + ) , + count = ( 0 != this.Ranges.Length + ? (ulong)this.Ranges.Length + : ( 0 != this.ValueSet.Length ? + (ulong)this.ValueSet.Length : (ulong)this.Table.Length) + ), + }; + } + } +} \ No newline at end of file diff --git a/Struct/BNProjectNotification.cs b/Struct/BNProjectNotification.cs new file mode 100644 index 0000000..c825cd1 --- /dev/null +++ b/Struct/BNProjectNotification.cs @@ -0,0 +1,114 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNProjectNotification + { + /// + /// void* context + /// + public IntPtr context; + + /// + /// void** beforeOpenProject + /// + public IntPtr beforeOpenProject; + + /// + /// void** afterOpenProject + /// + public IntPtr afterOpenProject; + + /// + /// void** beforeCloseProject + /// + public IntPtr beforeCloseProject; + + /// + /// void** afterCloseProject + /// + public IntPtr afterCloseProject; + + /// + /// void** beforeProjectMetadataWritten + /// + public IntPtr beforeProjectMetadataWritten; + + /// + /// void** afterProjectMetadataWritten + /// + public IntPtr afterProjectMetadataWritten; + + /// + /// void** beforeProjectFileCreated + /// + public IntPtr beforeProjectFileCreated; + + /// + /// void** afterProjectFileCreated + /// + public IntPtr afterProjectFileCreated; + + /// + /// void** beforeProjectFileUpdated + /// + public IntPtr beforeProjectFileUpdated; + + /// + /// void** afterProjectFileUpdated + /// + public IntPtr afterProjectFileUpdated; + + /// + /// void** beforeProjectFileDeleted + /// + public IntPtr beforeProjectFileDeleted; + + /// + /// void** afterProjectFileDeleted + /// + public IntPtr afterProjectFileDeleted; + + /// + /// void** beforeProjectFolderCreated + /// + public IntPtr beforeProjectFolderCreated; + + /// + /// void** afterProjectFolderCreated + /// + public IntPtr afterProjectFolderCreated; + + /// + /// void** beforeProjectFolderUpdated + /// + public IntPtr beforeProjectFolderUpdated; + + /// + /// void** afterProjectFolderUpdated + /// + public IntPtr afterProjectFolderUpdated; + + /// + /// void** beforeProjectFolderDeleted + /// + public IntPtr beforeProjectFolderDeleted; + + /// + /// void** afterProjectFolderDeleted + /// + public IntPtr afterProjectFolderDeleted; + } + + public class ProjectNotification + { + public ProjectNotification() + { + + } + } +} \ No newline at end of file diff --git a/Struct/BNQualifiedName.cs b/Struct/BNQualifiedName.cs new file mode 100644 index 0000000..5d5d906 --- /dev/null +++ b/Struct/BNQualifiedName.cs @@ -0,0 +1,124 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNQualifiedName + { + /// + /// const char** name + /// + internal IntPtr name; + + /// + /// const char* join + /// + internal IntPtr join; + + /// + /// uint64_t nameCount + /// + internal ulong nameCount; + } + + public sealed class QualifiedName : INativeWrapperEx + { + public string[] Name { get; set; } = Array.Empty(); + + public string Join { get; set; } = ""; + + public QualifiedName(string name = "") + { + this.Name = new string[1] + { + name + }; + + this.Join = ""; + } + + public QualifiedName(string[] name , string join = "") + { + this.Name = name; + + this.Join = join; + } + + internal static QualifiedName FromNative(BNQualifiedName native) + { + return new QualifiedName( + UnsafeUtils.ReadAnsiStringArray(native.name , native.nameCount) , + UnsafeUtils.ReadAnsiString(native.join) + ); + } + + internal static QualifiedName TakeNative(BNQualifiedName native) + { + QualifiedName target = QualifiedName.FromNative(native); + + NativeMethods.BNFreeQualifiedName(native); + + return target; + } + + public BNQualifiedName ToNativeEx(ScopedAllocator allocator) + { + return new BNQualifiedName() + { + name = allocator.AllocAnsiStringArray(this.Name) , + nameCount = (ulong)this.Name.Length, + join = allocator.AllocAnsiString(this.Join) + }; + } + + + public static implicit operator QualifiedName(string value) + { + return new QualifiedName(value ?? string.Empty); + } + + public static implicit operator string(QualifiedName? qn) + { + if (qn is null) + { + return string.Empty; + } + + return qn.ToString(); + } + + public override string ToString() + { + if ( this.Name.Length == 0) + { + return string.Empty; + } + + if ("::" == this.Join || string.IsNullOrEmpty(this.Join)) + { + if (1 == this.Name.Length) + { + return this.Name[0]; + } + } + + return string.Join(this.Join , this.Name); + } + } + + public class QualifiedNameAndId + { + public QualifiedName Name { get; set; } = new QualifiedName(); + + public string Id { get; set; } = string.Empty; + + public QualifiedNameAndId(QualifiedName name , string id) + { + this.Name = name; + this.Id = id; + } + } +} \ No newline at end of file diff --git a/Struct/BNQualifiedNameAndType.cs b/Struct/BNQualifiedNameAndType.cs new file mode 100644 index 0000000..66e2e42 --- /dev/null +++ b/Struct/BNQualifiedNameAndType.cs @@ -0,0 +1,85 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNQualifiedNameAndType + { + /// + /// BNQualifiedName name + /// + internal BNQualifiedName name; + + /// + /// BNType* type + /// + internal IntPtr type; + } + + public sealed class QualifiedNameAndType : INativeWrapperEx + { + public QualifiedName Name { get; set; } = new QualifiedName(); + + public BinaryNinja.Type Type { get; set; } + + public QualifiedNameAndType(QualifiedName name , BinaryNinja.Type type) + { + this.Name = name; + this.Type = type; + } + + internal static QualifiedNameAndType FromNative(BNQualifiedNameAndType native) + { + return new QualifiedNameAndType( + QualifiedName.FromNative(native.name) , + BinaryNinja.Type.MustNewFromHandle(native.type) + ); + } + + internal static QualifiedNameAndType TakeNative(BNQualifiedNameAndType native) + { + QualifiedNameAndType target = QualifiedNameAndType.FromNative(native); + + NativeMethods.BNFreeQualifiedNameAndType(native); + + return target; + } + + public BNQualifiedNameAndType ToNativeEx(ScopedAllocator allocator) + { + return new BNQualifiedNameAndType() + { + name= this.Name.ToNativeEx(allocator) , + type = this.Type.DangerousGetHandle() + }; + } + + internal static QualifiedName[] PickNames(QualifiedNameAndType[] nameAndTypes) + { + List targets = new List(); + + foreach (QualifiedNameAndType item in nameAndTypes) + { + targets.Add(item.Name); + } + + return targets.ToArray(); + } + + internal static BinaryNinja.Type[] PickTypes(QualifiedNameAndType[] nameAndTypes) + { + List targets = new List(); + + foreach (QualifiedNameAndType item in nameAndTypes) + { + targets.Add(item.Type); + } + + return targets.ToArray(); + } + + } +} \ No newline at end of file diff --git a/Struct/BNQualifiedNameList.cs b/Struct/BNQualifiedNameList.cs new file mode 100644 index 0000000..2469265 --- /dev/null +++ b/Struct/BNQualifiedNameList.cs @@ -0,0 +1,52 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNQualifiedNameList + { + /// + /// BNQualifiedName* names + /// + internal IntPtr names; + + /// + /// uint64_t count + /// + internal ulong count; + } + + public sealed class QualifiedNameList : INativeWrapperEx + { + public QualifiedName[] Names { get; set; } = Array.Empty(); + + public QualifiedNameList() + { + + } + + public QualifiedNameList(QualifiedName[]? names) + { + if (null != names) + { + this.Names = names; + } + } + + public BNQualifiedNameList ToNativeEx(ScopedAllocator allocator) + { + return new BNQualifiedNameList() + { + names = allocator.AllocStructArray( + allocator.ConvertToNativeArrayEx( + this.Names + ) + ) , + count = (ulong)this.Names.Length + }; + } + } +} \ No newline at end of file diff --git a/Struct/BNQualifiedNameTypeAndId.cs b/Struct/BNQualifiedNameTypeAndId.cs new file mode 100644 index 0000000..ea984c4 --- /dev/null +++ b/Struct/BNQualifiedNameTypeAndId.cs @@ -0,0 +1,61 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNQualifiedNameTypeAndId + { + /// + /// BNQualifiedName name + /// + internal BNQualifiedName name; + + /// + /// const char* id + /// + internal IntPtr id; + + /// + /// BNType* type + /// + internal IntPtr type; + } + + public sealed class QualifiedNameTypeAndId : INativeWrapperEx + { + public QualifiedName Name { get; set; } = new QualifiedName(); + + public BinaryNinja.Type Type { get; set; } + + public string Id { get; set; } = string.Empty; + + public QualifiedNameTypeAndId(QualifiedName name , BinaryNinja.Type type , string id ) + { + this.Name = name; + this.Type = type; + this.Id = id; + } + + internal static QualifiedNameTypeAndId FromNative(BNQualifiedNameTypeAndId native) + { + return new QualifiedNameTypeAndId( + QualifiedName.FromNative(native.name) , + BinaryNinja.Type.MustNewFromHandle(native.type), + UnsafeUtils.ReadAnsiString(native.id) + ); + } + + public BNQualifiedNameTypeAndId ToNativeEx(ScopedAllocator allocator) + { + return new BNQualifiedNameTypeAndId() + { + name = this.Name.ToNativeEx(allocator) , + id = allocator.AllocAnsiString(this.Id) , + type = this.Type.DangerousGetHandle() + }; + } + } +} \ No newline at end of file diff --git a/Struct/BNRange.cs b/Struct/BNRange.cs new file mode 100644 index 0000000..ee65501 --- /dev/null +++ b/Struct/BNRange.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNRange + { + /// + /// uint64_t start + /// + public ulong start; + + /// + /// uint64_t end + /// + public ulong end; + } + + public sealed class Range + { + public ulong Start { get; set; } = 0; + + public ulong End { get; set; } = 0; + + public Range() + { + + } + + internal static Range FromNative(BNRange raw) + { + return new Range() + { + Start = raw.start , + End = raw.end + }; + } + } +} \ No newline at end of file diff --git a/Struct/BNReferenceSource.cs b/Struct/BNReferenceSource.cs new file mode 100644 index 0000000..8b6c861 --- /dev/null +++ b/Struct/BNReferenceSource.cs @@ -0,0 +1,60 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNReferenceSource + { + /// + /// BNFunction* func + /// + internal IntPtr function; + + /// + /// BNArchitecture* arch + /// + internal IntPtr arch; + + /// + /// uint64_t addr + /// + internal ulong address; + } + + public class ReferenceSource : INativeWrapper + { + public Function? Function { get; set; } = null; + + public Architecture? Architecture { get; set; } = null; + + public ulong Address { get; set; } = 0; + + public ReferenceSource() + { + + } + + internal static ReferenceSource FromNative(BNReferenceSource raw) + { + return new ReferenceSource() + { + Function = Function.MustNewFromHandle(raw.function) , + Architecture = Architecture.MustFromHandle(raw.arch) , + Address = raw.address + }; + } + + public BNReferenceSource ToNative() + { + return new BNReferenceSource() + { + function = ( null == this.Function ? IntPtr.Zero : this.Function.DangerousGetHandle() ), + arch = (null == this.Architecture ? IntPtr.Zero :this.Architecture.DangerousGetHandle()) , + address = this.Address + }; + } + } +} \ No newline at end of file diff --git a/Struct/BNRegisterInfo.cs b/Struct/BNRegisterInfo.cs new file mode 100644 index 0000000..174b62b --- /dev/null +++ b/Struct/BNRegisterInfo.cs @@ -0,0 +1,73 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNRegisterInfo + { + /// + /// uint32_t fullWidthRegister + /// + internal uint fullWidthRegister; + + /// + /// uint64_t offset + /// + internal ulong offset; + + /// + /// uint64_t size + /// + internal ulong size; + + /// + /// BNImplicitRegisterExtend extend + /// + internal ImplicitRegisterExtend extend; + } + + public sealed class RegisterInfo + { + public uint FullWidthRegister { get;} = 0; + + public ulong Offset { get; } = 0; + + public ulong Size { get; } = 0; + + public ImplicitRegisterExtend Extend { get; } = ImplicitRegisterExtend.NoExtend; + + public RegisterInfo() + { + + } + + public RegisterInfo( + uint fullWidthRegister, + ulong offset, + ulong size, + ImplicitRegisterExtend extend + ) + { + this.FullWidthRegister = fullWidthRegister; + this.Offset = offset; + this.Size = size; + this.Extend = extend; + } + + internal RegisterInfo(BNRegisterInfo native) + { + this.FullWidthRegister = native.fullWidthRegister; + this.Offset = native.offset; + this.Size = native.size; + this.Extend = native.extend; + } + + internal static RegisterInfo FromNative(BNRegisterInfo native) + { + return new RegisterInfo(native); + } + } +} \ No newline at end of file diff --git a/Struct/BNRegisterOrConstant.cs b/Struct/BNRegisterOrConstant.cs new file mode 100644 index 0000000..da39dfc --- /dev/null +++ b/Struct/BNRegisterOrConstant.cs @@ -0,0 +1,60 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNRegisterOrConstant + { + /// + /// bool constant + /// + internal bool constant; + + /// + /// uint32_t reg + /// + internal uint reg; + + /// + /// uint64_t value + /// + internal ulong value; + } + + public sealed class RegisterOrConstant : INativeWrapper + { + public bool Constant { get; set; } = false; + + public uint Register { get; set; } = 0; + + public ulong Value { get; set; } = 0; + + public RegisterOrConstant() + { + + } + + internal static RegisterOrConstant FromNative(BNRegisterOrConstant native) + { + return new RegisterOrConstant() + { + Constant = native.constant , + Register = native.reg , + Value = native.value + }; + } + + public BNRegisterOrConstant ToNative() + { + return new BNRegisterOrConstant() + { + constant = this.Constant , + reg = this.Register , + value = this.Value + }; + } + } +} \ No newline at end of file diff --git a/Struct/BNRegisterSetWithConfidence.cs b/Struct/BNRegisterSetWithConfidence.cs new file mode 100644 index 0000000..67d4728 --- /dev/null +++ b/Struct/BNRegisterSetWithConfidence.cs @@ -0,0 +1,61 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNRegisterSetWithConfidence + { + /// + /// uint32_t* regs + /// + internal IntPtr regs; + + /// + /// uint64_t count + /// + internal ulong count; + + /// + /// uint8_t confidence + /// + internal byte confidence; + } + + public sealed class RegisterSetWithConfidence : INativeWrapperEx + { + public uint[] Registers { get; set; } = Array.Empty(); + + public byte Confidence { get; set; } = 0; + + public RegisterSetWithConfidence() + { + + } + + public RegisterSetWithConfidence(uint[] regs , byte confidence) + { + this.Registers = regs; + this.Confidence = confidence; + } + + internal static RegisterSetWithConfidence FromNative(BNRegisterSetWithConfidence raw) + { + return new RegisterSetWithConfidence( + UnsafeUtils.ReadNumberArray(raw.regs , raw.count) , + raw.confidence + ); + } + + public BNRegisterSetWithConfidence ToNativeEx(ScopedAllocator allocator) + { + return new BNRegisterSetWithConfidence() + { + regs = allocator.AllocIntegerArray(this.Registers), + confidence = this.Confidence + }; + } + } +} \ No newline at end of file diff --git a/Struct/BNRegisterStackAdjustment.cs b/Struct/BNRegisterStackAdjustment.cs new file mode 100644 index 0000000..67ca501 --- /dev/null +++ b/Struct/BNRegisterStackAdjustment.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNRegisterStackAdjustment + { + /// + /// uint32_t regStack + /// + public uint regStack; + + /// + /// int32_t adjustment + /// + public int adjustment; + + /// + /// uint8_t confidence + /// + public byte confidence; + + } + + public sealed class RegisterStackAdjustment + { + public uint RegStack { get; set; } = 0; + + public int Adjustment { get; set; } = 0; + + public byte Confidence { get; set; } = 0; + + public RegisterStackAdjustment() + { + + } + } +} \ No newline at end of file diff --git a/Struct/BNRegisterStackInfo.cs b/Struct/BNRegisterStackInfo.cs new file mode 100644 index 0000000..9b3b2ee --- /dev/null +++ b/Struct/BNRegisterStackInfo.cs @@ -0,0 +1,78 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNRegisterStackInfo + { + /// + /// uint32_t firstStorageReg + /// + internal uint firstStorageReg; + + /// + /// uint32_t firstTopRelativeReg + /// + internal uint firstTopRelativeReg; + + /// + /// uint32_t storageCount + /// + internal uint storageCount; + + /// + /// uint32_t topRelativeCount + /// + internal uint topRelativeCount; + + /// + /// uint32_t stackTopReg + /// + internal uint stackTopReg; + } + + public sealed class RegisterStackInfo + { + public uint FirstStorageReg { get; } = 0; + + public uint FirstTopRelativeReg { get;} = 0; + + public uint StorageCount { get; } = 0; + + public uint TopRelativeCount { get;} = 0; + + public uint StackTopReg { get;} = 0; + + public RegisterStackInfo() + { + + } + + public RegisterStackInfo( + uint firstStorageReg, + uint firstTopRelativeReg, + uint storageCount, + uint topRelativeCount, + uint stackTopReg + ) + { + this.FirstStorageReg = firstStorageReg; + this.FirstTopRelativeReg = firstTopRelativeReg; + this.StorageCount = storageCount; + this.TopRelativeCount = topRelativeCount; + this.StackTopReg = stackTopReg; + } + + public RegisterStackInfo(BNRegisterStackInfo native) + { + this.FirstStorageReg = native.firstStorageReg; + this.FirstTopRelativeReg = native.firstTopRelativeReg; + this.StorageCount = native.storageCount; + this.TopRelativeCount = native.topRelativeCount; + this.StackTopReg = native.stackTopReg; + } + } +} \ No newline at end of file diff --git a/Struct/BNRegisterValue.cs b/Struct/BNRegisterValue.cs new file mode 100644 index 0000000..f4d5c54 --- /dev/null +++ b/Struct/BNRegisterValue.cs @@ -0,0 +1,69 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNRegisterValue + { + /// + /// BNRegisterValueType state + /// + internal RegisterValueType state; + + /// + /// int64_t value + /// + internal long value; + + /// + /// int64_t offset + /// + internal long offset; + + /// + /// uint64_t size + /// + internal ulong size; + } + + public sealed class RegisterValue : INativeWrapper + { + public RegisterValueType State { get; set; } = RegisterValueType.UndeterminedValue; + + public long Value { get; set; } = 0; + + public long Offset { get; set; } = 0; + + public ulong Size { get; set; } = 0; + + public RegisterValue() + { + + } + + internal static RegisterValue FromNative(BNRegisterValue native) + { + return new RegisterValue() + { + State = native.state, + Value = native.value, + Offset = native.offset, + Size = native.size + }; + } + + public BNRegisterValue ToNative() + { + return new BNRegisterValue() + { + state = this.State, + value = this.Value, + offset = this.Offset, + size = this.Size + }; + } + } +} \ No newline at end of file diff --git a/Struct/BNRegisterValueWithConfidence.cs b/Struct/BNRegisterValueWithConfidence.cs new file mode 100644 index 0000000..431bf42 --- /dev/null +++ b/Struct/BNRegisterValueWithConfidence.cs @@ -0,0 +1,51 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNRegisterValueWithConfidence + { + /// + /// BNRegisterValue value + /// + internal BNRegisterValue value; + + /// + /// uint8_t confidence + /// + internal byte confidence; + } + + public sealed class RegisterValueWithConfidence : INativeWrapper + { + public RegisterValue Value { get; set; } = new RegisterValue(); + + public byte Confidence { get; set; } = 0; + + public RegisterValueWithConfidence() + { + + } + + internal static RegisterValueWithConfidence FromNative(BNRegisterValueWithConfidence native) + { + return new RegisterValueWithConfidence() + { + Value = RegisterValue.FromNative(native.value), + Confidence = native.confidence + }; + } + + public BNRegisterValueWithConfidence ToNative() + { + return new BNRegisterValueWithConfidence() + { + value = this.Value.ToNative(), + confidence = this.Confidence + }; + } + } +} \ No newline at end of file diff --git a/Struct/BNRelocationInfo.cs b/Struct/BNRelocationInfo.cs new file mode 100644 index 0000000..b2b808a --- /dev/null +++ b/Struct/BNRelocationInfo.cs @@ -0,0 +1,152 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNRelocationInfo + { + /// + /// BNRelocationType type + /// + public RelocationType type; + + /// + /// bool pcRelative + /// + public bool pcRelative; + + /// + /// bool baseRelative + /// + public bool baseRelative; + + /// + /// uint64_t _base + /// + public ulong _base; + + /// + /// uint64_t size + /// + public ulong size; + + /// + /// uint64_t truncateSize + /// + public ulong truncateSize; + + /// + /// uint64_t nativeType + /// + public ulong nativeType; + + /// + /// uint64_t addend + /// + public ulong addend; + + /// + /// bool hasSign + /// + public bool hasSign; + + /// + /// bool implicitAddend + /// + public bool implicitAddend; + + /// + /// bool external + /// + public bool external; + + /// + /// uint64_t symbolIndex + /// + public ulong symbolIndex; + + /// + /// uint64_t sectionIndex + /// + public ulong sectionIndex; + + /// + /// uint64_t address + /// + public ulong address; + + /// + /// uint64_t target + /// + public ulong target; + + /// + /// bool dataRelocation + /// + public bool dataRelocation; + + /// + /// uint8_t[8] relocationDataCache + /// + public IntPtr relocationDataCache; + + /// + /// BNRelocationInfo* prev + /// + public IntPtr prev; + + /// + /// BNRelocationInfo* next + /// + public IntPtr next; + } + + public class RelocationInfo + { + public RelocationType Type { get; set; } = RelocationType.ELFGlobalRelocationType; + + public bool PcRelative { get; set; } = false; + + public bool BaseRelative { get; set; } = false; + + public ulong Base { get; set; } = 0; + + public ulong Size { get; set; } = 0; + + public ulong TruncateSize { get; set; } = 0; + + public ulong NativeType { get; set; } = 0; + + public ulong Addend { get; set; } = 0; + + public bool HasSign { get; set; } = false; + + public bool ImplicitAddend { get; set; } = false; + + public bool External { get; set; } = false; + + public ulong SymbolIndex { get; set; } = 0; + + public ulong SectionIndex { get; set; } = 0; + + public ulong Address { get; set; } = 0; + + public ulong Target { get; set; } = 0; + + public bool DataRelocation { get; set; } = false; + + public byte[] RelocationDataCache { get; set; } = Array.Empty(); + + public RelocationInfo? Prev { get; set; } = null; + + public RelocationInfo? Next { get; set; } = null; + + public RelocationInfo() + { + + } + } +} \ No newline at end of file diff --git a/Struct/BNRenderLayerCallbacks.cs b/Struct/BNRenderLayerCallbacks.cs new file mode 100644 index 0000000..5861470 --- /dev/null +++ b/Struct/BNRenderLayerCallbacks.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNRenderLayerCallbacks + { + /// + /// void* context + /// + public IntPtr context; + + /// + /// void** applyToFlowGraph + /// + public IntPtr applyToFlowGraph; + + /// + /// void** applyToLinearViewObject + /// + public IntPtr applyToLinearViewObject; + + /// + /// void** freeLines + /// + public IntPtr freeLines; + } + + public class RenderLayerCallbacks + { + public RenderLayerCallbacks() + { + + } + } +} \ No newline at end of file diff --git a/Struct/BNScriptingInstanceCallbacks.cs b/Struct/BNScriptingInstanceCallbacks.cs new file mode 100644 index 0000000..a23e647 --- /dev/null +++ b/Struct/BNScriptingInstanceCallbacks.cs @@ -0,0 +1,94 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNScriptingInstanceCallbacks + { + /// + /// void* context + /// + public IntPtr context; + + /// + /// void** destroyInstance + /// + public IntPtr destroyInstance; + + /// + /// void** externalRefTaken + /// + public IntPtr externalRefTaken; + + /// + /// void** externalRefReleased + /// + public IntPtr externalRefReleased; + + /// + /// void** executeScriptInput + /// + public IntPtr executeScriptInput; + + /// + /// void** executeScriptInputFromFilename + /// + public IntPtr executeScriptInputFromFilename; + + /// + /// void** cancelScriptInput + /// + public IntPtr cancelScriptInput; + + /// + /// void** releaseBinaryView + /// + public IntPtr releaseBinaryView; + + /// + /// void** setCurrentBinaryView + /// + public IntPtr setCurrentBinaryView; + + /// + /// void** setCurrentFunction + /// + public IntPtr setCurrentFunction; + + /// + /// void** setCurrentBasicBlock + /// + public IntPtr setCurrentBasicBlock; + + /// + /// void** setCurrentAddress + /// + public IntPtr setCurrentAddress; + + /// + /// void** setCurrentSelection + /// + public IntPtr setCurrentSelection; + + /// + /// void** completeInput + /// + public IntPtr completeInput; + + /// + /// void** stop + /// + public IntPtr stop; + } + + public class ScriptingInstanceCallbacks + { + public ScriptingInstanceCallbacks() + { + + } + } +} \ No newline at end of file diff --git a/Struct/BNScriptingOutputListener.cs b/Struct/BNScriptingOutputListener.cs new file mode 100644 index 0000000..789eae0 --- /dev/null +++ b/Struct/BNScriptingOutputListener.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNScriptingOutputListener + { + /// + /// void* context + /// + public IntPtr context; + + /// + /// void** output + /// + public IntPtr output; + + /// + /// void** warning + /// + public IntPtr warning; + + /// + /// void** error + /// + public IntPtr error; + + /// + /// void** inputReadyStateChanged + /// + public IntPtr inputReadyStateChanged; + } + + public class ScriptingOutputListener + { + public ScriptingOutputListener() + { + + } + } +} \ No newline at end of file diff --git a/Struct/BNScriptingProviderCallbacks.cs b/Struct/BNScriptingProviderCallbacks.cs new file mode 100644 index 0000000..49000c1 --- /dev/null +++ b/Struct/BNScriptingProviderCallbacks.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNScriptingProviderCallbacks + { + /// + /// void* context + /// + public IntPtr context; + + /// + /// void** createInstance + /// + public IntPtr createInstance; + + /// + /// void** loadModule + /// + public IntPtr loadModule; + + /// + /// void** installModules + /// + public IntPtr installModules; + } + + public class ScriptingProviderCallbacks + { + public ScriptingProviderCallbacks() + { + + } + } +} \ No newline at end of file diff --git a/Struct/BNSecretsProviderCallbacks.cs b/Struct/BNSecretsProviderCallbacks.cs new file mode 100644 index 0000000..aa38348 --- /dev/null +++ b/Struct/BNSecretsProviderCallbacks.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNSecretsProviderCallbacks + { + /// + /// void* context + /// + public IntPtr context; + + /// + /// void** hasData + /// + public IntPtr hasData; + + /// + /// void** getData + /// + public IntPtr getData; + + /// + /// void** storeData + /// + public IntPtr storeData; + + /// + /// void** deleteData + /// + public IntPtr deleteData; + } + + public class SecretsProviderCallbacks + { + public SecretsProviderCallbacks() + { + + } + } +} \ No newline at end of file diff --git a/Struct/BNSegmentInfo.cs b/Struct/BNSegmentInfo.cs new file mode 100644 index 0000000..cc886a6 --- /dev/null +++ b/Struct/BNSegmentInfo.cs @@ -0,0 +1,78 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNSegmentInfo + { + /// + /// uint64_t start + /// + internal ulong start; + + /// + /// uint64_t length + /// + internal ulong length; + + /// + /// uint64_t dataOffset + /// + internal ulong dataOffset; + + /// + /// uint64_t dataLength + /// + internal ulong dataLength; + + /// + /// uint32_t flags + /// + internal uint flags; + } + + public sealed class SegmentInfo : INativeWrapper + { + public ulong Start { get; set; } = 0; + + public ulong Length { get; set; } = 0; + + public ulong DataOffset { get; set; } = 0; + + public ulong DataLength { get; set; } = 0; + + public uint Flags { get; set; } = 0; + + public SegmentInfo() + { + + } + + internal static SegmentInfo FromNative(BNSegmentInfo native) + { + return new SegmentInfo() + { + Start = native.start , + Length = native.length , + DataOffset = native.dataOffset , + DataLength = native.dataLength , + Flags = native.flags , + }; + } + + public BNSegmentInfo ToNative() + { + return new BNSegmentInfo() + { + start = this.Start , + length = this.Length , + dataOffset = this.DataOffset , + dataLength = this.DataLength , + flags = this.Flags + }; + } + } +} \ No newline at end of file diff --git a/Struct/BNStackVariableReference.cs b/Struct/BNStackVariableReference.cs new file mode 100644 index 0000000..5c86d6c --- /dev/null +++ b/Struct/BNStackVariableReference.cs @@ -0,0 +1,68 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNStackVariableReference + { + /// + /// uint32_t sourceOperand + /// + public uint sourceOperand; + + /// + /// uint8_t typeConfidence + /// + public byte typeConfidence; + + /// + /// BNType* type + /// + public IntPtr type; + + /// + /// const char* name + /// + public IntPtr name; + + /// + /// uint64_t varIdentifier + /// + public ulong varIdentifier; + + /// + /// int64_t referencedOffset + /// + public long referencedOffset; + + /// + /// uint64_t size + /// + public ulong size; + } + + public sealed class StackVariableReference + { + public uint SourceOperand { get; set; } = 0; + + public byte TypeConfidence { get; set; } = 0; + + public BinaryNinja.Type? Type { get; set; } = null; + + public string Name { get; set; } = string.Empty; + + public ulong VarIdentifier { get; set; } = 0; + + public long ReferencedOffset { get; set; } = 0; + + public ulong Size { get; set; } = 0; + + public StackVariableReference() + { + + } + } +} \ No newline at end of file diff --git a/Struct/BNStringReference.cs b/Struct/BNStringReference.cs new file mode 100644 index 0000000..a29e113 --- /dev/null +++ b/Struct/BNStringReference.cs @@ -0,0 +1,60 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNStringReference + { + /// + /// BNStringType type + /// + internal StringType type; + + /// + /// uint64_t start + /// + internal ulong start; + + /// + /// uint64_t length + /// + internal ulong length; + } + + public sealed class StringReference : INativeWrapper + { + public StringType Type { get; set; } = StringType.AsciiString; + + public ulong Start { get; set; } = 0; + + public ulong Length { get; set; } = 0; + + public StringReference() + { + + } + + internal static StringReference FromNative(BNStringReference raw) + { + return new StringReference() + { + Type = raw.type , + Start = raw.start , + Length = raw.length + }; + } + + public BNStringReference ToNative() + { + return new BNStringReference() + { + type = this.Type , + start = this.Start , + length = this.Length + }; + } + } +} \ No newline at end of file diff --git a/Struct/BNStructureMember.cs b/Struct/BNStructureMember.cs new file mode 100644 index 0000000..d9a2560 --- /dev/null +++ b/Struct/BNStructureMember.cs @@ -0,0 +1,148 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNStructureMember + { + /// + /// BNType* type + /// + internal IntPtr type; + + /// + /// const char* name + /// + internal IntPtr name; + + /// + /// uint64_t offset + /// + public ulong offset; + + /// + /// uint8_t typeConfidence + /// + internal byte typeConfidence; + + /// + /// BNMemberAccess access + /// + internal MemberAccess access; + + /// + /// BNMemberScope scope + /// + internal MemberScope scope; + } + + public sealed class StructureMember : INativeWrapperEx + { + public BinaryNinja.Type Type { get; set; } + + public string Name { get; set; } = string.Empty; + + public ulong Offset { get; set; } = 0; + + public byte TypeConfidence { get; set; } = 0; + + public MemberAccess Access { get; set; } = MemberAccess.NoAccess; + + public MemberScope Scope { get; set; } = MemberScope.NoScope; + + public StructureMember( + BinaryNinja.Type kind, + string name, + ulong offset = 0, + byte typeConfidence = 0, + MemberAccess access = MemberAccess.PublicAccess, + MemberScope scope = MemberScope.NoScope + ) + { + this.Type = kind; + this.Name = name; + this.Offset = offset; + this.TypeConfidence = typeConfidence; + this.Access = access; + this.Scope = scope; + } + + internal static StructureMember MustFromNativePointer(IntPtr pointer) + { + if (IntPtr.Zero == pointer) + { + throw new ArgumentNullException(nameof(pointer)); + } + + return StructureMember.FromNative( Marshal.PtrToStructure(pointer) ); + } + + internal static StructureMember? FromNativePointer(IntPtr pointer) + { + if (IntPtr.Zero == pointer) + { + return null; + } + + return StructureMember.FromNative( Marshal.PtrToStructure(pointer) ); + } + + internal static StructureMember FromNative(BNStructureMember native) + { + return new StructureMember( + new BinaryNinja.Type(NativeMethods.BNNewTypeReference(native.type) , true) , + UnsafeUtils.ReadAnsiString(native.name) , + native.offset , + native.typeConfidence , + native.access , + native.scope + ); + } + + internal static StructureMember? TakeNativePointer(IntPtr pointer) + { + if (IntPtr.Zero == pointer) + { + return null; + } + + StructureMember member = StructureMember.FromNative( + Marshal.PtrToStructure(pointer) + ); + + NativeMethods.BNFreeStructureMember(pointer); + + return member; + } + + public BNStructureMember ToNativeEx(ScopedAllocator allocator) + { + return new BNStructureMember() + { + type = this.Type.DangerousGetHandle() , + name = allocator.AllocAnsiString(this.Name) , + offset = this.Offset , + typeConfidence = this.TypeConfidence , + access = this.Access , + scope = this.Scope , + }; + } + + public override string ToString() + { + StringBuilder builder = new StringBuilder(); + + builder.AppendLine($"// offset: {this.Offset}"); + + builder.AppendLine($"// confidence: {this.TypeConfidence}"); + + builder.Append($"{this.Type.GetString()} {this.Name};"); + + return builder.ToString(); + } + } +} \ No newline at end of file diff --git a/Struct/BNSystemCallInfo.cs b/Struct/BNSystemCallInfo.cs new file mode 100644 index 0000000..f24c00b --- /dev/null +++ b/Struct/BNSystemCallInfo.cs @@ -0,0 +1,60 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNSystemCallInfo + { + /// + /// uint32_t number + /// + internal uint number; + + /// + /// BNQualifiedName name + /// + internal BNQualifiedName name; + + /// + /// BNType* type + /// + internal IntPtr type; + } + + public sealed class SystemCallInfo : INativeWrapperEx + { + public uint Number { get; set; } = 0; + + public QualifiedName Name { get; set; } = new QualifiedName(); + + public BinaryNinja.Type? Type { get; set; } = null; + + public SystemCallInfo() + { + + } + + internal static SystemCallInfo FromNative(BNSystemCallInfo native) + { + return new SystemCallInfo() + { + Number = native.number , + Name = QualifiedName.FromNative(native.name) , + Type = BinaryNinja.Type.NewFromHandle(native.type) , + }; + } + + public BNSystemCallInfo ToNativeEx(ScopedAllocator allocator) + { + return new BNSystemCallInfo() + { + number = this.Number , + name = this.Name.ToNativeEx(allocator) , + type = ( null == this.Type ? IntPtr.Zero : this.Type.DangerousGetHandle() ) + }; + } + } +} \ No newline at end of file diff --git a/Struct/BNTagReference.cs b/Struct/BNTagReference.cs new file mode 100644 index 0000000..23a5a9b --- /dev/null +++ b/Struct/BNTagReference.cs @@ -0,0 +1,84 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNTagReference + { + /// + /// BNTagReferenceType refType + /// + internal TagReferenceType refType; + + /// + /// bool autoDefined + /// + internal bool autoDefined; + + /// + /// BNTag* tag + /// + internal IntPtr tag; + + /// + /// BNArchitecture* arch + /// + internal IntPtr arch; + + /// + /// BNFunction* func + /// + internal IntPtr function; + + /// + /// uint64_t addr + /// + internal ulong address; + } + + public class TagReference : INativeWrapper + { + public TagReferenceType RefType { get; set; } = TagReferenceType.AddressTagReference; + + public bool AutoDefined { get; set; } = false; + + public Tag Tag { get; set; } + + public Architecture? Architecture { get; set; } = null; + + public Function? Function { get; set; } = null; + + public ulong Address { get; set; } = 0; + + public TagReference(Tag tag) + { + this.Tag = tag; + } + + internal static TagReference FromNative(BNTagReference native) + { + return new TagReference(Tag.MustNewFromHandle(native.tag)) + { + RefType = native.refType , + AutoDefined = native.autoDefined , + Architecture = Architecture.FromHandle(native.arch) , + Function = Function.NewFromHandle(native.function) , + }; + } + + public BNTagReference ToNative() + { + return new BNTagReference + { + refType = this.RefType , + autoDefined = this.AutoDefined , + tag = ( null == this.Tag ? IntPtr.Zero : this.Tag.DangerousGetHandle() ) , + arch = ( null == this.Architecture ? IntPtr.Zero : this.Architecture.DangerousGetHandle() ) , + function = ( null == this.Function ? IntPtr.Zero : this.Function.DangerousGetHandle() ) + }; + } + } +} \ No newline at end of file diff --git a/Struct/BNTokenEmitterExpr.cs b/Struct/BNTokenEmitterExpr.cs new file mode 100644 index 0000000..8bf27c6 --- /dev/null +++ b/Struct/BNTokenEmitterExpr.cs @@ -0,0 +1,58 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNTokenEmitterExpr + { + /// + /// uint64_t address + /// + internal ulong address; + + /// + /// uint32_t sourceOperand + /// + internal uint sourceOperand; + + /// + /// uint64_t exprIndex + /// + internal ulong exprIndex; + + /// + /// uint64_t instrIndex + /// + internal ulong instrIndex; + } + + public sealed class TokenEmitterExpression + { + public ulong Address { get; set; } = 0; + + public uint SourceOperand { get; set; } = 0; + + public HighLevelILExpressionIndex ExpressionIndex { get; set; } = 0; + + public HighLevelILInstructionIndex InstructionIndex { get; set; } = 0; + + public TokenEmitterExpression() + { + + } + + public BNTokenEmitterExpr ToNative() + { + return new BNTokenEmitterExpr() + { + address = this.Address , + sourceOperand = this.SourceOperand , + exprIndex = (ulong)this.ExpressionIndex , + instrIndex = (ulong)this.InstructionIndex , + }; + } + } +} \ No newline at end of file diff --git a/Struct/BNTransformParameter.cs b/Struct/BNTransformParameter.cs new file mode 100644 index 0000000..c029f85 --- /dev/null +++ b/Struct/BNTransformParameter.cs @@ -0,0 +1,57 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNTransformParameter + { + /// + /// char* name + /// + internal IntPtr name; + + /// + /// BNDataBuffer* value + /// + internal IntPtr value; + } + + public sealed class TransformParameter : INativeWrapperEx + { + public string Name { get; set; } = string.Empty; + + public DataBuffer Value { get; set; } + + public TransformParameter(string name , DataBuffer value) + { + this.Name = name; + this.Value = value; + } + + public TransformParameter(string name , byte[] value) + { + this.Name = name; + this.Value = DataBuffer.FromBytes(value); + } + + internal static TransformParameter FromNative(BNTransformParameter native) + { + return new TransformParameter( + UnsafeUtils.ReadAnsiString(native.name) , + DataBuffer.MustNewFromHandle(native.value) + ); + } + + public BNTransformParameter ToNativeEx(ScopedAllocator allocator) + { + return new BNTransformParameter() + { + name = allocator.AllocAnsiString(this.Name) , + value = this.Value.DangerousGetHandle() + }; + } + } +} \ No newline at end of file diff --git a/Struct/BNTransformParameterInfo.cs b/Struct/BNTransformParameterInfo.cs new file mode 100644 index 0000000..6a81085 --- /dev/null +++ b/Struct/BNTransformParameterInfo.cs @@ -0,0 +1,82 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNTransformParameterInfo + { + /// + /// char* name + /// + internal IntPtr name; + + /// + /// char* longName + /// + internal IntPtr longName; + + /// + /// uint64_t fixedLength + /// + internal ulong fixedLength; + } + + public sealed class TransformParameterInfo : INativeWrapperEx + { + public string Name { get; set; } = string.Empty; + + public string LongName { get; set; } = string.Empty; + + public ulong FixedLength { get; set; } = 0; + + public TransformParameterInfo() + { + + } + + internal static TransformParameterInfo FromNative(BNTransformParameterInfo native) + { + return new TransformParameterInfo() + { + Name = UnsafeUtils.ReadAnsiString(native.name) , + LongName = UnsafeUtils.ReadAnsiString(native.longName) , + FixedLength = native.fixedLength + }; + } + + public BNTransformParameterInfo ToNativeEx(ScopedAllocator allocator) + { + return new BNTransformParameterInfo() + { + name = allocator.AllocAnsiString(this.Name) , + longName = allocator.AllocAnsiString(this.LongName) , + fixedLength = this.FixedLength + }; + } + + internal BNTransformParameterInfo UnsafeToNative() + { + return new BNTransformParameterInfo() + { + name = UnsafeUtils.AllocAnsiString(this.Name) , + longName = UnsafeUtils.AllocAnsiString(this.LongName) , + fixedLength = this.FixedLength + }; + } + + internal static BNTransformParameterInfo[] UnsafeToNativeArray(TransformParameterInfo[] parameters) + { + List targets = new List(); + + foreach (TransformParameterInfo source in parameters) + { + targets.Add( source.UnsafeToNative() ); + } + + return targets.ToArray(); + } + } +} \ No newline at end of file diff --git a/Struct/BNTypeArchiveNotification.cs b/Struct/BNTypeArchiveNotification.cs new file mode 100644 index 0000000..4ab0dc1 --- /dev/null +++ b/Struct/BNTypeArchiveNotification.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNTypeArchiveNotification + { + /// + /// void* context + /// + public IntPtr context; + + /// + /// void** typeAdded + /// + public IntPtr typeAdded; + + /// + /// void** typeUpdated + /// + public IntPtr typeUpdated; + + /// + /// void** typeRenamed + /// + public IntPtr typeRenamed; + + /// + /// void** typeDeleted + /// + public IntPtr typeDeleted; + } + + public class TypeArchiveNotification + { + + public TypeArchiveNotification() + { + + } + } +} \ No newline at end of file diff --git a/Struct/BNTypeAttribute.cs b/Struct/BNTypeAttribute.cs new file mode 100644 index 0000000..411c9fe --- /dev/null +++ b/Struct/BNTypeAttribute.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNTypeAttribute + { + /// + /// const char* name + /// + public IntPtr name; + + /// + /// const char* _value + /// + public IntPtr _value; + } + + public sealed class TypeAttribute + { + public string Name { get; set; } = string.Empty; + + public string Value { get; set; } = string.Empty; + + public TypeAttribute() + { + + } + } +} \ No newline at end of file diff --git a/Struct/BNTypeContext.cs b/Struct/BNTypeContext.cs new file mode 100644 index 0000000..674a3e7 --- /dev/null +++ b/Struct/BNTypeContext.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNTypeContext + { + /// + /// BNType* type + /// + public IntPtr type; + + /// + /// uint64_t offset + /// + public ulong offset; + } + + public sealed class TypeContext + { + public BinaryNinja.Type? Type { get; set; } = null; + + public ulong Offset { get; set; } = 0; + + public TypeContext() + { + + } + } +} \ No newline at end of file diff --git a/Struct/BNTypeDefinitionLine.cs b/Struct/BNTypeDefinitionLine.cs new file mode 100644 index 0000000..c44e45e --- /dev/null +++ b/Struct/BNTypeDefinitionLine.cs @@ -0,0 +1,138 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNTypeDefinitionLine + { + /// + /// BNTypeDefinitionLineType lineType + /// + internal TypeDefinitionLineType lineType; + + /// + /// BNInstructionTextToken* tokens + /// + internal IntPtr tokens; + + /// + /// uint64_t count + /// + internal ulong count; + + /// + /// BNType* type + /// + internal IntPtr type; + + /// + /// BNType* parentType + /// + internal IntPtr parentType; + + /// + /// BNType* rootType + /// + internal IntPtr rootType; + + /// + /// const char* rootTypeName + /// + internal IntPtr rootTypeName; + + /// + /// BNNamedTypeReference* baseType + /// + internal IntPtr baseType; + + /// + /// uint64_t baseOffset + /// + internal ulong baseOffset; + + /// + /// uint64_t offset + /// + internal ulong offset; + + /// + /// uint64_t fieldIndex + /// + internal ulong fieldIndex; + } + + public sealed class TypeDefinitionLine : INativeWrapperEx + { + public TypeDefinitionLineType LineType { get; set; } = TypeDefinitionLineType.TypedefLineType; + + public InstructionTextToken[] Tokens { get; set; } = Array.Empty(); + + public BinaryNinja.Type? Type { get; set; } = null; + + public BinaryNinja.Type? ParentType { get; set; } = null; + + public BinaryNinja.Type? RootType { get; set; } = null; + + public string RootTypeName { get; set; } = string.Empty; + + public NamedTypeReference? BaseType { get; set; } = null; + + public ulong BaseOffset { get; set; } = 0; + + public ulong Offset { get; set; } = 0; + + public ulong FieldIndex { get; set; } = 0; + + public TypeDefinitionLine() + { + + } + + internal static TypeDefinitionLine FromNative(BNTypeDefinitionLine native) + { + return new TypeDefinitionLine() + { + LineType = native.lineType , + Tokens = UnsafeUtils.ReadStructArray( + native.tokens , + native.count , + InstructionTextToken.FromNative + ) , + Type = BinaryNinja.Type.NewFromHandle(native.type) , + ParentType = BinaryNinja.Type.NewFromHandle(native.parentType) , + RootType = BinaryNinja.Type.NewFromHandle(native.rootType) , + RootTypeName = UnsafeUtils.ReadAnsiString(native.rootTypeName) , + BaseType = NamedTypeReference.NewFromHandle(native.type) , + BaseOffset = native.baseOffset , + Offset = native.offset , + FieldIndex = native.fieldIndex + }; + } + + public BNTypeDefinitionLine ToNativeEx(ScopedAllocator allocator) + { + return new BNTypeDefinitionLine() + { + lineType = this.LineType, + tokens = allocator.AllocStructArray( + + allocator.ConvertToNativeArrayEx( + this.Tokens + ) + ), + count = (ulong)this.Tokens.Length, + type = ( null == this.Type ? IntPtr.Zero : this.Type.DangerousGetHandle() ), + parentType = ( null == this.ParentType ? IntPtr.Zero : this.ParentType.DangerousGetHandle() ), + rootType = ( null == this.RootType ? IntPtr.Zero : this.RootType.DangerousGetHandle() ), + rootTypeName = ( 0 == this.RootTypeName.Length ? IntPtr.Zero : allocator.AllocAnsiString(this.RootTypeName) ), + baseType = ( null == this.BaseType ? IntPtr.Zero : this.BaseType.DangerousGetHandle() ), + baseOffset = this.BaseOffset, + offset = this.Offset, + fieldIndex = this.FieldIndex + }; + } + } +} \ No newline at end of file diff --git a/Struct/BNTypeField.cs b/Struct/BNTypeField.cs new file mode 100644 index 0000000..91341aa --- /dev/null +++ b/Struct/BNTypeField.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNTypeField + { + /// + /// BNQualifiedName name + /// + public BNQualifiedName name; + + /// + /// uint64_t offset + /// + public ulong offset; + } + + public sealed class TypeField + { + public QualifiedName Name { get; set; } = new QualifiedName(); + + public ulong Offset { get; set; } = 0; + + public TypeField() + { + + } + } +} \ No newline at end of file diff --git a/Struct/BNTypeFieldReference.cs b/Struct/BNTypeFieldReference.cs new file mode 100644 index 0000000..a980472 --- /dev/null +++ b/Struct/BNTypeFieldReference.cs @@ -0,0 +1,58 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNTypeFieldReference + { + /// + /// BNFunction* func + /// + public IntPtr func; + + /// + /// BNArchitecture* arch + /// + public IntPtr arch; + + /// + /// uint64_t addr + /// + public ulong addr; + + /// + /// uint64_t size + /// + public ulong size; + + /// + /// BNTypeWithConfidence incomingType + /// + public BNTypeWithConfidence incomingType; + } + + public class TypeFieldReference + { + public Function? Function { get; set; } = null; + + public Architecture? Architecture { get; set; } = null; + + public ulong Address { get; set; } = 0; + + public ulong Size { get; set; } = 0; + + public TypeWithConfidence IncomingType { get; set; } + + internal TypeFieldReference(BNTypeFieldReference native) + { + this.Function = Function.NewFromHandle(native.func); + this.Architecture = Architecture.FromHandle(native.arch); + this.Address = native.addr; + this.Size = native.size; + this.IncomingType = TypeWithConfidence.FromNative(native.incomingType); + } + } +} \ No newline at end of file diff --git a/Struct/BNTypeFieldReferenceSizeInfo.cs b/Struct/BNTypeFieldReferenceSizeInfo.cs new file mode 100644 index 0000000..e090345 --- /dev/null +++ b/Struct/BNTypeFieldReferenceSizeInfo.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNTypeFieldReferenceSizeInfo + { + /// + /// uint64_t offset + /// + internal ulong offset; + + /// + /// uint64_t* sizes + /// + internal IntPtr sizes; + + /// + /// uint64_t count + /// + internal ulong count; + } + + public sealed class TypeFieldReferenceSizeInfo + { + public ulong Offset { get; set; } = 0; + + public ulong[] Sizes { get; set; } = Array.Empty(); + + public TypeFieldReferenceSizeInfo() + { + + } + + internal static TypeFieldReferenceSizeInfo FromNative(BNTypeFieldReferenceSizeInfo native) + { + return new TypeFieldReferenceSizeInfo() + { + Offset = native.offset , + Sizes = UnsafeUtils.ReadNumberArray(native.sizes , native.count) + }; + } + + } +} \ No newline at end of file diff --git a/Struct/BNTypeFieldReferenceTypeInfo.cs b/Struct/BNTypeFieldReferenceTypeInfo.cs new file mode 100644 index 0000000..635d9af --- /dev/null +++ b/Struct/BNTypeFieldReferenceTypeInfo.cs @@ -0,0 +1,51 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNTypeFieldReferenceTypeInfo + { + /// + /// uint64_t offset + /// + internal ulong offset; + + /// + /// BNTypeWithConfidence* types + /// + internal IntPtr types; + + /// + /// uint64_t count + /// + internal ulong count; + } + + public sealed class TypeFieldReferenceTypeInfo + { + public ulong Offset { get; set; } = 0; + + public TypeWithConfidence[] Types { get; set; } = Array.Empty(); + + public TypeFieldReferenceTypeInfo() + { + + } + + internal static TypeFieldReferenceTypeInfo FromNative(BNTypeFieldReferenceTypeInfo native) + { + return new TypeFieldReferenceTypeInfo() + { + Offset = native.offset , + Types = UnsafeUtils.ReadStructArray( + native.types , + native.count, + TypeWithConfidence.FromNative + ) + }; + } + } +} \ No newline at end of file diff --git a/Struct/BNTypeParserCallbacks.cs b/Struct/BNTypeParserCallbacks.cs new file mode 100644 index 0000000..9a9edfd --- /dev/null +++ b/Struct/BNTypeParserCallbacks.cs @@ -0,0 +1,59 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNTypeParserCallbacks + { + /// + /// void* context + /// + public IntPtr context; + + /// + /// void** getOptionText + /// + public IntPtr getOptionText; + + /// + /// void** preprocessSource + /// + public IntPtr preprocessSource; + + /// + /// void** parseTypesFromSource + /// + public IntPtr parseTypesFromSource; + + /// + /// void** parseTypeString + /// + public IntPtr parseTypeString; + + /// + /// void** freeString + /// + public IntPtr freeString; + + /// + /// void** freeResult + /// + public IntPtr freeResult; + + /// + /// void** freeErrorList + /// + public IntPtr freeErrorList; + } + + public class TypeParserCallbacks + { + public TypeParserCallbacks() + { + + } + } +} \ No newline at end of file diff --git a/Struct/BNTypeParserError.cs b/Struct/BNTypeParserError.cs new file mode 100644 index 0000000..78e7694 --- /dev/null +++ b/Struct/BNTypeParserError.cs @@ -0,0 +1,66 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNTypeParserError + { + /// + /// BNTypeParserErrorSeverity severity + /// + public TypeParserErrorSeverity severity; + + /// + /// const char* message + /// + public IntPtr message; + + /// + /// const char* fileName + /// + public IntPtr fileName; + + /// + /// uint64_t line + /// + public ulong line; + + /// + /// uint64_t column + /// + public ulong column; + } + + public sealed class TypeParserError + { + public TypeParserErrorSeverity Severity { get; set; } = TypeParserErrorSeverity.IgnoredSeverity; + + public string Message { get; set; } = string.Empty; + + public string FileName { get; set; } = string.Empty; + + public ulong Line { get; set; } = 0; + + public ulong Column { get; set; } = 0; + + public TypeParserError() + { + + } + + internal static TypeParserError FromNative(BNTypeParserError raw) + { + return new TypeParserError() + { + Severity = raw.severity , + Message = UnsafeUtils.ReadAnsiString(raw.message) , + FileName = UnsafeUtils.ReadAnsiString(raw.fileName) , + Line = raw.line , + Column = raw.column + }; + } + } +} \ No newline at end of file diff --git a/Struct/BNTypeParserResult.cs b/Struct/BNTypeParserResult.cs new file mode 100644 index 0000000..6914ce2 --- /dev/null +++ b/Struct/BNTypeParserResult.cs @@ -0,0 +1,86 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNTypeParserResult + { + /// + /// BNParsedType* types + /// + internal IntPtr types; + + /// + /// BNParsedType* variables + /// + internal IntPtr variables; + + /// + /// BNParsedType* functions + /// + internal IntPtr functions; + + /// + /// uint64_t typeCount + /// + internal ulong typeCount; + + /// + /// uint64_t variableCount + /// + internal ulong variableCount; + + /// + /// uint64_t functionCount + /// + internal ulong functionCount; + } + + public sealed class TypeParserResult + { + public ParsedType[] Types { get; set; } = Array.Empty(); + + public ParsedType[] Variables { get; set; } = Array.Empty(); + + public ParsedType[] Functions { get; set; } = Array.Empty(); + + public TypeParserResult() + { + + } + + internal static TypeParserResult FromNative(BNTypeParserResult native) + { + return new TypeParserResult() + { + Types = UnsafeUtils.ReadStructArray( + native.types , + native.typeCount , + ParsedType.FromNative + ) , + Variables = UnsafeUtils.ReadStructArray( + native.variables , + native.variableCount , + ParsedType.FromNative + ) , + Functions = UnsafeUtils.ReadStructArray( + native.functions , + native.functionCount , + ParsedType.FromNative + ) + }; + } + + internal static TypeParserResult TakeNative(BNTypeParserResult native) + { + TypeParserResult target = TypeParserResult.FromNative(native); + + NativeMethods.BNFreeTypeParserResult(native); + + return target; + } + } +} \ No newline at end of file diff --git a/Struct/BNTypePrinterCallbacks.cs b/Struct/BNTypePrinterCallbacks.cs new file mode 100644 index 0000000..59b909a --- /dev/null +++ b/Struct/BNTypePrinterCallbacks.cs @@ -0,0 +1,80 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNTypePrinterCallbacks + { + /// + /// void* context + /// + public IntPtr context; + + /// + /// void** getTypeTokens + /// + public IntPtr getTypeTokens; + + /// + /// void** getTypeTokensBeforeName + /// + public IntPtr getTypeTokensBeforeName; + + /// + /// void** getTypeTokensAfterName + /// + public IntPtr getTypeTokensAfterName; + + /// + /// void** getTypeString + /// + public IntPtr getTypeString; + + /// + /// void** getTypeStringBeforeName + /// + public IntPtr getTypeStringBeforeName; + + /// + /// void** getTypeStringAfterName + /// + public IntPtr getTypeStringAfterName; + + /// + /// void** getTypeLines + /// + public IntPtr getTypeLines; + + /// + /// void** printAllTypes + /// + public IntPtr printAllTypes; + + /// + /// void** freeTokens + /// + public IntPtr freeTokens; + + /// + /// void** freeString + /// + public IntPtr freeString; + + /// + /// void** freeLines + /// + public IntPtr freeLines; + + } + + public class TypePrinterCallbacks + { + public TypePrinterCallbacks() + { + + } + } +} \ No newline at end of file diff --git a/Struct/BNTypeReferenceSource.cs b/Struct/BNTypeReferenceSource.cs new file mode 100644 index 0000000..8128b9e --- /dev/null +++ b/Struct/BNTypeReferenceSource.cs @@ -0,0 +1,60 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNTypeReferenceSource + { + /// + /// BNQualifiedName name + /// + internal BNQualifiedName name; + + /// + /// uint64_t offset + /// + internal ulong offset; + + /// + /// BNTypeReferenceType type + /// + internal TypeReferenceType type; + } + + public sealed class TypeReferenceSource : INativeWrapperEx + { + public QualifiedName Name { get; set; } = new QualifiedName(); + + public ulong Offset { get; set; } = 0; + + public TypeReferenceType Type { get; set; } = TypeReferenceType.DirectTypeReferenceType; + + public TypeReferenceSource() + { + + } + + internal static TypeReferenceSource FromNative(BNTypeReferenceSource native) + { + return new TypeReferenceSource() + { + Name = QualifiedName.FromNative(native.name) , + Offset = native.offset , + Type = native.type + }; + } + + public BNTypeReferenceSource ToNativeEx(ScopedAllocator allocator) + { + return new BNTypeReferenceSource() + { + name = this.Name.ToNativeEx(allocator) , + offset = this.Offset , + type = this.Type + }; + } + } +} \ No newline at end of file diff --git a/Struct/BNTypeWithConfidence.cs b/Struct/BNTypeWithConfidence.cs new file mode 100644 index 0000000..0feeaa7 --- /dev/null +++ b/Struct/BNTypeWithConfidence.cs @@ -0,0 +1,61 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNTypeWithConfidence + { + /// + /// BNType* type + /// + internal IntPtr type; + + /// + /// uint8_t confidence + /// + internal byte confidence; + } + + public sealed class TypeWithConfidence : INativeWrapper + { + public BinaryNinja.Type Type { get; } + + public byte Confidence { get; } = 0; + + public TypeWithConfidence(BinaryNinja.Type type , byte confidence = 0) + { + this.Type = type; + this.Confidence = confidence; + } + + internal static TypeWithConfidence FromNative(BNTypeWithConfidence native) + { + return new TypeWithConfidence( + new BinaryNinja.Type( NativeMethods.BNNewTypeReference(native.type) , true) , + native.confidence + ); + } + + internal static TypeWithConfidence MustFromNativePointer(IntPtr pointer) + { + if (IntPtr.Zero == pointer) + { + throw new NullReferenceException(nameof(pointer)); + } + + return TypeWithConfidence.FromNative( Marshal.PtrToStructure(pointer) ); + } + + public BNTypeWithConfidence ToNative() + { + return new BNTypeWithConfidence() + { + type = this.Type.DangerousGetHandle(), + confidence = Confidence + }; + } + } +} \ No newline at end of file diff --git a/Struct/BNUpdateChannel.cs b/Struct/BNUpdateChannel.cs new file mode 100644 index 0000000..2f77f44 --- /dev/null +++ b/Struct/BNUpdateChannel.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNUpdateChannel + { + /// + /// const char* name + /// + public IntPtr name; + + /// + /// const char* description + /// + public IntPtr description; + + /// + /// const char* latestVersion + /// + public IntPtr latestVersion; + } + + public sealed class UpdateChannel + { + public string Name { get; set; } = string.Empty; + + public string Description { get; set; } = string.Empty; + + public string LatestVersion { get; set; } = string.Empty; + + public UpdateChannel() + { + + } + } +} \ No newline at end of file diff --git a/Struct/BNUpdateChannelFullInfo.cs b/Struct/BNUpdateChannelFullInfo.cs new file mode 100644 index 0000000..a7192d6 --- /dev/null +++ b/Struct/BNUpdateChannelFullInfo.cs @@ -0,0 +1,64 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNUpdateChannelFullInfo + { + /// + /// BNUpdateVersionNew* versions + /// + public IntPtr versions; + + /// + /// uint64_t versionCount + /// + public ulong versionCount; + + /// + /// BNChangelogEntry* changelogEntries + /// + public IntPtr changelogEntries; + + /// + /// uint64_t changelogEntryCount + /// + public ulong changelogEntryCount; + + /// + /// const char* name + /// + public IntPtr name; + + /// + /// const char* desc + /// + public IntPtr desc; + + /// + /// const char* latestVersion + /// + public IntPtr latestVersion; + } + + public sealed class UpdateChannelFullInfo + { + public UpdateVersionNew[] Versions { get; set; } = Array.Empty(); + + public ChangelogEntry[] ChangelogEntries { get; set; } = Array.Empty(); + + public string Name { get; set; } = string.Empty; + + public string Desc { get; set; } = string.Empty; + + public string LatestVersion { get; set; } = string.Empty; + + public UpdateChannelFullInfo() + { + + } + } +} \ No newline at end of file diff --git a/Struct/BNUpdateVersion.cs b/Struct/BNUpdateVersion.cs new file mode 100644 index 0000000..4f7401c --- /dev/null +++ b/Struct/BNUpdateVersion.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNUpdateVersion + { + /// + /// const char* version + /// + public IntPtr version; + + /// + /// const char* notes + /// + public IntPtr notes; + + /// + /// uint64_t time + /// + public ulong time; + } + + public sealed class UpdateVersion + { + public string Version { get; set; } = string.Empty; + + public string Notes { get; set; } = string.Empty; + + public ulong Time { get; set; } = 0; + + public UpdateVersion() + { + + } + } +} \ No newline at end of file diff --git a/Struct/BNUpdateVersionNew.cs b/Struct/BNUpdateVersionNew.cs new file mode 100644 index 0000000..e363c45 --- /dev/null +++ b/Struct/BNUpdateVersionNew.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNUpdateVersionNew + { + /// + /// BNVersionInfo version + /// + public BNVersionInfo version; + + /// + /// const char* name + /// + public IntPtr name; + + /// + /// uint64_t time + /// + public ulong time; + } + + public sealed class UpdateVersionNew + { + public VersionInfo Version { get; set; } = new VersionInfo(); + + public string Name { get; set; } = string.Empty; + + public ulong Time { get; set; } = 0; + + public UpdateVersionNew() + { + + } + } +} \ No newline at end of file diff --git a/Struct/BNUserVariableValue.cs b/Struct/BNUserVariableValue.cs new file mode 100644 index 0000000..71945ca --- /dev/null +++ b/Struct/BNUserVariableValue.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNUserVariableValue + { + /// + /// BNVariable variable + /// + internal BNVariable variable; + + /// + /// BNArchitectureAndAddress defSite + /// + internal BNArchitectureAndAddress defSite; + + /// + /// bool after + /// + internal bool after; + + /// + /// BNPossibleValueSet value + /// + internal BNPossibleValueSet value; + } + + public sealed class UserVariableValue + { + public CoreVariable Variable { get; set; } + + public ArchitectureAndAddress DefSite { get; set; } + + public bool After { get; set; } + + public PossibleValueSet Value { get; set; } + + internal UserVariableValue(BNUserVariableValue native) + { + this.Variable = CoreVariable.FromNative(native.variable); + this.DefSite = ArchitectureAndAddress.FromNative(native.defSite); + this.After = native.after; + this.Value = PossibleValueSet.FromNative(native.value); + } + } +} \ No newline at end of file diff --git a/Struct/BNValueRange.cs b/Struct/BNValueRange.cs new file mode 100644 index 0000000..05e38f0 --- /dev/null +++ b/Struct/BNValueRange.cs @@ -0,0 +1,60 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNValueRange + { + /// + /// uint64_t start + /// + internal ulong start; + + /// + /// uint64_t end + /// + internal ulong end; + + /// + /// uint64_t step + /// + internal ulong step; + } + + public sealed class ValueRange : INativeWrapper + { + public ulong Start { get; set; } = 0; + + public ulong End { get; set; } = 0; + + public ulong Step { get; set; } = 0; + + public ValueRange() + { + + } + + internal static ValueRange FromNative(BNValueRange native) + { + return new ValueRange() + { + Start = native.start , + End = native.end , + Step = native.step + }; + } + + public BNValueRange ToNative() + { + return new BNValueRange() + { + start = this.Start , + end = this.End , + step = this.Step + }; + } + } +} \ No newline at end of file diff --git a/Struct/BNVariable.cs b/Struct/BNVariable.cs new file mode 100644 index 0000000..c08bf45 --- /dev/null +++ b/Struct/BNVariable.cs @@ -0,0 +1,165 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNVariable + { + /// + /// BNVariableSourceType type + /// + internal VariableSourceType type; + + /// + /// uint32_t index + /// + internal uint index; + + /// + /// int64_t storage + /// + internal long storage; + } + + public abstract class AbstractVariable : INativeWrapper, + IEquatable, + IComparable + where T_SELF : AbstractVariable + { + public VariableSourceType Type { get; internal set; } = VariableSourceType.StackVariableSourceType; + + public uint Index { get; internal set; } = 0; + + public long Storage { get; internal set; } = 0; + + internal AbstractVariable() + { + + } + + internal AbstractVariable( + VariableSourceType type, + uint index, + long storage + ) + { + this.Type = type; + this.Index = index; + this.Storage = storage; + } + + internal AbstractVariable(BNVariable native) + { + this.Type = native.type; + this.Index = native.index; + this.Storage = native.storage; + } + + public BNVariable ToNative() + { + return new BNVariable() + { + type = this.Type , + index = this.Index , + storage = this.Storage + }; + } + + public ulong Identifier + { + get + { + return NativeMethods.BNToVariableIdentifier(this.ToNative()); + } + } + + public override bool Equals(object? other) + { + return Equals(other as T_SELF); + } + + public bool Equals(T_SELF? other) + { + if (other is null) + { + return false; + } + + if (ReferenceEquals(this , other)) + { + return true; + } + + return this.Identifier == other.Identifier; + } + + public override int GetHashCode() + { + return this.Identifier.GetHashCode(); + } + + public static bool operator ==(AbstractVariable? left, AbstractVariable? right) + { + if (left is null) + { + return right is null; + } + + return left.Equals(right); + } + + public static bool operator !=(AbstractVariable? left, AbstractVariable? right) + { + return !(left == right); + } + + public int CompareTo(T_SELF? other) + { + if (other is null) + { + return 1; + } + + return this.Identifier.CompareTo(other.Identifier); + } + } + + public sealed class CoreVariable : AbstractVariable + { + internal CoreVariable() + { + + } + + internal CoreVariable( + VariableSourceType type, + uint index, + long storage + ) : base(type, index, storage) + { + + } + + internal CoreVariable(BNVariable native) + :base(native) + { + + } + + internal static CoreVariable FromIdentifier(ulong identifier) + { + return new CoreVariable( + NativeMethods.BNFromVariableIdentifier(identifier) + ); + } + + internal static CoreVariable FromNative(BNVariable native) + { + return new CoreVariable(native); + } + } + +} \ No newline at end of file diff --git a/Struct/BNVariableFieldResolutionInfo.cs b/Struct/BNVariableFieldResolutionInfo.cs new file mode 100644 index 0000000..8fc97db --- /dev/null +++ b/Struct/BNVariableFieldResolutionInfo.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNVariableFieldResolutionInfo + { + /// + /// BNArchitectureAndAddress location + /// + internal BNArchitectureAndAddress location; + + /// + /// BNVariable _var + /// + internal BNVariable variable; + + /// + /// BNFieldResolutionInfo* info + /// + internal IntPtr info; + } + + public class VariableFieldResolutionInfo + { + public ArchitectureAndAddress Location; + + public CoreVariable Variable { get; set; } + + public FieldResolutionInfo? Info { get; set; } = null; + + internal VariableFieldResolutionInfo( + BNVariableFieldResolutionInfo native + ) + { + this.Location = ArchitectureAndAddress.FromNative(native.location); + this.Variable = CoreVariable.FromNative(native.variable); + } + } +} \ No newline at end of file diff --git a/Struct/BNVariableNameAndType.cs b/Struct/BNVariableNameAndType.cs new file mode 100644 index 0000000..1aa70e8 --- /dev/null +++ b/Struct/BNVariableNameAndType.cs @@ -0,0 +1,80 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + public unsafe struct BNVariableNameAndType + { + /// + /// BNVariable _var + /// + internal BNVariable variable; + + /// + /// BNType* type + /// + internal IntPtr type; + + /// + /// const char* name + /// + internal IntPtr name; + + /// + /// bool autoDefined + /// + internal bool autoDefined; + + /// + /// uint8_t typeConfidence + /// + internal byte typeConfidence; + } + + public class VariableNameAndType + { + public CoreVariable variable { get; set; } + + public BinaryNinja.Type Type { get; set; } + + public string Name { get; set; } = string.Empty; + + public bool AutoDefined { get; set; } = false; + + public byte TypeConfidence { get; set; } = 0; + + internal VariableNameAndType(BNVariableNameAndType native) + { + this.variable = CoreVariable.FromNative(native.variable); + this.Type = BinaryNinja.Type.MustNewFromHandle(native.type); + this.Name = UnsafeUtils.ReadAnsiString(native.name); + this.AutoDefined = native.autoDefined; + this.TypeConfidence = native.typeConfidence; + } + + internal static VariableNameAndType FromNative(BNVariableNameAndType native) + { + return new VariableNameAndType(native); + } + + public BNVariableNameAndType ToNative(ScopedAllocator allocator) + { + return new BNVariableNameAndType() + { + variable = this.variable.ToNative() , + type = this.Type.DangerousGetHandle() , + name = allocator.AllocAnsiString(this.Name) , + autoDefined = this.AutoDefined , + typeConfidence = this.TypeConfidence + }; + } + + public override string ToString() + { + return this.Name; + } + } +} \ No newline at end of file diff --git a/Struct/BNVariableReferenceSource.cs b/Struct/BNVariableReferenceSource.cs new file mode 100644 index 0000000..3920853 --- /dev/null +++ b/Struct/BNVariableReferenceSource.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNVariableReferenceSource + { + /// + /// BNVariable _var + /// + public BNVariable variable; + + /// + /// BNILReferenceSource source + /// + public BNILReferenceSource source; + } + + public class VariableReferenceSource + { + /// + /// BNVariable _var + /// + public Variable Variable { get; set; } + + /// + /// BNILReferenceSource source + /// + public ILReferenceSource Source { get; set; } + + public VariableReferenceSource(Variable variable , ILReferenceSource source) + { + this.Variable = variable; + this.Source = source; + } + } +} \ No newline at end of file diff --git a/Struct/BNVersionInfo.cs b/Struct/BNVersionInfo.cs new file mode 100644 index 0000000..32787c6 --- /dev/null +++ b/Struct/BNVersionInfo.cs @@ -0,0 +1,85 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNVersionInfo + { + /// + /// uint32_t major + /// + public uint major; + + /// + /// uint32_t minor + /// + public uint minor; + + /// + /// uint32_t build + /// + public uint build; + + /// + /// const char* channel + /// + public IntPtr channel; + } + + public sealed class VersionInfo + { + public uint Major { get; set; } = 0; + + public uint Minor { get; set; } = 0; + + public uint Build { get; set; } = 0; + + public string Channel { get; set; } = string.Empty; + + public VersionInfo() + { + + } + + internal static VersionInfo FromNative(BNVersionInfo raw) + { + return new VersionInfo() + { + Major = raw.major , + Minor = raw.minor , + Build = raw.build , + Channel = UnsafeUtils.ReadAnsiString(raw.channel) + }; + } + + public override string ToString() + { + return $"{Major}.{Minor}.{Build}.{Channel}"; + } + + public static VersionInfo GetVersionInfo() + { + return VersionInfo.FromNative( + NativeMethods.BNGetVersionInfo() + ); + } + + public static uint GetBuildId() + { + return NativeMethods.BNGetBuildId(); + } + + public static uint GetCurrentCoreABIVersion() + { + return NativeMethods.BNGetCurrentCoreABIVersion(); + } + + public static uint GetMinimumCoreABIVersion() + { + return NativeMethods.BNGetMinimumCoreABIVersion(); + } + } +} \ No newline at end of file diff --git a/Struct/BNWebsocketClientCallbacks.cs b/Struct/BNWebsocketClientCallbacks.cs new file mode 100644 index 0000000..7554335 --- /dev/null +++ b/Struct/BNWebsocketClientCallbacks.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNWebsocketClientCallbacks + { + /// + /// void* context + /// + public IntPtr context; + + /// + /// void** destroyClient + /// + public IntPtr destroyClient; + + /// + /// void** connect + /// + public IntPtr connect; + + /// + /// void** write + /// + public IntPtr write; + + /// + /// void** disconnect + /// + public IntPtr disconnect; + } + + public class WebsocketClientCallbacks + { + public WebsocketClientCallbacks() + { + + } + } +} \ No newline at end of file diff --git a/Struct/BNWebsocketClientOutputCallbacks.cs b/Struct/BNWebsocketClientOutputCallbacks.cs new file mode 100644 index 0000000..f76dfe7 --- /dev/null +++ b/Struct/BNWebsocketClientOutputCallbacks.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNWebsocketClientOutputCallbacks + { + /// + /// void* context + /// + public IntPtr context; + + /// + /// void** connectedCallback + /// + public IntPtr connectedCallback; + + /// + /// void** disconnectedCallback + /// + public IntPtr disconnectedCallback; + + /// + /// void** errorCallback + /// + public IntPtr errorCallback; + + /// + /// void** readCallback + /// + public IntPtr readCallback; + } + + public class WebsocketClientOutputCallbacks + { + public WebsocketClientOutputCallbacks() + { + + } + } +} \ No newline at end of file diff --git a/Struct/BNWebsocketProviderCallbacks.cs b/Struct/BNWebsocketProviderCallbacks.cs new file mode 100644 index 0000000..345f20c --- /dev/null +++ b/Struct/BNWebsocketProviderCallbacks.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace BinaryNinja +{ + [StructLayout(LayoutKind.Sequential)] + internal unsafe struct BNWebsocketProviderCallbacks + { + /// + /// void* context + /// + public IntPtr context; + + /// + /// void** createClient + /// + public IntPtr createClient; + } + + public class WebsocketProviderCallbacks + { + public WebsocketProviderCallbacks() + { + + } + } +} \ No newline at end of file diff --git a/Type/ArrayType.cs b/Type/ArrayType.cs new file mode 100644 index 0000000..03531ff --- /dev/null +++ b/Type/ArrayType.cs @@ -0,0 +1,53 @@ +using System; + +namespace BinaryNinja +{ + public sealed class ArrayType : BinaryNinja.Type + { + public ArrayType( + TypeWithConfidence elementType, + ulong elementCount + ) : base( ArrayType.rawCreate(elementType , elementCount) , true) + { + + } + + public ArrayType(BinaryNinja.Type type) + : base( type.DangerousGetHandle() , true) + { + + } + + internal ArrayType(IntPtr handle , bool owner) : base(handle , owner) + { + + } + + private static IntPtr rawCreate( + TypeWithConfidence elementType, + ulong elementCount + ) + { + return NativeMethods.BNCreateArrayType( + elementType.ToNative() , + elementCount + ); + } + + public ulong ElementCount + { + get + { + return NativeMethods.BNGetTypeElementCount(this.handle); + } + } + + public TypeWithConfidence ElementType + { + get + { + return TypeWithConfidence.FromNative( NativeMethods.BNGetChildType(this.handle) ); + } + } + } +} diff --git a/Type/BoolType.cs b/Type/BoolType.cs new file mode 100644 index 0000000..0b8de85 --- /dev/null +++ b/Type/BoolType.cs @@ -0,0 +1,23 @@ +using System; + +namespace BinaryNinja +{ + public sealed class BoolType : BinaryNinja.Type + { + public BoolType() : base( NativeMethods.BNCreateBoolType() , true) + { + + } + + public BoolType(BinaryNinja.Type type) + : base( type.DangerousGetHandle() , true) + { + + } + + internal BoolType(IntPtr handle , bool owner) : base(handle , owner) + { + + } + } +} diff --git a/Type/CharType.cs b/Type/CharType.cs new file mode 100644 index 0000000..63aa47b --- /dev/null +++ b/Type/CharType.cs @@ -0,0 +1,24 @@ +using System; + +namespace BinaryNinja +{ + public class CharType : IntegerType + { + public CharType(ulong width , string altName) + : base( width , true, altName ) + { + + } + + public CharType(BinaryNinja.Type type) + : base( type.DangerousGetHandle() , true) + { + + } + + internal CharType(IntPtr handle , bool owner) : base(handle , owner) + { + + } + } +} diff --git a/Type/EnumerationType.cs b/Type/EnumerationType.cs new file mode 100644 index 0000000..6d9dc26 --- /dev/null +++ b/Type/EnumerationType.cs @@ -0,0 +1,28 @@ +using System; + +namespace BinaryNinja +{ + public sealed class EnumerationType : BinaryNinja.Type + { + public EnumerationType(BinaryNinja.Type type) + : base( type.DangerousGetHandle() , true) + { + + } + + internal EnumerationType(IntPtr handle , bool owner) : base(handle , owner) + { + + } + + public Enumeration Enumeration + { + get + { + return Enumeration.MustTakeHandle( + NativeMethods.BNGetTypeEnumeration(this.handle) + ); + } + } + } +} diff --git a/Type/FloatType.cs b/Type/FloatType.cs new file mode 100644 index 0000000..030589f --- /dev/null +++ b/Type/FloatType.cs @@ -0,0 +1,24 @@ +using System; + +namespace BinaryNinja +{ + public sealed class FloatType : BinaryNinja.Type + { + public FloatType(ulong width , string altName) + : base( NativeMethods.BNCreateFloatType(width , altName) , true) + { + + } + + public FloatType(BinaryNinja.Type type) + : base( type.DangerousGetHandle() , true) + { + + } + + internal FloatType(IntPtr handle , bool owner) : base(handle , owner) + { + + } + } +} diff --git a/Type/FunctionType.cs b/Type/FunctionType.cs new file mode 100644 index 0000000..a1e25ad --- /dev/null +++ b/Type/FunctionType.cs @@ -0,0 +1,218 @@ +using System; + +namespace BinaryNinja +{ + public sealed class FunctionType : BinaryNinja.Type + { + public FunctionType( + TypeWithConfidence? returnType = null , + CallingConventionWithConfidence? callingConvention = null , + FunctionParameter[]? parameters = null , + BoolWithConfidence? varArg = null, + BoolWithConfidence? canReturn = null, + OffsetWithConfidence? stackAdjust = null , + uint[]? regStackAdjustRegs = null, + OffsetWithConfidence[]? regStackAdjustValues = null , + RegisterSetWithConfidence? returnRegs = null , + NameType ft = NameType.NoNameType, + BoolWithConfidence? pure = null + ) : base( + FunctionType.rawCreate( + returnType ?? new TypeWithConfidence(new VoidType() , 0), + callingConvention ?? new CallingConventionWithConfidence(callingConvention?.Convention , 0) , + parameters ?? Array.Empty() , + varArg ?? new BoolWithConfidence() , + canReturn ?? new BoolWithConfidence(), + stackAdjust ?? new OffsetWithConfidence(), + regStackAdjustRegs ?? Array.Empty() , + regStackAdjustValues ?? Array.Empty() , + returnRegs ?? new RegisterSetWithConfidence() , + ft , + pure ?? new BoolWithConfidence() + ) , true) + { + + } + + public FunctionType(BinaryNinja.Type type) + : base( type.DangerousGetHandle() , true) + { + + } + + internal FunctionType(IntPtr handle , bool owner) : base(handle , owner) + { + + } + + internal new static FunctionType? NewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new FunctionType( + NativeMethods.BNNewTypeReference(handle) , + true + ); + } + + internal new static FunctionType MustNewFromHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new FunctionType( + NativeMethods.BNNewTypeReference(handle) , + true + ); + } + + internal new static FunctionType? TakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new FunctionType(handle, true); + } + + internal new static FunctionType MustTakeHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new FunctionType(handle, true); + } + + internal new static FunctionType? BorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + return null; + } + + return new FunctionType(handle, false); + } + + internal new static FunctionType MustBorrowHandle(IntPtr handle) + { + if (handle == IntPtr.Zero) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new FunctionType(handle, false); + } + + private static IntPtr rawCreate( + TypeWithConfidence returnType , + CallingConventionWithConfidence callingConvention, + FunctionParameter[] parameters, + BoolWithConfidence varArg, + BoolWithConfidence canReturn, + OffsetWithConfidence stackAdjust, + uint[] regStackAdjustRegs, + OffsetWithConfidence[] regStackAdjustValues, + RegisterSetWithConfidence returnRegs, + NameType ft , + BoolWithConfidence pure + ) + { + using (ScopedAllocator allocator = new ScopedAllocator()) + { + return NativeMethods.BNCreateFunctionType( + returnType.ToNative(), + callingConvention.ToNative(), + allocator.ConvertToNativeArrayEx( + parameters + ), + (ulong)parameters.Length, + varArg.ToNative(), + canReturn.ToNative(), + stackAdjust.ToNative(), + regStackAdjustRegs, + UnsafeUtils.ConvertToNativeArray( + regStackAdjustValues + ), + (ulong)regStackAdjustValues.Length, + returnRegs.ToNativeEx(allocator), + ft, + pure.ToNative() + ); + } + } + + public OffsetWithConfidence StackAdjustment + { + get + { + return OffsetWithConfidence.FromNative( NativeMethods.BNGetTypeStackAdjustment(this.handle) ); + } + } + + public TypeWithConfidence ReturnType + { + get + { + return TypeWithConfidence.FromNative( NativeMethods.BNGetChildType(this.handle) ); + } + } + + public CallingConventionWithConfidence CallingConvention + { + get + { + return CallingConventionWithConfidence.FromNative(NativeMethods.BNGetTypeCallingConvention(this.handle)); + } + } + + public FunctionParameter[] Parameters + { + get + { + IntPtr arrayPointer = NativeMethods.BNGetTypeParameters( + this.handle , + out ulong arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer, + arrayLength, + FunctionParameter.FromNative, + NativeMethods.BNFreeTypeParameterList + ); + } + } + + public BoolWithConfidence HasVariableArguments + { + get + { + return BoolWithConfidence.FromNative(NativeMethods.BNTypeHasVariableArguments(this.handle)); + } + } + + public BoolWithConfidence CanReturn + { + get + { + return BoolWithConfidence.FromNative(NativeMethods.BNFunctionTypeCanReturn(this.handle)); + } + } + + public BoolWithConfidence IsPure + { + get + { + return BoolWithConfidence.FromNative(NativeMethods.BNIsTypePure(this.handle)); + } + } + } +} diff --git a/Type/IntegerType.cs b/Type/IntegerType.cs new file mode 100644 index 0000000..042a848 --- /dev/null +++ b/Type/IntegerType.cs @@ -0,0 +1,52 @@ +using System; + +namespace BinaryNinja +{ + public class IntegerType : BinaryNinja.Type + { + public IntegerType(ulong width , BoolWithConfidence sign , string altName) + : base( IntegerType.rawCreate(width , sign , altName) , true) + { + + } + + public IntegerType(BinaryNinja.Type type) + : base( type.DangerousGetHandle() , true) + { + + } + + private static IntPtr rawCreate(ulong width , BoolWithConfidence sign , string altName) + { + return NativeMethods.BNCreateIntegerType( + width , + sign.ToNative() , + altName + ); + } + + internal IntegerType(IntPtr handle , bool owner) : base(handle , owner) + { + + } + + public IntegerDisplayType DisplayType + { + get + { + return NativeMethods.BNGetIntegerTypeDisplayType(this.handle); + } + } + + public BoolWithConfidence IsSigned + { + get + { + return BoolWithConfidence.FromNative( + + NativeMethods.BNIsTypeSigned(this.handle) + ); + } + } + } +} diff --git a/Type/NamedTypeReferenceType.cs b/Type/NamedTypeReferenceType.cs new file mode 100644 index 0000000..4cd1d52 --- /dev/null +++ b/Type/NamedTypeReferenceType.cs @@ -0,0 +1,73 @@ +using System; + +namespace BinaryNinja +{ + public sealed class NamedTypeReferenceType : BinaryNinja.Type + { + public NamedTypeReferenceType( + NamedTypeReference namedType , + ulong width , + ulong align , + BoolWithConfidence cnst , + BoolWithConfidence vltl + ) + : base( + NamedTypeReferenceType.create( + namedType , + width , + align , + cnst , + vltl + ) , + true + ) + { + + } + + public NamedTypeReferenceType(BinaryNinja.Type type) + : base( type.DangerousGetHandle() , true) + { + + } + + internal NamedTypeReferenceType(IntPtr handle , bool owner) : base(handle , owner) + { + + } + + private static IntPtr create( + NamedTypeReference namedType , + ulong width , + ulong align , + BoolWithConfidence cnst , + BoolWithConfidence vltl + ) + { + return NativeMethods.BNCreateNamedTypeReference( + namedType.DangerousGetHandle() , + width , + align , + cnst.ToNative() , + vltl.ToNative() + ); + } + + public NamedTypeReferenceClass NamedTypeReferenceClass + { + get + { + return NativeMethods.BNGetTypeReferenceClass(this.handle); + } + } + + public string TypeReferenceId + { + get + { + return UnsafeUtils.TakeAnsiString(NativeMethods.BNGetTypeReferenceId(this.handle)); + } + } + + } +} diff --git a/Type/PointerType.cs b/Type/PointerType.cs new file mode 100644 index 0000000..c13c7a1 --- /dev/null +++ b/Type/PointerType.cs @@ -0,0 +1,120 @@ +using System; + +namespace BinaryNinja +{ + public sealed class PointerType : BinaryNinja.Type + { + public PointerType( + ulong width , + TypeWithConfidence kind, + BoolWithConfidence? cnst = null, + BoolWithConfidence? vltl = null, // volatile + ReferenceType refType = ReferenceType.PointerReferenceType + ) : base( PointerType.create( + width , + kind , + null == cnst ? false : cnst, + null == vltl ? false : vltl, + refType + ) , true) + { + + } + + public PointerType(BinaryNinja.Type type) + : base( type.DangerousGetHandle() , true) + { + + } + + internal PointerType(IntPtr handle , bool owner) : base(handle , owner) + { + + } + + private static IntPtr create( + ulong width , + TypeWithConfidence kind, + BoolWithConfidence cnst , + BoolWithConfidence vltl, // volatile + ReferenceType refType + ) + { + return NativeMethods.BNCreatePointerTypeOfWidth( + width , + kind.ToNative() , + cnst.ToNative() , + vltl.ToNative() , + refType + ); + } + + public TypeWithConfidence Pointee + { + get + { + BNTypeWithConfidence raw = NativeMethods.BNGetChildType(this.handle); + + return TypeWithConfidence.FromNative(raw); + } + } + + public PointerSuffix[] PointerSuffix + { + get + { + ulong arrayLength = 0; + + IntPtr arrayPointer = NativeMethods.BNGetTypePointerSuffix(this.handle , out arrayLength); + + return UnsafeUtils.TakeNumberArrayEx( + arrayPointer , + arrayLength, + NativeMethods.BNFreePointerSuffixList + ); + } + } + + public string PointerSuffixString + { + get + { + return UnsafeUtils.TakeAnsiString(NativeMethods.BNGetTypePointerSuffixString(this.handle)); + } + } + + public InstructionTextToken[] GetPointerSuffixTokens(byte baseConfidence) + { + ulong arrayLength = 0; + + IntPtr arrayPointer = NativeMethods.BNGetTypePointerSuffixTokens( + this.handle , + baseConfidence , + out arrayLength + ); + + return UnsafeUtils.TakeStructArrayEx( + arrayPointer, + arrayLength, + InstructionTextToken.FromNative, + NativeMethods.BNFreeInstructionText + ); + } + + public PointerBaseType PointerBaseType + { + get + { + return NativeMethods.BNTypeGetPointerBaseType(this.handle); + } + } + + public long PointerBaseOffset + { + get + { + return NativeMethods.BNTypeGetPointerBaseOffset(this.handle); + } + } + } +} diff --git a/Type/StructureType.cs b/Type/StructureType.cs new file mode 100644 index 0000000..216d651 --- /dev/null +++ b/Type/StructureType.cs @@ -0,0 +1,51 @@ +using System; + +namespace BinaryNinja +{ + public sealed class StructureType : BinaryNinja.Type + { + internal StructureType(IntPtr handle , bool owner) : base(handle , owner) + { + + } + + public StructureType(BinaryNinja.Type type) + : base( type.DangerousGetHandle() , true) + { + + } + + internal new static StructureType MustNewFromHandle(IntPtr handle) + { + if (IntPtr.Zero == handle) + { + throw new ArgumentNullException(nameof(handle)); + } + + return new StructureType( + NativeMethods.BNNewTypeReference(handle) , + true + ); + } + + public QualifiedName StructureName + { + get + { + return QualifiedName.TakeNative( + NativeMethods.BNTypeGetStructureName(this.handle) + ); + } + } + + public Structure Structure + { + get + { + return Structure.MustTakeHandle( + NativeMethods.BNGetTypeStructure(this.handle) + ); + } + } + } +} diff --git a/Type/VoidType.cs b/Type/VoidType.cs new file mode 100644 index 0000000..23c6fa0 --- /dev/null +++ b/Type/VoidType.cs @@ -0,0 +1,23 @@ +using System; + +namespace BinaryNinja +{ + public sealed class VoidType : BinaryNinja.Type + { + public VoidType() : base( NativeMethods.BNCreateVoidType() , true) + { + + } + + public VoidType(BinaryNinja.Type type) + : base( type.DangerousGetHandle() , true) + { + + } + + internal VoidType(IntPtr handle , bool owner) : base(handle , owner) + { + + } + } +} diff --git a/Type/WideCharType.cs b/Type/WideCharType.cs new file mode 100644 index 0000000..188dd50 --- /dev/null +++ b/Type/WideCharType.cs @@ -0,0 +1,24 @@ +using System; + +namespace BinaryNinja +{ + public sealed class WideCharType : BinaryNinja.Type + { + public WideCharType(ulong width = 2 , string altName = "WCHAR") + : base( NativeMethods.BNCreateWideCharType(width , altName) , true) + { + + } + + public WideCharType(BinaryNinja.Type type) + : base( type.DangerousGetHandle() , true) + { + + } + + internal WideCharType(IntPtr handle , bool owner) : base(handle , owner) + { + + } + } +} diff --git a/UnsafeUtils.cs b/UnsafeUtils.cs new file mode 100644 index 0000000..a0444f2 --- /dev/null +++ b/UnsafeUtils.cs @@ -0,0 +1,632 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Numerics; +using System.Runtime.InteropServices; + +namespace BinaryNinja +{ + internal static partial class UnsafeUtils + { + public static unsafe TTo ForceConvert(TFrom from) + where TFrom : unmanaged + where TTo : unmanaged + { + return *(TTo*)&from; + } + + internal static bool ReadBool(IntPtr address) + { + return 0 != Marshal.ReadByte(address); + } + + internal static T ReadNumber(IntPtr address) where T : unmanaged + { + if (typeof(T).UnderlyingSystemType == typeof(sbyte)) + { + return UnsafeUtils.ForceConvert(Marshal.ReadByte(address) ); + } + else if (typeof(T).UnderlyingSystemType == typeof(byte)) + { + return UnsafeUtils.ForceConvert(Marshal.ReadByte(address) ); + } + else if (typeof(T).UnderlyingSystemType == typeof(short)) + { + return UnsafeUtils.ForceConvert(Marshal.ReadInt16(address)); + } + else if (typeof(T).UnderlyingSystemType == typeof(ushort)) + { + return UnsafeUtils.ForceConvert(Marshal.ReadInt16(address)); + } + else if (typeof(T).UnderlyingSystemType == typeof(int)) + { + return UnsafeUtils.ForceConvert(Marshal.ReadInt32(address)); + } + else if (typeof(T).UnderlyingSystemType == typeof(uint)) + { + return UnsafeUtils.ForceConvert(Marshal.ReadInt32(address)); + } + else if (typeof(T).UnderlyingSystemType == typeof(long)) + { + return UnsafeUtils.ForceConvert(Marshal.ReadInt64(address)); + } + else if (typeof(T).UnderlyingSystemType == typeof(ulong)) + { + return UnsafeUtils.ForceConvert(Marshal.ReadInt64(address)); + } + else if (typeof(T).UnderlyingSystemType == typeof(float)) + { + byte[] buf = new byte[4]; + + Marshal.Copy(address, buf, 0, 4); + + float value = BitConverter.ToSingle(buf, 0); + + return UnsafeUtils.ForceConvert(value); + } + else if (typeof(T).UnderlyingSystemType == typeof(double)) + { + byte[] buf = new byte[8]; + + Marshal.Copy(address, buf, 0, 8); + + double value = BitConverter.ToDouble(buf, 0); + + return UnsafeUtils.ForceConvert(value); + } + + throw new NotSupportedException($"not supported type: {typeof(T).UnderlyingSystemType}"); + } + + internal static bool[] ReadBoolArray(IntPtr arrayPointer , ulong arrayLength) + { + List targets = new List(); + + int integerSize = Marshal.SizeOf(); + + if (( IntPtr.Zero != arrayPointer ) && ( 0 != arrayLength )) + { + for (ulong i = 0; i < arrayLength; i++) + { + int offset = checked((int)(i * (ulong)integerSize)); + + IntPtr addressOfElement = IntPtr.Add(arrayPointer, offset); + + targets.Add(UnsafeUtils.ReadBool(addressOfElement)); + } + } + + return targets.ToArray(); + } + + internal static T[] ReadNumberArray(IntPtr arrayPointer , ulong arrayLength) + where T : unmanaged + { + List targets = new List(); + + int integerSize = Marshal.SizeOf(); + + if (( IntPtr.Zero != arrayPointer ) && ( 0 != arrayLength )) + { + for (ulong i = 0; i < arrayLength; i++) + { + int offset = checked((int)(i * (ulong)integerSize)); + + IntPtr addressOfElement = IntPtr.Add(arrayPointer, offset); + + targets.Add(UnsafeUtils.ReadNumber(addressOfElement)); + } + } + + return targets.ToArray(); + } + + internal static string ReadAnsiString(IntPtr address) + { + string text = string.Empty; + + if (IntPtr.Zero != address) + { + string? optional = Marshal.PtrToStringAnsi(address); + + if (null != optional) + { + text = optional; + } + } + + return text; + } + + internal static string ReadUtf8String(IntPtr address) + { + string text = string.Empty; + + if (IntPtr.Zero != address) + { + string? optional = Marshal.PtrToStringUTF8(address); + + if (null != optional) + { + text = optional; + } + } + + return text; + } + + internal static string ReadUtf16String(IntPtr address) + { + string text = string.Empty; + + if (IntPtr.Zero != address) + { + string? optional = Marshal.PtrToStringUni(address); + + if (null != optional) + { + text = optional; + } + } + + return text; + } + + internal static string ReadUtf32String(IntPtr address) + { + string text = string.Empty; + + + if (IntPtr.Zero != address) + { + int length = 0; + while (Marshal.ReadInt32(address, length * 4) != 0) + { + length++; + } + + if (length > 0) + { + byte[] bytes = new byte[length * 4]; + + Marshal.Copy(address, bytes, 0, bytes.Length); + + text = System.Text.Encoding.UTF32.GetString(bytes); + } + } + + return text; + } + + internal static string[] ReadAnsiStringArray( + IntPtr arrayPointer , + ulong arrayLength + ) + { + return ReadStringArray( + arrayPointer, + arrayLength, + UnsafeUtils.ReadAnsiString + ); + } + + internal static string[] ReadUtf8StringArray( + IntPtr arrayPointer , + ulong arrayLength + ) + { + return ReadStringArray( + arrayPointer, + arrayLength, + UnsafeUtils.ReadUtf8String + ); + } + + internal static string[] ReadStringArray( + IntPtr arrayPointer , + ulong arrayLength, + Func? fnRead = null + ) + { + if (null == fnRead) + { + fnRead = UnsafeUtils.ReadAnsiString; + } + + List targets = new List(); + + if (( IntPtr.Zero != arrayPointer ) && ( 0 != arrayLength )) + { + for (ulong i = 0; i < arrayLength; i++) + { + int offset = checked((int)( i * (ulong)IntPtr.Size )); + + IntPtr addressOfElement = IntPtr.Add(arrayPointer, offset); + + IntPtr element = Marshal.ReadIntPtr(addressOfElement); + + if (IntPtr.Zero != element) + { + targets.Add( fnRead(element)); + } + } + } + + return targets.ToArray(); + } + + internal static TManaged[] ReadHandleArray( + IntPtr arrayPointer , + ulong arrayLength , + Func createManaged + ) + { + List targets = new List(); + + if (( IntPtr.Zero != arrayPointer ) && ( 0 != arrayLength )) + { + for (ulong i = 0; i < arrayLength; i++) + { + int offset = checked((int)(i * (ulong)IntPtr.Size)); + + IntPtr addressOfElement = IntPtr.Add(arrayPointer, offset); + + IntPtr element = Marshal.ReadIntPtr(addressOfElement); + + if (element != IntPtr.Zero) + { + targets.Add( createManaged(element)); + } + } + } + + return targets.ToArray(); + } + + internal static TManaged[] ReadStructArray< + [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] + TNative , TManaged>( + IntPtr arrayPointer , + ulong arrayLength , + Func createManaged + ) where TNative : struct + { + List targets = new List(); + + if (( IntPtr.Zero != arrayPointer ) && ( 0 != arrayLength )) + { + for (ulong i = 0; i < arrayLength; i++) + { + int offset = checked((int)(i * (ulong)Marshal.SizeOf())); + + IntPtr addressOfElement = IntPtr.Add(arrayPointer, offset); + + TNative? raw = Marshal.PtrToStructure(addressOfElement); + + if (raw.HasValue) + { + targets.Add(createManaged(raw.Value)); + } + } + } + + return targets.ToArray(); + } + + internal static string TakeAnsiString( + IntPtr address , + Action? freeText = null + ) + { + if (null == freeText) + { + freeText = NativeMethods.BNFreeString; + } + + string text = UnsafeUtils.ReadAnsiString(address); + + if (IntPtr.Zero != address) + { + if (null != freeText) + { + freeText(address); + } + } + + return text; + } + + internal static string TakeUtf8String(IntPtr address , Action? freeText = null) + { + if (null == freeText) + { + freeText = NativeMethods.BNFreeString; + } + + string text = UnsafeUtils.ReadUtf8String(address); + + if (IntPtr.Zero != address) + { + if (null != freeText) + { + freeText(address); + } + } + + return text; + } + + internal static string TakeUtf16String(IntPtr address) + { + string text = UnsafeUtils.ReadUtf16String(address); + + if (IntPtr.Zero != address) + { + NativeMethods.BNFreeString(address); + } + + return text; + } + + internal static string TakeUtf32String(IntPtr address) + { + string text = UnsafeUtils.ReadUtf32String(address); + + if (IntPtr.Zero != address) + { + NativeMethods.BNFreeString(address); + } + + return text; + } + + internal static string[] TakeAnsiStringArray( + IntPtr arrayPointer , + ulong arrayLength , + Action? freeArray + ) + { + if (null == freeArray) + { + freeArray = NativeMethods.BNFreeStringList; + } + + return TakeStringArrayEx( + arrayPointer , + arrayLength, + UnsafeUtils.ReadAnsiString, + freeArray + ); + } + + internal static string[] TakeUtf8StringArray( + IntPtr arrayPointer , + ulong arrayLength , + Action? freeArray = null + ) + { + if (null == freeArray) + { + freeArray = NativeMethods.BNFreeStringList; + } + + return TakeStringArrayEx( + arrayPointer , + arrayLength, + UnsafeUtils.ReadUtf8String, + freeArray + ); + } + + internal static string[] TakeStringArrayEx( + IntPtr arrayPointer , + ulong arrayLength, + Func? fnRead = null, + Action? freeArray = null + ) + { + if (null == fnRead) + { + fnRead = UnsafeUtils.ReadAnsiString; + } + + if (null == freeArray) + { + freeArray = NativeMethods.BNFreeStringList; + } + + string[] targets = UnsafeUtils.ReadStringArray( + arrayPointer, + arrayLength, + fnRead + ); + + if (IntPtr.Zero != arrayPointer) + { + if (freeArray != null) + { + freeArray(arrayPointer , arrayLength); + } + } + + return targets; + } + + + + internal static T[] TakeNumberArray( + IntPtr arrayPointer , + ulong arrayLength , + Action? freeArray + ) where T : unmanaged + { + T[] targets = UnsafeUtils.ReadNumberArray(arrayPointer , arrayLength); + + if (arrayPointer != IntPtr.Zero && freeArray != null) + { + freeArray(arrayPointer); + } + + return targets; + } + + internal static T[] TakeNumberArrayEx( + IntPtr arrayPointer , + ulong arrayLength , + Action? freeArray = null + ) where T : unmanaged + { + T[] targets = UnsafeUtils.ReadNumberArray(arrayPointer , arrayLength); + + if (arrayPointer != IntPtr.Zero && freeArray != null) + { + freeArray(arrayPointer , arrayLength); + } + + return targets; + } + + + + internal static TManaged[] TakeHandleArray( + IntPtr arrayPointer , + ulong arrayLength , + Func createManaged, + Action? freeArray = null + ) + { + TManaged[] targets = ReadHandleArray( arrayPointer , arrayLength , createManaged ); + + if (arrayPointer != IntPtr.Zero && freeArray != null) + { + freeArray(arrayPointer); + } + + return targets; + } + + internal static TManaged[] TakeHandleArrayEx( + IntPtr arrayPointer , + ulong arrayLength , + Func createManaged, + Action? freeArray = null + ) + { + TManaged[] targets = ReadHandleArray( arrayPointer , arrayLength , createManaged ); + + if (arrayPointer != IntPtr.Zero && freeArray != null) + { + freeArray(arrayPointer ,arrayLength); + } + + return targets; + } + + + internal static TManaged[] TakeStructArray< + [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] + TNative , TManaged>( + IntPtr arrayPointer , + ulong arrayLength , + Func createManaged, + Action? freeArray = null + ) where TNative : struct + { + TManaged[] targets = ReadStructArray(arrayPointer , arrayLength , createManaged ); + + if (arrayPointer != IntPtr.Zero && freeArray != null) + { + freeArray(arrayPointer); + } + + return targets; + } + + internal static TManaged[] TakeStructArrayEx< + [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors | DynamicallyAccessedMemberTypes.NonPublicConstructors)] + TNative , TManaged>( + IntPtr arrayPointer , + ulong arrayLength , + Func createManaged, + Action? freeArray = null + ) where TNative : struct + { + TManaged[] targets = ReadStructArray(arrayPointer , arrayLength , createManaged ); + + if (arrayPointer != IntPtr.Zero && freeArray != null) + { + freeArray(arrayPointer , arrayLength); + } + + return targets; + } + + internal static TNative[] ConvertToNativeArray(TManaged[] sources) + where TManaged : INativeWrapper + { + if (sources == null || sources.Length == 0) + { + return Array.Empty(); + } + + List targets = new List(); + + for (int i = 0; i < sources.Length; i++) + { + targets.Add( sources[i].ToNative() ); + } + + return targets.ToArray(); + } + + + internal static IntPtr AllocAnsiString(string text) + { + return Marshal.StringToHGlobalAnsi(text); + } + + internal static IntPtr AllocUtf8String(string text) + { + return Marshal.StringToCoTaskMemUTF8(text); + } + + internal static void FreeUtf8String(IntPtr text) + { + Marshal.FreeCoTaskMem(text); + } + + internal static IntPtr AllocStruct(T structure) where T : struct + { + int size = Marshal.SizeOf(); + + IntPtr pointer = Marshal.AllocHGlobal(size); + + Marshal.StructureToPtr(structure , pointer , false); + + return pointer; + } + + internal static IntPtr AllocStructArray(T[] structures) where T : struct + { + if (structures == null || structures.Length == 0) + { + return IntPtr.Zero; + } + + int structSize = Marshal.SizeOf(); + + int totalSize = structSize * structures.Length; + + IntPtr arrayPointer = Marshal.AllocHGlobal(totalSize); + + for (int i = 0; i < structures.Length; i++) + { + IntPtr addressOfElement = IntPtr.Add(arrayPointer , i * structSize); + + Marshal.StructureToPtr(structures[i] , addressOfElement , false); + } + + return arrayPointer; + } + } +} diff --git a/Utils.cs b/Utils.cs new file mode 100644 index 0000000..8ca87c2 --- /dev/null +++ b/Utils.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Numerics; + +namespace BinaryNinja +{ + public static class Utils + { + public static bool FlagOn(T flags , T flag) + where T : IBinaryInteger + { + + return T.Zero != ( flags & flag ); + } + + public static bool StrictFlagOn(T flags , T flag) + where T : IBinaryInteger + { + return ( flags & flag ) == flag; + } + } +} From 9b1dad2cecbbb6723afeb56a308dfd52692ff6f7 Mon Sep 17 00:00:00 2001 From: tinysec Date: Mon, 24 Nov 2025 22:03:31 +0800 Subject: [PATCH 2/4] doc: add readme --- .github/workflows/ci.yaml | 2 - README.md | 152 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 152 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5ef3c99..8dda69d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -47,10 +47,8 @@ jobs: matrix: include: - os: windows-latest - artifact_name: BinaryNinja.dll platform: windows - os: ubuntu-latest - artifact_name: BinaryNinja.so platform: linux runs-on: ${{ matrix.os }} diff --git a/README.md b/README.md index 139597f..c8979f7 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,154 @@ +# BinaryNinja C# Bindings (Typed, Safe, Native AOT Ready) +[![Build](https://img.shields.io/github/actions/workflow/status/tinysec/binaryninja/ci.yml?branch=master)](https://github.com/tinysec/binaryninja/actions) +[![NuGet](https://img.shields.io/nuget/v/BinaryNinjaBindings.svg)](https://www.nuget.org/packages/BinaryNinjaBindings) +![License](https://img.shields.io/github/license/tinysec/binaryninja) +![Platforms](https://img.shields.io/badge/platforms-windows%20%7C%20linux-blue) +![.NET](https://img.shields.io/badge/.NET-%3E%3D%208.0-512BD4) +Modern, fully statically typed C# bindings for the Binary Ninja C API. Designed for safety, performance, and Native AOT compatibility. +Use it as a dynamic library in your apps, compile CLI tools with Native AOT, or build native Binary Ninja plugins. + +- Statically typed API surface +- 100% SafeHandle-based resource management +- Idiomatic IDisposable/Dispose pattern +- Native AOT friendly (no reflection-heavy runtime dependencies) +- Works with .NET 8.0+ + +## WARNING +- Do not use this in production. The API is experimental and may introduce breaking changes without notice. + +## Install + +```shell +dotnet add package BinaryNinja +``` +## Requirements + +- .NET 8.0 or newer +- Binary Ninja installed (Desktop or Headless) +- Ensure the Binary Ninja native libraries are discoverable at runtime: + - environment variable: BINARYNINJA_BASE (points to Binary Ninja installation root) + +## Using in cli +```csharp +using System; +using BinaryNinja; + +class Program +{ + static void Main() + { + NativeLibrary.SetDllImportResolver( + typeof(BinaryNinja.Core).Assembly, + new LibraryResolver().ResolveDllImport + ); + + Core.InitPlugins(true); + + using BinaryView? view = BinaryView.LoadFile("driver.sys.bndb"); + + if (null == view) + { + throw new Exception("load fail"); + } + + foreach(Function? function in view.Functions) + { + Console.WriteLine(function.RawName); + } + + Core.Shutdown(); + } +} +``` + +## Using in Plugin + +```csharp +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Runtime.CompilerServices; +using BinaryNinja; + +namespace Dummy +{ + public static class Plugin + { + static Plugin() + { + NativeLibrary.SetDllImportResolver( + typeof(BinaryNinja.Core).Assembly, + new LibraryResolver().ResolveDllImport + ); + } + + [UnmanagedCallersOnly( + EntryPoint = "CorePluginABIVersion", + CallConvs = new[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) }) + ] + public static uint CorePluginABIVersion() + { + return BinaryNinja.Core.CurrentCoreABIVersion; + } + + [UnmanagedCallersOnly(EntryPoint = "CorePluginInit", CallConvs = new[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })] + public static byte CorePluginInit() + { + BinaryNinja.Core.LogInfo("[+] i am native aot plugin\n"); + + BinaryNinja.Core.LogInfo( $"[+] Core CurrentCoreABIVersion: {Core.GetCurrentCoreABIVersion()}\n"); + + BinaryNinja.Core.LogInfo( $"[+] Core MinimumCoreABIVersion: {Core.GetMinimumCoreABIVersion()}\n"); + + BinaryNinja.Core.LogInfo( $"[+] Plugin CurrentCoreABIVersion: {Core.CurrentCoreABIVersion }\n"); + + BinaryNinja.Logger logger = BinaryNinja.Logger.GetOrCreateLogger("Dummy"); + + logger.LogInfo("[+] use private logger\n"); + + BinaryNinja.PluginCommand.RegisterPluginCommand( + "Dummy command", + "Dummy command description", + Plugin.DefaultCommand, + Plugin.DefaultIsValid + ); + + logger.LogInfo("[+] init done."); + + return 1; // success + } + + public static void DefaultCommand(BinaryView view ) + { + Logger logger = BinaryNinja.Logger.GetOrCreateLogger("Dummy"); + + logger.LogInfo($"view length: {view.Length}"); + + Core.OpenUrl("https://github.com/tinysec/binaryninja"); + + Function? function = view.ChooseFunction(); + + if (null != function) + { + logger.LogInfo($"function , RawName: {function.RawName}"); + } + } + + public static bool DefaultIsValid(BinaryView view ) + { + return true; + } + } +} +``` + +## Troubleshooting + +- DllNotFoundException / EntryPointNotFoundException + - Ensure native libs are on PATH/LD_LIBRARY_PATH or set BINARYNINJA_BASE + - On Native AOT, confirm your RID is correct and you published with PublishAot=true +- AccessViolationException + - Check lifetime: ensure using-statements dispose views/sessions before exit + - Make sure the target BN C API functions exist in the installed version \ No newline at end of file From b9706ccf6fa6439e0979016cadc425367b2e3074 Mon Sep 17 00:00:00 2001 From: tinysec Date: Mon, 24 Nov 2025 22:09:53 +0800 Subject: [PATCH 3/4] ci: nuget --- .github/workflows/ci.yaml | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8dda69d..66d8c97 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -80,7 +80,7 @@ jobs: shell: bash run: | mkdir -p artifacts - cp "build/${{ matrix.artifact_name }}" artifacts/ + cp build/* artifacts/ ls -lh artifacts - name: upload artifacts @@ -115,4 +115,23 @@ jobs: draft: false prerelease: true token: ${{ secrets.GIT_TOKEN }} - files: artifacts/*.* \ No newline at end of file + files: artifacts/*.* + + - name: publish to NuGet + if: ${{ secrets.NUGET_TOKEN != '' }} + env: + NUGET_AUTH_TOKEN: ${{ secrets.NUGET_TOKEN }} + run: | + echo "[+] Publishing NuGet packages with version ${{ needs.version.outputs.version }}" + shopt -s globstar nullglob + + for pkg in artifacts/**/*.nupkg; do + if [[ "$pkg" == *.snupkg ]]; then + continue + fi + echo "-> dotnet nuget push $pkg" + dotnet nuget push "$pkg" \ + --api-key "$NUGET_AUTH_TOKEN" \ + --source "https://api.nuget.org/v3/index.json" \ + --skip-duplicate + done \ No newline at end of file From e39d5af8950888d251a8f6313538224e84b9c550 Mon Sep 17 00:00:00 2001 From: tinysec Date: Mon, 24 Nov 2025 22:25:47 +0800 Subject: [PATCH 4/4] ci --- .github/workflows/ci.yaml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 66d8c97..88df4b8 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -93,8 +93,7 @@ jobs: release: needs: [ version , build ] runs-on: ubuntu-latest - if: github.ref == 'refs/heads/master' && github.ref == 'refs/heads/master' && secrets.GIT_TOKEN != '' - + if: github.ref == 'refs/heads/master' && github.ref == 'refs/heads/master' && github.event_name == 'push' steps: - name: checkout uses: actions/checkout@v3 @@ -114,11 +113,10 @@ jobs: generate_releases: true draft: false prerelease: true - token: ${{ secrets.GIT_TOKEN }} files: artifacts/*.* - name: publish to NuGet - if: ${{ secrets.NUGET_TOKEN != '' }} + if: secrets.NUGET_TOKEN != '' env: NUGET_AUTH_TOKEN: ${{ secrets.NUGET_TOKEN }} run: |