[VB6] Icon Changer - Proxy-Base Community - Анонимность и безопасность в интернете.
Бесплатные прокси. Количество:
Прокси для пользователей форума (API). Количество:
Купить доступ к прокси-листам (API). Количество:
 



Информация по хайдам / репутации

(РЕКОМЕНДУЮ) №1 >>>DDos Атака<<|>>DDoS Service<<< ДДОС СЕРВИС<<|>>Заказать DDOS
Бесплатные прокси уже в Telegram
Все инфопродукты и приватная информация бесплатно
Старый 25.06.2011, 17:03   #1 (permalink)
VPN
 
Аватар для C00LPack
 
Регистрация: 11.01.2011
Сообщений: 324
Member ID: 11190
ICQ 364867

Репутация: 844
Репутация: 844
Сказал(а) спасибо: 166
Поблагодарили 548 раз(а) в 280 сообщениях
Топикстартер (автор темы) По умолчанию [VB6] Icon Changer

код сменьщика иконок у PE файлов на барсике

Код:
Option Explicit

Private Const OPEN_EXISTING             As Long = &H3
Private Const INVALID_HANDLE_VALUE      As Long = -1
Private Const GENERIC_READ              As Long = &H80000000
Private Const FILE_ATTRIBUTE_NORMAL     As Long = &H80
Private Const FILE_BEGIN                As Long = &H0
Private Const RT_ICON                   As Long = &H3
Private Const RT_GROUP_ICON             As Long = &HE

Private Type ICONDIRENTRY
    bWidth          As Byte
    bHeight         As Byte
    bColorCount     As Byte
    bReserved       As Byte
    wPlanes         As Integer
    wBitCount       As Integer
    dwBytesInRes    As Long
    dwImageOffset   As Long
End Type
 
Private Type ICONDIR
    idReserved      As Integer
    idType          As Integer
    idCount         As Integer
End Type
 
Private Type GRPICONDIRENTRY
    bWidth          As Byte
    bHeight         As Byte
    bColorCount     As Byte
    bReserved       As Byte
    wPlanes         As Integer
    wBitCount       As Integer
    dwBytesInRes    As Long
    nID             As Integer
End Type
 
Private Type GRPICONDIR
    idReserved      As Integer
    idType          As Integer
    idCount         As Integer
    idEntries()     As GRPICONDIRENTRY
End Type

Private Declare Function CreateFile Lib "kernel32.dll" Alias "CreateFileA" (ByVal lpFileName As String, ByVal dwDesiredAccess As Long, ByVal dwShareMode As Long, lpSecurityAttributes As Any, ByVal dwCreationDisposition As Long, ByVal dwFlagsAndAttributes As Long, ByVal hTemplateFile As Long) As Long
Private Declare Function ReadFile Lib "kernel32.dll" (ByVal lFile As Long, lpBuffer As Any, ByVal nNumberOfBytesToRead As Long, lpNumberOfBytesRead As Long, lpOverlapped As Any) As Long
Private Declare Function SetFilePointer Lib "kernel32.dll" (ByVal lFile As Long, ByVal lDistanceToMove As Long, lpDistanceToMoveHigh As Long, ByVal dwMoveMethod As Long) As Long
Private Declare Function CloseHandle Lib "kernel32.dll" (ByVal hObject As Long) As Long
Private Declare Function BeginUpdateResource Lib "kernel32.dll" Alias "BeginUpdateResourceA" (ByVal pFileName As String, ByVal bDeleteExistingResources As Long) As Long
Private Declare Function UpdateResource Lib "kernel32.dll" Alias "UpdateResourceA" (ByVal lUpdate As Long, ByVal lpType As Long, ByVal lpName As Long, ByVal wLanguage As Long, lpData As Any, ByVal cbData As Long) As Long
Private Declare Function EndUpdateResource Lib "kernel32.dll" Alias "EndUpdateResourceA" (ByVal lUpdate As Long, ByVal fDiscard As Long) As Long
Private Declare Sub CopyMemory Lib "kernel32.dll" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long)

