Example #1
0
//いいいいいいいいいいいいいいいいいいい

Sub UpdateLog(ps As String)
Example #2
0
Declare Sub UpdateLog(ps As String)
Example #3
0
		If Len(ps) Then
Example #4
0
//いいいいいいいいいいいいいいいいいいい
//expects "fs" to contain the path and name
//of either a PE or TLB format file
//It determines which type it is automatically
int ProcessFile(string fs)
{
int n		;
byte [] cs	;
string ls	;

	If Len(Dir$(fs)) Then

        n = GetTypeLibData(cs, fs);

		If n Then

			UpdateLog "Processing..."

			// --------------------------------------
			// open an output file for the disassembly
			Try
				#If %Def(%Study)
					CurFile = fs
					Note "" // reset message counter
				#EndIf
				ls = Mid$(fs, InStr(-1, fs, "\") + 1)
				ls = MCase$(Extract$(ls, ".")) & ".txt"
				Open LocalPath & "\" & ls For Output As fo
				UpdateLog "Output file: " & ls
			Catch
				UpdateLog "Error opening output file: " & ls
				Exit Function
			End Try

			If n = 1 Then DisTypeLib(cs)

		End If

	Else
		UpdateLog "Couldn't find: " & fs
	End If

	If FileAttr(fo, %IsOpen) Then Close# fo

End Function // ProcessFile

//いいいいいいいいいいいいいいいいいいい

CallBack Function ShowDlgProc()
Local  fs   As String

#If %Def(%ProfileOn)
	Profile "Profile.txt"
#EndIf

	Select Case As Long CbMsg

		// Case %WM_INITDIALOG

		Case %WM_NCACTIVATE
			Static hWndSaveFocus  As Dword
			If IsFalse CbWParam Then
				hWndSaveFocus = GetFocus()
			ElseIf hWndSaveFocus Then
				SetFocus(hWndSaveFocus)
				hWndSaveFocus = 0
			End If

		Case %WM_DROPFILES
			If (GetDroppedFile(CbWParam, fs)) Then
				Control Set Text ghDlg, %PathTxt, fs
			End If
			DragFinish CbWParam

		Case %WM_COMMAND
			Select Case As Long CbCtl
				Case %GoBtn
					If CbCtlMsg = %BN_CLICKED Or CbCtlMsg = 1 Then
						Control Get Text ghDlg, %PathTxt To fs
						UpdateLog ""
						ProcessFile(fs)
						UpdateLog "Ready..."
					End If
			End Select

	End Select

End Function

//いいいいいいいいいいいいいいいいいいい

Function PBMain() As Long
Local lRslt As Long

#If %Def(%ProfileOn)
	Profile "Profile.txt"
#EndIf

	// get and save the local path without a trailing backslash
	LocalPath = String$(%MAX_PATH, $Nul)
	GetModuleFileName(ByVal 0, ByVal StrPtr(LocalPath), %MAX_PATH)
	LocalPath = Left$(LocalPath, InStr(-1, LocalPath, "\") - 1)


	If Len(Command$) Then

		ProcessFile(Command$)
		MsgBox "Done"

	Else

		Dialog New %HWND_DESKTOP, $Caption, , , 256, 138, %WS_POPUP Or %WS_BORDER _
			Or %WS_DLGFRAME Or %WS_CAPTION Or %WS_SYSMENU Or %WS_MINIMIZEBOX Or _
			%WS_VISIBLE Or %DS_MODALFRAME Or %DS_SETFOREGROUND Or %DS_3DLOOK Or _
			%DS_NOFAILCREATE Or %DS_SETFONT, %WS_EX_WINDOWEDGE Or _
			%WS_EX_ACCEPTFILES Or %WS_EX_CONTROLPARENT Or %WS_EX_LEFT Or _
			%WS_EX_LTRREADING Or %WS_EX_RIGHTSCROLLBAR, To ghDlg

		Control Add Label,   ghDlg, %FileLbl, "&File:", 0, 4, 19, 10, %WS_CHILD Or _
			%WS_VISIBLE Or %WS_TABSTOP Or %SS_RIGHT, %WS_EX_LEFT Or %WS_EX_LTRREADING

		Control Add TextBox, ghDlg, %PathTxt, "", 20, 2, 233, 12

		Control Add Button,  ghDlg, %GoBtn, "&Go", 220, 17, 32, 14, %WS_CHILD Or _
			%WS_VISIBLE Or %WS_BORDER Or %WS_TABSTOP Or %BS_TEXT Or _
			%BS_DEFPUSHBUTTON Or %BS_PUSHBUTTON Or %BS_CENTER Or %BS_VCENTER, _
			%WS_EX_LEFT Or %WS_EX_LTRREADING

		Control Add Label, ghDlg, %MsgLbl, "&Messages:", 2, 22, 39, 10

		Control Add TextBox, ghDlg, %LogTxt, "", 2, 34, 252, 100, %WS_CHILD Or _
			%WS_VISIBLE Or %WS_TABSTOP Or %WS_HSCROLL Or %WS_VSCROLL Or %ES_LEFT _
			Or %ES_MULTILINE Or %ES_AUTOHSCROLL Or %ES_AUTOVSCROLL Or %ES_WANTRETURN, _
			%WS_EX_CLIENTEDGE Or %WS_EX_LEFT Or %WS_EX_LTRREADING Or %WS_EX_RIGHTSCROLLBAR

		Dialog Send ghDlg, %DM_SETDEFID, %GoBtn, 0
		Control Set Focus ghDlg, %PathTxt

		DragAcceptFiles ghDlg, %True // Register window to accept dropped files.

		Dialog Show Modal ghDlg, Call ShowDlgProc To lRslt

		Function = lRslt

	End If

End Function
Example #5
0
        private void button1_Click(object sender, EventArgs e)
        {
            ps f_open = new ps();

            f_open.ShowDialog();
        }