Re: How can I WEP-Key To CFDATARef ?
Re: How can I WEP-Key To CFDATARef ?
- Subject: Re: How can I WEP-Key To CFDATARef ?
- From: Dave Camp <email@hidden>
- Date: Thu, 12 May 2005 16:22:54 -0700
This seems like a basic programming issue, not a Mac networking
issue, but I'll bite...
The code you posted appears to take a UTF-8 C string, convert it to a
CFString, convert the CFString to ASCII, and then store the ASCII
text in a CFData object. The net result would be the same bytes you
started with.
Are you just asking how one might convert a hex string to a number? I
would think strtol() would do that quite handily.
Dave
On May 12, 2005, at 11:58 AM, Halit Özüberk ((ProDyne)) wrote:
Please Help me,
How can I convert a HEX WEP a CFString to CFData ???
example::
CFStringRef WepKey = CFSTR("AAFCE8A294"); //as HEX -> AAFCE8A294
void* keys[1];
void* values[1];
UInt8 Buffer[21];
memset(Buffer,0,sizeof(Buffer));
WepKey = CFStringCreateWithCString(kCFAllocatorDefault, cWepKey,
kCFStringEncodingUTF8);
CFRange range = CFRangeMake(0, CFStringGetLength(WepKey));
CFIndex usedBufLen = 0;
CFIndex iBytes = CFStringGetBytes( WepKey, range,
kCFStringEncodingASCII, 0 , false, Buffer, CFStringGetLength
(WepKey), &usedBufLen );
CFDataRef Password = CFDataCreate(kCFAllocatorDefault, Buffer,
iBytes);
keys[0] = (void*) CFSTR("WEPKEY");;
values[0] = (void*) Password;
.......
Result:
"WEPKEY" CFDATA <41414643 45384132 3934>
this is the Rigth encoded Result:
"WEPKEY" CFDATA <abdacee5 0544abd8 cee1053a abdace96 053babaf>
PLEASEEEEEE HELP MEEEEEEEEEEEEEE ! ! !
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40criticalpath.com
This email sent to email@hidden
---
It is dark; you are likely to be eaten by a grue. -Zork
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden