跳到主要內容

msnp15 認證過程(I)

使用別人開發好的msn sdk來開發程式;真的能夠滿足你對技術的慾望嗎?以下為msn protocol v15的認證過程,msnp15大致上延續前一版的協定,但是在認證的部份改了,目前msn server 已支援msnp16,而現階段最新的msn client (msn v8.1)還在使用msnp15,要到msn v9才會開始全面支援msnp16
直接從msn protocol著手的主要理由是~這樣,才能將msn 移植到非win32的平台上,否則;微軟本身也有釋出msn sdk,它的缺點是;只能依附在有安裝msn client 的win32上,就這一點來說;msn 的政策還相當封閉,因為每次protocol升級;認證的部份幾乎都有更動,這也是從protocol著手來應用msn 最大的麻煩,不過從追蹤 撰寫msn protocol,可以學到不少東西可說是額外的收穫,msn protocol在技術上跟xmpp真的很大的落差,msn protocol顯得格外凌亂設計不良,既不結構化也談不上功能上的彈性,看起來像是非資訊背景的工程師做出來的系統,我相信當msn與yahoo在談im整合時一定相互埋怨過對方的protocol設計怎麼如此草率,這恰好凸顯了xmpp protocol 的優勢...

207.46.110.86:1863
c2s->[client to server]
s2c->[server to client]

c2s->VER 1 MSNP15 CVR0
s2c->VER 1 MSNP15

c2s->CVR 2 0x0404 winnt 5.2 i386 MSNMSGR 8.1.0178 MSFT luke_shei@hotmail.com
s2c->CVR 2 8.1.0178 8.1.0178 8.1.0178 http://msgruser.dlservice.microsoft.com/download/1/C/F/1CF776CC-90D6-4497-B079-402BA9DB8BE4/Install_Messenger.exe http://get.live.com/tc

c2s->USR 3 SSO I luke_shei@hotmail.com
s2c->GCF 0 6713
s2c->
<Policies>(省略...)</Policies>USR 3 SSO S MBI_KEY_OLD ZUzrcaa4fRluSqjOaLzc9ExfHQaoiZB4MxTjfRcmohTooJuVilSvIJ7jSy+DKBeO

此時需要使用ssl 連接 https://login.live.com/RST.srf , 並且送出認證資訊
<?xml version="1.0" encoding="UTF-8" ?>
<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsse="http://schemas.xmlsoap.org/ws/2003/06/secext" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion" xmlns:wsp="http://schemas.xmlsoap.org/ws/2002/12/policy" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing" xmlns:wssc="http://schemas.xmlsoap.org/ws/2004/04/sc" xmlns:wst="http://schemas.xmlsoap.org/ws/2004/04/trust">
<Header>
<ps:AuthInfo xmlns:ps="http://schemas.microsoft.com/Passport/SoapServices/PPCRL" Id="PPAuthInfo">
<ps:HostingApp>{7108E71A-9926-4FCB-BCC9-9A9D3F32E423}</ps:HostingApp>
<ps:BinaryVersion>4</ps:BinaryVersion>
<ps:UIVersion>1</ps:UIVersion>
<ps:Cookies />
<ps:RequestParams>AQAAAAIAAABsYwQAAAAyMDUy</ps:RequestParams>
</ps:AuthInfo>
<wsse:Security>
<wsse:UsernameToken Id="user">
<wsse:Username>帳號@hotmail.com</wsse:Username>
<wsse:Password>密碼</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</Header>
<Body>
<ps:RequestMultipleSecurityTokens xmlns:ps="http://schemas.microsoft.com/Passport/SoapServices/PPCRL" Id="RSTS">
<wst:RequestSecurityToken Id="RST0">
<wst:RequestType>http://schemas.xmlsoap.org/ws/2004/04/security/trust/Issue</wst:RequestType>
<wsp:AppliesTo>
<wsa:EndpointReference>
<wsa:Address>http://Passport.NET/tb</wsa:Address>
</wsa:EndpointReference>
</wsp:AppliesTo>
</wst:RequestSecurityToken>
<wst:RequestSecurityToken Id="RST1">
<wst:RequestType>http://schemas.xmlsoap.org/ws/2004/04/security/trust/Issue</wst:RequestType>
<wsp:AppliesTo>
<wsa:EndpointReference>
<wsa:Address>messengerclear.live.com</wsa:Address>
</wsa:EndpointReference>
</wsp:AppliesTo>
<wsse:PolicyReference URI="MBI_KEY_OLD" />
</wst:RequestSecurityToken>
<wst:RequestSecurityToken Id="RST2">
<wst:RequestType>http://schemas.xmlsoap.org/ws/2004/04/security/trust/Issue</wst:RequestType>
<wsp:AppliesTo>
<wsa:EndpointReference>
<wsa:Address>messenger.msn.com</wsa:Address>
</wsa:EndpointReference>
</wsp:AppliesTo>
<wsse:PolicyReference URI="MBI" />
</wst:RequestSecurityToken>
</ps:RequestMultipleSecurityTokens>
</Body>
</Envelope>

