From owner-freebsd-hackers@freebsd.org Mon Feb 13 21:37:52 2017 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12269CDDDC4 for ; Mon, 13 Feb 2017 21:37:52 +0000 (UTC) (envelope-from eric@metricspace.net) Received: from mail.metricspace.net (mail.metricspace.net [IPv6:2001:470:1f11:617::107]) by mx1.freebsd.org (Postfix) with ESMTP id C3EBD11E2; Mon, 13 Feb 2017 21:37:51 +0000 (UTC) (envelope-from eric@metricspace.net) Received: from [IPv6:2001:470:1f11:617:3210:b3ff:fe77:ca3f] (unknown [IPv6:2001:470:1f11:617:3210:b3ff:fe77:ca3f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: eric) by mail.metricspace.net (Postfix) with ESMTPSA id 3268C1E13; Mon, 13 Feb 2017 21:37:51 +0000 (UTC) Subject: Re: GELI BIOS weirdness To: cem@freebsd.org, Dimitry Andric References: <6874308d-8892-2f03-d125-418949fd472c@metricspace.net> <919F6E39-476C-44B5-93EA-447D855921DE@FreeBSD.org> Cc: "freebsd-hackers@freebsd.org" From: Eric McCorkle Message-ID: <9127dfc3-3c33-68c7-53a7-31753ac7e1d3@metricspace.net> Date: Mon, 13 Feb 2017 16:37:47 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="2sLGNof96H6lqXf8oL1EdggCgJ5ipDx0L" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Feb 2017 21:37:52 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --2sLGNof96H6lqXf8oL1EdggCgJ5ipDx0L Content-Type: multipart/mixed; boundary="lGo4r0nAdRGBWbhiPIVi9LqAiP2rsGBev"; protected-headers="v1" From: Eric McCorkle To: cem@freebsd.org, Dimitry Andric Cc: "freebsd-hackers@freebsd.org" Message-ID: <9127dfc3-3c33-68c7-53a7-31753ac7e1d3@metricspace.net> Subject: Re: GELI BIOS weirdness References: <6874308d-8892-2f03-d125-418949fd472c@metricspace.net> <919F6E39-476C-44B5-93EA-447D855921DE@FreeBSD.org> In-Reply-To: --lGo4r0nAdRGBWbhiPIVi9LqAiP2rsGBev Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 02/13/2017 16:32, Conrad Meyer wrote: > "objdump -D -b binary -Mx86-64 -mi386 foo.bin" should work fine (no > symbols, though...). This is a raw binary, which is necessary for BIOS booting. boot0 is way too small to load an ELF. >=20 > On Mon, Feb 13, 2017 at 1:16 PM, Dimitry Andric wrote= : >> On 13 Feb 2017, at 21:58, Eric McCorkle wrote: >>> >>> On 02/13/2017 15:36, Dimitry Andric wrote: >>> >>>> This disassembles to: >>>> >>>> 0: 66 0f 38 f6 f0 adcx %eax,%esi >>>> 5: 31 c6 xor %eax,%esi >>>> 7: 8b 4d 14 mov 0x14(%ebp),%ecx >>>> a: 89 cf mov %ecx,%edi >>>> c: c1 ff 1f sar $0x1f,%edi >>>> f: 8b .byte 0x8b >>> >>> Note that this was truncated, so the sar and .byte are probably a >>> truncated instruction. >>> >>> Also, when I had printfs in place, I could see the call instructions.= >>> >>>> My first guess would be that the code simply jumped into garbage. B= ut >>>> can you post the complete .o file somewhere for inspection? >>> >>> Attached. >>> >> >> Can you please post the file before it's been stripped and objcopied >> from ELF to binary format? That makes it a lot easier to disassemble >> and analyze... :) >> >> -Dimitry >> --lGo4r0nAdRGBWbhiPIVi9LqAiP2rsGBev-- --2sLGNof96H6lqXf8oL1EdggCgJ5ipDx0L Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYIAB0WIQRELMWN3SgpoYkrmidWwohAqoAEjQUCWKInLAAKCRBWwohAqoAE jSjpAP9TctLmgMt//n1u+EDyekEWMdgoFGUX7TYnc/A4KSA1BwEAl5cvQgDiS+F1 bYCn59120efsjzEhZUrwRykYlPbGGAE= =+yzR -----END PGP SIGNATURE----- --2sLGNof96H6lqXf8oL1EdggCgJ5ipDx0L--