java/src/org/openantivirus/engine/vfs/container/ucl CStructure.java,1.3,1.4 PackHeader.java,1.1,1.2 PEHeader.java,1.2,1.3 UPXDecompress.java,1.1,1.2
Kurt Huwig <[email protected]> Sat, 03 Sep 2005 16:16:42 +0000
| Newsgroups | gmane.comp.security.virus.openantivirus.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/openantivirus/java/src/org/openantivirus/engine/vfs/container/ucl
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28211/src/org/openantivirus/engine/vfs/container/ucl
Modified Files:
CStructure.java PackHeader.java PEHeader.java
UPXDecompress.java
Log Message:
Code cleanup
Index: CStructure.java
===================================================================
RCS file: /cvsroot/openantivirus/java/src/org/openantivirus/engine/vfs/container/ucl/CStructure.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- CStructure.java 18 May 2004 09:03:28 -0000 1.3
+++ CStructure.java 3 Sep 2005 16:16:40 -0000 1.4
@@ -77,12 +77,12 @@
}
public static long getLE32(byte[] data, int index) {
- return ((long) getLE16(data, index)
+ return (getLE16(data, index)
+ (((long) getLE16(data, index + 2)) << 16));
}
public static long getBE32(byte[] data, int index) {
- return ((long) getBE16(data, index + 2)
+ return (getBE16(data, index + 2)
+ (((long) getBE16(data, index)) << 16));
}
}
Index: UPXDecompress.java
===================================================================
RCS file: /cvsroot/openantivirus/java/src/org/openantivirus/engine/vfs/container/ucl/UPXDecompress.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- UPXDecompress.java 14 Dec 2003 11:08:26 -0000 1.1
+++ UPXDecompress.java 3 Sep 2005 16:16:40 -0000 1.2
@@ -51,7 +51,7 @@
private static final String UPX_SECTION_NAME = "UPX";
private static final int MAX_VERSION = 12;
- private static final int
+ public static final int
M_NRV2B_LE32 = 2,
M_NRV2B_8 = 3,
M_NRV2B_LE16 = 4,
@@ -59,7 +59,7 @@
M_NRV2D_8 = 6,
M_NRV2D_LE16 = 7;
- private boolean isRTM;
+ private boolean rtm;
private long pe_offset;
private PEHeader ih;
private PESection[] isection;
@@ -164,7 +164,7 @@
final byte[] aStub = new byte[sStub.length()];
raf.seek(0x200);
raf.readFully(aStub);
- isRTM = sStub.equals(new String(aStub));
+ rtm = sStub.equals(new String(aStub));
return true;
}
@@ -231,21 +231,25 @@
private long bitBuffer;
private int bitCount;
- protected int getbit() throws IOException {
+ protected int getbit() {
if (bitCount > 0) {
bitCount--;
return (int) ((bitBuffer >> bitCount) & 1);
- } else {
- bitCount = 31;
- bitBuffer = CStructure.getByte(src, ilen++)
- + (CStructure.getByte(src, ilen++) << 8)
- + (CStructure.getByte(src, ilen++) << 16)
- + (CStructure.getByte(src, ilen++) << 24);
- return (int) ((bitBuffer >> 31) & 1);
}
+
+ bitCount = 31;
+ bitBuffer = CStructure.getByte(src, ilen++)
+ + (CStructure.getByte(src, ilen++) << 8)
+ + (CStructure.getByte(src, ilen++) << 16)
+ + (CStructure.getByte(src, ilen++) << 24);
+ return (int) ((bitBuffer >> 31) & 1);
}
public void close() throws IOException {
raf.close();
}
+
+ public boolean isRtm() {
+ return rtm;
+ }
}
Index: PackHeader.java
===================================================================
RCS file: /cvsroot/openantivirus/java/src/org/openantivirus/engine/vfs/container/ucl/PackHeader.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- PackHeader.java 14 Dec 2003 11:08:26 -0000 1.1
+++ PackHeader.java 3 Sep 2005 16:16:40 -0000 1.2
@@ -212,4 +212,24 @@
}
return -1;
}
+
+ public long getC_adler() {
+ return c_adler;
+ }
+
+ public int getFilter() {
+ return filter;
+ }
+
+ public int getFilter_cto() {
+ return filter_cto;
+ }
+
+ public long getU_adler() {
+ return u_adler;
+ }
+
+ public int getU_file_size() {
+ return u_file_size;
+ }
}
Index: PEHeader.java
===================================================================
RCS file: /cvsroot/openantivirus/java/src/org/openantivirus/engine/vfs/container/ucl/PEHeader.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- PEHeader.java 1 May 2004 14:36:10 -0000 1.2
+++ PEHeader.java 3 Sep 2005 16:16:40 -0000 1.3
@@ -43,7 +43,7 @@
ENTRY = 40,
DDIRS_START = 120,
DDIRS_LENGTH = 8,
- DDIRS_VADDR = 0,
+// DDIRS_VADDR = 0,
DDIRS_SIZE = 4;
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf