Katharina T. Huber

90 papers A 1C 5Journal 81Unranked 1
YearRankTypeTitle / Venue / Authors
2025 J jnl
Discret. Appl. Math.
David Bryant, Katharina T. Huber, Vincent Moulton, Andreas Spillner
2025 J jnl
Discret. Math. Theor. Comput. Sci.
Katharina T. Huber, Simone Linz, Vincent Moulton
2025 J jnl
Inf. Process. Lett.
Katharina T. Huber, Leo van Iersel, Vincent Moulton, Guillaume E. Scholz
2025 J jnl
CoRR
David Bryant, Katharina T. Huber, Vincent Moulton, Andreas Spillner
2024 J jnl
CoRR
Katharina T. Huber, Leo van Iersel, Mark Jones, Vincent Moulton, Leonie Veenema-Nipius
2024 J jnl
J. Comput. Syst. Sci.
Katharina T. Huber, Leo van Iersel, Remie Janssen, Mark Jones, Vincent Moulton, Yukihiro Murakami, Charles Semple
2024 J jnl
Electron. J. Comb.
Katharina T. Huber, Simone Linz, Vincent Moulton, Charles Semple
2024 J jnl
SIAM J. Discret. Math.
Katharina T. Huber, Vincent Moulton, Guillaume E. Scholz
2023 J jnl
J. Graph Algorithms Appl.
Katharina T. Huber, Vincent Moulton, Andreas Spillner
2023 J jnl
Discret. Comput. Geom.
David Bryant, Katharina T. Huber, Vincent Moulton, Paul F. Tupper
2023 J jnl
Adv. Appl. Math.
Andrew R. Francis, Katharina T. Huber, Vincent Moulton, Taoyang Wu
2023 J jnl
Graphs Comb.
Marc Hellmuth, Katharina T. Huber, Vincent Moulton, Guillaume E. Scholz, Peter F. Stadler
2023 J jnl
CoRR
Katharina T. Huber, Vincent Moulton, Guillaume E. Scholz
2022 J jnl
Discret. Appl. Math.
Katharina T. Huber, Leo van Iersel, Remie Janssen, Mark Jones, Vincent Moulton, Yukihiro Murakami
2022 J jnl
Discret. Appl. Math.
Katharina T. Huber, Vincent Moulton, Guillaume E. Scholz
2021 C conf
CIAC
Henning Fernau, Katharina T. Huber, Joseph (Seffi) Naor
2021 J jnl
Discret. Appl. Math.
Katharina T. Huber, Vincent Moulton, Andreas Spillner
2021 C conf
CIAC
Katharina T. Huber
2020 J jnl
Algorithms Mol. Biol.
Mattéo Delabre, Nadia El-Mabrouk, Katharina T. Huber, Manuel Lafond, Vincent Moulton, Emmanuel Noutahi, Miguel Sautie Castellanos
2020 J jnl
Adv. Appl. Math.
Katharina T. Huber, Guillaume E. Scholz
2020 J jnl
Inf. Process. Lett.
Momoko Hayamizu, Katharina T. Huber, Vincent Moulton, Yukihiro Murakami
2020 J jnl
CoRR
Katharina T. Huber, Simone Linz, Vincent Moulton
2019 C ed.
WABI
Katharina T. Huber, Dan Gusfield
2019 J jnl
J. Classif.
Katharina T. Huber, Vincent Moulton, Taoyang Wu
2019 J jnl
CoRR
Momoko Hayamizu, Katharina T. Huber, Vincent Moulton, Yukihiro Murakami
2019 J jnl
CoRR
Katharina T. Huber, Leo van Iersel, Remie Janssen, Mark Jones, Vincent Moulton, Yukihiro Murakami, Charles Semple
2019 J jnl
Theor. Comput. Sci.
Manuel Lafond, Nadia El-Mabrouk, Katharina T. Huber, Vincent Moulton
2019 J jnl
Discret. Math.
Katharina T. Huber, Jack H. Koolen, Vincent Moulton
2019 J jnl
J. Classif.
Katharina T. Huber, Vincent Moulton, Guillaume E. Scholz
2018 J jnl
Algorithmica
Katharina T. Huber, Guillaume E. Scholz
2018 J jnl
Adv. Appl. Math.
Stefan Grünewald, Katharina T. Huber, Vincent Moulton, Mike A. Steel
2018 J jnl
Inf. Process. Lett.
Katharina T. Huber, Vincent Moulton, Marie-France Sagot, Blerina Sinaimeri
2018 conf
RECOMB-CG
Mattéo Delabre, Nadia El-Mabrouk, Katharina T. Huber, Manuel Lafond, Vincent Moulton, Emmanuel Noutahi, Miguel Sautie Castellanos
2018 J jnl
CoRR
Manuel Lafond, Nadia El-Mabrouk, Katharina T. Huber, Vincent Moulton
2017 J jnl
CoRR
Maribel Hernandez-Rosales, Marc Hellmuth, Nicolas Wieseke, Katharina T. Huber, Vincent Moulton, Peter F. Stadler
2017 J jnl
CoRR
Katharina T. Huber, Vincent Moulton, Charles Semple, Taoyang Wu
2017 J jnl
Algorithmica
Katharina T. Huber, Leo van Iersel, Vincent Moulton, Céline Scornavacca, Taoyang Wu
2017 J jnl
CoRR
Magnus Bordewich, Katharina T. Huber, Vincent Moulton, Charles Semple
2017 J jnl
CoRR
Andrew R. Francis, Katharina T. Huber, Vincent Moulton
2016 J jnl
CoRR
Katharina T. Huber, Guillaume E. Scholz
2016 J jnl
Australas. J Comb.
Andreas W. M. Dress, Katharina T. Huber, Jacobus H. Koolen, Vincent Moulton, Andreas Spillner
2015 J jnl
SIAM J. Discret. Math.
Katharina T. Huber, George Kettleborough
2015 J jnl
Bioinform.
Andrei-Alin Popescu, Katharina T. Huber
2014 J jnl
Discret. Math. Theor. Comput. Sci.
Andreas W. M. Dress, Katharina T. Huber, Mike A. Steel
2014 J jnl
CoRR
Katharina T. Huber, Leo van Iersel, Vincent Moulton, Céline Scornavacca, Taoyang Wu
2014 J jnl
SIAM J. Discret. Math.
Katharina T. Huber, Vincent Moulton, Charles Semple, Taoyang Wu
2014 J jnl
Electron. J. Comb.
Katharina T. Huber, Mike A. Steel
2013 J jnl
Algorithmica
Katharina T. Huber, Vincent Moulton
2012 book
Andreas W. M. Dress, Katharina T. Huber, Jacobus H. Koolen, Vincent Moulton, Andreas Spillner
2012 A conf
ALENEX
Katharina T. Huber, Vincent Moulton, Andreas Spillner, Sabine Storandt, Radoslaw Suchecki
2012 J jnl
BMC Bioinform.
Maribel Hernandez-Rosales, Marc Hellmuth, Nicolas Wieseke, Katharina T. Huber, Vincent Moulton, Peter F. Stadler
2012 J jnl
J. Classif.
Sven Herrmann, Katharina T. Huber, Vincent Moulton, Andreas Spillner
2012 J jnl
Bioinform.
Andrei-Alin Popescu, Katharina T. Huber, Emmanuel Paradis
2011 J jnl
CoRR
Andreas W. M. Dress, Katharina T. Huber, Michael Anthony Steel
2011 J jnl
IEEE ACM Trans. Comput. Biol. Bioinform.
Katharina T. Huber, Leo van Iersel, Steven Kelk, Radoslaw Suchecki
2011 J jnl
SIAM J. Discret. Math.
Andreas W. M. Dress, Katharina T. Huber, Jacobus H. Koolen, Vincent Moulton
2011 J jnl
CoRR
Katharina T. Huber, Vincent Moulton
2011 J jnl
IEEE ACM Trans. Comput. Biol. Bioinform.
Katharina T. Huber, Andreas Spillner, Radoslaw Suchecki, Vincent Moulton
2010 J jnl
J. Classif.
Andreas W. M. Dress, Katharina T. Huber, Jacobus H. Koolen, Vincent Moulton, Andreas Spillner
2010 J jnl
J. Discrete Algorithms
Jaroslaw Byrka, Pawel Gawrychowski, Katharina T. Huber, Steven Kelk
2009 J jnl
Appl. Math. Lett.
Andreas W. M. Dress, Katharina T. Huber, Jacobus H. Koolen, Vincent Moulton
2009 J jnl
CoRR
Andreas W. M. Dress, Katharina T. Huber, Jacobus H. Koolen, Vincent Moulton, Andreas Spillner
2009 J jnl
Adv. Appl. Math.
Stefan Grünewald, Katharina T. Huber, Vincent Moulton, Charles Semple, Andreas Spillner
2009 J jnl
IEEE ACM Trans. Comput. Biol. Bioinform.
Magnus Bordewich, Olivier Gascuel, Katharina T. Huber, Vincent Moulton
2009 J jnl
Bioinform.
Martin Lott, Andreas Spillner, Katharina T. Huber, Vincent Moulton
2008 J jnl
Appl. Math. Lett.
Andreas W. M. Dress, Katharina T. Huber, Jacobus H. Koolen, Vincent Moulton
2008 J jnl
Electron. J. Comb.
Katharina T. Huber, Jacobus H. Koolen, Vincent Moulton, Andreas Spillner
2008 J jnl
Eur. J. Comb.
Andreas W. M. Dress, Katharina T. Huber, Jacobus H. Koolen, Vincent Moulton
2008 J jnl
Eur. J. Comb.
Y. B. Choe, Katharina T. Huber, Jacobus H. Koolen, Y. S. Kwon, Vincent Moulton
2008 J jnl
Appl. Math. Lett.
Andreas W. M. Dress, Katharina T. Huber, Jacobus H. Koolen, Vincent Moulton
2008 J jnl
J. Comput. Biol.
Katharina T. Huber, Martin Lott, Vincent Moulton, Andreas Spillner
2007 C conf
COCOA
Andreas W. M. Dress, Katharina T. Huber, Jacobus H. Koolen, Vincent Moulton
2007 ch.
Mathematics of Evolution and Phylogeny
Vincent Moulton, Katharina T. Huber
2006 C conf
WABI
Barbara R. Holland, Glenn Conner, Katharina T. Huber, Vincent Moulton
2006 J jnl
Eur. J. Comb.
Katharina T. Huber, Jacobus H. Koolen, Vincent Moulton
2005 J jnl
Discret. Appl. Math.
Andreas W. M. Dress, Barbara R. Holland, Katharina T. Huber, Jack H. Koolen, Vincent Moulton, Jan Weyer-Menkhoff
2005 J jnl
SIAM J. Discret. Math.
Katharina T. Huber, Vincent Moulton, Michael Anthony Steel
2005 J jnl
Discret. Math.
Magnus Bordewich, Katharina T. Huber, Charles Semple
2005 J jnl
Appl. Math. Lett.
Katharina T. Huber, Vincent Moulton, Charles Semple, Mike A. Steel
2005 J jnl
Discret. Math.
Katharina T. Huber, Jacobus H. Koolen, Vincent Moulton
2004 J jnl
Discret. Math.
Katharina T. Huber
2004 J jnl
Discret. Appl. Math.
Katharina T. Huber, Vincent Moulton, Charles Semple
2004 J jnl
Discret. Comput. Geom.
Katharina T. Huber, Jacobus H. Koolen, Vincent Moulton
2003 J jnl
Appl. Math. Lett.
Dietmar Cieslik, Andreas W. M. Dress, Katharina T. Huber, Vincent Moulton
2002 J jnl
Eur. J. Comb.
Andreas W. M. Dress, Katharina T. Huber, Vincent Moulton
2002 J jnl
Discret. Appl. Math.
Hans-Jürgen Bandelt, Katharina T. Huber, Vincent Moulton
2002 J jnl
Discret. Math.
Katharina T. Huber, Vincent Moulton
2001 J jnl
Eur. J. Comb.
Andreas W. M. Dress, Katharina T. Huber, Jacobus H. Koolen, Vincent Moulton
2000 J jnl
Discret. Comput. Geom.
Andreas W. M. Dress, Katharina T. Huber, Vincent Moulton
1999 J jnl
Electron. Notes Discret. Math.
Andreas W. M. Dress, Katharina T. Huber, Vincent Moulton
redb/extractors/decompiler/_archive/GhidraDecompilerScript-latest.java
← Index redb/extractors/decompiler/_archive/GhidraDecompilerScript-latest.java java
import ghidra.app.script.GhidraScript;
import ghidra.program.model.listing.*;
import ghidra.app.decompiler.*;
import ghidra.program.model.block.*;
import ghidra.program.model.symbol.*;
import ghidra.program.model.pcode.*;
import ghidra.program.model.address.*;
import org.json.JSONObject;
import org.json.JSONArray;
import java.security.MessageDigest;
import java.nio.charset.StandardCharsets;

public class GhidraDecompilerScript extends GhidraScript {
    private DecompInterface decompInterface;
    private BasicBlockModel basicBlockModel;
    
    @Override
    public void run() throws Exception {
        // Get binary hash and filepath from arguments
        String[] args = getScriptArgs();
        if (args.length < 2) {
            System.err.println("{\"error\": \"Both SHA256 and filepath arguments are required\"}");
            return;
        }
        String sha256 = args[0];
        String filepath = args[1];

        // Initialize analysis components
        setupDecompiler();
        basicBlockModel = new BasicBlockModel(currentProgram);

        // Create the main JSON object for output
        JSONObject output = new JSONObject();
        output.put("sha256", sha256);
        output.put("decompiled", new JSONArray());
        output.put("disassembled", new JSONArray());
        output.put("cfg", new JSONArray());

        // Process all functions
        FunctionIterator functions = currentProgram.getFunctionManager().getFunctions(true);
        for (Function function : functions) {
            processFunction(function, output);
        }

        // Output the final JSON to stdout
        System.out.println(output.toString());
    }

    private void setupDecompiler() {
        decompInterface = new DecompInterface();
        DecompileOptions options = new DecompileOptions();
        decompInterface.setOptions(options);
        decompInterface.openProgram(currentProgram);
    }

