Quantcast
Channel: VBForums - ASP, VB Script
Viewing all articles
Browse latest Browse all 686

Dllcalls in a vbscript

$
0
0
I am not sure, this is probably not the right subforum... I would like to have a simple vbs script which runs on every Windows PC without additional apps and tools.

Below is a short script written in AHK: A text string is extracted from a file and added as resource in an exe file by dllcalls.

Can this be reproduced in a simple way in vbs?

Thank you very much in advance!

ExeFile = MyExe.exe
ScriptF = Script.txt
FileRead, Script, %ScriptF%

VarSetCapacity(Bin, BinScript_Len := StrPut(Script, "UTF-8") - 1)
StrPut(Script, &BinScript, "UTF-8")

Module := DllCall("BeginUpdateResource", "str", ExeFile, "uint", 0, "ptr")

DllCall("UpdateResource", "ptr", Module, "ptr", 10, "str", ">MY SCRIPT<"
, "ushort", 0x409, "ptr", &BinScript, "uint", BinScript_Len, "uint")
DllCall("EndUpdateResource", "ptr", Module, "uint", 0)

Viewing all articles
Browse latest Browse all 686

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>