Reverse engineering failed not found machine code ошибка

the firmware file hash

E:\zigb>rahash2 -a md5 xbp24-dm_8073.ehx2.dec
xbp24-dm_8073.ehx2.dec: 0x00000000-0x00022bcd md5: 971f71b674af2d5edb670a5ce4b0371f

the version mingw objcopy in my windows box

E:\zigb>objcopy -V
GNU objcopy (GNU Binutils) 2.25.1
Copyright (C) 2014 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) any later version.
This program has absolutely no warranty.

duplicated the file

E:\zigb>copy xbp24-dm_8073.ehx2.dec test.dec
        1 file(s) copied.

now i objcopy it

E:\zigb>objcopy -I srec -O binary -S  test.dec

E:\zigb>ls -l
total 200
-rw-rw-rw-  1 HP 0  60800 2017-03-30 03:25 test.dec
-rw-rw-rw-  1 HP 0 142286 2017-03-30 02:43 xbp24-dm_8073.ehx2.dec

dumping 32 bytes from the file

E:\zigb>xxd -g 1 -l 32 test.dec
0000000: 43 54 02 d1 47 10 36 43 4e 00 d1 31 00 00 41 43  CT..G.6CN..1..AC
0000010: 00 d1 12 00 00 56 52 02 9c 1d fd 46 46 52 00 d1  .....VR....FFR..

dumping the first two lines from original file

E:\zigb>head -n 2 xbp24-dm_8073.ehx2.dec
S0260000433A5C446576656C6F706D656E745C646D32345C62696E5C584232342D444D2E70726DBE
S1231080435402D1471036434E00D1310000414300D11200005652029C1DFD46465200D14C

Deciphering the first s0 record (header) and the second line an S1 data record

E:\zigb>rax2 -s 433A5C446576656C6F706D656E745C646D32345C62696E5C584232342D444D2E70726D
C:\Development\dm24\bin\XB24-DM.prm

E:\zigb>rax2 -s 435402D1471036434E00D1310000414300D11200005652029C1DFD46465200D1
CT☻╤G►6CN ╤1  AC ╤↕  VR☻£↔²FFR ╤

it appears to be correct conversion by objcopy

btw objdump can use srec as target so no objconv is required i think

:\>arm-none-eabi-objdump.exe -D -bsrec -marm  -Mforce-thumb --start-address=0x1893 --stop-address=0x
18a3 e:\zigb\xbp24-dm_8073.ehx2.dec

e:\zigb\xbp24-dm_8073.ehx2.dec:     file format srec


Disassembly of section .sec2:

