Drop your file to analyze it

CSPEC File

What are CSPEC files and how to open them

Are you having problems opening a CSPEC file or are you simply curious about its contents? We're here to explain the properties of these files and provide you with software that can open or handle your CSPEC files.

What is a CSPEC file?

A .CSPEC file is a Ghidra Compiler Specification file.

Ghidra Compiler Specification files encode the rules that a particular compiler uses when producing binaries. They are written by open-source reverse engineering tool Ghidra to describe how functions are called, how arguments are passed, how stack pointers work, which registers are volatile, how data types are aligned, and other ABI (Application Binary Interface) conventions. This information allows Ghidra's decompiler and analysis tools to interpret compiled code correctly for a given compiler.

These files are XML documents read at startup or when a program is opened, identified by a language's configuration. Each language module in Ghidra's data/languages directory contains one or more compiler specifications so that multiple compilers (for example gcc, Visual Studio, Borland) can be associated with the same processor architecture. Ghidra uses .cspec files in conjunction with other specification layers: .sla (instruction semantics), .pspec (processor architecture), and .ldefs (language definitions) to form a complete model for analysis.

Typical content includes: data organization (pointer size, alignment, signedness of enums), prototype models or calling conventions (where inputs and outputs are stored), stack behavior (which register is used as stack pointer, how the stack is shifted or cleaned up after calls), global memory ranges, and p-code fixups that map compiler bookkeeping or calling convention effects into Ghidra's internal intermediate representation. Tags like <prototype>, <callfixup>, <global>, <stackpointer>, <default_prototype> etc. are used.

Files start with the XML declaration including version and encoding (for example <?xml version="1.0" encoding="UTF-8"?>), and the root element is <compiler_spec>. Signature strings found in the file include markers like STACKPOINTER REGISTER, PROTOTYPE NAME, DEFAULT_PROTO, REGISTER NAME, PENTRY, MAXSIZE, MINSIZE, GLOBAL, INPUT, OUTPUT among others, which distinguish them uniquely.

How to open CSPEC files

Important: Different programs may use files with the CSPEC file extension for different purposes, so unless you are sure which format your CSPEC file is, you may need to try a few different programs.

We have not yet verified any programs for Windows that work with this specific file format. If you know one, please use the 'Suggest a program' link below. Thanks!

Last updated: September 19, 2026

Help us help others

File.org helps thousands of users every day, and we would love to hear from you if you have additional information about CSPEC file formats, example files, or compatible programs. Please use the links below or email us at submit@file.org to discuss further.