StealAssembly.pb

Working on new editor enhancements?
User avatar
Lunasole
Addict
Addict
Posts: 1091
Joined: Mon Oct 26, 2015 2:55 am
Location: UA
Contact:

StealAssembly.pb

Post by Lunasole »

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: Select all

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
"W̷i̷s̷h̷i̷n̷g o̷n a s̷t̷a̷r"
User avatar
Tenaja
Addict
Addict
Posts: 1948
Joined: Tue Nov 09, 2010 10:15 pm

Re: StealAssembly.pb

Post by Tenaja »

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
Post Reply