Use Delphi to OICQ surgery (1)

zhaozj2021-02-11  185

Use Delphi to OICQ surgery (1)

http://www.tongyi.net

This article describes how to remove ads through Delphi file operations, and mask Tencent browser.

Take OICQ2000B Build 0110 as an example, carefully analyze the working principle of OICQ, it can be found that the ads in the "Send Message" window in the OICQ are saved in the AD folder in the OICQ installation directory, all of which are GIF format. When the file in the AD folder does not exist, the OICQ calls the GIF image in the DAT folder, then downloads the ad image and save it in the AD folder for an order. As for Tencent browser, you can replace it with Microsoft browser (assuming the current browser is Microsoft IE).

After understanding these, you can use Delphi's file operation to remove the advertisement and block the Tencent browser.

As shown in the figure, start Delphi, new project, place the following controls on the Form:

With regard to the advertising bar, imagine that you first read all GIF formats under the AD folder, and then replace with a transparent small GIF image while replacing the GIF file under the DAT folder. The program is implemented as follows:

Procedure TFORM1.DEL_ADCLICK (Sender: TOBJECT);

VAR

SearchRec: tsearchrec;

Slist: tstringlist;

DIR, SDIR: STRING;

I, FindResult: Integer;

Begin

Dir: = edit1.text; // OICQ installation path

Slist: = tstringlist.create; // Used to save a list of files

/ / Judgment whether the OICQ installation path is correct

IF not fileexists (edit1.text 'OICQ.exe') THEN

Begin

Application.MessageBox ('is incorrect, please re-select!',

'Please re-select', 0);

EXIT;

END;

/ / Judgment whether the end of the path string is "", don't add ""

IF Dir [Length (DIR)] <> 'Then

DIR: = DIR '';

DIR: = DIR 'AD';

/ / Find the first GIF file under this folder, the file name is saved in SearchRec,

// Return the result is saved in FindResult

FindResult: = FindFirst (Dir '* .gif', FaanyFile, SearchRec);

Try

While FindResult = 0 do // Find success

Begin

/ / Add file name in the list

Slist.add (LowerCase (Dir SearchRec.name);

/ / Continue to find the next eligible file

FindResult: = FindNext (SearchRec);

END;

转载请注明原文地址:https://www.9cbs.com/read-4168.html

New Post(0)