|
|
|
[求助]在MASM32中怎样实现文件逐行读取?
include masm32.inc includelib masm32.lib 使用 readline ================= readline readline proc source:DWORD,buffer:DWORD,spos:DWORD Description A procedure to read a line of text directly from memory. Parameters 1. source The address of the memory to read the text from. 2. buffer The destination buffer to write the line of text to. 3. spos The current location pointer. Return Value The updated "spos" value is returned in EAX. The line length not including zero or 13 is returned in ECX. |
|
|
|
[求助]汇编程序里播放xm音乐的问题
复制 mfmplayer.inc到masm32\include\ mfmplayer.lib到masm32\lib\ 如果你使用MASMPlus,分别复制两个文件到MASMPlus目录下的Include和lib目录中 |
|
[求助]关于创建多界面程序问题.....
RadASM中有Tab模版,你可以参考一下. DlgProc proc hWin:HWND,uMsg:UINT,wParam:WPARAM,lParam:LPARAM LOCAL ts:TC_ITEM mov eax,uMsg .if eax==WM_COMMAND ... .elseif eax==WM_INITDIALOG ;Create the tabs invoke GetDlgItem,hWin,IDC_TAB1 mov hTab,eax mov ts.imask,TCIF_TEXT mov ts.lpReserved1,0 mov ts.lpReserved2,0 mov ts.iImage,-1 mov ts.lParam,0 mov ts.pszText,offset TabTitle1 mov ts.cchTextMax,sizeof TabTitle1 invoke SendMessage,hTab,TCM_INSERTITEM,0,addr ts mov ts.pszText,offset TabTitle2 mov ts.cchTextMax,sizeof TabTitle2 invoke SendMessage,hTab,TCM_INSERTITEM,1,addr ts mov ts.pszText,offset TabTitle3 mov ts.cchTextMax,sizeof TabTitle3 invoke SendMessage,hTab,TCM_INSERTITEM,2,addr ts ;Create the tab dialogs invoke CreateDialogParam,hInstance,IDD_TAB1,hTab,addr Tab1Proc,0 mov hTabDlg,eax invoke CreateDialogParam,hInstance,IDD_TAB2,hTab,addr Tab2Proc,0 mov hTabDlg[4],eax invoke CreateDialogParam,hInstance,IDD_TAB3,hTab,addr Tab3Proc,0 mov hTabDlg[8],eax .elseif eax==WM_CLOSE invoke EndDialog,hWin,NULL .else mov eax,FALSE ret .endif mov eax,TRUE ret DlgProc endp |
|
[求助]怎么获得其他机子的关机权限
//调整关机权限 procedure TForm1.AdjustPrivileges(); var hdlProcessHandle : Cardinal; hdlTokenHandle : Cardinal; tmpLuid : Int64; tkpPrivilegeCount : Int64; tkp : TOKEN_PRIVILEGES; tkpNewButIgnored : TOKEN_PRIVILEGES; lBufferNeeded : Cardinal; Privilege : array[0..0] of _LUID_AND_ATTRIBUTES; begin hdlProcessHandle := GetCurrentProcess; OpenProcessToken(hdlProcessHandle, (TOKEN_ADJUST_PRIVILEGES Or TOKEN_QUERY),hdlTokenHandle); // Get the LUID for shutdown privilege. LookupPrivilegeValue('', 'SeShutdownPrivilege', tmpLuid); Privilege[0].Luid := tmpLuid; Privilege[0].Attributes := SE_PRIVILEGE_ENABLED; tkp.PrivilegeCount := 1; // One privilege to set tkp.Privileges[0] := Privilege[0]; // Enable the shutdown privilege in the access token of this process. AdjustTokenPrivileges(hdlTokenHandle, False,tkp,Sizeof(tkpNewButIgnored),tkpNewButIgnored,lBufferNeeded); end; //关机 function ShutDownSystem():BOOL; var hProcess,hAccessToken:THandle; LUID_AND_ATTRIBUTES:TLUIDAndAttributes; TOKEN_PRIVILEGES: TTokenPrivileges; BufferIsNull:DWORD; Const SE_SHUTDOWN_NAME='SeShutdownPrivilege'; begin hProcess:=GetCurrentProcess(); OpenProcessToken(hprocess,TOKEN_ADJUST_PRIVILEGES+TOKEN_QUERY,hAccessToken); LookupPrivilegeValue(Nil,SE_SHUTDOWN_NAME,LUID_AND_ATTRIBUTES.Luid); LUID_AND_ATTRIBUTES.Attributes:=SE_PRIVILEGE_ENABLED; TOKEN_PRIVILEGES.PrivilegeCount:=1; TOKEN_PRIVILEGES.Privileges[0]:=LUID_AND_ATTRIBUTES; BufferIsNull:=0; AdjustTokenPrivileges(hAccessToken,False,TOKEN_PRIVILEGES,sizeof(TOKEN_PRIVILEGES),Nil,BufferIsNull); ExitWindowsEx(EWX_REBOOT, 0); ShutDownSystem:=True; end; |
|
[求助]FindNextFile遇到困惑....
问题在这里: invoke DeleteFile,addr FileNamePattern FileNamePattern指向的字串"C:\WINDOWS\*.txt",你让DeleteFile删除哪个文件呢?既然声明了finddata,为什么不用? 稍作修改如下: .386 .model flat, stdcall option casemap :none include windows.inc include user32.inc include kernel32.inc includelib user32.lib includelib kernel32.lib .data FileNamePattern db "C:\TDdownload\*.txt",0 FilePath db "C:\TDdownload\",0 .data? FileName db 256 dup(?) .code ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> FillFileInfo proc uses edi LOCAL finddata:WIN32_FIND_DATA LOCAL hFindFile:DWORD invoke FindFirstFile,addr FileNamePattern,addr finddata .if eax!=INVALID_HANDLE_VALUE mov hFindFile,eax .repeat invoke RtlZeroMemory,addr FileName,sizeof FileName invoke lstrcat,addr FileName,addr FilePath lea eax,finddata.cFileName invoke lstrcat,addr FileName,eax invoke DeleteFile, addr FileName invoke FindNextFile,hFindFile,addr finddata .until eax == FALSE invoke FindClose,hFindFile .endif ret FillFileInfo endp ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> start: call FillFileInfo invoke ExitProcess,NULL end start |
|
[求助]怎么获得其他机子的关机权限
发个指令让客户端软件调用shutdown.exe -s |
操作理由
RANk
{{ user_info.golds == '' ? 0 : user_info.golds }}
雪币
{{ experience }}
课程经验
{{ score }}
学习收益
{{study_duration_fmt}}
学习时长
基本信息
荣誉称号:
{{ honorary_title }}
能力排名:
No.{{ rank_num }}
等 级:
LV{{ rank_lv-100 }}
活跃值:
在线值:
浏览人数:{{ visits }}
最近活跃:{{ last_active_time }}
注册时间:{{ user_info.create_date_jsonfmt }}
勋章
兑换勋章
证书
证书查询 >
能力值