It is currently Wed Jan 27, 2021 4:46 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: StealAssembly.pb
PostPosted: Sun Dec 13, 2015 7:27 am 
Offline
Addict
Addict
User avatar

Joined: Mon Oct 26, 2015 2:55 am
Posts: 938
Location: UA
A simple program to intercept PureBasic.asm file. For Windows.
1. Compile it as console app and name "fasm.exe"
2. Goto "compilers" folder, rename true fasm.exe to "fasm_true.exe"
3. Place compiled file to it's place

It will produce PureBasic.asm file on user desktop after every compilation

Code:
EnableExplicit
   Import "kernel32.lib"
     GetConsoleWindow()
   EndImport
ShowWindow_(GetConsoleWindow(), #SW_HIDE) ; hide this console window manually

Define TInt.i, Params.i = CountProgramParameters()
Define AsmParams.s
   For TInt = 0 To Params - 1
      AsmParams + ProgramParameter(TInt) + " "
   Next TInt

Define AsmFile.s = ProgramParameter(0) ; 1st param is .asm file inside temp folder
Define OutPath.s = GetHomeDirectory() + "desktop\" + AsmFile ; placing output to user desktop [windows]
   If FileSize(AsmFile) > 0 :   CopyFile(AsmFile, OutPath) : EndIf

Define FASM.i = RunProgram("fasm_true.exe", AsmParams, GetCurrentDirectory(),  #PB_Program_Open)
Define iRet.i = 1
   If FASM
      WaitProgram (FASM)
      iRet = ProgramExitCode(FASM)
      CloseProgram(FASM)
   EndIf
End iRet

_________________
High hopes * Low expectations


Top
 Profile  
Reply with quote  
 Post subject: Re: StealAssembly.pb
PostPosted: Sun Dec 13, 2015 5:49 pm 
Offline
Addict
Addict
User avatar

Joined: Tue Nov 09, 2010 10:15 pm
Posts: 1719
I have saved your code for future reference--thank you for sharing.

When I want the asm, it seems I always want to see it immediately. For those situations, use one of the many CommentedASM.pb files; a few are here:
http://www.purebasic.fr/english/viewtopic.php?t=30843


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye