PureBasic Forum
http://forums.purebasic.com/english/

StealAssembly.pb
http://forums.purebasic.com/english/viewtopic.php?f=18&t=64283
Page 1 of 1

Author:  Lunasole [ Sun Dec 13, 2015 7:27 am ]
Post subject:  StealAssembly.pb

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

Author:  Tenaja [ Sun Dec 13, 2015 5:49 pm ]
Post subject:  Re: StealAssembly.pb

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

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/