Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use vbs to implement exe2swf tool

2025-01-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

Editor to share with you how to use vbs to achieve the exe2swf tool script code, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

The code is as follows:

Dim AsoR,FlashFileName

Set ArgObj = WScript.Arguments

Dim PositionStart,OKed,Tag,EndSize

PositionStart = approximate number of bytes of the player for 920000'flash 4

EndSize = 8 'bytes at the end of the exe file, other versions can be set to 0

FlashFileName = ArgObj (0) 'delivery path

Set AsoR=CreateObject ("Adodb.Stream")

AsoR.Mode=3

AsoR.Type=1

AsoR.Open

Set AsoW=CreateObject ("Adodb.Stream")

AsoW.Mode=3

AsoW.Type=1

AsoW.Open

AsoR.LoadFromFile (FlashFileName)

OKed = true

Dim filesize

Filesize = AsoR.size

If filesize > PositionStart then

While OKed

AsoR.Position = PositionStart

Tag = Bin2Str (AsoR.read (20))

If instr (Tag, "0000000") > 0 then

PositionStart = PositionStart + 1

Else

PositionStart = PositionStart + 20

End if

If Tag = "0000000000000000000708783" or Tag = "00000000000000000678783" then

OKed = false

End if

'if PositionStart > filesize then

'OKed = false

'end if

Wend

Else

Msgbox "File error"

End if

PositionStart = PositionStart + 16

'msgbox PositionStart

AsoR.Position = PositionStart

AsoW.write AsoR.read (filesize-int (PositionStart)-int (EndSize))

'New file name

Dim newFileName

'newFileName = left (FlashFileName,len (FlashFileName)-4) & ".swf"

NewFileName = FlashFileName & ".swf"

Set fso = CreateObject ("Scripting.FileSystemObject")

If (fso.FileExists (newFileName)) Then

Overwrite = msgbox (newFileName& "already exists" & vbnewline & "do you want to replace it?", 308, "File already exists-exe2swf script")

If overwrite=6 then

AsoW.SaveToFile newFileName, 2

Else

Msgbox "Operation canceled", 0, "exe2swf script"

End if

Else

AsoW.SaveToFile newFileName, 1

End if

AsoR.close

Set AsoR=nothing

AsoW.close

Set AsoW=nothing

Function Bin2Str (Bin)

Dim I, Str

For iTun1 to LenB (Bin)

Clow=MidB (Bin,I,1)

If ASCB (clow)

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development