在线等 反编译过来的JAVA代码中有GOTO

OracleJ 2009-01-06 10:51:57
在对ahxu中的上传文件中的DiskFileUploadEx.class进行反编译时出现了goto语句:
编译后的代码如下:
public List parseRequestEx(HttpServletRequest req)
throws FileUploadException
{
ArrayList InvalidFiles;
ArrayList items;
String contentType;
if(req == null)
throw new NullPointerException("req parameter");
InvalidFiles = new ArrayList();
items = new ArrayList();
contentType = req.getHeader("Content-type");
if(contentType == null || !contentType.startsWith("multipart/"))
throw new org.apache.commons.fileupload.FileUploadBase.InvalidContentTypeException("the request doesn't contain a multipart/form-data or multipart/mixed stream, content type header is " + contentType);
checkIfInMaxSize(req);
byte boundary[];
MultipartStream multi;
boolean nextPart;
int boundaryIndex = contentType.indexOf("boundary=");
if(boundaryIndex < 0)
throw new FileUploadException("the request was rejected because no multipart boundary was found");
boundary = contentType.substring(boundaryIndex + 9).getBytes();
java.io.InputStream input = req.getInputStream();
aUploadProcess = new UploadProcess(req);
aUploadProcess.init();
aUploadProcess.setReportLimitSize(reportLimitSize);
InputSteamEx inputEx = new InputSteamEx(input, aUploadProcess);
multi = new MultipartStream(inputEx, boundary);
String headerEncoding = getHeaderEncoding();
multi.setHeaderEncoding(headerEncoding);
nextPart = multi.skipPreamble();
goto _L1
_L16:
java.util.Map headers;
String fieldName;
headers = parseHeaders(multi.readHeaders());
fieldName = getFieldName(headers);
if(fieldName == null) goto _L3; else goto _L2
_L2:
String subContentType = getHeader(headers, "Content-type");
if(subContentType == null || !subContentType.startsWith("multipart/mixed")) goto _L5; else goto _L4
_L4:
boolean nextSubPart;
byte subBoundary[] = subContentType.substring(subContentType.indexOf("boundary=") + 9).getBytes();
multi.setBoundary(subBoundary);
nextSubPart = multi.skipPreamble();
goto _L6
_L10:
headers = parseHeaders(multi.readHeaders());
if(getFileName(headers) == null) goto _L8; else goto _L7
_L7:
FileItem item;
if(!isInAllowFilesList(getFileName(headers)))
{
InvalidFiles.add(getFileName(headers));
multi.discardBodyData();
continue; /* Loop/switch isn't completed */
}
item = createItem(headers, false);
OutputStream os = item.getOutputStream();
try
{
aUploadProcess.setCurrentUploadFileName(getFileName(headers));
multi.readBodyData(os);
}
finally
{
os.close();
}
items.add(item);
continue; /* Loop/switch isn't completed */
_L8:
multi.discardBodyData();
nextSubPart = multi.readBoundary();
_L6:
if(nextSubPart) goto _L10; else goto _L9
_L9:
multi.setBoundary(boundary);
continue; /* Loop/switch isn't completed */
_L5:
if(getFileName(headers) == null) goto _L12; else goto _L11
_L11:
FileItem item;
if(!isInAllowFilesList(getFileName(headers)))
{
InvalidFiles.add(getFileName(headers));
multi.discardBodyData();
continue; /* Loop/switch isn't completed */
}
item = createItem(headers, false);
OutputStream os = item.getOutputStream();
try
{
aUploadProcess.setCurrentUploadFileName(getFileName(headers));
multi.readBodyData(os);
}
finally
{
os.close();
}
items.add(item);
continue; /* Loop/switch isn't completed */
_L12:
if(!allowField) goto _L14; else goto _L13
_L13:
item = createItem(headers, true);
OutputStream os = item.getOutputStream();
try
{
multi.readBodyData(os);
}
finally
{
os.close();
}
items.add(item);
continue; /* Loop/switch isn't completed */
_L14:
multi.discardBodyData();
continue; /* Loop/switch isn't completed */
_L3:
multi.discardBodyData();
nextPart = multi.readBoundary();
_L1:
if(nextPart) goto _L16; else goto _L15
_L15:
if(!InvalidFiles.isEmpty())
throw new InvalidFileUploadException("Unallowed Files!", InvalidFiles);
break MISSING_BLOCK_LABEL_710;
IOException e;
e;
throw new FileUploadException("Processing of multipart/form-data request failed. " + e.getMessage());
return items;
}
如何对上面的代码进行还原?请高手帮帮
高手帮帮忙 在线等..........
...全文
745 13 打赏 收藏 转发到动态 举报
写回复
用AI写文章
13 条回复
切换为时间正序
请发表友善的回复…
发表回复
ZangXT 2009-01-06
  • 打赏
  • 举报
回复
混淆器处理过的class文件
pubaolin 2009-01-06
  • 打赏
  • 举报
回复
[Quote=引用 8 楼 fulianglove 的回复:]
check是标记,这里的continue就和goto的功能很像了
[/Quote]
谢谢~~
fulianglove 2009-01-06
  • 打赏
  • 举报
回复
check是标记,这里的continue就和goto的功能很像了
pubaolin 2009-01-06
  • 打赏
  • 举报
回复
[Quote=引用 5 楼 fulianglove 的回复:]
有个网页
http://hi.baidu.com/qepqgeqqt%5Ftech/blog/item/975f401061c75406213f2ed9.html
你看看吧,共3篇文章,讲的是反编译后的代码还原,看看有没有帮助
[/Quote]


public void f2() {
int[] list = new int[] { 1, 2, 3, 4 };
if (Boolean.getBoolean("sys")) {
System.out.println("sys");
} else {
check: while (true) {
for (int i = 0; i < list.length; i++) {
if (list[i] == 2) {
continue check;
} else {
break;
}
}
}
}
}

这段代码中的check是起什么做用的,是JAVA的关键字吗
zou_wei_forever 2009-01-06
  • 打赏
  • 举报
回复
goto在java中只是一个保留字,以备未来用
fulianglove 2009-01-06
  • 打赏
  • 举报
回复
有个网页
http://hi.baidu.com/qepqgeqqt%5Ftech/blog/item/975f401061c75406213f2ed9.html
你看看吧,共3篇文章,讲的是反编译后的代码还原,看看有没有帮助
OracleJ 2009-01-06
  • 打赏
  • 举报
回复
也就是怎样去掉 goto 关键字
fulianglove 2009-01-06
  • 打赏
  • 举报
回复
不对,java里是break,continue有goto的作用。。。。。。。
fulianglove 2009-01-06
  • 打赏
  • 举报
回复
还原?代码有什么问题??
goto是java中的一个关键字啊,程序直接跳转到指定的地方继续执行。
上biadu找找相关信息吧。
glglglglglgllll 2009-01-06
  • 打赏
  • 举报
回复
没反编译完全好像
leves1989 2009-01-06
  • 打赏
  • 举报
回复
混淆器处理过的class文件

可能!
hjy273 2009-01-06
  • 打赏
  • 举报
回复
用if else理一下顺序再稍作修改就可以了
OracleJ 2009-01-06
  • 打赏
  • 举报
回复

比如用下面的语句:当程序执行到continue这个语句时,程序是执行下面的_L3,还是继续循环下一个呢?
_L14:
multi.discardBodyData();
continue; /* Loop/switch isn't completed */
_L3:
multi.discardBodyData();
nextPart = multi.readBoundary();

81,114

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