X hits on this document

307 views

0 shares

0 downloads

0 comments

49 / 120

intellectual property that is worth protecting, one can perform transformations to the

source code which make it difficult to read, but have no impact on the machine code that

would ultimately be generated when the program is compiled. To demonstrate source

code obfuscation, COBF [23], a free C/C++ source code obfuscator was configured and

given VerifyPassword.cpp as input; the results of which are displayed in Table 7.5.

Table 7.5. COBF obfuscation results for VerifyPassword.cpp.

COBF invocation:

01: C:\cobf_1.06\src\win32\release\cobf.exe 02: @C:\cobf_1.06\src\setup_cpp_tokens.inv -o cobfoutput -b -p C: 03: \cobf_1.06\etc\pp_eng_msvc.bat VerifyPassword.cpp

COBF obfuscated source for VerifyPassword.cpp:

01: 02: 03: 04: 05: 06: 07: 08:

#include"cobf.h" ls lp lk;lf lo(lf ln,ld*lj[]){ll ld*lc="\x6a\x75\x70\x21\x74 \x65\x72";lh la;lb<<"\x45\x6e\x74\x65\x72\x20\x70\x61\x73\x73 \x77\x6f\x72\x64""\x3a\x20";li(lq,la);lm(la.lg(lc)==0){lb<<"\x5b \x4f\x4b\x5d\x20\x41" "\x63\x63\x65\x73\x73\x20\x67\x72\x61\x6e \x74\x65\x64\x2e"<<le;}lr{lb<<"\x5b\x45\x72\x72\x6f\x72\x5d \x20\x41\x63\x63\x65\x73\x73\x20\x64" "\x65\x6e\x69\x65 \x64\x2e"<<le;}}

09:

#define

lb cout

10:

#define

li getline

11:

#define

lq cin

12:

#define

lm if

13:

#define

lg compare

14:

#define le endl

01: #define

ls

using

02: #define

lp

namespace

03: #define

lk

std

04: #define

lf

int

05: #define

lo

main

06: #define

ld

char

07: #define

ll

const

08: #define

lh string

COBF generated

header (cobf.h):

15: #define lr else

COBF replaces all user-defined method and variables in the immediate source file

with meaningless identifiers. In addition, COBF replaces standard language keywords

and library calls with meaningless identifiers, however these replacements must be

undone before compilation; for example, the keyword “if” cannot be left as “lm”.

41

Document info
Document views307
Page views308
Page last viewedSat Dec 03 13:01:42 UTC 2016
Pages120
Paragraphs2913
Words25794

Comments