Skip to content
MPGHThe Dark Arts
/
RegisterLog in
Forum
Community
What's NewLatest posts across the boardTrendingHottest threads right nowSubscribedThreads you follow
Discussion
GeneralIntroductionsEntertainmentDebate FortFlaming & Rage
Board
News & AnnouncementsMPGH TimesSuggestions & HelpGiveaways
More Sections
Art & Graphic DesignProgrammingHackingCryptocurrency
Hacks & Cheats
Games
ValorantCS2 / CS:GOCall of Duty / WarzoneFortniteApex LegendsEscape From Tarkov
+14 moreLeague of LegendsGTA VMinecraftRustROTMGBattlefieldTroveBattleOnCombat ArmsCrossFireBlackshotRuneScapeDayZDead by Daylight
Resources
Game Hacking TutorialsReverse EngineeringGeneral Game HackingAnti-CheatConsole Game Hacking
Tools
Game Hacking ToolsTrainers & CheatsHack/Release NewsNew
Submit a release →Share your cheat, tool, or config with the community.
AINEW
AI Tools
General & DiscussionPrompt EngineeringLLM JailbreaksHotAI Agents & AutomationLocal / Open Models
AI × Gaming
AI Aimbots & VisionML Anti-CheatGame Bots & Automation
Create
AI Coding / Vibe CodingAI Art & MediaAI Voice & TTS
The AI frontier →Where game hacking meets modern machine learning. Jump in.
Marketplace
Buy & Sell
SellingBuyingTradingUser Services
Trust & Safety
Middleman LoungeMarketplace TalkVouch Copy Profiles
Money
Cryptocurrency TalkCurrency ExchangeWork & Job Offers
Start selling →List accounts, services, and goods. Use the middleman to trade safe.
MPGH The Dark Arts

A community for offensive security research, reverse engineering, and AI.

Community

ForumMarketplaceSearch

Account

RegisterLog in

Legal

Privacy PolicyForum RulesHelp & FAQ
© 2026 MPGH · All rights reserved.Built by the community, for the community. For educational purposes onlyContent is shared for security research and education — we don't condone illegal use. You're responsible for complying with applicable laws. Use at your own risk.
Home › Forum › Programming › Visual Basic Programming › Open Resource

Open Resource

Posts 1–9 of 9 · Page 1 of 1
ySoNoob
ySoNoob
Open Resource
I added a resource in my fb project and would like to open it but cant!!!
tried this IO.File.WriteAllBytes(filePath, My.Resources.TheResourceHere)
#1 · 13y ago
DA
DawgiiStylz
Quote Originally Posted by ySoNoob View Post
I added a resource in my fb project and would like to open it but cant!!!
tried this IO.File.WriteAllBytes(filePath, My.Resources.TheResourceHere)
I think I know the problem, but you're not telling us much.

Does the file path consist of the file name w/ extension? You have to tell it in the first parameter of the exact file location to write to.
Example: C:\Users\MPGH\Documents\TheResourceHere.dll
#2 · 13y ago
ySoNoob
ySoNoob
Quote Originally Posted by DawgiiStylz View Post

I think I know the problem, but you're not telling us much.

Does the file path consist of the file name w/ extension? You have to tell it in the first parameter of the exact file location to write to.
Example: C:\Users\MPGH\Documents\TheResourceHere.dll
mmk ill try that I just tried the folder!

---------- Post added at 07:27 PM ---------- Previous post was at 06:58 PM ----------

didn't help im trying to open a file (.exe) via Button!
#3 · 13y ago
DA
DawgiiStylz
Can't open if its in your resources

You'll have to write the file to disk and then run that file
#4 · edited 13y ago · 13y ago
Pingo
Pingo
@ySoNoob
So you have this .exe in your resource and you want to write it to your hdd and run it?
Something like
Code:
Imports System . I O
Code:
    Sub RunResource(ByVal Name As String, ByVal _Resource As Byte())
        Dim _Path As String = Application.StartupPath + If(Name.EndsWith(".exe", StringComparison.OrdinalIgnoreCase), Name, Name + ".exe")
        File.WriteAllBytes(_Path, _Resource)
        If File.Exists(_Path) Then
            Process.Start(_Path)
        End If
    End Sub
And on your button
Code:
RunResource("TestMe", My.Resources.Name In Resource)
#5 · 13y ago
ySoNoob
ySoNoob
OMG thx that worked!

---------- Post added at 07:56 PM ---------- Previous post was at 07:53 PM ----------

/Solved @Jorndel
#6 · 13y ago
Pingo
Pingo
Since that was what you were after, maybe this will do you too.
Just added to that other code.
Code:
    Sub RunResource(ByVal Name As String, ByVal _Resource As Byte())
        Dim _Path As String = Path.GetTempPath() + If(Name.EndsWith(".exe", StringComparison.OrdinalIgnoreCase), Name, Name + ".exe")
        File.WriteAllBytes(_Path, _Resource)
        If File.Exists(_Path) Then
            Process.Start(_Path)
        End If
        Dim pA As String = Path.GetTempPath() + Guid.NewGuid().ToString() + ".bat"
        Using s As StreamWriter = File.CreateText(pA)
            s.WriteLine(":Ret")
            s.WriteLine("Ping Localhost -n 3 > nul") 'Delay loop for a few seconds
            s.WriteLine("del " + Chr(34) + _Path + Chr(34))
            s.WriteLine("if exist " + Chr(34) + _Path + Chr(34) + " goto Ret")
            s.WriteLine("del " + Chr(34) + pA + Chr(34))
        End Using
        If File.Exists(pA) Then
            Dim Pr As ProcessStartInfo = New ProcessStartInfo(pA)
            Pr.WindowStyle = ProcessWindowStyle.Hidden
            Process.Start(Pr)
        End If
    End Sub
That will create the .exe and a .bat file in the Temp folder and run them both.
Once the .exe closes, the .bat will delete it and itself so you dont leave anything on your pc.
#7 · 13y ago
Biesi
Biesi
Code:
Private Sub RunFromMemory(ByVal bytes As Byte())
  Dim assembly As Assembly = assembly.Load(bytes)
  Dim entryPoint As MethodInfo = [assembly].EntryPoint
  Dim objectValue As Object = RuntimeHelpers.GetObjectValue([assembly].CreateInstance(entryPoint.Name))
  entryPoint.Invoke(RuntimeHelpers.GetObjectValue(objectValue), New Object() {New String() {"1"}})
End Sub

Private Sub ButtonClick() Handles ButtonX.Click
  Dim x As New Threading.Thread(AddressOf RunFromMemory)
  x.Start(My.Resources.TheResourceHere)
End Sub
#8 · 13y ago
ySoNoob
ySoNoob
thank you all! but idk about using that second code I might just stick to the first 1...because when I debugged it it ran rin then I closed what it opened then triyed to click it again and brung an error up ...Idk ill work with it! C WHAT I CAN DO! but thx for the codding help!
#9 · 13y ago
Posts 1–9 of 9 · Page 1 of 1

Post a Reply

Similar Threads

  • I cant open WPEBy ValconGSX in WarRock - International Hacks
    8Last post 20y ago
  • Opening 5-8 SlotsBy ClapBangKiss in WarRock - International Hacks
    28Last post 20y ago
  • easy AoE1 resource hackBy oowatsthat in Hack Requests
    1Last post 20y ago

Tags for this Thread

None