From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id EA6D8BC68 for ; Sun, 12 Nov 2006 15:40:28 +0100 (CET) Received: from pilet.ens-lyon.fr (pilet.ens-lyon.fr [140.77.167.16]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id kACEeI7h026639 for ; Sun, 12 Nov 2006 15:40:28 +0100 Received: from localhost (localhost [127.0.0.1]) by pilet.ens-lyon.fr (Postfix) with ESMTP id 72BF315BA66 for ; Sun, 12 Nov 2006 15:40:16 +0100 (CET) Received: from pilet.ens-lyon.fr ([127.0.0.1]) by localhost (pilet [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 08424-18 for ; Sun, 12 Nov 2006 15:40:14 +0100 (CET) Received: from [192.168.1.11] (AAnnecy-152-1-23-40.w83-197.abo.wanadoo.fr [83.197.40.40]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client did not present a certificate) by pilet.ens-lyon.fr (Postfix) with ESMTP id 3992A15BA68 for ; Sun, 12 Nov 2006 15:40:14 +0100 (CET) From: Pierre-Etienne Meunier To: caml-list@yquem.inria.fr Subject: Bytecode object files structure Date: Sun, 12 Nov 2006 15:42:30 +0100 User-Agent: KMail/1.7.2 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200611121542.30370.pierreetienne.meunier@ens-lyon.fr> X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at ens-lyon.fr X-Miltered: at concorde with ID 45573252.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; ens-lyon:01 bytecode:01 cmo:01 ocaml:01 cmo:01 ocaml:01 bytecode:01 vaguely:01 ens-lyon:01 assembler:02 linking:02 string:02 string:02 seems:03 seems:03 Hi, I'm trying to decrypt .cmo files produced by simple programs, such as 1+1;; or print_string "string";; or List.length [1;2;3;4;5];; According to the source of Ocaml, there's something called the "cmo_magic_number", systematically written at the beginning of all .cmo files. Does it have a real function for executing the programs, or is it just a way to make sure the file contains ocaml bytecode ? Then, there's the address of what seems to be the last bytecode instruction. Then, the bytecode instructions, as documented in opcodes.ml. After that, I can't understand anything : there vaguely seems to be some information related to linking or so... What is the precise structure of this part ? Is there some kind of a bytecode assembler ? Thanks, P.E. Meunier (pierreetienne.meunier@ens-lyon.fr)