最近我有个Java项目需要逆向
原因是这个项目经太多人的手了,建表时,很多东西没有规范,算了,原因不多说了,搞逆向的人都有说不清的苦
说说PDMan2.1.3 2019.3 逆向工程 数据库连接问题
问题主要表现为
2019-03-12 12:42:17.509 [main] INFO group.rober.pdman.dbconnector.Application - ========================================================================================
2019-03-12 12:42:17.511 [main] INFO group.rober.pdman.dbconnector.Application - 执行命令:ping url=jdbc:mysql://127.0.0.1:3306/superdesk_service_test?useUnicode=true&characterEncoding=utf-8 username=root password=12345678
2019-03-12 12:42:17.511 [main] INFO group.rober.pdman.dbconnector.Application - ========================================================================================
2019-03-12 12:42:17.512 [main] ERROR group.rober.pdman.dbconnector.Application - 未知的错误
java.lang.NullPointerException: null
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at group.rober.pdman.command.impl.PingDBCommand.exec(PingDBCommand.java:23)
at group.rober.pdman.command.impl.PingDBCommand.exec(PingDBCommand.java:16)
at group.rober.pdman.dbconnector.Application.main(Application.java:75)
问了管理员@杨松
确定了几个事
PDMan java 部分走的 java1.8
日志会在 ${user.home}/logs/pdman 目录下的日志文件
好,先去看了gitee.com下的js源代码,走的是react,不过我做Vue已经很多个项目了,看这个没问题
找到代码
/mnt1t/NODEJS_HOME/wordspace/pdman/src/app/JavaHomeConfig.js
_connectJDBC = () => {
//const { project } = this.props;
const { data } = this.state;
const value = data.JAVA_HOME;
const defaultPath = ipcRenderer.sendSync('jarPath');
const jar = data.DB_CONNECTOR || defaultPath;
const tempValue = value ? `${value}${this.split}bin${this.split}java` : 'java';
execFile(tempValue,
[
'-jar', jar,
],
(error, stdout, stderr) => {
if (error) {
Modal.error({title: '连接失败', message: stderr});
} else {
Modal.success({title: '连接成功', message: stdout});
}
});
}
正好对映表现层的返回,反观log日志,这明显是通过package的反射得类时没找到
推导出 react 中能发起调用 pdman-db-connector.jar 走的是command
Java部分没有源代码呀,怎么办,去百度查一下 appimage怎样解包
AppImage格式操作说明
解压已有的AppImage文件,通过如下命令:
./PDMan-linux_v2.1.3.AppImage --appimage-extract
解开为
[linjinyu@localhost wordspace]$ ./PDMan-linux_v2.1.3.AppImage --appimage-extractsquashfs-root/AppRun
squashfs-root/LICENSE.electron.txt
squashfs-root/LICENSES.chromium.html
squashfs-root/blink_image_resources_200_percent.pak
squashfs-root/content_resources_200_percent.pak
squashfs-root/content_shell.pak
squashfs-root/icudtl.dat
squashfs-root/libffmpeg.so
squashfs-root/libnode.so
squashfs-root/locales
squashfs-root/locales/am.pak
squashfs-root/locales/ar.pak
squashfs-root/locales/bg.pak
squashfs-root/locales/bn.pak
squashfs-root/locales/ca.pak
squashfs-root/locales/cs.pak
squashfs-root/locales/da.pak
squashfs-root/locales/de.pak
squashfs-root/locales/el.pak
squashfs-root/locales/en-GB.pak
squashfs-root/locales/en-US.pak
squashfs-root/locales/es-419.pak
squashfs-root/locales/es.pak
squashfs-root/locales/et.pak
squashfs-root/locales/fa.pak
squashfs-root/locales/fake-bidi.pak
squashfs-root/locales/fi.pak
squashfs-root/locales/fil.pak
squashfs-root/locales/fr.pak
squashfs-root/locales/gu.pak
squashfs-root/locales/he.pak
squashfs-root/locales/hi.pak
squashfs-root/locales/hr.pak
squashfs-root/locales/hu.pak
squashfs-root/locales/id.pak
squashfs-root/locales/it.pak
squashfs-root/locales/ja.pak
squashfs-root/locales/kn.pak
squashfs-root/locales/ko.pak
squashfs-root/locales/lt.pak
squashfs-root/locales/lv.pak
squashfs-root/locales/ml.pak
squashfs-root/locales/mr.pak
squashfs-root/locales/ms.pak
squashfs-root/locales/nb.pak
squashfs-root/locales/nl.pak
squashfs-root/locales/pl.pak
squashfs-root/locales/pt-BR.pak
squashfs-root/locales/pt-PT.pak
squashfs-root/locales/ro.pak
squashfs-root/locales/ru.pak
squashfs-root/locales/sk.pak
squashfs-root/locales/sl.pak
squashfs-root/locales/sr.pak
squashfs-root/locales/sv.pak
squashfs-root/locales/sw.pak
squashfs-root/locales/ta.pak
squashfs-root/locales/te.pak
squashfs-root/locales/th.pak
squashfs-root/locales/tr.pak
squashfs-root/locales/uk.pak
squashfs-root/locales/vi.pak
squashfs-root/locales/zh-CN.pak
squashfs-root/locales/zh-TW.pak
squashfs-root/natives_blob.bin
squashfs-root/pdman
squashfs-root/pdman.desktop
squashfs-root/pdman.png
squashfs-root/resources
squashfs-root/resources/app.asar
squashfs-root/resources/app.asar.unpacked
squashfs-root/resources/app.asar.unpacked/build
squashfs-root/resources/app.asar.unpacked/build/jar
squashfs-root/resources/app.asar.unpacked/build/jar/pdman-db-connector.jar
squashfs-root/resources/app.asar.unpacked/build/word
squashfs-root/resources/app.asar.unpacked/build/word/template.docx
squashfs-root/resources/electron.asar
squashfs-root/ui_resources_200_percent.pak
squashfs-root/usr
squashfs-root/usr/lib
squashfs-root/usr/lib/libXss.so.1
squashfs-root/usr/lib/libXtst.so.6
squashfs-root/usr/lib/libappindicator.so.1
squashfs-root/usr/lib/libgconf-2.so.4
squashfs-root/usr/lib/libindicator.so.7
squashfs-root/usr/lib/libnotify.so.4
squashfs-root/usr/share
squashfs-root/usr/share/icons
squashfs-root/usr/share/icons/hicolor
squashfs-root/usr/share/icons/hicolor/0x0
squashfs-root/usr/share/icons/hicolor/0x0/apps
squashfs-root/usr/share/icons/hicolor/0x0/apps/pdman.png
squashfs-root/v8_context_snapshot.bin
查看了一下,关注的只有
/mnt1t/NODEJS_HOME/wordspace/squashfs-root/resources/app.asar.unpacked/build/jar
用解压工具找开看一下
com 有呀 展开 com.mysql.jdbc.Driver.class有呀,为什么会有问题呢?
再去看一下 resources 没有用spring什么的东西
最近都在搞Spring Boot ,Spring Cloud ,所以,还有一个地方要看
META-INF
maven -> 是用maven打包的 -> lib都在里边 -> 问题来了,为什么mysql的公包没在里边呢,而在.jar的根呢?一定有问题,大概是加工了
services -> 看到 java.sql.Driver -> 打开看,呵呵,就是他了,至于为什么这样认定,就不说了
推导
react 中能发起调用 pdman-db-connector.jar 走的是command(返回走的是javax.ws) 返回JSON(走的是com.alibaba.fastjson.support.jaxrs.FastJsonProvider)
@杨松
@林进雨 @章纪成 @奇杰 这个框,你们鼠标移进去,删除一下,然后再恢复删除前的样子,就可以了。这是一个BUG
哦。。。那就是react input bind value的问题?
未标明原创文章均为采集,版权归作者所有,转载无需和我联系,请注明原出处,南摩阿彌陀佛,知识,不只知道,要得到
最新评论