https://login.live.com/RST.srf 回應

<?xml version="1.0" encoding="utf-8" ?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Header>
<psf:pp xmlns:psf="http://schemas.microsoft.com/Passport/SoapServices/SOAPFault">
<psf:serverVersion>1</psf:serverVersion>
<psf:PUID>0001613089FFCD2E</psf:PUID>
<psf:configVersion>3.100.2199.0</psf:configVersion>
<psf:uiVersion>3.0.869.0</psf:uiVersion>
<psf:authstate>0x48803</psf:authstate>
<psf:reqstatus>0x0</psf:reqstatus>
<psf:serverInfo Path="Live1" RollingUpgradeState="ExclusiveNew" LocVersion="0" ServerTime="2008-08-20T06:17:36Z">BAYIDSLGN1E20 2008.07.30.00.23.50</psf:serverInfo>
<psf:cookies/>
<psf:browserCookies>
<psf:browserCookie Name="MH" URL="http://www.msn.com">MH=MSFT; path=/; domain=.msn.com; expires=Wed, 30-Dec-2037 16:00:00 GMT</psf:browserCookie>
<psf:browserCookie Name="MHW" URL="http://www.msn.com">MHW=; path=/; domain=.msn.com; expires=Thu, 30-Oct-1980 16:00:00 GMT</psf:browserCookie>
<psf:browserCookie Name="MH" URL="http://www.live.com">MH=MSFT; path=/; domain=.live.com; expires=Wed, 30-Dec-2037 16:00:00 GMT</psf:browserCookie>
<psf:browserCookie Name="MHW" URL="http://www.live.com">MHW=; path=/; domain=.live.com; expires=Thu, 30-Oct-1980 16:00:00 GMT</psf:browserCookie>
</psf:browserCookies>
<psf:credProperties>
<psf:credProperty Name="MainBrandID">MSFT</psf:credProperty>
<psf:credProperty Name="BrandIDList">
</psf:credProperty>
<psf:credProperty Name="IsWinLiveUser">true</psf:credProperty>
<psf:credProperty Name="CID">15797708e38d3864</psf:credProperty>
<psf:credProperty Name="AuthMembername">帳號@hotmail.com</psf:credProperty>
</psf:credProperties>
<psf:extProperties>
<psf:extProperty Name="ANON" Expiry="Sun, 08-Mar-2009 13:17:36 GMT" Domains="" IgnoreRememberMe="false">A=604A1CF7C863B25590E98D87FFFFFFFF&E=751&W=1</psf:extProperty>
<psf:extProperty Name="NAP" Expiry="Fri, 28-Nov-2008 14:17:36 GMT" Domains="" IgnoreRememberMe="false">V=1.6&E=6f7&C=D3sTmCI3EaEA1q-Ugji4rYA5G76akrqFloSZtTfKwkT6_ToKa0MUog&W=1</psf:extProperty>
<psf:extProperty Name="LastUsedCredType">1</psf:extProperty>
</psf:extProperties>
<psf:response/>
</psf:pp>
</S:Header>
<S:Body>
<wst:RequestSecurityTokenResponseCollection xmlns:S="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wst="http://schemas.xmlsoap.org/ws/2004/04/trust" xmlns:wsse="http://schemas.xmlsoap.org/ws/2003/06/secext" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion" xmlns:wsp="http://schemas.xmlsoap.org/ws/2002/12/policy" xmlns:psf="http://schemas.microsoft.com/Passport/SoapServices/SOAPFault">
<wst:RequestSecurityTokenResponse>
<wst:TokenType>urn:passport:legacy</wst:TokenType>
<wsp:AppliesTo xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing">
<wsa:EndpointReference>
<wsa:Address>http://Passport.NET/tb</wsa:Address>
</wsa:EndpointReference>
</wsp:AppliesTo>
<wst:LifeTime>
<wsu:Created>2008-08-20T06:17:36Z</wsu:Created>
<wsu:Expires>2008-08-21T06:17:36Z</wsu:Expires>
</wst:LifeTime>
<wst:RequestedSecurityToken>
<EncryptedData xmlns="http://www.w3.org/2001/04/xmlenc#" Id="BinaryDAToken0" Type="http://www.w3.org/2001/04/xmlenc#Element">
<EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc">
</EncryptionMethod>
<ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<ds:KeyName>http://Passport.NET/STS</ds:KeyName>
</ds:KeyInfo>
<CipherData>
<CipherValue>AXFOGn0CJ316qWBnizuzibVEto6s2I2AlZRmD69bPE+dfzAzqHWA3rjheo3p+wy46qtVQJXDw61/V9tVQZ3yFuQ2vuq4EWWaH5wB8RV6Bw5EVxJvlViM4FqNf7a/DaBSUCJqoPCGXxGRvXT5VYJDmMt/KAutuoO3ULh8r1aQYDs4JJQdFzHdst95oRQkeC4b1vzzNh4mRT/3y1C6wnplhlVhArpSRIf5yI5YYAz6dq0w2jzpfUZ/dJmz/vzfEsS3jV7eO0xptvy9X7wA/YM4U1r+8cIITG7DgfU85GhJmjh5P0LbvcZ6p39R/hNxUWJrHw5WU91qdVui0uMSOpQYloZxbtHtNWiQZ0Q2y+/YyGmX7THQdfyPqMSC7wl7gl2M+wwCrPzpUgpu2hRB89kUyARUz5O849F9uBy/DzV2u+l2oNmIzcOjhNDFqf9M003tJqV+ND7DA0KBJD/wQvHXP8M0OXRuTAxA4+z5bnqa858VgqwDrg==</CipherValue>
</CipherData>
</EncryptedData>
</wst:RequestedSecurityToken>
<wst:RequestedTokenReference>
<wsse:KeyIdentifier ValueType="urn:passport">
</wsse:KeyIdentifier>
<wsse:Reference URI="#BinaryDAToken0">
</wsse:Reference>
</wst:RequestedTokenReference>
<wst:RequestedProofToken>
<wst:BinarySecret>BZP+6JadxbOLyXqPL5Ryf1hHNpI9bYtU</wst:BinarySecret>
</wst:RequestedProofToken>
</wst:RequestSecurityTokenResponse>
<wst:RequestSecurityTokenResponse>
<wst:TokenType>urn:passport:compact</wst:TokenType>
<wsp:AppliesTo xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing">
<wsa:EndpointReference>
<wsa:Address>messengerclear.live.com</wsa:Address>
</wsa:EndpointReference>
</wsp:AppliesTo>
<wst:LifeTime>
<wsu:Created>2008-08-20T06:17:36Z</wsu:Created>
<wsu:Expires>2008-08-20T14:17:36Z</wsu:Expires>
</wst:LifeTime>
<wst:RequestedSecurityToken>

