Arama butonu
Bu konudaki kullanıcılar: 1 misafir
1
Cevap
763
Tıklama
0
Öne Çıkarma
Arkadaşlar takıldım VB6dan VB.Net e Çeviri
M
5 yıl
Yüzbaşı
Konu Sahibi

Çeviren olursa teşekkürler

Function writeMailSlot(MailSlotName As String) As Long
Dim KO_MSLOT As Long, pHook As String, p() As Byte, ph() As Byte, CF As Long, WF As Long, CH As Long
KO_MSLOT = VirtualAllocEx(KO_HANDLE, 0, 1024, MEM_COMMIT, PAGE_READWRITE)
If KO_MSLOT <= 0 Then Exit Function: MsgBox "memory could not be opened!", vbCritical
CF = GetProcAddress(GetModuleHandle("kernel32.dll"), "CreateFileA")
WF = GetProcAddress(GetModuleHandle("kernel32.dll"), "WriteFile")
CH = GetProcAddress(GetModuleHandle("kernel32.dll"), "CloseHandle")
Debug.Print Hex(KO_MSLOT)
ConvHEX2ByteArray StringToHex(MailSlotName), p
WriteByteArray KO_MSLOT + &H400, p, UBound(p) - LBound(p) + 1
pHook = "558BEC83C4F433C08945FC33D28955F86A0068800000006A036A006A01680000004068" & AlignDWORD(KO_MSLOT + &H400) & "E8" & AlignDWORD(getCallDiff(KO_MSLOT + &H27, CF)) & "8945F86A008D4DFC51FF750CFF7508FF75F8E8" & AlignDWORD(getCallDiff(KO_MSLOT + &H3E, WF)) & "8945F4FF75F8E8" & AlignDWORD(getCallDiff(KO_MSLOT + &H49, CH)) & "8BE55DC3" '&H49
ConvHEX2ByteArray pHook, ph
WriteByteArray KO_MSLOT, ph, UBound(ph) - LBound(ph) + 1
writeMailSlot = KO_MSLOT
End Function


Sub recvHook(MailSlotName As String, RecvFunction As Long, RecvBase As Long)
Dim KO_MSLOT As Long, KO_RCVHK As Long, pHook As String, ph() As Byte
KO_MSLOT = writeMailSlot(MailSlotName)
If KO_MSLOT <= 0 Then Exit Sub: MsgBox "memory could not be opened!", vbCritical
KO_RCVHK = VirtualAllocEx(KO_HANDLE, 0, 1024, MEM_COMMIT, PAGE_READWRITE)
If KO_RCVHK <= 0 Then Exit Sub: MsgBox "memory could not be opened!", vbCritical

pHook = "558BEC83C4F8538B450883C0048B108955FC8B4D0883C1088B018945F8FF75FCFF75F8E8" & AlignDWORD(getCallDiff(KO_RCVHK + &H23, KO_MSLOT)) & "83C4088B0D" & AlignDWORD(KO_PTR_DLG - &H14) & "FF750CFF7508B8" & AlignDWORD(RecvFunction) & "FFD05B59595DC20800"
ConvHEX2ByteArray pHook, ph
WriteByteArray KO_RCVHK, ph, UBound(ph) - LBound(ph) + 1

pHook = AlignDWORD(KO_RCVHK)
ConvHEX2ByteArray pHook, ph
WriteByteArray RecvBase, ph, UBound(ph) - LBound(ph) + 1
End Sub


Public Sub FindHook(MailSlotName As String)
Dim KO_RECVHK As Long, KO_RCVHKB As Long
KO_RECVHK = ReadLong(ReadLong(KO_PTR_DLG - &H14)) + &H8
KO_RCVHKB = ReadLong(KO_RECVHK)
Debug.Print Hex(KO_RECVHK) & "//" & Hex(KO_RCVHKB)
recvHook MailSlotName, KO_RCVHKB, KO_RECVHK
End Sub





< Bu mesaj bu kişi tarafından değiştirildi Madara Uchiha -- 6 Ocak 2019; 20:34:57 >

M
5 yıl
Yüzbaşı
Konu Sahibi

Private Function ReadMessage1(Handle As Long, MailMessage As String, MessagesLeft As Long) 
Dim lBytesRead As Long, lNextMsgSize As Long, lpBuffer As String
ReadMessage1 = False
Call GetMailslotInfo(Handle, ByVal 0&, lNextMsgSize, MessagesLeft, ByVal 0&)
If MessagesLeft > 0 And lNextMsgSize <> MAILSLOT_NO_MESSAGE Then
lBytesRead = 0
lpBuffer = String$(lNextMsgSize, Chr$(0))
Call ReadFile(Handle, ByVal lpBuffer, Len(lpBuffer), lBytesRead, ByVal 0&)
If lBytesRead <> 0 Then
MailMessage = Left(lpBuffer, lBytesRead)
ReadMessage1 = True
Call GetMailslotInfo(Handle, ByVal 0&, lNextMsgSize, MessagesLeft, ByVal 0&)
End If
End If
End Function



DH Mobil uygulaması ile devam edin. Mobil tarayıcınız ile mümkün olanların yanı sıra, birçok yeni ve faydalı özelliğe erişin. Gizle ve güncelleme çıkana kadar tekrar gösterme.