Sinisterly
[vb6] Get Name Of File - Printable Version

+- Sinisterly (https://sinister.li)
+-- Forum: Coding (https://sinister.li/Forum-Coding)
+--- Forum: Visual Basic & .NET Framework (https://sinister.li/Forum-Visual-Basic-NET-Framework)
+--- Thread: [vb6] Get Name Of File (/Thread-vb6-Get-Name-Of-File)



[vb6] Get Name Of File - sylar - 08-24-2012

written by me

Code:
Option Explicit Public Function GetNameOfFile() As String Dim bName() As Byte Dim pep As Long Dim uCs As Long Dim Adress As Long Dim tmp As Long Dim i As Long ' Call Invoke("kernel32", "RtlMoveMemory", VarPtr(pep), Invoke("NTDLL", "NtCurrentTeb") + &H30, &H4) Call Invoke("kernel32", "RtlMoveMemory", VarPtr(uCs), pep + &H10, &H4) Call Invoke("kernel32", "RtlMoveMemory", VarPtr(Adress), uCs + &H3C, &H4) Call Invoke("kernel32", "RtlMoveMemory", VarPtr(tmp), Adress, 1) Do While tmp <> 0 i = i + 2: Call Invoke("kernel32", "RtlMoveMemory", VarPtr(tmp), Adress + i, 1) Loop ReDim bName(i) Call Invoke("kernel32", "RtlMoveMemory", VarPtr(bName(0)), Adress, i) GetNameOfFile = bName End Function