<wsse:BinarySecurityToken Id="Compact1">
t=EwBgAswbAQAUs1/VcBU2sH7mwYy3BysWZ71CRDGAAPyC8gbVv65DNR9B35NbtWgaPfSxjcx8TQRH7dSQkHl+pf46GQS1pukb1fNuh5NtW2fsIGDXCyNhyMBi4/BKhzeE66MGXBsfgdWzDzSj/SGnQYnZtvKLdBi9ihv1hR+q018ePodvV4x3Vlcet38/CE1yPd9t8Z/yhNyCBcufTbMVA2YAAAjOONh/nTbDBLABYnUuPlUVuIv9ImLzUxYuvlSzHsgEAxTJkrpnHNmJv4IS0lUGIO9+yvfEbAl46rS1vpr0MHN8uL4JIE7XkS7MHhElesCRHvMpWp/h2O9clTrk9P5krslyhepE45ZCWYyodEaCEPsD5ZEauYe4M8wf3Pm9mrF+vr0RiKwATDDz4Ow1QQ+zz/HS7XaKohPEsCQDLf5rnC+nsQha9053Wbsq6qrbTtAh5DHviCv2KjHVHykPufhlr1R/FTb4Pu/ufe3dt8r3pQseGcm0H16bYJBqlxqyG7ACIKha16xFYCltbENmNas4JGZvKWZMZsPL9XWiRwzwxg2kDUROlAZeW2AA2cBi+M8xjpZwpoktR5JbnZxu9qMta9s8576i/3plIxLxvvutva5FM/favzAauwbSZUX3virKDYKe569LyZxurrAWEmnPWNzj7ORajtvT1CXWcVwHMT+eu5oqW8PhPrKgIeCad5bRjnzyaG3WGNczkOdTcDJ8ybVCOztqrA90vqvSHS1qw1FL6JiJK0hIWHccwXrDoN7YGsnhtxhCFMLj2IQlD5KtA/SMsBJlSCtQKRa+xAE=&p=
</wsse:BinarySecurityToken>

