前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >arthas教程2

arthas教程2

作者头像
IT云清
发布2019-10-25 09:31:59
4220
发布2019-10-25 09:31:59
举报
文章被收录于专栏:IT云清IT云清

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。

本文链接:https://blog.csdn.net/weixin_39800144/article/details/100525139

本文介绍:jad,sc的使用

5.jad反编译

可以使用jad反编译class文件,中文字符会被编解码。 这里以com.runlion.fsp.credit.service.impl包下为例NCSourceServiceImpl类为例: 我们可以看到整个类的ClassLoader,从哪里加载的,以及类的完整信息;

代码语言:javascript
复制
$ jad com.runlion.fsp.credit.service.impl.NCSourceServiceImpl
代码语言:javascript
复制
$ jad com.runlion.fsp.credit.service.impl.NCSourceServiceImpl

ClassLoader:                                                                                                                                                                              
+-org.springframework.boot.loader.LaunchedURLClassLoader@681a9515                                                                                                                         
  +-sun.misc.Launcher$AppClassLoader@70dea4e                                                                                                                                              
    +-sun.misc.Launcher$ExtClassLoader@30f39991                                                                                                                                           

Location:                                                                                                                                                                                 
file:/home/fsp/servers/credit-web-1.0-RELEASE.jar!/BOOT-INF/classes!/                                                                                                                     

/*
 * Decompiled with CFR 0_132.
 * 
 * Could not load the following classes:
 *  com.alibaba.fastjson.JSON
省略。。。。。。
 *  org.springframework.stereotype.Service
 */
package com.runlion.fsp.credit.service.impl;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
省略。。。。。。
import org.springframework.stereotype.Service;

@Service(value="nCSourceServiceImpl")
public class NCSourceServiceImpl
implements NCSourceService {
    private static final Logger log = LoggerFactory.getLogger(NCSourceServiceImpl.class);
    @Value(value="${nc.credit.queryYearDiscount.address}")
    private String queryYearDiscountAddress;
    @Value(value="${nc.credit.queryYearDiscount.method}")
    private String queryYearDiscountMethod;
    @Value(value="${nc.credit.querySupplierCorpCredit.address}")
    private String querySupplierCorpCredit;
    @Value(value="${nc.credit.querySupplierAllCorpCredit.address}")
    private String querySupplierAllCorpCredit;

    public BigDecimal getDealNoBackMnyFromNC(String custcode, String companycode) {
        log.info("\u3010\u6388\u4fe1\u8c03\u7528NC\u67e5\u8be2\u7d2f\u8ba1\u672a\u9000\u91d1\u989d\u3011\u4eceNC\u83b7\u53d6\u7ecf\u9500\u5546\u7d2f\u8ba1\u672a\u9000\u91d1\u989d,\u5165\u53c2\u4e3acustcode=" + custcode + ",companycode=" + companycode + ",\u5730\u5740\u4e3a\uff1a" + this.queryYearDiscountAddress);
        OMElement omElement = null;
        BigDecimal noBackMny = BigDecimal.ZERO;
        try {
            ServiceClient serviceClient = new ServiceClient();
            String url = this.queryYearDiscountAddress;
            EndpointReference targetEPR = new EndpointReference(url);
            省略。。。。。。

6.sc 查看

使用sc命令查看一个类的加载情况

代码语言:javascript
复制
$ sc com.runlion.fsp.credit.controller.web.CreditController
com.runlion.fsp.credit.controller.web.CreditController
Affect(row-cnt:1) cost in 10 ms.
$ 

输出当前类的详细信息,包括这个类所加载的原始文件来源、类的声明、加载的ClassLoader等详细信息。

代码语言:javascript
复制
$ sc -d com.runlion.fsp.credit.controller.web.CreditController
 class-info        com.runlion.fsp.credit.controller.web.CreditController                                                                                                                 
 code-source       file:/home/fsp/servers/credit-web-1.0-RELEASE.jar!/BOOT-INF/classes!/                                                                                                  
 name              com.runlion.fsp.credit.controller.web.CreditController                                                                                                                 
 isInterface       false                                                                                                                                                                  
 isAnnotation      false                                                                                                                                                                  
 isEnum            false                                                                                                                                                                  
 isAnonymousClass  false                                                                                                                                                                  
 isArray           false                                                                                                                                                                  
 isLocalClass      false                                                                                                                                                                  
 isMemberClass     false                                                                                                                                                                  
 isPrimitive       false                                                                                                                                                                  
 isSynthetic       false                                                                                                                                                                  
 simple-name       CreditController                                                                                                                                                       
 modifier          public                                                                                                                                                                 
 annotation        org.springframework.web.bind.annotation.RestController,org.springframework.web.bind.annotation.RequestMapping                                                          
 interfaces                                                                                                                                                                               
 super-class       +-java.lang.Object                                                                                                                                                     
 class-loader      +-org.springframework.boot.loader.LaunchedURLClassLoader@681a9515                                                                                                      
                     +-sun.misc.Launcher$AppClassLoader@70dea4e                                                                                                                           
                       +-sun.misc.Launcher$ExtClassLoader@30f39991                                                                                                                        
 classLoaderHash   681a9515                                                                                                                                                               

Affect(row-cnt:1) cost in 13 ms.
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2019-09-03 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 本文介绍:jad,sc的使用
  • 5.jad反编译
  • 6.sc 查看
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档