How to read *.tbc file

Altair Forum User
Altair Forum User
Altair Employee
edited October 2020 in Community Q&A

hi all,

 

i having one file with extension '.tbc'.

 

i had tried to open it in simple text editor but not working.

 

can anyone guide me, how to open '.tbc' file

 

 

thanks 

Adams

Answers

  • tinh
    tinh Altair Community Member
    edited April 2014

    Hello,

    it is compiled code, it's a text format but we cannot read

    purpose of tbc is to hide source code of some authors

    But in some case we can dump it back, for example if the codes were written in body of namespace or the codes is a part of a class (object-orient)

    otherwise just the guys wrote tbcload and procomp know how to read tbc

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited April 2014

    yes code is written in namespace body.

     

    can i convert the '.tbc' code in standard '.tcl' format?

     

     

    thanks 

    Shivanshu

  • tinh
    tinh Altair Community Member
    edited April 2014

    yes, you can get tcl codes of each compiled procedure by using

    info args procname

    info body procname

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited April 2014

    yes code is written in namespace body.

     

    can i convert the '.tbc' code in standard '.tcl' format?

     

     

    thanks 

    Shivanshu

     

    Have a look at http://stackoverflow.com/questions/14633101/tbc-to-tcl-file

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited April 2014

    thanks for replying.

     

    but i am not gettign the the way how exactly i have to convert the

    '.tbc' to 'tcl'

     

    please help with explained sol.

     

     

    thanks 

     

    Adams

  • tinh
    tinh Altair Community Member
    edited April 2014

    Hello

    as i know there is no available tool to convert tbc file to tcl file

    above guide just help you to be able to know what the tbc file do by dumping its detail actions

     

    to dump a procedure explicitly,  open command window and type in:

    dump procname

     

    if the procedure was pre-compiled, then nothing resulted

    it (procedure) can be dumped if it is inside a namespace, an object or nested in a command (generated from a command)

  • alpha_21885
    alpha_21885 Altair Community Member
    edited December 2017

    Hello Tinh,

     

    Do you know which free/opensource software to convert from *.tcl to *.tbc?

  • tinh
    tinh Altair Community Member
    edited December 2017

    I am sorry because I don't know such a software.

    But I can debug it to know how it acts. Because it will invoke other tcl commands, by tracing them we may know what's happening.

    unfortunately, this is a terrible work, with tons of output need to be parsed

  • alpha_21885
    alpha_21885 Altair Community Member
    edited December 2017

    Hi Tĩnh.

     

    I am sorry for making wrong explanation. I would like to know how to compile my tcl code to *.tbc in case I wanna protect my program.

  • tinh
    tinh Altair Community Member
    edited December 2017

    Hi alpha,

    I use this soft:

    https://www.tcl.tk/software/tclpro/eval/1.4.html

    newer versions are released by active-state

    this v1.4 cannot compile newer syntax like {*}, expr with eq, ne, in, ni operators,...

  • alpha_21885
    alpha_21885 Altair Community Member
    edited December 2017

    Thanks Tinh so much for your information!

  • brahmadev
    brahmadev Altair Community Member
    edited December 2018

    yes, you can get tcl codes of each compiled procedure by using

     

     

    info args procname

     

     

     

    info body procname

     

    I have tried this way but I haven't got the body if code instead it is throwing me an error saying 'compiled -- no source code available'

     

    Is there any other turnaround ?

     

     

  • tinh
    tinh Altair Community Member
    edited December 2018

    Compiled script cannot be dumped by that way

    Commands inside body of switch, [ ] ,... are exposed and can be traced, but no way to trace commands in level 1 of a proc because they are converted to bytecode

  • Vlad VB
    Vlad VB Altair Community Member
    edited June 2020

    Tinh, 

        I have trying to get TclPro installed but the link isn't working anymore. Do you knwo weh i can download it and do you have an example of how to compile a script. Thank you for any help

  • Q.Nguyen-Dai
    Q.Nguyen-Dai Altair Community Member
    edited June 2020

    Before, you can buy TclDevKit at ActiveState. But it's not possible from now.

    In fact ActiveState have released TDK as OpenSource software: https://www.activestate.com/blog/tcl-dev-kit-now-open-source/