</wst:RequestedSecurityToken>
<wst:RequestedTokenReference>
<wsse:KeyIdentifier ValueType="urn:passport:compact">
</wsse:KeyIdentifier>
<wsse:Reference URI="#Compact1">
</wsse:Reference>
</wst:RequestedTokenReference>
<wst:RequestedProofToken>

<wst:BinarySecret>
YdSj/GIkHNjeRoClluok9J4bYNsWVEea
</wst:BinarySecret>

</wst:RequestedProofToken>
</wst:RequestSecurityTokenResponse>
<wst:RequestSecurityTokenResponse>
<wst:TokenType>urn:passport:compact</wst:TokenType>
<wsp:AppliesTo xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing">
<wsa:EndpointReference>
<wsa:Address>messenger.msn.com</wsa:Address>
</wsa:EndpointReference>
</wsp:AppliesTo>
<wst:LifeTime>
<wsu:Created>2008-08-20T06:17:36Z</wsu:Created>
<wsu:Expires>2008-08-20T14:17:36Z</wsu:Expires>
</wst:LifeTime>
<wst:RequestedSecurityToken>
<wsse:BinarySecurityToken Id="Compact2">t=EwDYAfsBAAAUAHmHi/fIK5MsbQWTulxz7EiCF2+AAFyqVQompSp1Zu7W3g7T5yMceStaxs7w5I8wsiIeECJSj2+j7V3JorQeMfR1Y5Z4Azu5z+VHsRDIPrBh7FUgleNZF9SMSrhYfCiEjstd2OWD2RIWzLFmoLdZlDmhAZp1SLtJlf52O5rK6LFwTQrBJCgwYcLrX2o9l1OnwUuIMe0sA2YAAAheN9vDJtdLsigBd3QSSEiD2MhG5sHTnl8nC9xg4TMGF1+p3MomH45rnQPiQrGsgSxbymrtvO3gDDe0GSMIfLCDxJikDWVeUGeqIfrYC/KMEBbKcK24O3H+BkiWNk8PinF8T1FNAv7kK4f/fO6/UucbIyVyZC81b8/ahFjxJ0Z8tYGF3TrAGJzvqWIrgK7Hr3EC2GaagbHs6i3c3u9aNxBWqL+2x2c4csFR79lPx+cyS4DvYY0AMf6DNt03Gy6NiG51oS5At2QMyP7xT+doH2SeDeVGM3fVCa3jL0JlkOZbDy6SxDMANfaPPfOQYEadQsubPyZBe7UDCwmN6X0iio4Jy1DJyWpbROKF+lPax8ICEtB2ZAYw8PUTkym/TSCmEwX54A/LKFa6mwvA33tr4hYIv/hEAQ==&p=</wsse:BinarySecurityToken>
</wst:RequestedSecurityToken>
<wst:RequestedTokenReference>
<wsse:KeyIdentifier ValueType="urn:passport:compact">
</wsse:KeyIdentifier>
<wsse:Reference URI="#Compact2">
</wsse:Reference>
</wst:RequestedTokenReference>
</wst:RequestSecurityTokenResponse>
</wst:RequestSecurityTokenResponseCollection>
</S:Body>
</S:Envelope>

