Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    New to the CF scene
    Join Date
    Apr 2009
    Thanked 0 Times in 0 Posts

    Need to write a BSP decompiler

    I need to write a D3DBSP decompiler. Specifically, one that can decompile BSPs that are type 4. Someone on another forum was able to successfully decompile a type 4 BSP file using a program he wrote, but he doesn't want to release it. All he told me was that the decompiler was coded using C++, and that before he built it, he investigated several D3DBSP files (with a hex editor, I'm assuming) and ASM sources of a D3DBSP compiler.
    My question is, how would be able to write a decompiler like that? As far as I know, a D3DBSP file is just a BSP file that has been modified to support DirectX 9 graphics. I need to reverse this process:

    set bsppath=%~1
    set mapsourcepath=%~2
    set treepath=%~3
    set mapname=%4
    set platform=%5
    set parmBSPOptions=%~6
    set parmLightOptions=%~7
    set compileBSP=%8
    set compileLight=%9
    set compilePaths=%9
    set runmap=%9
    set mpmap=%9
    set compileVis=%9
    if "%parmBSPoptions%" == "-" (
    	set parmBSPoptions=
    if "%parmLightOptions%" == "-" (
    	set parmLightOptions=
    mkdir "%treepath%main\maps\"
    mkdir "%treepath%main\maps\mp"
    if "%compileBSP%" == "1" (
    	copy "%mapsourcepath%%mapname%.map" "%bsppath%%mapname%.map"
    	chdir "%treepath%bin"
    	cod2map -platform %platform% %parmBSPOptions% "%bsppath%%mapname%"
    if "%compileVis%" == "1" (
    	chdir "%treepath%bin"
    	cod2map -vis -platform %platform% "%bsppath%%mapname%"
    if "%compileLight%" == "1" (
    	IF EXIST "%mapsourcepath%%mapname%.grid"	copy "%mapsourcepath%%mapname%.grid" "%bsppath%%mapname%.grid"
    	IF EXIST "%mapsourcepath%%mapname%.vclog"	copy "%mapsourcepath%%mapname%.vclog" "%bsppath%%mapname%.vclog"
    	IF EXIST "%bsppath%%mapname%.map"			del "%bsppath%%mapname%.map"
    	chdir "%treepath%bin"
    	cod2rad -platform %platform% %parmLightOptions% "%bsppath%%mapname%"
    IF EXIST "%bsppath%%mapname%.map"		del "%bsppath%%mapname%.map"
    IF EXIST "%bsppath%%mapname%.d3dpoly"	del "%bsppath%%mapname%.d3dpoly"
    IF EXIST "%bsppath%%mapname%.vclog"		del "%bsppath%%mapname%.vclog"
    IF EXIST "%bsppath%%mapname%.grid"		del "%bsppath%%mapname%.grid"
    IF EXIST "%bsppath%%mapname%.lin"		move "%bsppath%%mapname%.lin" "%mapsourcepath%%mapname%.lin"
    chdir "%treepath%bin"
    if "%compilePaths%" == "1" (
    ) else (
    	goto RUNMAP
    echo Connecting Paths on %mapname%...
    echo runmap value: %runmap%
    echo compilePaths value: %compilePaths%
    if "%runmap%" == "1" (
    	call cod2compiletools_runmap.bat %platform% "%treepath%" %mapname% "+set g_connectpaths 1"
    	goto END
    ) else (
    	call cod2compiletools_runmap.bat %platform% "%treepath%" %mapname% "+set g_connectpaths 2"
    	goto END
    if "%runmap%" == "1" (
    	echo Starting %mapname%...
    	call cod2compiletools_runmap.bat %platform% "%treepath%" %mapname% %mpmap%
    	goto END
    If someone could help, it would be greatly appreciated.
    Last edited by JxcelDoghmQ; 04-26-2009 at 07:42 PM.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts