From owner-freebsd-hackers@freebsd.org Mon Feb 13 21:33:00 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 72315CDDBC5 for ; Mon, 13 Feb 2017 21:33:00 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-wm0-f48.google.com (mail-wm0-f48.google.com [74.125.82.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 12221E53; Mon, 13 Feb 2017 21:32:59 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-wm0-f48.google.com with SMTP id r141so2193896wmg.1; Mon, 13 Feb 2017 13:32:59 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=tRMkvQvuYSukcKtMT36giYcYJVirJTj282QQv7PBEvI=; b=kr2YucXIrZdPlrUz1WRBqOO/+QCuwtb3uN56TxzrgEadIO3jai/8Ylis5Zww0gS3du Vku+D/j35n1sONmQJTzDaVmVoj7EEhLUNlGx4c1F7X5Qut9S3DC2IqcUFDtvU/AK2kQy Kmmjz1eMVvYgz5A+ee7DYaw5nI3s250tt0AK6vwvsZqLyxJKkF9SmPa+BZVzB5Cq7hmA w/B3weR7Y/GWOmZWqqPsocjIIKpEddB2rJSpNxsmzAlwKX5u4h6/B+Zqlf4MajUUoSGx N/+w+hje1yNk7T7eYh/bisp76vyuMFTkIMFKEDoZaODtLZKMW0pc9tb8DodFp/UccZp/ OVtg== X-Gm-Message-State: AMke39kKSv+2ooHZYFAQFHVQl87tE8dK/1pe+K49kc31CgP7p42W09wWK9ChhkZGQemyzA== X-Received: by 10.28.213.142 with SMTP id m136mr351888wmg.90.1487021572427; Mon, 13 Feb 2017 13:32:52 -0800 (PST) Received: from mail-wr0-f177.google.com (mail-wr0-f177.google.com. [209.85.128.177]) by smtp.gmail.com with ESMTPSA id q1sm6880900wmd.6.2017.02.13.13.32.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Feb 2017 13:32:52 -0800 (PST) Received: by mail-wr0-f177.google.com with SMTP id o16so159639013wra.1; Mon, 13 Feb 2017 13:32:52 -0800 (PST) X-Received: by 10.223.145.163 with SMTP id 32mr23816219wri.198.1487021572102; Mon, 13 Feb 2017 13:32:52 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.80.152.82 with HTTP; Mon, 13 Feb 2017 13:32:51 -0800 (PST) In-Reply-To: <919F6E39-476C-44B5-93EA-447D855921DE@FreeBSD.org> References: <6874308d-8892-2f03-d125-418949fd472c@metricspace.net> <919F6E39-476C-44B5-93EA-447D855921DE@FreeBSD.org> From: Conrad Meyer Date: Mon, 13 Feb 2017 13:32:51 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: GELI BIOS weirdness To: Dimitry Andric Cc: Eric McCorkle , "freebsd-hackers@freebsd.org" Content-Type: text/plain; charset=UTF-8 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:33:00 -0000 "objdump -D -b binary -Mx86-64 -mi386 foo.bin" should work fine (no symbols, though...). Best, Conrad 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. But >>> 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 >