    private void processFunction(Function function, JSONObject output) {
        Address entry = function.getEntryPoint();
        String functionName = function.getName();
        String functionAddress = entry.toString();

        // Process decompiled code
        processDecompiledCode(function, output.getJSONArray("decompiled"), 
                            functionName, functionAddress);

        // Process disassembled code
        processDisassembledCode(function, output.getJSONArray("disassembled"), 
                              functionName, functionAddress);

        // Process CFG
        processCFG(function, output.getJSONArray("cfg"), functionAddress);
    }

    private void processDecompiledCode(Function function, JSONArray decompArray, 
                                     String functionName, String functionAddress) {
        DecompileResults results = decompInterface.decompileFunction(function, 30, monitor);
        if (results.decompileCompleted()) {
            String decompiledCode = results.getDecompiledFunction().getC();
            String contentHash = calculateHash(decompiledCode);

            JSONObject functionObj = new JSONObject();
            functionObj.put("decompiled_content_hash", contentHash);
            functionObj.put("decompiled_function_name", functionName);
            functionObj.put("decompiled_function_address", functionAddress);
            functionObj.put("decompiled_function", decompiledCode);
            
            decompArray.put(functionObj);
        }
    }

    private void processDisassembledCode(Function function, JSONArray disasmArray, 
                                       String functionName, String functionAddress) {
        try {
            StringBuilder disassembly = new StringBuilder();
            StringBuilder normalized = new StringBuilder();
            int instructionCount = 0;

            Listing listing = currentProgram.getListing();
            AddressSetView functionBody = function.getBody();
            InstructionIterator instructions = listing.getInstructions(functionBody, true);

            while (instructions.hasNext()) {
                try {
                    Instruction instr = instructions.next();
                    String disasmLine = instr.toString();
                    disassembly.append(disasmLine).append("\n");
                    normalized.append(normalizeInstruction(disasmLine)).append("\n");
                    instructionCount++;
                } catch (Exception e) {
                    System.err.println("Error processing instruction in " + functionName + ": " + e.getMessage());
                }
            }

            String disassembledCode = disassembly.toString();
            String contentHash = calculateHash(disassembledCode);

            JSONObject functionObj = new JSONObject();
            functionObj.put("disassembled_content_hash", contentHash);
            functionObj.put("disassembled_function_name", functionName);
            functionObj.put("disassembled_function_address", functionAddress);
            functionObj.put("disassembled_function", disassembledCode);
            functionObj.put("normalized_disassembly", normalized.toString());
            functionObj.put("instruction_count", instructionCount);

            // Set similarity-related fields to null for now
            functionObj.put("minhash_signature", JSONObject.NULL);
            functionObj.put("opcode_frequency_vector", JSONObject.NULL);
            functionObj.put("api_calls_vector", JSONObject.NULL);
            functionObj.put("instruction_embedding", JSONObject.NULL);

            disasmArray.put(functionObj);
        } catch (Exception e) {
            System.err.println("Error processing disassembly for " + functionName + ": " + e.getMessage());
        }
    }

    private void processCFG(Function function, JSONArray cfgArray, String functionAddress) {
        try {
            CodeBlockIterator blocks = basicBlockModel.getCodeBlocksContaining(
                function.getBody(), monitor);

            while (blocks.hasNext()) {
                CodeBlock block = blocks.next();
                String blockInstructions = getBlockInstructions(block);
                String blockId = calculateHash(blockInstructions);

                JSONObject blockObj = new JSONObject();
                blockObj.put("block_id", blockId);
                blockObj.put("function_address", functionAddress);
                blockObj.put("block_instructions", blockInstructions);

                // Get successor blocks
                CodeBlockReferenceIterator successors = block.getDestinations(monitor);
                JSONArray successorAddresses = new JSONArray();
                while (successors.hasNext()) {
                    CodeBlockReference ref = successors.next();
                    successorAddresses.put(ref.getDestinationAddress().toString());
                }
                blockObj.put("successor_blocks", successorAddresses);

                cfgArray.put(blockObj);
            }
        } catch (Exception e) {
            System.err.println("{\"error\": \"Error processing CFG: " + 
                             e.getMessage().replace("\"", "'") + "\"}");
        }
    }

    private String normalizeInstruction(String instruction) {
        return instruction.replaceAll("0x[0-9a-fA-F]+", "IMM")
                        .replaceAll("\\b\\d+\\b", "NUM");
    }

    private String getBlockInstructions(CodeBlock block) {
        StringBuilder instructions = new StringBuilder();
        AddressIterator addresses = block.getAddresses(true);
        while (addresses.hasNext()) {
            Address addr = addresses.next();
            Instruction instr = currentProgram.getListing().getInstructionAt(addr);
            if (instr != null) {
                instructions.append(instr.toString()).append("\n");
            }
        }
        return instructions.toString();
    }

    private String calculateHash(String content) {
        try {
            MessageDigest digest = MessageDigest.getInstance("SHA-256");
            byte[] hash = digest.digest(content.getBytes(StandardCharsets.UTF_8));
            StringBuilder hexString = new StringBuilder();
            for (byte b : hash) {
                hexString.append(String.format("%02x", b));
            }
            return hexString.toString();
        } catch (Exception e) {
            System.err.println("{\"error\": \"Error calculating hash\"}");
            return "";
        }
    }
}