Re: Couple ?s



"Andy Kennedy" <spamtrap@xxxxxxxxxx> ???????/???????? ? ???????? ?????????: news:44498bc9.65c.41@xxxxxxxx
Question 1 concerning the RegQueryValueEx API
REG_BINARY

When it says binary data in any form, what does that
specifically entail.
(as opposed to REG_SZ used for strings)

The differences deal with null-chars and A / W issues.
A value of REG_SZ type must contain no embedded nulls.
Also when you use A or W version of the API, the system returns "ansi" or "unicode" version of the string.
REG_BINARY value can contain any "chars" (more precisely
the term "character" is not applicable, this is just a byte sequence) and returned data is not dependent on A
or W version of the API.

Also you should pay some attention to buffer length in the case when you allocate it after first call the API with a small or null buffer to determine the length (+/-1 issues).

Question 2
How can I automate this to check for multiple characters in
a string. I tried a
inc esi statement.

lea esi, szBigBuffer[0] ;look at 1st character in buffer
for a match
lodsb

.if EAX==31h ; the '1' character

?

.



Relevant Pages

  • Re: Copying string to byte array
    ... of Strings and the CryptEncrypt + CryptDecrypt APIs. ... binary data should not be held in String variables. ... a) not all character codes are valid in a given ...
    (microsoft.public.vb.general.discussion)
  • Re: TS and an address of a const?
    ... type safe so that you cannot accidentally overrun the buffer. ... strings it would be wise to make the destination buffer one character ... terminate using double zero, and don't calculate the bufsize correctly. ...
    (comp.lang.modula2)
  • Re: Unicode Support
    ... > Not knowing much about UTF-8 (my Unicode knowledge extends as far as ... > literal strings of this form as long as the character code for quote ... > can never appear in a MBCS (multibyte character sequence). ... then XP Notepad directly understands UNICODE and you can ...
    (alt.lang.asm)
  • Re: [Lit.] Buffer overruns
    ... >> As has been pointed out, C strings are unrelated to C buffer overflow ... > is a infrastructure source length available based on nul-terminated, ... > data-pattern based length paradigm ... ...
    (sci.crypt)
  • Re: Need help on string manipulation
    ... better to convert strings to UCS-32 before manipulation? ... Characters represented by wchar_t must use one wchar_t per character, ... which may use a multibyte encoding. ... use some newer Unicode characters, if this is a problem for you, then ...
    (comp.lang.c)