воскресенье, 9 августа 2015 г.

AutoLogin to website on Javascript from panel of bookmarks


AutoLogin to website from panel of bookmarks on Javascript:
Автоматическая авторизация на сайте через яваскрипт код из панели закладок.


javascript:(function(){function autosubmit(email,pass)
{var form=document.createElement('form');
var element1=document.createElement('input');
var element2=document.createElement('input');
form.method='post';form.action='http://codefeel.blogspot.ru/';
element1.value=email;element1.name='email';
form.appendChild(element1);
element2.value=pass;element2.name='pass';
form.appendChild(element2);
document.body.appendChild(form);
form.submit();}
autosubmit('email@mail.ru','passw0rD')})();




Macros for Excel on VBA for copy only values

You can see Macros for Excel on VBA for copy only values. Hidden rows will be copied too,  because here we are not control it, but You can add it in Your code by yuorself, if needed:


Sub CopyOnlyValuesCell()
On Error Resume Next
Dim str As String
Dim arrData() As Variant
Dim arrReturnData() As Variant
Dim rng As Excel.Range
Dim lRows As Long
Dim lCols As Long
Dim i As Long, j As Long
  lRows = Selection.Rows.Count
  lCols = Selection.Columns.Count
  ReDim arrData(1 To lRows, 1 To lCols)
  ReDim arrReturnData(1 To lRows, 1 To lCols)
  Set rng = Selection
  arrData = rng.Value
 
 If Selection.Count = 1 Then
  str = ActiveCell.Value
 Else
  For i = 1 To lRows
    For j = 1 To lCols
        If j > 1 Then
         str = str & Chr(9) & (arrData(i, j))
        Else
         str = str & arrData(i, j)
        End If
    Next j
    If i > 0 Then str = str & Chr(13) & Chr(10)
  Next i
 End If
    CopyTextToClipboard (str)
  Set rng = Nothing
End Sub

CopyTextToClipboard is our function. We can do it so:



Sub CopyTextToClipboard(ByVal inText As String)
  Dim objClipboard As Object
  Set objClipboard = CreateObject("new:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}")

  objClipboard.SetText inText
  objClipboard.PutInClipboard

  Set objClipboard = Nothing
End Sub
 
 
 
Function GetTextFromClipboard() As String
  Dim objClipboard As Object
  Set objClipboard = CreateObject("new:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}")

  objClipboard.GetFromClipboard
  GetTextFromClipboard = objClipboard.GetText

  Set objClipboard = Nothing
End Function


Crack the password in Excel and uprotect modules

For  2003 XLS file, using Excel 2007 and may be 2010


  1. Backup the xls file
  2. Using a HEX editor, locate the DPB=... part
  3. Change the DPB=... string to DPx=...
  4. Open the xls file in Excel
  5. Open the VBA editor (ALT+F11)
  6. Excel discovers an invalid key (DPx) and asks whether you want to continue loading the project (basically ignoring the protection)
  7. You will be able to overwrite the password, so change it to something you can remember
  8. Save the xls file*
  9. Close and reopen the document.


