Re: Library Design, f0dder's nightmare.
- From: "f0dder" <f0dder_nospam@xxxxxxxxxxxxxxxx>
- Date: Mon, 19 Jun 2006 13:58:10 +0200
japheth wrote:
Nice, Hutch, but unless you provide a reliable source where we can get
this mysterious f0dder.lib and can make our own tests - if someone is
really that bored - your posting must be regarded as slander.
I spent the ~45 seconds it took to add TAB support to my tokenizer, it can
be found at http://f0dder.reteam.org/misc/cmdline_parse_2.zip . I dunno why
anybody would use tab delimiting for commandlines, but here it is.
The snippet is useful for constructing a C-style argv[] array, without
modifying the OS-supplied commandline, and only allocating as much memory as
is really needed. It doesn't have a limitation on the length of the
commandline (or whatever you're tokenizing with it), nor on the length of
each individual argument.
It does, however, use the stack for storing {offset,length} pairs while
parsing the string, so there's a limit to the maximum number of tokens it
can handle. A win32 executable with default stack options can handle ~130k
arguments without a crash, so it should be "quite sufficient" for parsing
commandlines. A boundscheck would be trivial to add, if desired.
.
- Follow-Ups:
- Re: Library Design, f0dder's nightmare.
- From: hutch--
- Re: Library Design, f0dder's nightmare.
- References:
- Library Design, f0dder's nightmare.
- From: hutch--
- Re: Library Design, f0dder's nightmare.
- From: japheth
- Library Design, f0dder's nightmare.
- Prev by Date: Re: Question Regarding the FS segment Register
- Next by Date: Re: Freudian slip at the old win32asm forum ?
- Previous by thread: Re: Library Design, f0dder's nightmare.
- Next by thread: Re: Library Design, f0dder's nightmare.
- Index(es):