Public Function ChangeIcon(ByVal strExePath As String, ByVal strIcoPath As String) As Boolean
    Dim lFile               As Long
    Dim lUpdate             As Long
    Dim lRet                As Long
    Dim i                   As Integer
    Dim tICONDIR            As ICONDIR
    Dim tGRPICONDIR         As GRPICONDIR
    Dim tICONDIRENTRY()     As ICONDIRENTRY
    
    Dim bIconData()         As Byte
    Dim bGroupIconData()    As Byte
    
    lFile = CreateFile(strIcoPath, GENERIC_READ, 0, ByVal 0&, OPEN_EXISTING, 0, ByVal 0&)
    
    If lFile = INVALID_HANDLE_VALUE Then
        ChangeIcon = False
        CloseHandle (lFile)
        Exit Function
    End If
    
    Call ReadFile(lFile, tICONDIR, Len(tICONDIR), lRet, ByVal 0&)
    
    ReDim tICONDIRENTRY(tICONDIR.idCount - 1)
    
    For i = 0 To tICONDIR.idCount - 1
        Call ReadFile(lFile, tICONDIRENTRY(i), Len(tICONDIRENTRY(i)), lRet, ByVal 0&)
    Next i
    
    ReDim tGRPICONDIR.idEntries(tICONDIR.idCount - 1)
    
    tGRPICONDIR.idReserved = tICONDIR.idReserved
    tGRPICONDIR.idType = tICONDIR.idType
    tGRPICONDIR.idCount = tICONDIR.idCount
    
    For i = 0 To tGRPICONDIR.idCount - 1
        tGRPICONDIR.idEntries(i).bWidth = tICONDIRENTRY(i).bWidth
        tGRPICONDIR.idEntries(i).bHeight = tICONDIRENTRY(i).bHeight
        tGRPICONDIR.idEntries(i).bColorCount = tICONDIRENTRY(i).bColorCount
        tGRPICONDIR.idEntries(i).bReserved = tICONDIRENTRY(i).bReserved
        tGRPICONDIR.idEntries(i).wPlanes = tICONDIRENTRY(i).wPlanes
        tGRPICONDIR.idEntries(i).wBitCount = tICONDIRENTRY(i).wBitCount
        tGRPICONDIR.idEntries(i).dwBytesInRes = tICONDIRENTRY(i).dwBytesInRes
        tGRPICONDIR.idEntries(i).nID = i + 1
    Next i
    
    lUpdate = BeginUpdateResource(strExePath, False)
    For i = 0 To tICONDIR.idCount - 1
        ReDim bIconData(tICONDIRENTRY(i).dwBytesInRes)
        SetFilePointer lFile, tICONDIRENTRY(i).dwImageOffset, ByVal 0&, FILE_BEGIN
        Call ReadFile(lFile, bIconData(0), tICONDIRENTRY(i).dwBytesInRes, lRet, ByVal 0&)
    
        If UpdateResource(lUpdate, RT_ICON, tGRPICONDIR.idEntries(i).nID, 0, bIconData(0), tICONDIRENTRY(i).dwBytesInRes) = False Then
            ChangeIcon = False
            CloseHandle (lFile)
            Exit Function
        End If
        
    Next i

    ReDim bGroupIconData(6 + 14 * tGRPICONDIR.idCount)
    CopyMemory ByVal VarPtr(bGroupIconData(0)), ByVal VarPtr(tICONDIR), 6
 
    For i = 0 To tGRPICONDIR.idCount - 1
        CopyMemory ByVal VarPtr(bGroupIconData(6 + 14 * i)), ByVal VarPtr(tGRPICONDIR.idEntries(i).bWidth), 14&
    Next
                
    If UpdateResource(lUpdate, RT_GROUP_ICON, 1, 0, ByVal VarPtr(bGroupIconData(0)), UBound(bGroupIconData)) = False Then
        ChangeIcon = False
        CloseHandle (lFile)
        Exit Function
    End If
    
    If EndUpdateResource(lUpdate, False) = False Then
        ChangeIcon = False
        CloseHandle (lFile)
    End If

    Call CloseHandle(lFile)
    ChangeIcon = True
End Function

Private Sub Command1_Click()
        ChangeIcon "C:\file.exe", "C:\icon.ico"
End Sub
C00LPack вне форума   Ответить с цитированием
4 пользователя(ей) сказали cпасибо:
Ответ

Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск
Опции просмотра

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Trackbacks are Вкл.
Pingbacks are Вкл.
Refbacks are Вкл.


Похожие темы
Тема Автор Раздел Ответов Последнее сообщение
ICQ md5-password changer hide Программы для ICQ 4 26.06.2012 16:55
Extra ICQ Password Changer NTR Программы для ICQ 10 19.03.2012 03:17
ICQ Password Changer S[T]RELOK Дополнительные утилиты 9 19.08.2011 03:43
ICQ Password Changer by DarkOff.ru .Chuck Программы для ICQ 2 03.12.2010 07:20
ICQ Mass Info Changer hide Программы для ICQ 1 17.08.2009 08:54




DDoS Protected




Мы в твиттере, Proxy-Base.Org Twitter

Proxy-Base Community - Анонимность и безопасность в интернете.
Наши партнеры: CRC Labs, SEO-Crack.Com, Garsuk.Com, SED Team, Skladchik.com, BSS Family

Powered by vBulletin® | Булка сделана в пекарне®
Copyright © 2000 - , Jelsoft Enterprises Ltd. Перевод: zCarot
Вся информация на сайте выложена исключительно в ознакомительных целях.