[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Jilc-dev] Problem
From: |
Gopal.V |
Subject: |
Re: [Jilc-dev] Problem |
Date: |
Fri, 22 Feb 2002 02:55:15 +0530 |
User-agent: |
Mutt/1.2.5i |
If memory serves me right, Gaurav Vaish wrote:
> The new jdasm is unable to deassemble a simple file - I am attaching the
> code and bytecode here.
Actually new jdasm is appropriate here. A small typo is what is
causing the core dump..... I'll give you three guesses ... read the
code below and find out on you own... ;-).
|| OLD CODE
|| -------
|| case LABEL:
|| printf("%d;code offset ",
|| insn_offset+(Int16)(code[start+1]<<8|code[start+2]));
|| NEW CODE
|| ---------
|| case LABEL: PRINT_OP_NAME(found);
|| printf("\t %s;code offset ", insn_offset + \
|| ( ((Int16)code[start + 1]) << 0x08 | \
|| ((Int16)code[start + 2]) ) );
To give a hint I call it "a format string vulnerability" , LOL.
This kind of thing happens to the best of us...
To check this kind of error, try running my original code, that
shows a GOTO instruction where the SEGFAULT occurs. So I go and check
the GOTO's param type "LABEL". And there you are...
<stuff>
That reminds me , ever tried
if(NULL == 0) printf("%s\n",NULL);
That's when you start appreciating gcc .... (will this dump a core ?)
</stuff>
Gopal.V
PS: 2:40 AM .... and I get this mail saying my code doesn't work !
swap out of deep sleep mode to deep hack mode ....... AAH !
--
The difference between insanity and genius is only measured by success
//===<=>===\\
|| GNU RULEZ ||
\\===<=>===//