mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "openbsd shen" <openbsd.shen@gmail.com>
To: kernel <linux-kernel@vger.kernel.org>
Subject: What means "\xc7\x44\x24\x18\xda\xff\xff\xff\xe8"
Date: Thu, 6 Apr 2006 09:38:33 +0800	[thread overview]
Message-ID: <6ff3e7140604051838k1b332990i488f373aad99fa71@mail.gmail.com> (raw)

this code from get_sct() of suckit 2, why memmem()
"\xc7\x44\x24\x18\xda\xff\xff\xff\xe8"use, what it want to find?
The get_sct() founction:

ulong   get_sct()
{
        uchar   code[SCLEN+256];
        uchar   *p, *pt;
        ulong   r;
        uchar   pt_off, pt_bit;
        int     i;

        kernel_old80 = get_ep();

        if (!kernel_old80)
                return 0;
        if (rkm(code, sizeof(code), kernel_old80-4) <= 0)
                return 0;

        if (!memcmp(code, "PUNK", 4))
                return 0;

        p = (char *) memmem(code, SCLEN, "\xff\x14\x85", 3);
        if (!p) return 0;

        pt = (char *) memmem(p+7, SCLEN-(p-code)-7,
                "\xc7\x44\x24\x18\xda\xff\xff\xff\xe8", 9);
        /* when run at here , it always return 0 */
        if (!pt) {
                eprintf("pt = %s\n", pt);
                return 0;
        }

        sc.trace = *((ulong *) (pt + 9));
        sc.trace += kernel_old80 + (pt - code) - 4 + 9 + 4;

        pt = (char *) memmem(p+7, SCLEN-(p-code)-7, "\xff\x14\x85", 3);
        if (!pt) return 0;

        for (i = 0; i < (p-code); i++) {
                if ((code[i] == 0xf6) && (code[i+1] == 0x43) &&
                    (code[i+4] == 0x75) && (code[i+2] < 127)) {
                        pt_off = code[i+2];
                        pt_bit = code[i+3];
                        goto cc;
                }
        }

        return 0;
}

             reply	other threads:[~2006-04-06  1:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-06  1:38 openbsd shen [this message]
2006-04-06 12:15 ` linux-os (Dick Johnson)
2006-04-06 13:32   ` David Schwartz
2006-04-08  9:06 ` Jan Engelhardt
2006-04-10 20:17 ` Dan Sheppard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6ff3e7140604051838k1b332990i488f373aad99fa71@mail.gmail.com \
    --to=openbsd.shen@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®