====

BinarySecurityToken-> t=EwBgAswbAQAUs1/VcBU2sH7mwYy3BysWZ71CRDGAAPyC8gbVv65DNR9B35NbtWgaPfSxjcx8TQRH7dSQkHl+pf46GQS1pukb1fNuh5NtW2fsIGDXCyNhyMBi4/BKhzeE66MGXBsfgdWzDzSj/SGnQYnZtvKLdBi9ihv1hR+q018ePodvV4x3Vlcet38/CE1yPd9t8Z/yhNyCBcufTbMVA2YAAAjOONh/nTbDBLABYnUuPlUVuIv9ImLzUxYuvlSzHsgEAxTJkrpnHNmJv4IS0lUGIO9+yvfEbAl46rS1vpr0MHN8uL4JIE7XkS7MHhElesCRHvMpWp/h2O9clTrk9P5krslyhepE45ZCWYyodEaCEPsD5ZEauYe4M8wf3Pm9mrF+vr0RiKwATDDz4Ow1QQ+zz/HS7XaKohPEsCQDLf5rnC+nsQha9053Wbsq6qrbTtAh5DHviCv2KjHVHykPufhlr1R/FTb4Pu/ufe3dt8r3pQseGcm0H16bYJBqlxqyG7ACIKha16xFYCltbENmNas4JGZvKWZMZsPL9XWiRwzwxg2kDUROlAZeW2AA2cBi+M8xjpZwpoktR5JbnZxu9qMta9s8576i/3plIxLxvvutva5FM/favzAauwbSZUX3virKDYKe569LyZxurrAWEmnPWNzj7ORajtvT1CXWcVwHMT+eu5oqW8PhPrKgIeCad5bRjnzyaG3WGNczkOdTcDJ8ybVCOztqrA90vqvSHS1qw1FL6JiJK0hIWHccwXrDoN7YGsnhtxhCFMLj2IQlD5KtA/SMsBJlSCtQKRa+xAE=&p=
--
nonce-> ZUzrcaa4fRluSqjOaLzc9ExfHQaoiZB4MxTjfRcmohTooJuVilSvIJ7jSy+DKBeO
--
BinarySecret-> YdSj/GIkHNjeRoClluok9J4bYNsWVEea
--
此處的程式下一篇補上,將上述資訊做hash 3des 的加密...程式後,產生
HAAAAAEAAAADZgAABIAAAAgAAAAUAAAASAAAAAAAAAAAAAAAu1u3n7shOrO0b1zrRTR/+hPQ97ucXZ/4vd6sPYkgZjyEUBE+nF4Xe+y1WuNzKxLSIG9AcWpKbu0JYUa06PuyvvLCTtjeqipeyISPnyHncMivinI/LcZmGmhOpfo=
而這個值是下一個程序 USR 4 SSO S t=...&p=xxx 中的p值,而t值為BinarySecurityToken

====

