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=1.1 required=5.0 tests=AWL,SPF_NEUTRAL autolearn=disabled version=3.1.3 Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 42A09BC68 for ; Mon, 13 Nov 2006 10:16:43 +0100 (CET) Received: from nz-out-0102.google.com (nz-out-0102.google.com [64.233.162.201]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id kAD9GgnI029667 for ; Mon, 13 Nov 2006 10:16:42 +0100 Received: by nz-out-0102.google.com with SMTP id i11so707387nzh for ; Mon, 13 Nov 2006 01:16:42 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=LPZHPlFRexxPfu9GI38wOnzQOnuIOIDUX566i8zRnx3Hg/rFrimzCQ9OKzMUti5K2RUNfO+qoPAVAH5Kvy136IWHpwwXrtJQqk8E59hGEyJBZ3gPqAAwk1h3+WArlo2uSMLqEGvbq2jYBMDvHKLQWz/0HhRlWjiX7bulbkGD1jo= Received: by 10.35.66.1 with SMTP id t1mr10843849pyk.1163409400799; Mon, 13 Nov 2006 01:16:40 -0800 (PST) Received: by 10.35.10.18 with HTTP; Mon, 13 Nov 2006 01:16:40 -0800 (PST) Message-ID: <1af89fca0611130116u1b6e4592q63fa24769ef5dac8@mail.gmail.com> Date: Mon, 13 Nov 2006 10:16:40 +0100 From: "=?ISO-8859-1?Q?Yann_R=E9gis-Gianas?=" Reply-To: yann@regis-gianas.com To: "Pierre-Etienne Meunier" Subject: Re: [Caml-list] Bytecode object files structure Cc: caml-list@yquem.inria.fr In-Reply-To: <200611121542.30370.pierreetienne.meunier@ens-lyon.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <200611121542.30370.pierreetienne.meunier@ens-lyon.fr> X-j-chkmail-Score: MSGID : 455837FA.000 on discorde : j-chkmail score : X : 0/20 1 X-Miltered: at discorde with ID 455837FA.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; regis-gianas:01 bytecode:01 o'caml:01 bytecode:01 regis-gianas:01 ens-lyon:01 cmo:01 ocaml:01 cmo:01 ocaml:01 vaguely:01 ens-lyon:01 beginner's:01 bug:01 beginners:01 Hi, The file tools/dumpobj.ml in the O'Caml tree may be used to parse the object file. This should be a first step to understand the bytecode file format. Hope this help, -- Yann R=E9gis-Gianas On 11/12/06, Pierre-Etienne Meunier wro= te: > 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 instructi= on. > 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) > > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs > --=20 Yann