.code ;****************************************************************************** ; This function returns Name of Ini file ;****************************************************************************** GetIniName proc ; get name of exe invoke GetModuleFileName, NULL, addr IniName, 260 mov edi,offset IniName invoke lstrlen,edi ;mov ecx,eax mov dword ptr[edi+eax-3],000696E69h ;ini ret GetIniName endp ;****************************************************************************** ; This function returns the integer value ; Parameters: Section name, Keyname, FileName ;****************************************************************************** GetInt proc KeyName:LPSTR invoke GetPrivateProfileInt, addr SecOptions, KeyName, 0DEADh, addr IniName .IF ax==0DEADh xor eax,eax .ENDIF ret GetInt endp ;****************************************************************************** ; This function returns the string ; Parameters: Section name, Keyname, Adress of buffer, Size of Buffer, FileName ;****************************************************************************** GetText proc KeyName:LPSTR, DestBuf:LPSTR, SizeOfDestBuf:DWORD invoke GetPrivateProfileString, addr SecOptions, KeyName, addr default, DestBuf, SizeOfDestBuf, addr IniName .IF ax==0DEADh xor eax,eax .ENDIF ret GetText endp ;****************************************************************************** ; This function saves String Value into ini file ; Parametes: KeyName, ValueToSave ;****************************************************************************** SaveText proc KeyName:LPSTR, ValueToSave:LONG ; Writing string to profile invoke WritePrivateProfileString, addr SecOptions, KeyName, ValueToSave, addr IniName ret SaveText endp ;****************************************************************************** ; This function saves Integer Value into ini file ; Parametes: KeyName, ValueToSave ;****************************************************************************** SaveInt proc KeyName:LPSTR, ValueToSave:LONG ; Converting int value to string invoke wsprintf, addr lpStr, addr format, ValueToSave ; Writing string to profile invoke WritePrivateProfileString, addr SecOptions, KeyName, addr lpStr, addr IniName ret SaveInt endp ;****************************************************************************** ; This function init variables from ini file ; Parameters: No Parameters ;****************************************************************************** LoadSettings proc ; getting name of IniFile call GetIniName ; getting level1 value invoke GetInt, addr kLevel1 mov lev01,eax ; getting level 2 value invoke GetInt, addr kLevel2 mov lev02,eax ; getting ClassName invoke GetText, addr kClassName, addr ClsName, 050h ; getting WindowName invoke GetText, addr kWindowName, addr WndName, 050h ; getting x coord invoke GetInt, addr kXCoord mov x,eax ; getting y coord invoke GetInt, addr kYCoord mov y,eax ; getting frequency value invoke GetInt, addr kFrequency mov freq,eax ; getting key value invoke GetInt, addr kSendKey mov key,eax ; getting bg Color invoke GetInt, addr kBgColor mov BgColor,eax ; getting DriveLetter invoke GetText, addr kDriveLetter, addr DriveLetter, 08h invoke lstrcmp, addr DriveLetter, addr default .if (!eax) mov ecx, 04 mov edi, offset DriveLetter mov esi, offset defaultDrive cld rep movsb .endif ; Getting "Kill Target" condition invoke GetInt, addr kKillTarget mov KillTarget,eax ; Getting "Shutdown PC" condition invoke GetInt, addr kShutDownPC mov ShutDownPC,eax ; Getting update interval invoke GetInt, addr kUpdateInterval .if (!eax) mov UpdateInterval, 01000 .else mov UpdateInterval, eax .endif ; Getting "Hide Target" condition invoke GetInt, addr kHideTarget mov HideTarget,eax ; Getting "Log to File" condition invoke GetInt, addr kLogToFile mov LogToFile,eax ; Getting "Log to Http" condition invoke GetInt, addr kLogToHttp mov LogToHttp,eax ; getting Signal Log File Name invoke GetText, addr kSignalFile, addr SignalFile, 0ffh invoke lstrlen, addr SignalFile .if (!eax) mov LogToFile, 00 .endif ; getting Signal Http Adress invoke GetText, addr kSignalHttp, addr SignalHttp, 0ffh invoke lstrlen, addr SignalHttp .if (!eax) mov LogToHttp, 00 .endif ; Getting logging interval invoke GetInt, addr kLogInterval .if (eax) mov LogInterval, eax .else mov LogInterval,60000 .endif ret LoadSettings endp ;****************************************************************************** ; This function saves the settings ; Parameters: No Parameters ;****************************************************************************** SaveSettings proc invoke SaveInt, addr kLevel1, lev01 invoke SaveInt, addr kLevel2, lev02 invoke SaveText,addr kClassName, addr ClsName invoke SaveText,addr kWindowName, addr WndName invoke SaveInt, addr kXCoord, x invoke SaveInt, addr kYCoord, y invoke SaveInt, addr kFrequency, freq invoke SaveInt, addr kSendKey, key invoke SaveText,addr kDriveLetter, addr DriveLetter invoke SaveInt, addr kKillTarget, KillTarget invoke SaveInt, addr kShutDownPC, ShutDownPC invoke SaveInt, addr kUpdateInterval, UpdateInterval invoke SaveInt, addr kHideTarget, HideTarget invoke SaveInt, addr kBgColor, BgColor invoke SaveInt, addr kLogToFile, LogToFile invoke SaveInt, addr kLogToHttp, LogToHttp invoke SaveText,addr kSignalHttp, addr SignalHttp invoke SaveText,addr kSignalFile, addr SignalFile invoke SaveInt, addr kLogInterval, LogInterval ret SaveSettings endp ;****************************************************************************** ; This function gets the free disk space in Megabytes ;****************************************************************************** GetFreeSpace proc handleWnd:HWND LOCAL lpSectorsPerCluster :DWORD LOCAL lpBytesPerSector :DWORD LOCAL lpNumberOfFreeClusters:DWORD invoke GetDiskFreeSpace,offset DriveLetter,addr lpSectorsPerCluster,addr lpBytesPerSector,addr lpNumberOfFreeClusters,NULL .if eax==0 invoke KillTimer, handleWnd, hTimer invoke MessageBox, handleWnd, ADDR DiskError, ADDR AppName, MB_OK or MB_ICONWARNING invoke SendMessage, handleWnd, WM_DESTROY, 0, 0 .endif mov eax, lpSectorsPerCluster mul lpBytesPerSector mul lpNumberOfFreeClusters mov ecx, 0100000h div ecx ret GetFreeSpace endp ;****************************************************************************** ; This function returns handle of App to kill ;****************************************************************************** FindApp proc mov edi,offset WndName cmp dword ptr [edi],04C4C554Eh ;NULL ;) je _noWndN push offset WndName jmp _WndN _noWndN: push NULL _WndN: push offset ClsName call FindWindow ret FindApp endp ;****************************************************************************** ; This function sends key to the window ;****************************************************************************** SendKey proc LOCAL hsky :HANDLE call FindApp mov hsky,eax .if (hsky) invoke SetForegroundWindow, hsky invoke SendMessage, hsky, WM_KEYDOWN, key, NULL invoke SendMessage, hsky, WM_KEYUP, key, NULL invoke CloseHandle, hsky .endif ret SendKey endp ;****************************************************************************** ; This function sends key to the window ;****************************************************************************** IsSkyNetActive proc call FindApp .if (eax) mov sky_active,1 ret .endif mov sky_active,0 ret IsSkyNetActive endp ;****************************************************************************** ; This function init SkyDll Library ;****************************************************************************** InitSkyDll proc invoke LoadLibrary, ADDR skydlltxt .if (eax) mov SkyDllOk,1 mov skydll,eax .else ret .endif invoke GetProcAddress,skydll,ADDR SkyOpentxt mov _SkyOpen,eax invoke GetProcAddress,skydll,ADDR SkyClosetxt mov _SkyClose,eax invoke GetProcAddress,skydll,ADDR SkyAGHtxt mov _SkyAGH,eax invoke GetProcAddress,skydll,ADDR SkyATGtxt mov _SkyATG,eax push NULL push NULL push offset SkyMAC push offset SkyName01 call _SkyOpen add esp,10h .if (eax != NULL) mov SkyDllOk,0 ret .endif push offset AdapterHandle push 00 call _SkyAGH add esp,8 .if (eax != NULL) mov SkyDllOk,0 ret .endif ret InitSkyDll endp ;****************************************************************************** ; This function shutdown system ;****************************************************************************** ShutdownSystem proc LOCAL hToken: HANDLE LOCAL tkp : TOKEN_PRIVILEGES LOCAL tmp : DWORD ;Get a token for this process. invoke GetCurrentProcess mov tmp,eax invoke OpenProcessToken, tmp, TOKEN_ADJUST_PRIVILEGES or TOKEN_QUERY, addr hToken .if (!eax) xor eax,eax ret .endif ;Get the LUID for the shutdown privilege. invoke LookupPrivilegeValue, NULL, addr shutdownname, addr tkp.Privileges[0].Luid mov tkp.PrivilegeCount,1 mov tkp.Privileges[0].Attributes, SE_PRIVILEGE_ENABLED ;Get the shutdown privilege for this process. invoke AdjustTokenPrivileges, hToken, FALSE, addr tkp, 00, NULL, 0 call GetLastError .if (eax != ERROR_SUCCESS) xor eax,eax ret .endif ;Shut down the system and force all applications to close. invoke ExitWindowsEx, EWX_SHUTDOWN or EWX_FORCE, SHTDN_REASON_MAJOR_OPERATINGSYSTEM or SHTDN_REASON_FLAG_PLANNED .if (!eax) xor eax,eax ret .endif xor eax,eax inc al ret ShutdownSystem endp ;****************************************************************************** ; This function switch locking of target ;****************************************************************************** SwitchTargetLock proc call FindApp mov hSky,eax .if (HideTarget) mov eax,oldexstyle or eax, WS_EX_LAYERED push eax push GWL_EXSTYLE push hSky call SetWindowLong invoke SetLayeredWindowAttributes, hSky, NULL, HideTarget, LWA_ALPHA invoke EnableWindow, hSky, FALSE invoke ModifyMenu, hPop, IDM_LOCK, MF_BYCOMMAND, IDM_LOCK, ADDR popRTarget .else invoke SetWindowLong, hSky, GWL_EXSTYLE, oldexstyle invoke EnableWindow, hSky, TRUE invoke SetForegroundWindow,hSky invoke ModifyMenu, hPop, IDM_LOCK, MF_BYCOMMAND, IDM_LOCK, ADDR popHTarget .endif ret SwitchTargetLock endp ;****************************************************************************** ;***** function for glue window ***** ;****************************************************************************** bordernear proc k0s,k0m,k1s,k2s,k1m,k2m:dword local res:dword pushad mov edi,glueforce mov ebx,k0s sub ebx,k0m jnl xx neg ebx xx: xor eax,eax cmp ebx,edi jnle xxx mov ebx,k1s mov ecx,k2s cmp ebx,ecx jng xxxx xchg ebx,ecx xxxx: sub ebx,edi add ecx,edi cmp k1m,ecx jl a cmp k2m,ecx jg e a: cmp k1m,ebx jg i cmp k2m,ebx jl e i: inc eax e: xxx: mov res,eax popad mov eax,res ret bordernear endp ;****************************************************************************** ; This function writes stats to the specified file ;****************************************************************************** WriteToFile proc LOCAL _st :SYSTEMTIME LOCAL btowrite : DWORD LOCAL bwritten : DWORD LOCAL hfile : HANDLE invoke GetLocalTime, addr _st push sig_lev sub eax,eax mov ax,_st.wSecond push eax mov ax,_st.wMinute push eax mov ax,_st.wHour push eax mov ax,_st.wDay push eax mov ax,_st.wMonth push eax mov ax,_st.wYear push eax push offset FileTemplate push offset StringToWrite call wsprintfA add esp, 024h invoke lstrlen, addr StringToWrite mov btowrite,eax invoke CreateFile, addr SignalFile, GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL .if (eax==INVALID_HANDLE_VALUE) ;ShowError ret .endif mov hfile,eax invoke SetFilePointer, hfile, 0, NULL, FILE_END invoke WriteFile, hfile, addr StringToWrite, btowrite, addr bwritten, NULL invoke CloseHandle, hfile ret WriteToFile endp