<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=gb2312" http-equiv=Content-Type>
<META content="MSHTML 5.00.3819.300" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face="Times New Roman" size=2>Hi,</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face="Times New Roman" size=2>Is there a way to modify the string
such as char a or char b? Could I use the way like "Replace an instruction
with another Value" in Programm Manual? In fact, what I am interested in is
string with visible expression, not all string, and I am trying to hide the
orignal string by using simple way like XOR.. </FONT></DIV>
<DIV> </DIV>
<DIV><FONT face="Times New Roman" size=2>Is there a way to reorder the basic
blocks? </FONT></DIV>
<DIV> </DIV>
<DIV><FONT face="Times New Roman" size=2>Thanks.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face="Times New Roman" size=2>Qiuyu</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face="Times New Roman" size=2>C Source code:</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face="Times New Roman" size=2>#include <stdio.h><BR>#include
<stdlib.h></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face="Times New Roman" size=2>char a[20]="global string
test\n";</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face="Times New Roman" size=2>int main( int argc , char
*argv[]){</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face="Times New Roman" size=2> char b[20]= "Internal string
test";</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face="Times New Roman" size=2> printf("Global %s
\n",a);<BR> printf("Internal %s\n",b);</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face="Times New Roman" size=2>}<BR></FONT></DIV>
<DIV><FONT face="Times New Roman" size=2></FONT> </DIV>
<DIV><FONT face="Times New Roman" size=2>IR code :</FONT></DIV>
<DIV><FONT face="Times New Roman" size=2></FONT> </DIV>
<DIV><FONT face="Times New Roman" size=2>target endian = little<BR>target
pointersize = 32<BR> %struct..TorRec = type { int, void ()*
}<BR> %struct.TorRec = type { int, void ()* }<BR>%a = internal global [20 x
sbyte] c"global string test\0A\00" ; <[20 x sbyte]*>
[#uses=1]<BR>%.ctor_1 = internal global [20 x sbyte] c"Internal string
test" ; <[20 x sbyte]*> [#uses=1]<BR>%.str_1 = internal
constant [12 x sbyte] c"Global %s \0A\00" ; <[12 x sbyte]*>
[#uses=1]<BR>%.str_2 = internal constant [13 x sbyte] c"Internal
%s\0A\00" ; <[13 x sbyte]*> [#uses=1]<BR>%Initialized.0__ =
internal global bool false ; <bool*> [#uses=2]</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face="Times New Roman" size=2>implementation ;
Functions:</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face="Times New Roman" size=2>declare int %printf(sbyte*,
...)</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face="Times New Roman" size=2>int %main(int %argc, sbyte** %argv)
{<BR>entry:<BR> %b = alloca [20 x sbyte] ; <[20 x sbyte]*>
[#uses=1]<BR> %tmp.1.i = load bool* %Initialized.0__ ;
<bool> [#uses=1]<BR> br bool %tmp.1.i, label %__main.entry, label
%endif.0.i</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face="Times New Roman" size=2>endif.0.i: ; preds =
%entry<BR> store bool true, bool* %Initialized.0__<BR> br label
%__main.entry</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face="Times New Roman" size=2>__main.entry: ; preds =
%entry, %endif.0.i<BR> %tmp.0 = getelementptr [20 x sbyte]* %b, uint 0,
uint 0 ; <sbyte*> [#uses=2]<BR> call void %llvm.memcpy(
sbyte* %tmp.0, sbyte* getelementptr ([20 x sbyte]* %.ctor_1, long 0, long
0), uint 20, uint 1 )<BR> %tmp.3 = call int (sbyte*, ...)* %printf( sbyte*
getelementptr ([12 x sbyte]* %.str_1, long 0, long 0), sbyte*
getelementptr ([20 x sbyte]* %a, long 0, long 0) ) ;
<int> [#uses=0]<BR> %tmp.6 = call int (sbyte*, ...)* %printf( sbyte*
getelementptr ([13 x sbyte]* %.str_2, long 0, long 0), sbyte* %tmp.0
) ; <int> [#uses=0]<BR> ret int 0<BR>}</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face="Times New Roman" size=2>declare void %llvm.memcpy(sbyte*,
sbyte*, uint, uint)<BR></DIV></FONT></BODY></HTML>