### Cloning CapstoneDelphi Repository (Shell) Source: https://github.com/delphilite/capstonedelphi/blob/master/README.md This command clones the CapstoneDelphi GitHub repository to your local machine, which is the first step for manual installation. It fetches all project files and history, making them available for use. ```sh git clone https://github.com/delphilite/CapstoneDelphi.git ``` -------------------------------- ### Disassembling Function Code with TCapstone (Delphi/Pascal) Source: https://github.com/delphilite/capstonedelphi/blob/master/README.md This Delphi/Pascal code demonstrates how to use the `TCapstone` wrapper class to disassemble a function's code. It initializes the disassembler, sets the architecture mode (32-bit or 64-bit), and iterates through instructions, printing their string representation. It also shows how to handle exceptions and release resources. ```pascal uses SysUtils, Capstone; procedure DisAsmFunctionCode(const AFunc: Pointer; ASize: Integer = -1); var aInsn: TCsInsn; disasm: TCapstone; nAddr: UInt64; nSize: NativeUInt; begin if ASize < 0 then nSize := MaxInt else nSize := ASize; disasm := TCapstone.Create; with disasm do try {$IFDEF CPUX64} Mode := [csm64]; {$ELSE} Mode := [csm32]; {$ENDIF} Arch := csaX86; nAddr := UInt64(AFunc); if Open(AFunc, nSize) then while GetNext(nAddr, aInsn) do begin WriteLn(aInsn.ToString); if (ASize < 0) and (aInsn.mnemonic = 'ret') then Break; end; finally Free; end; end; begin try WriteLn(Format('Capstone Engine: v%s(%s), DisAsm ExpandFileNameCase ...', [TCapstone.LibraryVersion, TCapstone.EngineVersion])); WriteLn(''); DisAsmFunctionCode(@SysUtils.ExpandFileNameCase); WriteLn(''); WriteLn('Done.'); ReadLn; except on E: Exception do WriteLn(Format('Error Decompiler: %s', [E.Message])); end; end. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.