00001893 <.sec2+0x67>:
    1893:       0f45            lsrs    r5, r0, #29
    1895:       942e            str     r4, [sp, #184]  ; 0xb8
    1897:       0e45            lsrs    r5, r0, #25
    1899:       9602            str     r6, [sp, #8]
    189b:       7701            strb    r1, [r0, #28]
    189d:       0e20            lsrs    r0, r4, #24
    189f:       a5a6            add     r5, pc, #664    ; (adr r5, 0x1b38)
    18a1:       0132            lsls    r2, r6, #4

:\>

Strings inside binary xbee-pro digimesh v24 and mc13213 a hcs08 compatible cpu it seems

Epic Developer Community Forums

Loading

I still can’t get this to work. Either all tables are include or all are excluded — I can’t be selective.

For example, here is my hibernate.reveng.xml, and below it, the output of the hibernate ant task. This reveng.xml file does not include the «catch all» excludes, so all tables are included (which I don’t want). Further down I show the reveng.xml with the «catch all» excludes and the corresponding output.

===================hibernate.reveng.xml================

<?xml version=»1.0″ encoding=»UTF-8″?>

<!DOCTYPE hibernate-reverse-engineering SYSTEM «http://hibernate.sourceforge.net/hibernate-reverse-engineering-3.0.dtd» >

<hibernate-reverse-engineering>

<!— Exclude the sys stuff —>

<table-filter match-name=»ALL$.*» exclude=»true» />

<table-filter match-name=»OL$.*» exclude=»true» />

<table-filter match-name=»MRV$.*» exclude=»true» />

<table-filter match-name=»DBA$.*» exclude=»true» />

<table-filter match-name=»CWM2$.*» exclude=»true» />

<!— catch all and exclude, i.e. Reveng is acting strange or I am tired…—>

<!— <table-filter match-schema=».*» match-name=».*» exclude=»true»/>—>

<!— Include what I want —>

<table-filter match-schema=».*» match-name=»DOES.DBO.DOES_GATEWAYS»/>

</hibernate-reverse-engineering>

===============================================

======================Output=====================

[hibernatetool] Executing Hibernate Tool with a JDBC Configuration (for reverse engineering)

[hibernatetool] 1. task: hbm2java (Generates a set of .java files)

[hibernatetool] 17:49:23,245 INFO Environment:464 — Hibernate 3.0.5

[hibernatetool] 17:49:23,261 INFO Environment:477 — hibernate.properties not found

[hibernatetool] 17:49:23,261 INFO Environment:510 — using CGLIB reflection optimizer

[hibernatetool] 17:49:23,261 INFO Environment:540 — using JDK 1.4 java.sql.Timestamp handling

[hibernatetool] 17:49:23,464 INFO Configuration:1144 — configuring from file: hibernate.cfg.xml

[hibernatetool] 17:49:23,542 DEBUG DTDEntityResolver:42 — trying to locate

http://hibernate.sourceforge.net/hibern … on-3.0.dtd

in classpath under org/hibernate/

[hibernatetool] 17:49:23,542 DEBUG DTDEntityResolver:53 — found

http://hibernate.sourceforge.net/hibern … on-3.0.dtd

in classpath

[hibernatetool] 17:49:23,636 DEBUG Configuration:1067 — hibernate.connection.provider_class=org.hibernate.connection.C3P0ConnectionProvider

[hibernatetool] 17:49:23,636 DEBUG Configuration:1067 — hibernate.c3p0.min_size=5

[hibernatetool] 17:49:23,636 DEBUG Configuration:1067 — hibernate.c3p0.max_size=20

[hibernatetool] 17:49:23,636 DEBUG Configuration:1067 — hibernate.c3p0.timeout=1800

[hibernatetool] 17:49:23,636 DEBUG Configuration:1067 — hibernate.c3p0.max_statements=50

[hibernatetool] 17:49:23,652 DEBUG Configuration:1067 — connection.driver_class=com.sybase.jdbc2.jdbc.SybDriver

[hibernatetool] 17:49:23,652 DEBUG Configuration:1067 — connection.url=jdbc:sybase:Tds:scsefpsddb01:5001/does

[hibernatetool] 17:49:23,652 DEBUG Configuration:1067 — connection.username=eqprod1

[hibernatetool] 17:49:23,652 DEBUG Configuration:1067 — connection.password=deriv8tives

[hibernatetool] 17:49:23,652 DEBUG Configuration:1067 — dialect=org.hibernate.dialect.SybaseAnywhereDialect

[hibernatetool] 17:49:23,652 DEBUG Configuration:1067 — show_sql=true

[hibernatetool] 17:49:23,652 INFO Configuration:1222 — Configured SessionFactory: null

[hibernatetool] 17:49:23,652 DEBUG Configuration:1223 — properties: {hibernate.connection.password=deriv8tives, java.runtime.name=Java(TM) 2 Runtime Environment, Standard Edition, sun.boot.library.path=C:\Program Files\Java\j2re1.4.2_04\bin, java.vm.version=1.4.2_04-b05, hibernate.connection.username=eqprod1, ant.library.dir=c:\DevTools\eclipse\plugins\org.apache.ant_1.6.5\lib, java.vm.vendor=Sun Microsystems Inc., java.vendor.url=http://java.sun.com/, path.separator=;, java.vm.name=Java HotSpot(TM) Client VM, file.encoding.pkg=sun.io, user.country=US, sun.os.patch.level=Service Pack 1, java.vm.specification.name=Java Virtual Machine Specification, user.dir=C:\Edgar\WorkSpaces\DAS\hibernate, java.runtime.version=1.4.2_04-b05, java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment, hibernate.c3p0.max_statements=50, java.endorsed.dirs=C:\Program Files\Java\j2re1.4.2_04\lib\endorsed, os.arch=x86, java.io.tmpdir=C:\DOCUME~1\nbk38on\LOCALS~1\Temp\, line.separator=

[hibernatetool] , java.vm.specification.vendor=Sun Microsystems Inc., user.variant=, os.name=Windows XP, ant.home=c:\DevTools\eclipse\plugins\org.apache.ant_1.6.5, sun.java2d.fontpath=, hibernate.c3p0.timeout=1800, java.library.path=C:\WINNT\system32;.;C:\WINNT\System32;C:\WINNT;C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;C:\Program Files\Hummingbird\Connectivity\9.00\Accessories\;C:\Program Files\Sybase\DLL;C:\Program FIles\Sybase\Bin;C:\Program Files\Reuters\Login;C:\DevTools\bea\jrockit81sp4_142_05\bin;C:\DevTools\xmlbeans-2.0.0\bin;c:\DevTools\eclipse\configuration\org.eclipse.osgi\bundles\61\1\.cp, java.specification.name=Java Platform API Specification, java.class.version=48.0, java.util.prefs.PreferencesFactory=java.util.prefs.WindowsPreferencesFactory, os.version=5.1, connection.password=deriv8tives, user.home=C:\Documents and Settings\nbk38on, user.timezone=America/New_York, connection.username=eqprod1, java.awt.printerjob=sun.awt.windows.WPrinterJob, file.encoding=Cp1252, java.specification.version=1.4, hibernate.c3p0.min_size=5, hibernate.connection.driver_class=com.sybase.jdbc2.jdbc.SybDriver, show_sql=true, java.class.path=C:\DevTools\eclipse\plugins\org.apache.ant_1.6.5\lib\ant.jar;C:\DevTools\eclipse\plugins\org.apache.ant_1.6.5\lib\ant-antlr.jar;C:\DevTools\eclipse\plugins\org.apache.ant_1.6.5\lib\ant-apache-bcel.jar;C:\DevTools\eclipse\plugins\org.apache.ant_1.6.5\lib\ant-apache-bsf.jar;C:\DevTools\eclipse\plugins\org.apache.ant_1.6.5\lib\ant-apache-log4j.jar;C:\DevTools\eclipse\plugins\org.apache.ant_1.6.5\lib\ant-apache-oro.jar;C:\DevTools\eclipse\plugins\org.apache.ant_1.6.5\lib\ant-apache-regexp.jar;C:\DevTools\eclipse\plugins\org.apache.ant_1.6.5\lib\ant-apache-resolver.jar;C:\DevTools\eclipse\plugins\org.apache.ant_1.6.5\lib\ant-commons-logging.jar;C:\DevTools\eclipse\plugins\org.apache.ant_1.6.5\lib\ant-commons-net.jar;C:\DevTools\eclipse\plugins\org.apache.ant_1.6.5\lib\ant-icontract.jar;C:\DevTools\eclipse\plugins\org.apache.ant_1.6.5\lib\ant-jai.jar;C:\DevTools\eclipse\plugins\org.apache.ant_1.6.5\lib\ant-javamail.jar;C:\DevTools\eclipse\plugins\org.apache.ant_1.6.5\lib\ant-jdepend.jar;C:\DevTools\eclipse\plugins\org.apache.ant_1.6.5\lib\ant-jmf.jar;C:\DevTools\eclipse\plugins\org.apache.ant_1.6.5\lib\ant-jsch.jar;C:\DevTools\eclipse\plugins\org.apache.ant_1.6.5\lib\ant-junit.jar;C:\DevTools\eclipse\plugins\org.apache.ant_1.6.5\lib\ant-launcher.jar;C:\DevTools\eclipse\plugins\org.apache.ant_1.6.5\lib\ant-netrexx.jar;C:\DevTools\eclipse\plugins\org.apache.ant_1.6.5\lib\ant-nodeps.jar;C:\DevTools\eclipse\plugins\org.apache.ant_1.6.5\lib\ant-starteam.jar;C:\DevTools\eclipse\plugins\org.apache.ant_1.6.5\lib\ant-stylebook.jar;C:\DevTools\eclipse\plugins\org.apache.ant_1.6.5\lib\ant-swing.jar;C:\DevTools\eclipse\plugins\org.apache.ant_1.6.5\lib\ant-trax.jar;C:\DevTools\eclipse\plugins\org.apache.ant_1.6.5\lib\ant-vaj.jar;C:\DevTools\eclipse\plugins\org.apache.ant_1.6.5\lib\ant-weblogic.jar;C:\DevTools\eclipse\plugins\org.apache.ant_1.6.5\lib\ant-xalan1.jar;C:\DevTools\eclipse\plugins\org.apache.ant_1.6.5\lib\ant-xslp.jar;C:\DevTools\eclipse\configuration\org.eclipse.osgi\bundles\6\1\.cp\lib\remoteAnt.jar;C:\DevTools\bea\jrockit81sp4_142_05\lib\tools.jar;C:\DevTools\eclipse\plugins\org.eclipse.swt.win32.win32.x86_3.1.0.jar, user.name=nbk38on, hibernate.show_sql=true, java.vm.specification.version=1.0, java.home=C:\Program Files\Java\j2re1.4.2_04, sun.arch.data.model=32, hibernate.dialect=org.hibernate.dialect.SybaseAnywhereDialect, hibernate.connection.url=jdbc:sybase:Tds:scsefpsddb01:5001/does, user.language=en, java.specification.vendor=Sun Microsystems Inc., hibernate.c3p0.max_size=20, awt.toolkit=sun.awt.windows.WToolkit, hibernate.cglib.use_reflection_optimizer=true, java.vm.info=mixed mode, java.version=1.4.2_04, java.ext.dirs=C:\Program Files\Java\j2re1.4.2_04\lib\ext, sun.boot.class.path=C:\Program Files\Java\j2re1.4.2_04\lib\rt.jar;C:\Program Files\Java\j2re1.4.2_04\lib\i18n.jar;C:\Program Files\Java\j2re1.4.2_04\lib\sunrsasign.jar;C:\Program Files\Java\j2re1.4.2_04\lib\jsse.jar;C:\Program Files\Java\j2re1.4.2_04\lib\jce.jar;C:\Program Files\Java\j2re1.4.2_04\lib\charsets.jar;C:\Program Files\Java\j2re1.4.2_04\classes, java.vendor=Sun Microsystems Inc., connection.driver_class=com.sybase.jdbc2.jdbc.SybDriver, file.separator=\, hibernate.connection.provider_class=org.hibernate.connection.C3P0ConnectionProvider, java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport.cgi, sun.io.unicode.encoding=UnicodeLittle, sun.cpu.endian=little, connection.url=jdbc:sybase:Tds:scsefpsddb01:5001/does, dialect=org.hibernate.dialect.SybaseAnywhereDialect, sun.cpu.isalist=pentium i486 i386}

[hibernatetool] 17:49:23,667 INFO OverrideRepository:40 — Override file: C:\Edgar\WorkSpaces\DAS\hibernate\hibernate.reveng.xml

[hibernatetool] 17:49:23,667 DEBUG DTDEntityResolver:42 — trying to locate

http://hibernate.sourceforge.net/hibern … ng-3.0.dtd

in classpath under org/hibernate/

[hibernatetool] 17:49:23,667 DEBUG DTDEntityResolver:53 — found

http://hibernate.sourceforge.net/hibern … ng-3.0.dtd

in classpath

[hibernatetool] 17:49:23,777 INFO ConnectionProviderFactory:53 — Initializing connection provider: org.hibernate.connection.C3P0ConnectionProvider

[hibernatetool] 17:49:23,792 INFO C3P0ConnectionProvider:50 — C3P0 using driver: com.sybase.jdbc2.jdbc.SybDriver at URL: jdbc:sybase:Tds:scsefpsddb01:5001/does

[hibernatetool] 17:49:23,792 INFO C3P0ConnectionProvider:51 — Connection properties: {user=eqprod1, password=****}

[hibernatetool] 17:49:23,808 INFO C3P0ConnectionProvider:54 — autocommit mode: false

[hibernatetool] Initializing c3p0 pool… com.mchange.v2.c3p0.PoolBackedDataSource@149d886 [ connectionPoolDataSource -> com.mchange.v2.c3p0.WrapperConnectionPoolDataSource@1e4853f [ acquireIncrement -> 1, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, idleConnectionTestPeriod -> 0, initialPoolSize -> 5, maxIdleTime -> 1800, maxPoolSize -> 20, maxStatements -> 50, maxStatementsPerConnection -> 0, minPoolSize -> 5, nestedDataSource -> com.mchange.v2.c3p0.DriverManagerDataSource@68c26c [ description -> null, driverClass -> null, factoryClassLocation -> null, jdbcUrl -> jdbc:sybase:Tds:scsefpsddb01:5001/does, properties -> {user=******, password=******} ] , preferredTestQuery -> null, propertyCycle -> 300, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, usesTraditionalReflectiveProxies -> false ] , factoryClassLocation -> null, numHelperThreads -> 3, poolOwnerIdentityToken -> 149d886 ]

[hibernatetool] 17:49:25,105 DEBUG SettingsFactory:295 — could not get database version from JDBC metadata

[hibernatetool] 17:49:25,120 INFO SettingsFactory:77 — RDBMS: Adaptive Server Enterprise, version: Adaptive Server Enterprise/12.5.3/EBF 12144/P/Sun_svr4/OS 5.8/ase125x/1883/64-bit/FBO/Fri Nov 12 05:19:26 2004

[hibernatetool] 17:49:25,120 INFO SettingsFactory:78 — JDBC driver: jConnect (TM) for JDBC (TM), version: jConnect (TM) for JDBC(TM)/5.5(Build 25578)/P/EBF12435/JDK13/Tue Feb 22 6:07:39 2005

[hibernatetool] 17:49:25,198 INFO Dialect:92 — Using dialect: org.hibernate.dialect.SybaseAnywhereDialect

[hibernatetool] 17:49:25,339 INFO TransactionFactoryFactory:31 — Using default transaction strategy (direct JDBC transactions)

[hibernatetool] 17:49:25,339 INFO TransactionManagerLookupFactory:33 — No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)

[hibernatetool] 17:49:25,339 INFO SettingsFactory:125 — Automatic flush during beforeCompletion(): disabled

[hibernatetool] 17:49:25,339 INFO SettingsFactory:129 — Automatic session close at end of transaction: disabled

[hibernatetool] 17:49:25,355 INFO SettingsFactory:144 — Scrollable result sets: enabled

[hibernatetool] 17:49:25,355 DEBUG SettingsFactory:148 — Wrap result sets: disabled

[hibernatetool] 17:49:25,355 INFO SettingsFactory:152 — JDBC3 getGeneratedKeys(): disabled

[hibernatetool] 17:49:25,355 INFO SettingsFactory:160 — Connection release mode: null

[hibernatetool] 17:49:25,355 INFO SettingsFactory:187 — Default batch fetch size: 1

[hibernatetool] 17:49:25,355 INFO SettingsFactory:191 — Generate SQL with comments: disabled

[hibernatetool] 17:49:25,355 INFO SettingsFactory:195 — Order SQL updates by primary key: disabled

[hibernatetool] 17:49:25,355 INFO SettingsFactory:334 — Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory

[hibernatetool] 17:49:25,370 INFO ASTQueryTranslatorFactory:21 — Using ASTQueryTranslatorFactory

[hibernatetool] 17:49:25,370 INFO SettingsFactory:203 — Query language substitutions: {}

[hibernatetool] 17:49:25,370 INFO SettingsFactory:209 — Second-level cache: enabled

[hibernatetool] 17:49:25,370 INFO SettingsFactory:213 — Query cache: disabled

[hibernatetool] 17:49:25,386 INFO SettingsFactory:321 — Cache provider: org.hibernate.cache.EhCacheProvider

[hibernatetool] 17:49:25,386 INFO SettingsFactory:228 — Optimize cache for minimal puts: disabled

[hibernatetool] 17:49:25,386 INFO SettingsFactory:237 — Structured second-level cache entries: disabled

[hibernatetool] 17:49:25,402 DEBUG SQLExceptionConverterFactory:52 — Using dialect defined converter

[hibernatetool] 17:49:25,402 INFO SettingsFactory:257 — Echoing all SQL to stdout

[hibernatetool] 17:49:25,402 INFO SettingsFactory:261 — Statistics: disabled

[hibernatetool] 17:49:25,402 INFO SettingsFactory:265 — Deleted entity synthetic identifier rollback: disabled

[hibernatetool] 17:49:25,417 INFO SettingsFactory:279 — Default entity-mode: pojo

[hibernatetool] 17:49:25,448 DEBUG JDBCBinder:604 — Ignoring table sysalternates of type SYSTEM TABLE

[hibernatetool] 17:49:25,448 DEBUG JDBCBinder:604 — Ignoring table sysattributes of type SYSTEM TABLE

[hibernatetool] 17:49:25,448 DEBUG JDBCBinder:604 — Ignoring table syscolumns of type SYSTEM TABLE

[hibernatetool] 17:49:25,448 DEBUG JDBCBinder:604 — Ignoring table syscomments of type SYSTEM TABLE

[hibernatetool] 17:49:25,448 DEBUG JDBCBinder:604 — Ignoring table sysconstraints of type SYSTEM TABLE

[hibernatetool] 17:49:25,448 DEBUG JDBCBinder:604 — Ignoring table sysdepends of type SYSTEM TABLE

[hibernatetool] 17:49:25,464 DEBUG JDBCBinder:604 — Ignoring table sysgams of type SYSTEM TABLE

[hibernatetool] 17:49:25,464 DEBUG JDBCBinder:604 — Ignoring table sysindexes of type SYSTEM TABLE

[hibernatetool] 17:49:25,464 DEBUG JDBCBinder:604 — Ignoring table sysjars of type SYSTEM TABLE

[hibernatetool] 17:49:25,464 DEBUG JDBCBinder:604 — Ignoring table syskeys of type SYSTEM TABLE

[hibernatetool] 17:49:25,464 DEBUG JDBCBinder:604 — Ignoring table syslogs of type SYSTEM TABLE

[hibernatetool] 17:49:25,464 DEBUG JDBCBinder:604 — Ignoring table sysobjects of type SYSTEM TABLE

[hibernatetool] 17:49:25,464 DEBUG JDBCBinder:604 — Ignoring table syspartitions of type SYSTEM TABLE

[hibernatetool] 17:49:25,464 DEBUG JDBCBinder:604 — Ignoring table sysprocedures of type SYSTEM TABLE

[hibernatetool] 17:49:25,464 DEBUG JDBCBinder:604 — Ignoring table sysprotects of type SYSTEM TABLE

[hibernatetool] 17:49:25,464 DEBUG JDBCBinder:604 — Ignoring table sysqueryplans of type SYSTEM TABLE

[hibernatetool] 17:49:25,464 DEBUG JDBCBinder:604 — Ignoring table sysreferences of type SYSTEM TABLE

[hibernatetool] 17:49:25,464 DEBUG JDBCBinder:604 — Ignoring table sysroles of type SYSTEM TABLE

[hibernatetool] 17:49:25,464 DEBUG JDBCBinder:604 — Ignoring table syssegments of type SYSTEM TABLE

[hibernatetool] 17:49:25,464 DEBUG JDBCBinder:604 — Ignoring table sysstatistics of type SYSTEM TABLE

[hibernatetool] 17:49:25,464 DEBUG JDBCBinder:604 — Ignoring table systabstats of type SYSTEM TABLE

[hibernatetool] 17:49:25,464 DEBUG JDBCBinder:604 — Ignoring table systhresholds of type SYSTEM TABLE

[hibernatetool] 17:49:25,464 DEBUG JDBCBinder:604 — Ignoring table systypes of type SYSTEM TABLE

[hibernatetool] 17:49:25,464 DEBUG JDBCBinder:604 — Ignoring table sysusermessages of type SYSTEM TABLE

[hibernatetool] 17:49:25,480 DEBUG JDBCBinder:604 — Ignoring table sysusers of type SYSTEM TABLE

[hibernatetool] 17:49:25,480 DEBUG JDBCBinder:604 — Ignoring table sysxtypes of type SYSTEM TABLE

[hibernatetool] 17:49:25,480 DEBUG JDBCBinder:600 — Adding table org.hibernate.mapping.Table(does.dbo.dba) of type TABLE

[hibernatetool] 17:49:25,480 DEBUG JDBCBinder:600 — Adding table org.hibernate.mapping.Table(does.dbo.does_arch) of type TABLE

[hibernatetool] 17:49:25,480 DEBUG JDBCBinder:600 — Adding table org.hibernate.mapping.Table(does.dbo.does_gateways) of type TABLE

[hibernatetool] 17:49:25,480 DEBUG JDBCBinder:600 — Adding table org.hibernate.mapping.Table(does.dbo.does_tran_action_descr) of type TABLE

[hibernatetool] 17:49:25,480 DEBUG JDBCBinder:600 — Adding table org.hibernate.mapping.Table(does.dbo.hts_xact_history) of type TABLE

[hibernatetool] 17:49:25,480 DEBUG JDBCBinder:600 — Adding table org.hibernate.mapping.Table(does.dbo.rs_lastcommit) of type TABLE

[hibernatetool] 17:49:25,480 DEBUG JDBCBinder:600 — Adding table org.hibernate.mapping.Table(does.dbo.rs_threads) of type TABLE

[hibernatetool] 17:49:25,495 DEBUG JDBCBinder:600 — Adding table org.hibernate.mapping.Table(does.dbo.d) of type VIEW

[hibernatetool] 17:49:25,495 DEBUG JDBCBinder:600 — Adding table org.hibernate.mapping.Table(does.dbo.view_does_arch) of type VIEW

[hibernatetool] 17:49:25,495 DEBUG JDBCBinder:600 — Adding table org.hibernate.mapping.Table(does.dbo.view_does_arch_exec) of type VIEW

[hibernatetool] 17:49:25,495 DEBUG JDBCBinder:731 — Finding columns for does.dbo.d

[hibernatetool] 17:49:25,714 WARN JDBCBinder:999 — The JDBC driver didn’t report any primary key columns in d

[hibernatetool] 17:49:25,730 DEBUG JDBCBinder:731 — Finding columns for does.dbo.dba

[hibernatetool] 17:49:25,855 WARN JDBCBinder:999 — The JDBC driver didn’t report any primary key columns in dba

[hibernatetool] 17:49:25,870 DEBUG JDBCBinder:731 — Finding columns for does.dbo.does_arch

[hibernatetool] 17:49:26,527 WARN JDBCBinder:999 — The JDBC driver didn’t report any primary key columns in does_arch

[hibernatetool] 17:49:26,558 DEBUG JDBCBinder:731 — Finding columns for does.dbo.does_gateways

[hibernatetool] 17:49:26,573 DEBUG JDBCBinder:1001 — primary key for org.hibernate.mapping.Table(does.dbo.does_gateways) -> org.hibernate.mapping.PrimaryKey(does_gateways[org.hibernate.mapping.Column(gtw_id)]) as does_gatew_7200055961

[hibernatetool] 17:49:26,589 DEBUG JDBCBinder:731 — Finding columns for does.dbo.does_tran_action_descr

[hibernatetool] 17:49:26,605 WARN JDBCBinder:999 — The JDBC driver didn’t report any primary key columns in does_tran_action_descr

[hibernatetool] 17:49:26,620 DEBUG JDBCBinder:731 — Finding columns for does.dbo.hts_xact_history

[hibernatetool] 17:49:26,652 WARN JDBCBinder:999 — The JDBC driver didn’t report any primary key columns in hts_xact_history

[hibernatetool] 17:49:26,667 DEBUG JDBCBinder:731 — Finding columns for does.dbo.rs_lastcommit

[hibernatetool] 17:49:26,698 WARN JDBCBinder:999 — The JDBC driver didn’t report any primary key columns in rs_lastcommit

[hibernatetool] 17:49:26,698 DEBUG JDBCBinder:731 — Finding columns for does.dbo.rs_threads

[hibernatetool] 17:49:26,730 WARN JDBCBinder:999 — The JDBC driver didn’t report any primary key columns in rs_threads

[hibernatetool] 17:49:26,730 DEBUG JDBCBinder:731 — Finding columns for does.dbo.view_does_arch

[hibernatetool] 17:49:26,808 WARN JDBCBinder:999 — The JDBC driver didn’t report any primary key columns in view_does_arch

[hibernatetool] 17:49:26,823 DEBUG JDBCBinder:731 — Finding columns for does.dbo.view_does_arch_exec

[hibernatetool] 17:49:26,886 WARN JDBCBinder:999 — The JDBC driver didn’t report any primary key columns in view_does_arch_exec

[hibernatetool] 17:49:26,902 DEBUG JDBCBinder:1020 — Calling getExportedKeys on org.hibernate.mapping.Table(does.dbo.d)

BUILD FAILED

C:\Edgar\WorkSpaces\DAS\hibernate\build.xml:18: org.hibernate.exception.GenericJDBCException: Reading from database

===============================================

Now here is the reveng.xml with the «catch all», and below it the output. Note that, eventhough the build is successful, nothing has been generated.

===================reveng.xml=====================

<?xml version=»1.0″ encoding=»UTF-8″?>

<!DOCTYPE hibernate-reverse-engineering SYSTEM «http://hibernate.sourceforge.net/hibernate-reverse-engineering-3.0.dtd» >

<hibernate-reverse-engineering>

<!— Exclude the sys stuff —>

<table-filter match-name=»ALL$.*» exclude=»true» />

<table-filter match-name=»OL$.*» exclude=»true» />

<table-filter match-name=»MRV$.*» exclude=»true» />

<table-filter match-name=»DBA$.*» exclude=»true» />

<table-filter match-name=»CWM2$.*» exclude=»true» />

<!— Include what I want —>

<table-filter match-schema=».*» match-name=»DOES.DBO.DOES_GATEWAYS»/>

<!— catch all and exclude, i.e. Reveng is acting strange or I am tired…—>

<table-filter match-schema=».*» match-name=».*» exclude=»true»/>

</hibernate-reverse-engineering>

===============================================

===================Output========================

[hibernatetool] Executing Hibernate Tool with a JDBC Configuration (for reverse engineering)

[hibernatetool] 1. task: hbm2java (Generates a set of .java files)

[hibernatetool] 17:54:46,523 INFO Environment:464 — Hibernate 3.0.5

[hibernatetool] 17:54:46,538 INFO Environment:477 — hibernate.properties not found

[hibernatetool] 17:54:46,554 INFO Environment:510 — using CGLIB reflection optimizer

[hibernatetool] 17:54:46,554 INFO Environment:540 — using JDK 1.4 java.sql.Timestamp handling

[hibernatetool] 17:54:46,741 INFO Configuration:1144 — configuring from file: hibernate.cfg.xml

[hibernatetool] 17:54:46,835 DEBUG DTDEntityResolver:42 — trying to locate

http://hibernate.sourceforge.net/hibern … on-3.0.dtd

in classpath under org/hibernate/

[hibernatetool] 17:54:46,835 DEBUG DTDEntityResolver:53 — found

http://hibernate.sourceforge.net/hibern … on-3.0.dtd

in classpath

[hibernatetool] 17:54:46,913 DEBUG Configuration:1067 — hibernate.connection.provider_class=org.hibernate.connection.C3P0ConnectionProvider

[hibernatetool] 17:54:46,929 DEBUG Configuration:1067 — hibernate.c3p0.min_size=5

[hibernatetool] 17:54:46,929 DEBUG Configuration:1067 — hibernate.c3p0.max_size=20

[hibernatetool] 17:54:46,929 DEBUG Configuration:1067 — hibernate.c3p0.timeout=1800

[hibernatetool] 17:54:46,929 DEBUG Configuration:1067 — hibernate.c3p0.max_statements=50

[hibernatetool] 17:54:46,929 DEBUG Configuration:1067 — connection.driver_class=com.sybase.jdbc2.jdbc.SybDriver

[hibernatetool] 17:54:46,929 DEBUG Configuration:1067 — connection.url=jdbc:sybase:Tds:scsefpsddb01:5001/does

[hibernatetool] 17:54:46,929 DEBUG Configuration:1067 — connection.username=eqprod1

[hibernatetool] 17:54:46,929 DEBUG Configuration:1067 — connection.password=deriv8tives

[hibernatetool] 17:54:46,929 DEBUG Configuration:1067 — dialect=org.hibernate.dialect.SybaseAnywhereDialect

[hibernatetool] 17:54:46,929 DEBUG Configuration:1067 — show_sql=true

[hibernatetool] 17:54:46,944 INFO Configuration:1222 — Configured SessionFactory: null

[hibernatetool] 17:54:46,944 DEBUG Configuration:1223 — properties: {hibernate.connection.password=deriv8tives, java.runtime.name=Java(TM) 2 Runtime Environment, Standard Edition, sun.boot.library.path=C:\Program Files\Java\j2re1.4.2_04\bin, java.vm.version=1.4.2_04-b05, hibernate.connection.username=eqprod1, ant.library.dir=c:\DevTools\eclipse\plugins\org.apache.ant_1.6.5\lib, java.vm.vendor=Sun Microsystems Inc., java.vendor.url=http://java.sun.com/, path.separator=;, java.vm.name=Java HotSpot(TM) Client VM, file.encoding.pkg=sun.io, user.country=US, sun.os.patch.level=Service Pack 1, java.vm.specification.name=Java Virtual Machine Specification, user.dir=C:\Edgar\WorkSpaces\DAS\hibernate, java.runtime.version=1.4.2_04-b05, java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment, hibernate.c3p0.max_statements=50, java.endorsed.dirs=C:\Program Files\Java\j2re1.4.2_04\lib\endorsed, os.arch=x86, java.io.tmpdir=C:\DOCUME~1\nbk38on\LOCALS~1\Temp\, line.separator=

[hibernatetool] , java.vm.specification.vendor=Sun Microsystems Inc., user.variant=, os.name=Windows XP, ant.home=c:\DevTools\eclipse\plugins\org.apache.ant_1.6.5, sun.java2d.fontpath=, hibernate.c3p0.timeout=1800, java.library.path=C:\WINNT\system32;.;C:\WINNT\System32;C:\WINNT;C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;C:\Program Files\Hummingbird\Connectivity\9.00\Accessories\;C:\Program Files\Sybase\DLL;C:\Program FIles\Sybase\Bin;C:\Program Files\Reuters\Login;C:\DevTools\bea\jrockit81sp4_142_05\bin;C:\DevTools\xmlbeans-2.0.0\bin;c:\DevTools\eclipse\configuration\org.eclipse.osgi\bundles\61\1\.cp, java.specification.name=Java Platform API Specification, java.class.version=48.0, java.util.prefs.PreferencesFactory=java.util.prefs.WindowsPreferencesFactory, os.version=5.1, connection.password=deriv8tives, user.home=C:\Documents and Settings\nbk38on, user.timezone=America/New_York, connection.username=eqprod1, java.awt.printerjob=sun.awt.windows.WPrinterJob, file.encoding=Cp1252, java.specification.version=1.4, hibernate.c3p0.min_size=5, hibernate.connection.driver_class=com.sybase.jdbc2.jdbc.SybDriver, show_sql=true, java.class.path=C:\DevTools\eclipse\plugins\org.apache.ant_1.6.5\lib\ant.jar;C:\DevTools\eclipse\plugins\org.apache.ant_1.6.5\lib\ant-antlr.jar;C:\DevTools\eclipse\plugins\org.apache.ant_1.6.5\lib\ant-apache-bcel.jar;C:\DevTools\eclipse\plugins\org.apache.ant_1.6.5\lib\ant-apache-bsf.jar;C:\DevTools\eclipse\plugins\org.apache.ant_1.6.5\lib\ant-apache-log4j.jar;C:\DevTools\eclipse\plugins\org.apache.ant_1.6.5\lib\ant-apache-oro.jar;C:\DevTools\eclipse\plugins\org.apache.ant_1.6.5\lib\ant-apache-regexp.jar;C:\DevTools\eclipse\plugins\org.apache.ant_1.6.5\lib\ant-apache-resolver.jar;C:\DevTools\eclipse\plugins\org.apache.ant_1.6.5\lib\ant-commons-logging.jar;C:\DevTools\eclipse\plugins\org.apache.ant_1.6.5\lib\ant-commons-net.jar;C:\DevTools\eclipse\plugins\org.apache.ant_1.6.5\lib\ant-icontract.jar;C:\DevTools\eclipse\plugins\org.apache.ant_1.6.5\lib\ant-jai.jar;C:\DevTools\eclipse\plugins\org.apache.ant_1.6.5\lib\ant-javamail.jar;C:\DevTools\eclipse\plugins\org.apache.ant_1.6.5\lib\ant-jdepend.jar;C:\DevTools\eclipse\plugins\org.apache.ant_1.6.5\lib\ant-jmf.jar;C:\DevTools\eclipse\plugins\org.apache.ant_1.6.5\lib\ant-jsch.jar;C:\DevTools\eclipse\plugins\org.apache.ant_1.6.5\lib\ant-junit.jar;C:\DevTools\eclipse\plugins\org.apache.ant_1.6.5\lib\ant-launcher.jar;C:\DevTools\eclipse\plugins\org.apache.ant_1.6.5\lib\ant-netrexx.jar;C:\DevTools\eclipse\plugins\org.apache.ant_1.6.5\lib\ant-nodeps.jar;C:\DevTools\eclipse\plugins\org.apache.ant_1.6.5\lib\ant-starteam.jar;C:\DevTools\eclipse\plugins\org.apache.ant_1.6.5\lib\ant-stylebook.jar;C:\DevTools\eclipse\plugins\org.apache.ant_1.6.5\lib\ant-swing.jar;C:\DevTools\eclipse\plugins\org.apache.ant_1.6.5\lib\ant-trax.jar;C:\DevTools\eclipse\plugins\org.apache.ant_1.6.5\lib\ant-vaj.jar;C:\DevTools\eclipse\plugins\org.apache.ant_1.6.5\lib\ant-weblogic.jar;C:\DevTools\eclipse\plugins\org.apache.ant_1.6.5\lib\ant-xalan1.jar;C:\DevTools\eclipse\plugins\org.apache.ant_1.6.5\lib\ant-xslp.jar;C:\DevTools\eclipse\configuration\org.eclipse.osgi\bundles\6\1\.cp\lib\remoteAnt.jar;C:\DevTools\bea\jrockit81sp4_142_05\lib\tools.jar;C:\DevTools\eclipse\plugins\org.eclipse.swt.win32.win32.x86_3.1.0.jar, user.name=nbk38on, hibernate.show_sql=true, java.vm.specification.version=1.0, java.home=C:\Program Files\Java\j2re1.4.2_04, sun.arch.data.model=32, hibernate.dialect=org.hibernate.dialect.SybaseAnywhereDialect, hibernate.connection.url=jdbc:sybase:Tds:scsefpsddb01:5001/does, user.language=en, java.specification.vendor=Sun Microsystems Inc., hibernate.c3p0.max_size=20, awt.toolkit=sun.awt.windows.WToolkit, hibernate.cglib.use_reflection_optimizer=true, java.vm.info=mixed mode, java.version=1.4.2_04, java.ext.dirs=C:\Program Files\Java\j2re1.4.2_04\lib\ext, sun.boot.class.path=C:\Program Files\Java\j2re1.4.2_04\lib\rt.jar;C:\Program Files\Java\j2re1.4.2_04\lib\i18n.jar;C:\Program Files\Java\j2re1.4.2_04\lib\sunrsasign.jar;C:\Program Files\Java\j2re1.4.2_04\lib\jsse.jar;C:\Program Files\Java\j2re1.4.2_04\lib\jce.jar;C:\Program Files\Java\j2re1.4.2_04\lib\charsets.jar;C:\Program Files\Java\j2re1.4.2_04\classes, java.vendor=Sun Microsystems Inc., connection.driver_class=com.sybase.jdbc2.jdbc.SybDriver, file.separator=\, hibernate.connection.provider_class=org.hibernate.connection.C3P0ConnectionProvider, java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport.cgi, sun.io.unicode.encoding=UnicodeLittle, sun.cpu.endian=little, connection.url=jdbc:sybase:Tds:scsefpsddb01:5001/does, dialect=org.hibernate.dialect.SybaseAnywhereDialect, sun.cpu.isalist=pentium i486 i386}

[hibernatetool] 17:54:46,944 INFO OverrideRepository:40 — Override file: C:\Edgar\WorkSpaces\DAS\hibernate\hibernate.reveng.xml

[hibernatetool] 17:54:46,944 DEBUG DTDEntityResolver:42 — trying to locate

http://hibernate.sourceforge.net/hibern … ng-3.0.dtd

in classpath under org/hibernate/

[hibernatetool] 17:54:46,944 DEBUG DTDEntityResolver:53 — found

http://hibernate.sourceforge.net/hibern … ng-3.0.dtd

in classpath

[hibernatetool] 17:54:47,054 INFO ConnectionProviderFactory:53 — Initializing connection provider: org.hibernate.connection.C3P0ConnectionProvider

[hibernatetool] 17:54:47,085 INFO C3P0ConnectionProvider:50 — C3P0 using driver: com.sybase.jdbc2.jdbc.SybDriver at URL: jdbc:sybase:Tds:scsefpsddb01:5001/does

[hibernatetool] 17:54:47,085 INFO C3P0ConnectionProvider:51 — Connection properties: {user=eqprod1, password=****}

[hibernatetool] 17:54:47,085 INFO C3P0ConnectionProvider:54 — autocommit mode: false

[hibernatetool] Initializing c3p0 pool… com.mchange.v2.c3p0.PoolBackedDataSource@149d886 [ connectionPoolDataSource -> com.mchange.v2.c3p0.WrapperConnectionPoolDataSource@1e4853f [ acquireIncrement -> 1, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, idleConnectionTestPeriod -> 0, initialPoolSize -> 5, maxIdleTime -> 1800, maxPoolSize -> 20, maxStatements -> 50, maxStatementsPerConnection -> 0, minPoolSize -> 5, nestedDataSource -> com.mchange.v2.c3p0.DriverManagerDataSource@68c26c [ description -> null, driverClass -> null, factoryClassLocation -> null, jdbcUrl -> jdbc:sybase:Tds:scsefpsddb01:5001/does, properties -> {user=******, password=******} ] , preferredTestQuery -> null, propertyCycle -> 300, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, usesTraditionalReflectiveProxies -> false ] , factoryClassLocation -> null, numHelperThreads -> 3, poolOwnerIdentityToken -> 149d886 ]

[hibernatetool] 17:54:48,476 DEBUG SettingsFactory:295 — could not get database version from JDBC metadata

[hibernatetool] 17:54:48,491 INFO SettingsFactory:77 — RDBMS: Adaptive Server Enterprise, version: Adaptive Server Enterprise/12.5.3/EBF 12144/P/Sun_svr4/OS 5.8/ase125x/1883/64-bit/FBO/Fri Nov 12 05:19:26 2004

[hibernatetool] 17:54:48,491 INFO SettingsFactory:78 — JDBC driver: jConnect (TM) for JDBC (TM), version: jConnect (TM) for JDBC(TM)/5.5(Build 25578)/P/EBF12435/JDK13/Tue Feb 22 6:07:39 2005

[hibernatetool] 17:54:48,569 INFO Dialect:92 — Using dialect: org.hibernate.dialect.SybaseAnywhereDialect

[hibernatetool] 17:54:48,694 INFO TransactionFactoryFactory:31 — Using default transaction strategy (direct JDBC transactions)

[hibernatetool] 17:54:48,694 INFO TransactionManagerLookupFactory:33 — No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)

[hibernatetool] 17:54:48,710 INFO SettingsFactory:125 — Automatic flush during beforeCompletion(): disabled

[hibernatetool] 17:54:48,710 INFO SettingsFactory:129 — Automatic session close at end of transaction: disabled

[hibernatetool] 17:54:48,710 INFO SettingsFactory:144 — Scrollable result sets: enabled

[hibernatetool] 17:54:48,710 DEBUG SettingsFactory:148 — Wrap result sets: disabled

[hibernatetool] 17:54:48,710 INFO SettingsFactory:152 — JDBC3 getGeneratedKeys(): disabled

[hibernatetool] 17:54:48,710 INFO SettingsFactory:160 — Connection release mode: null

[hibernatetool] 17:54:48,710 INFO SettingsFactory:187 — Default batch fetch size: 1

[hibernatetool] 17:54:48,710 INFO SettingsFactory:191 — Generate SQL with comments: disabled

[hibernatetool] 17:54:48,726 INFO SettingsFactory:195 — Order SQL updates by primary key: disabled

[hibernatetool] 17:54:48,726 INFO SettingsFactory:334 — Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory

[hibernatetool] 17:54:48,741 INFO ASTQueryTranslatorFactory:21 — Using ASTQueryTranslatorFactory

[hibernatetool] 17:54:48,741 INFO SettingsFactory:203 — Query language substitutions: {}

[hibernatetool] 17:54:48,741 INFO SettingsFactory:209 — Second-level cache: enabled

[hibernatetool] 17:54:48,741 INFO SettingsFactory:213 — Query cache: disabled

[hibernatetool] 17:54:48,741 INFO SettingsFactory:321 — Cache provider: org.hibernate.cache.EhCacheProvider

[hibernatetool] 17:54:48,741 INFO SettingsFactory:228 — Optimize cache for minimal puts: disabled

[hibernatetool] 17:54:48,741 INFO SettingsFactory:237 — Structured second-level cache entries: disabled

[hibernatetool] 17:54:48,757 DEBUG SQLExceptionConverterFactory:52 — Using dialect defined converter

[hibernatetool] 17:54:48,772 INFO SettingsFactory:257 — Echoing all SQL to stdout

[hibernatetool] 17:54:48,772 INFO SettingsFactory:261 — Statistics: disabled

[hibernatetool] 17:54:48,772 INFO SettingsFactory:265 — Deleted entity synthetic identifier rollback: disabled

[hibernatetool] 17:54:48,772 INFO SettingsFactory:279 — Default entity-mode: pojo

[hibernatetool] 17:54:48,819 INFO Configuration:875 — processing extends queue

[hibernatetool] 17:54:48,819 INFO Configuration:879 — processing collection mappings

[hibernatetool] 17:54:48,819 INFO Configuration:888 — processing association property references

[hibernatetool] 17:54:48,819 INFO Configuration:917 — processing foreign key constraints

[hibernatetool] 17:54:49,054 DEBUG template:91 — CommonsLogLogSystem name is ‘org.hibernate.tool.hbm2x.template’

[hibernatetool] 17:54:49,054 INFO template:88 — **************************************************************

[hibernatetool] 17:54:49,054 INFO template:88 — Starting Jakarta Velocity v1.4

[hibernatetool] 17:54:49,054 INFO template:88 — RuntimeInstance initializing.

[hibernatetool] 17:54:49,054 INFO template:88 — Default Properties File: org\apache\velocity\runtime\defaults\velocity.properties

[hibernatetool] 17:54:49,054 INFO template:88 — Trying to use logger class org.apache.velocity.tools.generic.log.CommonsLogLogSystem

[hibernatetool] 17:54:49,054 INFO template:88 — Using logger class org.apache.velocity.tools.generic.log.CommonsLogLogSystem

[hibernatetool] 17:54:49,069 INFO template:88 — Default ResourceManager initializing. (class org.apache.velocity.runtime.resource.ResourceManagerImpl)

[hibernatetool] 17:54:49,085 INFO template:88 — Resource Loader Instantiated: org.apache.velocity.runtime.resource.loader.FileResourceLoader

[hibernatetool] 17:54:49,085 INFO template:88 — FileResourceLoader : initialization starting.

[hibernatetool] 17:54:49,085 INFO template:88 — FileResourceLoader : adding path ‘.’

[hibernatetool] 17:54:49,085 INFO template:88 — FileResourceLoader : initialization complete.

[hibernatetool] 17:54:49,085 INFO template:88 — Resource Loader Instantiated: org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader

[hibernatetool] 17:54:49,085 INFO template:88 — ClasspathResourceLoader : initialization starting.

[hibernatetool] 17:54:49,085 INFO template:88 — ClasspathResourceLoader : initialization complete.

[hibernatetool] 17:54:49,101 INFO template:88 — ResourceCache : initialized. (class org.apache.velocity.runtime.resource.ResourceCacheImpl)

[hibernatetool] 17:54:49,101 INFO template:88 — Default ResourceManager initialization complete.

[hibernatetool] 17:54:49,101 INFO template:88 — Loaded System Directive: org.apache.velocity.runtime.directive.Literal

[hibernatetool] 17:54:49,116 INFO template:88 — Loaded System Directive: org.apache.velocity.runtime.directive.Macro

[hibernatetool] 17:54:49,132 INFO template:88 — Loaded System Directive: org.apache.velocity.runtime.directive.Parse

[hibernatetool] 17:54:49,132 INFO template:88 — Loaded System Directive: org.apache.velocity.runtime.directive.Include

[hibernatetool] 17:54:49,147 INFO template:88 — Loaded System Directive: org.apache.velocity.runtime.directive.Foreach

[hibernatetool] 17:54:49,351 INFO template:88 — Created: 20 parsers.

[hibernatetool] 17:54:49,351 INFO template:88 — Velocimacro : initialization starting.

[hibernatetool] 17:54:49,351 INFO template:88 — Velocimacro : allowInline = true : VMs can be defined inline in templates

[hibernatetool] 17:54:49,351 INFO template:88 — Velocimacro : allowInlineToOverride = false : VMs defined inline may NOT replace previous VM definitions

[hibernatetool] 17:54:49,351 INFO template:88 — Velocimacro : allowInlineLocal = false : VMs defined inline will be global in scope if allowed.

[hibernatetool] 17:54:49,366 INFO template:88 — Velocimacro : messages on : VM system will output logging messages

[hibernatetool] 17:54:49,366 INFO template:88 — Velocimacro : autoload off : VM system will not automatically reload global library macros

[hibernatetool] 17:54:49,366 INFO template:88 — Velocimacro : initialization complete.

[hibernatetool] 17:54:49,366 INFO template:88 — Velocity successfully started.

BUILD SUCCESSFUL

===============================================

Many beginners or even intermediate Android developers fail to realize that the Android app they build and ship can be reverse engineered to a greater extent. If you are one of the developers who think hard-coding secret keys or even storing it in build.gradle file will prevent it from going into the hands of hackers or other developers, you are wrong. For this reason, the following article explains how to reverse engineer an android application in easy steps.

Security has never been easy and the very first rule is to never trust the security on the client-side. The Client-side is not an environment we control and thus we should not rely on it by hard-coding or storing secrets that can disrupt our system. So the best and to ensure you do not end up getting caught by developers and hackers is to reverse engineer the application by yourself and fix the issues if possible.

Interesting Incident — Once I was working on an Android Application which required a mathematical formula to be used in a feature. Disliking math to the core, I found it more easy and interesting to reverse engineer one of the competitor’s application, and then I took out the Math formula from the code successfully! :p

So, let’s get started.

  1. APK of the application.
  2. Some set of codes to execute.
  3. Java Decompiler Tool (JD JUI in this article) to view the decompiled code.
Basic understanding of the Android app. Source — Pranay Airan.

First Step —

We would need the APK of the application we want to reverse-engineering. There are many ways to do that but I will suggest a simple way here. Download the app Apk Extractor on your device and select the application from the list inside the application. Once done, open any File Explorer and go to the ExtractedApks folder present in the Internal Storage directory. There, you will find the APK. Copy that APK to your system and we will proceed with the below steps.

Second Step —

Once we have the APK, we will reverse it to know and see the code. That will enable us and give us insights about the structuring of the code as well as find the security measures they have taken to avoid facing a reverse engineering attack.

Here, we will rename our {app}.apk file to {app}.zip and extract it. Inside the extracted folder, we will find the classes.dex file which contains the application code.

A DEX file is an executable file that contains the compiled code and runs on the Android platform.

Now, we will use the classes.dex file we took from the APK zip file and convert it to JAR. For doing that, we can use ‘dex2jar’ open-source tool available hereHead over to the release section and download the latest available zip file and extract it. Copy the extracted classes.dex file and paste it inside the ‘dex2jar-x.x’ directory.

Open Terminal on your machine and head over to the ‘dex2jar-x.x’ directory. Now we will run the command –

d2j-dex2jar.bat classes.dex

This will convert the classes.dex file to a JAR file which we can view using any Decompiler Tool.

Third Step —

We will use JD JUI which is a simple Java Decompiler tool. You can get it from here. Download and extract the zip. Run the jd-gui.exe and open the dex file and Voila! We reverse-engineered an android application!!

Decompiled Android App Source Code

Conclusion —

Thus if you see, by following these simple steps which takes less than 5 minutes, we can Reverse Engineer An Android Application and understand how it works. This will help you understand how to prevent hackers from stealing your secrets and how you can better product your code from being exploited.

Useful Links –

  1. If you respect your users and want to have File-Storage related features in your app without asking for Storage Permissions, read the article here on how to implement it.


Post Views:
9,880

Waleed Alhajri
13/02/2021

Introduction
This blog will explain how to perform reverse engineering on an android application and how to restore the source code for the application. This method will eventually help us to conduct better penetration testing on the mobile application.

What is Reverse Engineering?
It is a way to take the application apart to restore its first form, which will help us understand its components and how the application is working.
There are two methods to take an Android application apart:

Decompile
This method will restore the application to a replica of the source code, and we will be able to understand its components and how it works, but it will be hard to re-compile it again.

Disassemble
Using this method, we will take the application apart to some extent with the ability to edit its behavior and re-build it again, but all this will be in Smali instruction (hard to read).

How to Build an Android Application
Below I will explain how to transfer the source code of an Android application to a working APK installed inside an Android phone. There is more to this process, but I will focus on the parts that the developer wrote for simplicity.

⦁ The source code is written in Java will be compiled to become Java Bytecode, and its extensions will be changed from .java to .class

⦁ Then the Java Bytecode will become Dalvik Bytecode using the Dex compiler. Keep in mind that a single .dex file can only hold 65536 methods, including the Android framework, third-party library, and functions that the developer has written.

⦁ In the end, all of the above will be compress with the resources files and other files to make an APK.
The below picture describes the above steps:

Android Application Contents
Android application is a compressed file that can be unzipped to reveal its files by typing the following command

unzip <android applicaion>

Android Files
Below are the files you should expect when you decompress an APK file
AndroidManifest.xml: here are everything about the application like
⦁ Package name
⦁ Target and minimum API level
⦁ App configuration
⦁ App components
⦁ Permissions

META-INF: contain metadata about the application
⦁ classes.dex: this file contains the compiled source code
⦁ assets: a folder containing the following
⦁ Pictures
⦁ Fonts
⦁ Videos files

Lib: include the native library that the application uses

Res: this is the resources folder, and you can find in it stuff like
⦁ Shapes
⦁ Colors
⦁ Pictures

UnCrackable Challenge
Trying to solve this challenge from OWASP_MSTG, we will try one of the methods of reverse engineering. Let start by downloading the APK from their page.

After downloading the application, we need to install it on an Android phone preferred to be rooted.

adb install UnCrackable-Level1.apk

adb: a tool that enables us to control an Android phone through the command-line

Now we need to run the application.

At first, we can see that the application is implementing root detection, and we only have the option of clicking the «OK» button, which will close the application. Let see how is this feature is implemented using Jadx to decompile the application

jadx-gui UnCrackable-Level1.apk

Jadx: a tool that decompiles the application, restoring it to its first form (Source Code)

At first, we need to identify the starting point of the application by going to the AndroidManifest.xml file, and then we need to find the Activity which has the following line android.intent.action.MAIN Inside it as this is the starting point

From the value of the android:name, we can find the right activity

In the life cycle of the activity, the first method that should be started is the onCreate method, and inside this method, there is an if statement that checks three things. If any of it is true we will see the alert dialog that will force us to exit the application.
If we trace these three methods by doing the following

In an abstract way we can say that these three functions check for tools and methods used in getting root access on an Android phone if any of these returns true value, we will get the alert dialog

Now back to the MainActivity if any of these methods return true a method called (a) will be executed and looking to the red box we can see that the application will not close unless the «OK» button was clicked and also we can’t cancel the dialog cause the value of the method on line 25 is set to false, but if somehow we were able to change this value we can bypass this restriction

To change any value at runtime first we need make the application debuggable. To make an application debuggable first we need to disassemble the application

apktool d UnCrackable-Level1.apk -o base

apktool: a tool that helps us in the process of disassembling an application and also rebuild it.
d: disassemble
o: write the output inside a folder

Now inside the AndroidManifest.xml we have to add the following
android:debuggable=true

Now we have to rebuild the application like this

apktool b base/ -o base.apk

b: reassemble
o: name the output APK

Now before installing the application on an Android phone, we need to create a signing key since Android will only install an application that its developer has signed

keytool -genkey -v -keystore WH_keys.keystore -alias WH -keyalg RSA -keysize 2048 -validity 10000

keytool: a tool to generate a keys that could be used for signing
genkey: generate a key
v: verbose
keystore: key name
alias: alias name
keyalg: algorithm to use
keysize: key size
validity: validity time
We then need to enter the key information

Now we will use the key to sign the application

jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore WH_keys.keystore base.apk Wh

jarsigner: use the previously generated key to sign the application
verbose: for more verbosity
sigalg: wanted algorithm
digestalg: wanted hashing method
keystore: name and location of the keystore generated previously
base.apk: name of the application to sign
Wh: key nickname

Lastly, we need to align the application by using the following tool

zipalign -v 4 base.apk debuggable-crackme.apk

v: verbose
4: switch to do 32-bit alignment

Now we need to install the modified application

After the application start, we will see that the application has detected our changes by displaying the following alert dialog

Also, while the application is running, we can check if the application is debuggable by doing the following

Jdwp: will list all debuggable processes
now we can check application running on this process

Frida: tool used for dynamic analysis, I explained how to installed it and use it in this article

Now we need to run the application on debug mode

adb shell am start -D "owasp.mstg.uncrackable1/sg.vantagepoint.uncrackable1.MainActivity"

Looking on the phone we can see that the phone is waiting for the debugger to attach to it

First thing we need the application process number

after this we need to pull the process to a local port on our machine, I chose this port 1234

adb forward tcp:1234 jdwp:11561

forward: forward our traffic from the local port to the internal process
tcp: local port on your local machine (you need to make sure that the port is not used)
jdwp: the application process number
now we need to just connect the debugger using JDB to the application, but we need to give it suspend which is one of the JDB option to stop the application at the moment of connection

(echo suspend && cat) | jdb -connect com.sun.jdi.SocketAttach:hostname=127.0.0.1,port=1234

The goal from all this is to change the value of setCancelable from false to true so we can ignore the dialog. But first, we need to know the classpath so we can set a breakpoint on it, we can see by tracing the method using Jadx like the below picture that the method setCancelable is called from the following class android.app.AlertDialog

But if we try to put a breakpoint on it, it will say that the method is not found

And if we look at the Android documentation, we will see that the class AlertDialog is inheriting it method from a class called Dialog

And it contains the method setCancelable

So instead of writing this

stop in android.app.AlertDialog.setCancelable

we can write the following

stop in android.app.Dialog.setCancelable

Now the debugger has identified the method, now we can write resume until we hit the breakpoint

Now we need to type locals and replace the the value of the flag from false to true then we type resume

We continue this cycle until the alert dialog appears on the phone

Now we only have to press the dimmed place on the screen and the alert dialog will disappear

This way we were able to bypass the security control placed on the application, the next step we need to know the secret text stored inside the application. But first, we need to remove previous breakpoints so we don’t stop on them

Now if we went back to the source code, we can see that the entered text is being given to a function called a.a and if it returns true it will print a success message. Let see how this function is validating the input

Inside the class «a» there is a method «a» which we at the end compare two values of the stored text with what we entered in the input field and the comparison is happing on the last line of this method

To intercept this comparison, we need first to put a breakpoint on the a.a method and then entered any text and press VERFIY button

After we get stopped by the place breakpoint then we need to put another breakpoint on the equals method, but how to know which classpath to type from the code below we can see that the equals is part of str which is an object of the class String

if we searched the String class in Android documentation we are going to see that the classpath for this function is java.lang.String.equals

Now since we know the classpath we can put a breakpoint like this

stop in java.lang.String.equals

Now we only need to type resume then locals until we find the secret text

Now let check if this text is the secret text by entering it into the input field, but first we need to remove all the breakpoints

This way we were able to get the code

Conclusion
In reverse engineering, there is no single method that will work every time also there is no right or wrong way. There is a lot of methods and tools and I think the best way to get hang of this field is to stick to one method or tool until you master it and then move to the next one until you get it. Also, OWASP_MSTG is a very good starting point.

Follow us

Advance your skills by reading the latest blog created by our team.

Понравилась статья? Поделить с друзьями:
  • Rex c100 ошибка 0000
  • Ricoh sp 220sfnw ошибка каретки сканера
  • Ricoh sp 220sfnw ошибка sc542 сброс ошибки
  • Rewriterule ошибка 500
  • Return to castle wolfenstein hunkusage dat ошибка