If you are using a .xls You can open:

  1. Create a new simple excel file.
  2. In the VBA part, set a simple password (say - 1234).
  3. Save the file and exit. Then check the file size - see Stewbob's gotcha
  4. Open the file you just created with a hex editor.
  5. Copy the lines starting with the following keys:


  6. CMG=....
    DPB=...
    GC=...
    FIRST BACKUP the excel file you don't know the VBA password for, then open it with your hex editor, and paste the above copied lines from the dummy file.


  7. Save the excel file and exit.
  8. Now, open the excel file you need to see the VBA code in. The password for the VBA code will simply be 1234 (as in the example I'm showing here).

VBA method:


`code credited to Siwtom (nick name), a vietnamese develope
Option Explicit
Private Const PAGE_EXECUTE_READWRITE = &H40
Private Declare Sub MoveMemory Lib "kernel32" Alias "RtlMoveMemory" _
        (Destination As Long, Source As Long, ByVal Length As Long)
Private Declare Function VirtualProtect Lib "kernel32" (lpAddress As Long, _
        ByVal dwSize As Long, ByVal flNewProtect As Long, lpflOldProtect As Long) As Long
Private Declare Function GetModuleHandleA Lib "kernel32" (ByVal lpModuleName As String) As Long
Private Declare Function GetProcAddress Lib "kernel32" (ByVal hModule As Long, _
        ByVal lpProcName As String) As Long
Private Declare Function DialogBoxParam Lib "user32" Alias "DialogBoxParamA" (ByVal hInstance As Long, _
        ByVal pTemplateName As Long, ByVal hWndParent As Long, _
        ByVal lpDialogFunc As Long, ByVal dwInitParam As Long) As Integer
Dim HookBytes(0 To 5) As Byte
Dim OriginBytes(0 To 5) As Byte
Dim pFunc As Long
Dim Flag As Boolean
Private Function GetPtr(ByVal Value As Long) As Long
    GetPtr = Value
End Function
Public Sub RecoverBytes()
    If Flag Then MoveMemory ByVal pFunc, ByVal VarPtr(OriginBytes(0)), 6
End Sub
Public Function Hook() As Boolean
    Dim TmpBytes(0 To 5) As Byte
    Dim p As Long
    Dim OriginProtect As Long
    Hook = False
    pFunc = GetProcAddress(GetModuleHandleA("user32.dll"), "DialogBoxParamA")

    If VirtualProtect(ByVal pFunc, 6, PAGE_EXECUTE_READWRITE, OriginProtect) <> 0 Then
        MoveMemory ByVal VarPtr(TmpBytes(0)), ByVal pFunc, 6
        If TmpBytes(0) <> &H68 Then
            MoveMemory ByVal VarPtr(OriginBytes(0)), ByVal pFunc, 6
            p = GetPtr(AddressOf MyDialogBoxParam)
            HookBytes(0) = &H68
            MoveMemory ByVal VarPtr(HookBytes(1)), ByVal VarPtr(p), 4
            HookBytes(5) = &HC3
            MoveMemory ByVal pFunc, ByVal VarPtr(HookBytes(0)), 6
            Flag = True
            Hook = True
        End If
    End If
End Function
Private Function MyDialogBoxParam(ByVal hInstance As Long, _
        ByVal pTemplateName As Long, ByVal hWndParent As Long, _
        ByVal lpDialogFunc As Long, ByVal dwInitParam As Long) As Integer
    If pTemplateName = 4070 Then
        MyDialogBoxParam = 1
    Else
        RecoverBytes
        MyDialogBoxParam = DialogBoxParam(hInstance, pTemplateName, _
                           hWndParent, lpDialogFunc, dwInitParam)
        Hook
    End If
End Function


And call it:

Sub unprotected()
    If Hook Then
        MsgBox "VBA Project is unprotected!", vbInformation, "*****"
    End If
End Sub



For Unprotect worksheet in Excel:


Sub PasswordRemove()
Dim i As Integer, j As Integer, k As Integer
Dim l As Integer, m As Integer, n As Integer
Dim i1 As Integer, i2 As Integer, i3 As Integer
Dim i4 As Integer, i5 As Integer, i6 As Integer
On Error Resume Next
For i = 65 To 66: For j = 65 To 66: For k = 65 To 66
For l = 65 To 66: For m = 65 To 66: For i1 = 65 To 66
For i2 = 65 To 66: For i3 = 65 To 66: For i4 = 65 To 66
For i5 = 65 To 66: For i6 = 65 To 66: For n = 32 To 126
ActiveSheet.Unprotect Chr(i) & Chr(j) & Chr(k) & Chr(l) & Chr(m) & Chr(i1) & Chr(i2) & Chr(i3) & Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)
If ActiveSheet.ProtectContents = False Then
MsgBox "«Password» removed " & (i) & (j) & (k) & (l) & (m) & (i1) & (i2) & (i3) & (i4) & (i5) & (i6) & (n)
ActiveWorkbook.Sheets(1).Select
' Range("da1").FormulaR1C1 = Chr(i) & Chr(j) & Chr(k) & Chr(l) & Chr(m) & Chr(i1) & Chr(i2) & Chr(i3) & Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)
Exit Sub
End If
Next: Next: Next: Next: Next: Next
Next: Next: Next: Next: Next: Next
End Sub


Постоянные читатели

Популярные сообщения