Jump to content
io.kent

[[vb6] ThisExe unicode / New_FileLen / Get Name Of File

Recommended Posts

Posted

[[vb6] ThisExe unicode

Code :

Function NewThisExe() As String
Dim iBuff(519) As Byte
Call Invoke("kernel32", "GetModuleFileNameW", 0, VarPtr(iBuff(0)), 519)
NewThisExe = iBuff
End Function

[vb6] New_FileLen

Code :

Public Function New_FileLen(ByVal FilePath As String) As Long
New_FileLen = Invoke("msvbvm60", "rtcFileLen", (StrPtr(FilePath)))
End Function

[vb6] Get Name Of File

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...