惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Security Affairs
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Jina AI
Jina AI
P
Palo Alto Networks Blog
GbyAI
GbyAI
大猫的无限游戏
大猫的无限游戏
A
Arctic Wolf
Hugging Face - Blog
Hugging Face - Blog
小众软件
小众软件
Y
Y Combinator Blog
T
The Blog of Author Tim Ferriss
Blog — PlanetScale
Blog — PlanetScale
S
Schneier on Security
V
Vulnerabilities – Threatpost
C
Cybersecurity and Infrastructure Security Agency CISA
雷峰网
雷峰网
T
Tenable Blog
人人都是产品经理
人人都是产品经理
T
Tor Project blog
C
Cyber Attacks, Cyber Crime and Cyber Security
AWS News Blog
AWS News Blog
Microsoft Security Blog
Microsoft Security Blog
J
Java Code Geeks
Scott Helme
Scott Helme
SecWiki News
SecWiki News
C
CERT Recently Published Vulnerability Notes
Recorded Future
Recorded Future
I
InfoQ
Security Archives - TechRepublic
Security Archives - TechRepublic
Help Net Security
Help Net Security
Cloudbric
Cloudbric
C
Check Point Blog
Engineering at Meta
Engineering at Meta
TaoSecurity Blog
TaoSecurity Blog
B
Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园_首页
N
News and Events Feed by Topic
云风的 BLOG
云风的 BLOG
MyScale Blog
MyScale Blog
腾讯CDC
量子位
Application and Cybersecurity Blog
Application and Cybersecurity Blog
K
Kaspersky official blog
Vercel News
Vercel News
F
Full Disclosure
T
Troy Hunt's Blog
Forbes - Security
Forbes - Security
S
Security @ Cisco Blogs

博客园 - Enhydraboy

[ZT]MSN Messenger的口令获取源代码, MSNMessenger的口令是经过DPAPI加密后保存在注册表中 ADO Connection Strings[转贴] 农民造“飞碟”后记 Tomcat's Thread Pool Source(BT) - Enhydraboy 使用 jakata DBCP package 作 DB Connection pooling[ZT] 数据类型的不匹配可能会导致索引失效 我的MSN机器人终于有了自己的头像 Field6的类型说明 MSN协议中关于Send DP的研究 搞懂了MSN协议中的client id是怎么得到的 Java正则表达式详解[转载] MSN P2P资料转载 MSN协议中的msnobj浅析 MSNP10中修改自己的FRIENDLY NAME改成了RPR命令 msp10协议中的SYN好像发生了变化 准备让MSN机器人可以显示头像 jMSN开发指南 我自己的msn机器人诞生了 中国足球进步了
msnlib中的MimeMessage.parse代码需要修改
Enhydraboy · 2004-08-02 · via 博客园 - Enhydraboy

msnlib源代码中MimeMessage的parse是通过

BufferedReader br=new BufferedReader(new StringReader(raw));
addProperty( br.readLine()); 
// MIME-Version
        addProperty( br.readLine()); // Content-Type

来获得每一行的内容,但是发现br.readline是以\r(0X0A),\n(0X0D)中的任何一个字符即认为是行结束符。
这样,在获取48字节头的时候,如果字节内容正好包括0D的时候,就会发生截取出来的头少于48个字节而引起indexbound错误。
因此,修改如下:

package rath.msnm.msg;

import java.io.
*;
/**
 * <p>Title: </p>
 * <p>Description: </p>
 * <p>Copyright: Copyright (c) 2004</p>
 * <p>Company: </p>
 * @author unascribed
 * @version 1.0
 
*/


public class MimeMessageBufferedReader extends BufferedReader {
  
private String charcode;
  
public MimeMessageBufferedReader(Reader in,String charcode) {
    super(
in);
    
this.charcode =charcode;
  }


  
public MimeMessageBufferedReader(Reader in,int sz,String charcode) {
   super(
in,sz);
   
this.charcode=charcode;
  }


  
public String readLine()
                throws IOException
  
{
    CharArrayWriter caw
=new CharArrayWriter(6);
    ByteArrayOutputStream bo
=new ByteArrayOutputStream();

    
int c=this.read();
    
if(c==-1)
    
{
      
return null;
    }


    
while(c!=-1){
      
if(c==13){
        
int d=this.read();
        
if(d==10){
          
break;
        }
else
        
{caw.write(c);
         caw.write(d);
        }

      }
else{
        caw.write(c);
      }


      
byte[] bt=new String(caw.toCharArray()).getBytes(charcode);
      bo.write(bt);
      caw.reset();
      c
=this.read();
    }

    
return new String(bo.toByteArray(),charcode);
  }

}


public void parse( String raw ) throws Exception
    
{
        MimeMessageBufferedReader br 
= new MimeMessageBufferedReader(new StringReader(raw),rath.msnm.msnmConstant.getCharacterCode());



}