Skip to content

Commit da4b39b

Browse files
committed
removed dirty debung remains
1 parent ace2534 commit da4b39b

File tree

2 files changed

+1
-75
lines changed

2 files changed

+1
-75
lines changed

Makefile

+1-2
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,8 @@ LZMATDIR = ${SOURCEDIR}/lzmat
2424
OBJDIR = ./obj
2525
OUTBIN = libendetool.a
2626
DEFINEOPT = -D_GNU_SOURCE
27-
#OPTIMOPT = -O2 -fomit-frame-pointer
27+
OPTIMOPT = -O2 -fomit-frame-pointer
2828
#OPTIMOPT = -g3 -DDEBUG
29-
OPTIMOPT = -g3
3029
OPTADD =
3130
OPTARCH =
3231

src/endetool.cpp

-73
Original file line numberDiff line numberDiff line change
@@ -87,17 +87,6 @@ long long EnDeTool::encodebinary( const char* src, unsigned srcsize, char* &out
8787
if ( src == NULL )
8888
return -1;
8989

90-
#ifdef DEBUG
91-
printf( "=== encodebianry:sourcetest:begin ===\n" );
92-
printf( "srcsize = %u\n", srcsize );
93-
for( size_t x=0; x<srcsize; x++ )
94-
{
95-
printf( "%c",src[x] );
96-
}
97-
printf( "\n=== encodebianry:sourcetest:end ===\n" );
98-
fflush( stdout );
99-
#endif
100-
10190
generateiv();
10291
AES_ctx* actx = (AES_ctx*)cryptcontext;
10392
AES_init_ctx_iv( actx,
@@ -116,19 +105,11 @@ long long EnDeTool::encodebinary( const char* src, unsigned srcsize, char* &out
116105

117106
if ( doingcompress == true )
118107
{
119-
#ifdef DEBUG
120-
printf( "compressbuffer( %llu bytes );\n", encbuffsz );
121-
fflush( stdout );
122-
#endif
123108
encbuffsz = compressbuffer( encbuff, encbuffsz );
124109
if ( encbuffsz == 0 ) /// failure case.
125110
{
126111
return -3; /// decompress failure.
127112
}
128-
#ifdef DEBUG
129-
printf( "compressed %llu to %llu bytes.\n", encbuffsz, srcsize + 4 );
130-
fflush( stdout );
131-
#endif
132113
}
133114

134115
unsigned tmpCiperLen = encbuffsz;
@@ -169,18 +150,6 @@ long long EnDeTool::encodebinary( const char* src, unsigned srcsize, char* &out
169150
}
170151

171152
out = encbuff;
172-
173-
#ifdef DEBUG
174-
printf( "=== encodebianry:out:begin ===\n" );
175-
printf( "tmpCiperLen = %u\n", tmpCiperLen );
176-
for( size_t x=0; x<tmpCiperLen; x++ )
177-
{
178-
printf( "%02X",(uint8_t)out[x] );
179-
}
180-
printf( "\n=== encodebianry:out:end ===\n" );
181-
fflush( stdout );
182-
#endif /// of DEBUG
183-
184153
return (long long)tmpCiperLen;
185154
}
186155

@@ -189,17 +158,6 @@ long long EnDeTool::decodebinary( const char* src, unsigned srcsize, char* &out
189158
if ( ( src == NULL ) || ( srcsize < AES_BLOCKLEN ) )
190159
return -1;
191160

192-
#ifdef DEBUG
193-
printf( "=== decodebinary:sourcetest:begin ===\n" );
194-
printf( "srcsize = %u\n", srcsize );
195-
for( size_t x=0; x<srcsize; x++ )
196-
{
197-
printf( "%02X",(uint8_t)src[x] );
198-
}
199-
printf( "\n=== decodebinary:sourcetest:end ===\n" );
200-
fflush( stdout );
201-
#endif
202-
203161
unsigned decbuffsz = srcsize;
204162
unsigned int realsz = 0;
205163

@@ -234,23 +192,10 @@ long long EnDeTool::decodebinary( const char* src, unsigned srcsize, char* &out
234192
// checks is it compressed ..
235193
if ( memcmp( decptr, &LZMAT_COMPRESS_HEADER, 4 ) == 0 )
236194
{
237-
#ifdef DEBUG
238-
printf( "data compressed!\n" );
239-
fflush( stdout );
240-
#endif /// of DEBUG
241195
unsigned worksz = srcsize - 4;
242196

243197
// reallocate buffer for decompress buffer.
244-
#ifdef DEBUG
245-
printf( "decompressing ... " );
246-
fflush( stdout );
247-
#endif /// of DEBUG
248198
decbuffsz = decompressbuffer( decptr, worksz );
249-
#ifdef DEBUG
250-
printf( "%u bytes\n", decbuffsz );
251-
fflush( stdout );
252-
#endif /// of DEBUG
253-
254199
if ( decbuffsz < AES_BLOCKLEN )
255200
{
256201
delete[] decptr;
@@ -286,25 +231,7 @@ long long EnDeTool::decodebinary( const char* src, unsigned srcsize, char* &out
286231
if ( out != NULL )
287232
{
288233
memset( out, 0, realsz + 1 );
289-
#ifdef DEBUG
290-
printf( "#TEST#\n" );
291-
printf( "decptr = %llX ~ %llX, size = %llu\n",
292-
decptr, decptr + decbuffsz, decbuffsz );
293-
printf( "out = %llX~%llX, size = %llu\n",
294-
out, out + realsz + 1, realsz );
295-
fflush( stdout );
296-
#endif /// of DEBUG
297234
memcpy( out, &decptr[4], realsz );
298-
#ifdef DEBUG
299-
printf( "=== decodebinary:out:begin ===\n" );
300-
printf( "realsz = %u\n", realsz );
301-
for( size_t x=0; x<realsz; x++ )
302-
{
303-
printf( "%c",out[x] );
304-
}
305-
printf( "\n=== decodebinary:out:end ===\n" );
306-
fflush( stdout );
307-
#endif /// of DEBUG
308235
delete[] decptr;
309236
}
310237
else

0 commit comments

Comments
 (0)