All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.joern.ghidra2cpg.passes.NamespacePass.scala Maven / Gradle / Ivy

The newest version!
package io.joern.ghidra2cpg.passes

import io.shiftleft.codepropertygraph.generated.Cpg
import io.shiftleft.codepropertygraph.generated.nodes
import io.shiftleft.passes.ForkJoinParallelCpgPass

import java.io.File

class NamespacePass(cpg: Cpg, programFile: File) extends ForkJoinParallelCpgPass[String](cpg) {
  override def generateParts(): Array[String] =
    Array(programFile.getCanonicalFile.toString)

  override def runOnPart(diffGraph: DiffGraphBuilder, fileName: String): Unit = {
    val namespaceNodeNode =
      nodes
        .NewNamespaceBlock()
        .filename(fileName)
        .fullName(s"$fileName:")
        .name("")
        .order(1)

    diffGraph.addNode(namespaceNodeNode)
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy