1用pbkiller可以从pbd导出"*.sr?"这样的文件,但是不能直接导出pbl
2由于pb导入"*.sr?"时,由于(1)类之间的依赖关系,若a的父类为b,先导a是不行的(2)pbkiller导出的源码有部分源码错误。 3鉴于以上情况,本人写了serach and replace脚本,对错误语法进行替换 4网上搜索到了一个批量导入"*.sr?"的程序,pb写的,用pbkiller反编译出来,但存在反编译错误 5由4知,用到了PBORC80.DLL,OD跟踪pb的导入对象的过程,得到了pb导入用到的函数参数,修复了反编译错误 ==================================================== 如下是serch and replace的正则替换脚本,修复部分pbkiller导出的源码错误 getclassdefinition/(/)替换 classdefinition getscriptlist/(/) 替换scriptlist getscript/(1,/[*[]/]/).getname/()/ 替换scriptlist/[%1/].name getvariablelist/(/) getvariable/(1,/[*[]/]/).getname/()/ 替换variablelist/[%1/].name getargumentlist/(/) getargument/(1,/[*[]/]/).getname/()/ 替换 argumentlist/[%1/].name getlocalvariablelist/(/) getlocalvariable/(1,/[*[]/]/).getname/()/ 替换 localvariablelist/[%1/].name /?/?/?/?/? = l?_*[]$ 替换 %2 = l%1_%2 ,"+",+./?/?/?/?/?(,|/)) 替换 ,"%1",%2.%1%3 /(+/)+/!messagebox/(/?/?/?/?/?/) 替换 messagebox/("",%1,%2/!/) ,/[+/](,|/)) 替换 ,{%1}%2 ==================================================== 如下是pb导入的核心函数,你可以写一个批处理,就不用一个一个手工导入源码了 forward global type n_cst_pborc from nonvisualobject end type end forward global type n_cst_pborc from nonvisualobject autoinstantiate end type global n_cst_pborc n_cst_pborc type prototypes public function long sessionopen7 () library "PBORC70.DLL" alias for "PBORCA_SessionOpen" public subroutine sessionclose7 (long horcasession) library "PBORC70.DLL" alias for "PBORCA_SessionClose" public function integer sessionsetlibrarylist7 (long horcasession,ref string plibnames[],integer inumberoflibs) library "PBORC70.DLL" alias for "PBORCA_SessionSetLibraryList" public function integer sessionsetcurrentappl7 (long horcasession,string lpszappllibname,string lpszapplname) library "PBORC70.DLL" alias for "PBORCA_SessionSetCurrentAppl" public function integer libraryentryexport7 (long horcasession,string lpszlibraryname,string lpszentryname,long otentrytype,ref string lpszexportbuffer,long lexportbuffersize) library "PBORC70.DLL" alias for "PBORCA_LibraryEntryExport" public function integer compileentryimport7 (long horcasession,string lpszlibraryname,string lpszentryname,long otentrytype,string lpszcomments,string lpszentrysyntax,long lentrysyntaxbuffsize,long pcomperrorproc,long puserdata) library "PBORC70.DLL" alias for "PBORCA_CompileEntryImport" public function long sessionopen8 () library "PBORC80.DLL" alias for "PBORCA_SessionOpen" public subroutine sessionclose8 (long horcasession) library "PBORC80.DLL" alias for "PBORCA_SessionClose" public function integer sessionsetlibrarylist8 (long horcasession,ref string plibnames[],integer inumberoflibs) library "PBORC80.DLL" alias for "PBORCA_SessionSetLibraryList" public function integer sessionsetcurrentappl8 (long horcasession,string lpszappllibname,string lpszapplname) library "PBORC80.DLL" alias for "PBORCA_SessionSetCurrentAppl" public function integer libraryentryexport8 (long horcasession,string lpszlibraryname,string lpszentryname,long otentrytype,ref string lpszexportbuffer,long lexportbuffersize) library "PBORC80.DLL" alias for "PBORCA_LibraryEntryExport" public function integer compileentryimport8 (long horcasession,string lpszlibraryname,string lpszentryname,long otentrytype,string lpszcomments,string lpszentrysyntax,long lentrysyntaxbuffsize,long pcomperrorproc,long puserdata) library "PBORC80.DLL" alias for "PBORCA_CompileEntryImport" public function long sessionopen9 () library "PBORC90.DLL" alias for "PBORCA_SessionOpen" public subroutine sessionclose9 (long horcasession) library "PBORC90.DLL" alias for "PBORCA_SessionClose" public function integer sessionsetlibrarylist9 (long horcasession,ref string plibnames[],integer inumberoflibs) library "PBORC90.DLL" alias for "PBORCA_SessionSetLibraryList" public function integer sessionsetcurrentappl9 (long horcasession,string lpszappllibname,string lpszapplname) library "PBORC90.DLL" alias for "PBORCA_SessionSetCurrentAppl" public function integer libraryentryexport9 (long horcasession,string lpszlibraryname,string lpszentryname,long otentrytype,ref string lpszexportbuffer,long lexportbuffersize) library "PBORC90.DLL" alias for "PBORCA_LibraryEntryExport" public function integer compileentryimport9 (long horcasession,string lpszlibraryname,string lpszentryname,long otentrytype,string lpszcomments,string lpszentrysyntax,long lentrysyntaxbuffsize,long pcomperrorproc,long puserdata) library "PBORC90.DLL" alias for "PBORCA_CompileEntryImport" public function long sessionopen10 () library "PBORC100.DLL" alias for "PBORCA_SessionOpen" public subroutine sessionclose10 (long horcasession) library "PBORC100.DLL" alias for "PBORCA_SessionClose" public function integer sessionsetlibrarylist10 (long horcasession,ref string plibnames[],integer inumberoflibs) library "PBORC100.DLL" alias for "PBORCA_SessionSetLibraryList" public function integer sessionsetcurrentappl10 (long horcasession,string lpszappllibname,string lpszapplname) library "PBORC100.DLL" alias for "PBORCA_SessionSetCurrentAppl" public function integer libraryentryexport10 (long horcasession,string lpszlibraryname,string lpszentryname,long otentrytype,ref string lpszexportbuffer,long lexportbuffersize) library "PBORC100.DLL" alias for "PBORCA_LibraryEntryExport" public function integer compileentryimport10 (long horcasession,string lpszlibraryname,string lpszentryname,long otentrytype,string lpszcomments,string lpszentrysyntax,long lentrysyntaxbuffsize,long pcomperrorproc,long puserdata) library "PBORC100.DLL" alias for "PBORCA_CompileEntryImport" public function long sessionopen () library "PBORC90.DLL" alias for "PBORCA_SessionOpen" public subroutine sessionclose (long horcasession) library "PBORC90.DLL" alias for "PBORCA_SessionClose" public function integer sessionsetlibrarylist (long horcasession,ref string plibnames[],integer inumberoflibs) library "PBORC90.DLL" alias for "PBORCA_SessionSetLibraryList" public function integer sessionsetcurrentappl (long horcasession,string lpszappllibname,string lpszapplname) library "PBORC90.DLL" alias for "PBORCA_SessionSetCurrentAppl" public function integer libraryentryexport (long horcasession,string lpszlibraryname,string lpszentryname,long otentrytype,ref string lpszexportbuffer,long lexportbuffersize) library "PBORC90.DLL" alias for "PBORCA_LibraryEntryExport" public function integer compileentryimport (long horcasession,string lpszlibraryname,string lpszentryname,long otentrytype,string lpszcomments,string lpszentrysyntax,long lentrysyntaxbuffsize,long pcomperrorproc,long puserdata) library "PBORC90.DLL" alias for "PBORCA_CompileEntryImport" end prototypes type variables public long pborca_application public long pborca_datawindow = 1 public long pborca_function = 2 public long pborca_menu = 3 public long pborca_query = 4 public long pborca_structure = 5 public long pborca_userobject = 6 public long pborca_window = 7 public long pborca_pipeline = 8 public long pborca_project = 9 public long pborca_proxyobject = 10 public long pborca_binary = 11 public integer pborca_ok public long pborca_invalidparms = -1 public long pborca_dupoperation = -2 public long pborca_objnotfound = -3 public long pborca_badlibrary = -4 public long pborca_liblistnotset = -5 public long pborca_libnotinlist = -6 public long pborca_libioerror = -7 public long pborca_objexists = -8 public long pborca_invalidname = -9 public long pborca_buffertoosmall = -10 public long pborca_comperror = -11 public long pborca_linkerror = -12 public long pborca_currapplnotset = -13 public long pborca_objhasnoancs = -14 public long pborca_objhasnorefs = -15 public long pborca_pbdcounterror = -16 public long pborca_pbdcreaterror = -17 public long pborca_checkouterror = -18 end variables forward prototypes public function integer of_importfile (string as_syntax,string as_object,long al_type,string as_pbl,string as_library[],string as_appl) end prototypes public function integer of_importfile (string as_syntax,string as_object,long al_type,string as_pbl,string as_library[],string as_appl);long li_handle long ll_sid long ll_index integer li_result ll_sid=sessionopen() li_result = sessionsetlibrarylist(ll_sid,as_library,upperbound(as_library)) if li_result = 0 then li_result = sessionsetcurrentappl(ll_sid,as_library[1],as_appl) if li_result = 0 then li_result = compileentryimport(ll_sid,as_pbl,as_object,al_type,"Messagebox->gf_msgbox",as_syntax,len(as_syntax),0,0) if li_result <> 0 then li_handle = fileopen("status.txt",linemode!,write!,lockwrite!,append!) filewrite(li_handle,string(li_result) + " - " + as_pbl + " - " + as_object) fileclose(li_handle) else li_handle = fileopen("status.txt",linemode!,write!,lockwrite!,append!) filewrite(li_handle,string(li_result) + " - " + as_pbl + " - " + as_object) fileclose(li_handle) end if else li_handle = fileopen("status.txt",linemode!,write!,lockwrite!,append!) filewrite(li_handle,string(li_result) + " - " + as_pbl + " - " + as_object) fileclose(li_handle) end if else li_handle = fileopen("status.txt",linemode!,write!,lockwrite!,append!) filewrite(li_handle,string(li_result) + " - " + as_pbl + " - " + as_object) fileclose(li_handle) end if sessionclose(ll_sid) return li_result end function on n_cst_pborc.create call super::create triggerevent("constructor") end on on n_cst_pborc.destroy triggerevent("destructor") call super::destroy end on |