c2s->USR 4 SSO S t=EwBgAswbAQAUs1/VcBU2sH7mwYy3BysWZ71CRDGAAPyC8gbVv65DNR9B35NbtWgaPfSxjcx8TQRH7dSQkHl+pf46GQS1pukb1fNuh5NtW2fsIGDXCyNhyMBi4/BKhzeE66MGXBsfgdWzDzSj/SGnQYnZtvKLdBi9ihv1hR+q018ePodvV4x3Vlcet38/CE1yPd9t8Z/yhNyCBcufTbMVA2YAAAjOONh/nTbDBLABYnUuPlUVuIv9ImLzUxYuvlSzHsgEAxTJkrpnHNmJv4IS0lUGIO9+yvfEbAl46rS1vpr0MHN8uL4JIE7XkS7MHhElesCRHvMpWp/h2O9clTrk9P5krslyhepE45ZCWYyodEaCEPsD5ZEauYe4M8wf3Pm9mrF+vr0RiKwATDDz4Ow1QQ+zz/HS7XaKohPEsCQDLf5rnC+nsQha9053Wbsq6qrbTtAh5DHviCv2KjHVHykPufhlr1R/FTb4Pu/ufe3dt8r3pQseGcm0H16bYJBqlxqyG7ACIKha16xFYCltbENmNas4JGZvKWZMZsPL9XWiRwzwxg2kDUROlAZeW2AA2cBi+M8xjpZwpoktR5JbnZxu9qMta9s8576i/3plIxLxvvutva5FM/favzAauwbSZUX3virKDYKe569LyZxurrAWEmnPWNzj7ORajtvT1CXWcVwHMT+eu5oqW8PhPrKgIeCad5bRjnzyaG3WGNczkOdTcDJ8ybVCOztqrA90vqvSHS1qw1FL6JiJK0hIWHccwXrDoN7YGsnhtxhCFMLj2IQlD5KtA/SMsBJlSCtQKRa+xAE=&p= HAAAAAEAAAADZgAABIAAAAgAAAAUAAAASAAAAAAAAAAAAAAAu1u3n7shOrO0b1zrRTR/+hPQ97ucXZ/4vd6sPYkgZjyEUBE+nF4Xe+y1WuNzKxLSIG9AcWpKbu0JYUa06PuyvvLCTtjeqipeyISPnyHncMivinI/LcZmGmhOpfo=
s2c->USR 4 OK luke_shei@hotmail.com 1 0
SBS 0 null
s2c->MSG Hotmail Hotmail 1234
MIME-Version: 1.0
Content-Type: text/x-msmsgsprofile; charset=UTF-8
LoginTime: 1219213056
EmailEnabled: 1
MemberIdHigh: 90416
MemberIdLow: -1979724498
lang_preference: 1028
preferredEmail:
country: TW
PostalCode:
Gender:
Kid: 0
Age:
BDayPre:
Birthday:
Wallet:
Flags: 1610613827
sid: 72652
MSPAuth: EwBgAswbAQAUs1/VcBU2sH7mwYy3BysWZ71CRDGAAPyC8gbVv65DNR9B35NbtWgaPfSxjcx8TQRH7dSQkHl+pf46GQS1pukb1fNuh5NtW2fsIGDXCyNhyMBi4/BKhzeE66MGXBsfgdWzDzSj/SGnQYnZtvKLdBi9ihv1hR+q018ePodvV4x3Vlcet38/CE1yPd9t8Z/yhNyCBcufTbMVA2YAAAjOONh/nTbDBLABYnUuPlUVuIv9ImLzUxYuvlSzHsgEAxTJkrpnHNmJv4IS0lUGIO9+yvfEbAl46rS1vpr0MHN8uL4JIE7XkS7MHhElesCRHvMpWp/h2O9clTrk9P5krslyhepE45ZCWYyodEaCEPsD5ZEauYe4M8wf3Pm9mrF+vr0RiKwATDDz4Ow1QQ+zz/HS7XaKohPEsCQDLf5rnC+nsQha9053Wbsq6qrbTtAh5DHviCv2KjHVHykPufhlr1R/FTb4Pu/ufe3dt8r3pQseGcm0H16bYJBqlxqyG7ACIKha16xFYCltbENmNas4JGZvKWZMZsPL9XWiRwzwxg2kDUROlAZeW2AA2cBi+M8xjpZwpoktR5JbnZxu9qMta9s8576i/3plIxLxvvutva5FM/favzAauwbSZUX3virKDYKe569LyZxurrAWEmnPWNzj7ORajtvT1CXWcVwHMT+eu5oqW8PhPrKgIeCad5bRjnzyaG3WGNczkOdTcDJ8ybVCOztqrA90vqvSHS1qw1FL6JiJK0hIWHccwXrDoN7YGsnhtxhCFMLj2IQlD5KtA/SMsBJlSCtQKRa+xAE=&p=
ClientIP: 59.120.234.89
ClientPort: 6413
ABCHMigrated: 1
Nickname: luke
MPOPEnabled: 0

留言

這個網誌中的熱門文章

怎麼在網路上註冊成為youbike 會員?

新版官網請參考  怎麼在網路上註冊成為youbike 會員?   http://rd-program.blogspot.tw/2014/04/youbike.html 網路的申請步驟類似,下面將以網路申請來說明申請步驟:申請的時候需要準備悠遊卡、或晶片信用卡,以及手機門號。 1. 請先登入ubike網址: http://www.youbike.com.tw/ ,登入後選擇【正體中文】,要選英文也可以啦! 2. 在螢幕的右上角選擇【註冊】。 3.點擊【開始註冊】。 4. 點擊【同意】。(沒有其他選擇?) 5. 輸入您的【手機號碼】以及【認證碼】,然後按【送出】。這時候手機會收到ubike傳來的簡訊,通之驗證碼,有四個阿拉伯數字。 6. 輸入帳號(手機號碼)、驗證碼(ubike傳到手機的簡訊)、密碼,然後按【下一步】。 7. 還沒完成喔!這裡告訴你如何租車及還車的步驟。把螢幕拉到最下面,記得勾選【我已清楚瞭解租還車步驟】,然後按【下一步】。 8. 選擇悠遊卡或是晶片信用卡,然後輸入卡片號碼,卡片號碼請參卡畫面又下方的提示位置,請注意有些卡號可能已經模糊不清,可能無法輸入。每隻手機不只可以輸入一個卡號。 9. 填寫個人姓名及Email帳號,如果不想收到相關訊息就把前面的打勾取消。按【確認】按鈕。 10. 恭喜您註冊成功,可已開始使用YouBike了。

Youbike 線上註冊會員

Youbike 線上註冊會員 https://www.youbike.com.tw/cht/f61.html youbike sitemap   網站內容快速連結  場站地圖 場站列表 服務中心資訊 預計設站地點 媒體報導 活動情報 緊急通知 營運資訊 營運成果 關於YouBike 大事記 設備介紹 租還方式 費率說明 安全騎乘 分類列表 失物招領 YouBike協尋 加入會員 會員資料管理 YouBike電子報 騎乘記錄查詢 合作夥伴 友站連結 一般文件 APP 隱私權政策 連絡我們

Llama2 建構部署的相關過程

macOS 作業系統 #meta llama2模型下載 #先用git clone整個repository !git clone https://github.com/facebookresearch/llama.git #下載權重跟模型 #方法一: # https://llama-2.ai/download/ #方法二: # https://ai.meta.com/resources/models-and-libraries/llama-downloads/ # 填寫資料後會發信提供下載時需填的資訊(這個資訊只能使用24hours,之後要下載必須再申請) # cd ./llama/;./download.sh # 執行後會需要輸入信裡的資訊/選擇模型,開始下載,大約需要80分鐘 # 結束後會產生  ./llama/llama-2-7b-chat 目錄,其下是一些檔案 # 以及 ./tokenizer_checklist.chk  ./tokenizer.model # 需要把上面那兩個檔案複製進  ./llama/llama-2-7b-chat 目錄內 # 將 meta 提供的 .pth(pytorch 轉換為 hugging face 規格) # 可以先上 https://huggingface.co/ 註冊,以及提供公鑰,稍晚下載時會需要 # 要這樣轉換是因為 huggingface發展了共用規格,多數應用使用這種格式 !pip install torch fairscale fire sentencepiece !pip install llama-recipes transformers datasets accelerate protobuf==3.20 py7zr scipy peft bitsandbytes !TRANSFORM=`python -c "import transformers;print('/'.join(transformers.__file__.split('/')[:-1])+'/models/llama/convert_llama_weights_to_hf.py')"` !python ${TR