|
win32asm为什么出现乱码?
mov lpString11[173],0000H已去掉。 |
|
win32asm为什么出现乱码?
应该如何写入? |
|
win32asm为什么出现乱码?
.386 .model flat,stdcall option casemap:none ; 过程函数定义? WinMain proto :DWORD,:DWORD,:DWORD,:DWORD DlgProc proto :DWORD,:DWORD,:DWORD,:DWORD PmsjProc proto :DWORD,:DWORD,:DWORD,:DWORD ; 包含文件? include \masm32\include\debug.inc includelib \masm32\lib\debug.lib include \masm32\include\windows.inc include \masm32\include\user32.inc include \masm32\include\kernel32.inc include \masm32\include\gdi32.inc include \masm32\include\masm32.inc include \masm32\include\Fpu.inc includelib \masm32\lib\user32.lib includelib \masm32\lib\kernel32.lib includelib \masm32\lib\gdi32.lib includelib \masm32\lib\masm32.lib includelib \masm32\lib\Fpu.lib ; 数据初始化? .data ClassName db "SimpleWinClass",0 AppName db "路桥工程",0 MenuName db "IDR_MENU",0 ; The name of our menu in the resource file. zhString db "桩号:",0 zbxString db "X坐标:",0 zbyString db "Y坐标:",0 qdString db "起点",0 jdString db "交点",0 zdString db "终点",0 hq1String db "第一缓和曲线",0 hq2String db "第二缓和曲线",0 zhnum1 dt 0 qdxnum1 dt 0 qdynum1 dt 0 jdxnum1 dt 0 jdynum1 dt 0 zdxnum1 dt 0 zdynum1 dt 0 hq1num1 dt 0 yqnum1 dt 0 hq2num1 dt 0 num1 dt 0 num2 dt 0 num3 dt 0 num4 dt 0 num5 dt 0 num6 dt 0 num7 dt 0 num8 dt 0 num9 dt 0 num10 dt 0 str1 dd 0 str2 dd 0 str3 dd 0 str4 dd 0 str5 dd 0 str6 dd 0 str7 dd 0 str8 dd 0 str9 dd 0 str10 dd 0 str11 dd 0 str12 dd 0 ; 未初始化数据? .data? hInstance HINSTANCE ? CommandLine LPSTR ? buffer db 512 dup(?) lpString11 LPCTSTR 512 dup(?) lpString1 LPCTSTR 4 dup(?) lpString2 LPCTSTR 4 dup(?) lpString3 LPCTSTR 4 dup(?) lpString4 LPCTSTR 4 dup(?) lpString5 LPCTSTR 4 dup(?) lpString6 LPCTSTR 4 dup(?) lpString7 LPCTSTR 4 dup(?) lpString8 LPCTSTR 4 dup(?) lpString9 LPCTSTR 4 dup(?) lpString10 LPCTSTR 4 dup(?) nMaxCount db ? hdc HDC ? ; 常量定义? .const __UNICODE__ equ 1 IDR_MENU equ 10000 IDM_XJ equ 10008 IDM_DK equ 10002 IDM_BC equ 10003 IDM_LC equ 10004 IDM_DYYL equ 10005 IDM_DY equ 10006 IDM_DYSZ equ 10007 IDM_CX equ 10010 IDM_CZ equ 10014 IDM_JQ equ 10011 IDM_FZ equ 10012 IDM_NL equ 10013 IDM_PMSJ equ 10016 IDM_ZDMSJ equ 10017 IDM_ZDSJ equ 10018 IDM_JDSJ equ 10019 IDM_BQ equ 10022 IDM_LQ equ 10023 IDD_DLG1 equ 1000 IDC_STC1 equ 1001 IDC_STC2 equ 1002 IDC_STC3 equ 1003 IDC_STC4 equ 10031 IDC_STC5 equ 10032 IDC_STC6 equ 10033 IDC_STC7 equ 10034 IDC_STC8 equ 10035 IDC_STC9 equ 10036 IDC_STC10 equ 10037 IDC_EDT1 equ 1004 IDC_EDT2 equ 1005 IDC_EDT3 equ 1006 IDC_EDT4 equ 10061 IDC_EDT5 equ 10062 IDC_EDT6 equ 10063 IDC_EDT7 equ 10064 IDC_EDT8 equ 10065 IDC_EDT9 equ 10066 IDC_EDT10 equ 10067 IDC_BTN1 equ 1007 IDC_BTN2 equ 1008 IDC_BTN3 equ 1009 ; 代码段? .code start: invoke GetModuleHandle, NULL mov hInstance,eax invoke GetCommandLine mov CommandLine,eax invoke WinMain, hInstance,NULL,CommandLine, SW_SHOWDEFAULT invoke ExitProcess,eax ; 主函数? WinMain proc hInst:HINSTANCE,hPrevInst:HINSTANCE,CmdLine:LPSTR,CmdShow:DWORD LOCAL wc:WNDCLASSEX LOCAL msg:MSG LOCAL hwnd:HWND mov wc.cbSize,SIZEOF WNDCLASSEX mov wc.style, CS_HREDRAW or CS_VREDRAW mov wc.lpfnWndProc, OFFSET WndProc mov wc.cbClsExtra,NULL mov wc.cbWndExtra,NULL push hInst pop wc.hInstance mov wc.hbrBackground,COLOR_WINDOW+1 mov wc.lpszMenuName,OFFSET IDR_MENU ; Put our menu name here mov wc.lpszClassName,OFFSET ClassName invoke LoadIcon,NULL,IDI_APPLICATION mov wc.hIcon,eax mov wc.hIconSm,eax invoke LoadCursor,NULL,IDC_ARROW mov wc.hCursor,eax invoke RegisterClassEx, addr wc invoke CreateWindowEx,NULL,ADDR ClassName,ADDR AppName,\ WS_OVERLAPPEDWINDOW,CW_USEDEFAULT,\ CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,NULL,NULL,\ hInst,NULL mov hwnd,eax invoke ShowWindow, hwnd,SW_SHOWNORMAL invoke UpdateWindow, hwnd .WHILE TRUE invoke GetMessage, ADDR msg,NULL,0,0 .BREAK .IF (!eax) invoke DispatchMessage, ADDR msg .ENDW mov eax,msg.wParam ret WinMain endp ; 过程? WndProc proc hWnd:HWND, uMsg:UINT, wParam:WPARAM, lParam:LPARAM LOCAL ps:PAINTSTRUCT LOCAL hfont:HFONT LOCAL rect:RECT .IF uMsg==WM_DESTROY invoke PostQuitMessage,NULL .elseif uMsg == WM_PAINT invoke BeginPaint,hWnd, ADDR ps mov hdc,eax ;invoke CreateFont,24,0,0,0,0,0,0,0,0,0,0,0,0,0 ;invoke SelectObject, hdc, eax ;mov hfont,eax ;invoke TextOut,hdc,0,0,ADDR lpString1,SIZEOF lpString1 ;invoke TextOut,hdc,0,24,ADDR lpString2,SIZEOF lpString2 ;invoke TextOut,hdc,0,48,ADDR lpString3,SIZEOF lpString3 ;invoke TextOut,hdc,0,72,ADDR lpString4,SIZEOF lpString4 ;invoke TextOut,hdc,0,96,ADDR lpString5,SIZEOF lpString5 ;invoke TextOut,hdc,0,120,ADDR lpString6,SIZEOF lpString6 ;invoke TextOut,hdc,0,144,ADDR lpString7,SIZEOF lpString7 ;invoke TextOut,hdc,0,168,ADDR lpString8,SIZEOF lpString8 ;invoke TextOut,hdc,0,192,ADDR lpString9,SIZEOF lpString9 ;invoke TextOut,hdc,0,216,ADDR lpString10,SIZEOF lpString10 ;invoke TextOut,hdc,0,240,ADDR lpString11,SIZEOF lpString11 ;invoke TextOut,hdc,0,264,ADDR lpString11[16],SIZEOF lpString11[16] invoke GetClientRect,hWnd, ADDR rect invoke DrawText, hdc,ADDR lpString11,512, ADDR rect,0 --------------输出字符串 ;invoke SelectObject,hdc, hfont invoke EndPaint,hWnd, ADDR ps ;invoke GetDC,hWnd ;mov hdc,eax ;invoke TextOut,hdc,0,0,ADDR lpString2,SIZEOF lpString2 ;invoke ReleaseDC,hdc,0 ;invoke SetScrollRange,hWnd,SB_CTL,10,10,0 .ELSEIF uMsg==WM_COMMAND mov eax,wParam .IF eax==IDM_PMSJ invoke DialogBoxParam, hInstance,IDD_DLG1,NULL,DlgProc, NULL invoke InvalidateRect,hWnd,0,0 .ELSEIF eax==IDM_ZDMSJ invoke MessageBox, NULL,ADDR AppName, OFFSET AppName,MB_OK .ELSEIF eax==IDM_ZDSJ invoke MessageBox,NULL,ADDR AppName, OFFSET AppName, MB_OK .ELSE invoke DestroyWindow,hWnd .ENDIF .ELSE invoke DefWindowProc,hWnd,uMsg,wParam,lParam ret .ENDIF xor eax,eax ret WndProc endp ; 函数? DlgProc proc hWnd:HWND, uMsg:UINT, wParam:WPARAM, lParam:LPARAM .IF uMsg==WM_INITDIALOG invoke GetDlgItem, hWnd,IDC_EDT1 invoke SetFocus,eax .ELSEIF uMsg==WM_CLOSE invoke EndDialog, hWnd,NULL .ELSEIF uMsg==WM_COMMAND mov eax,wParam .IF eax==IDC_BTN1 invoke PmsjProc,hWnd,uMsg,wParam,lParam .ELSEIF eax==IDC_BTN2 invoke MessageBox,NULL,ADDR buffer,ADDR AppName,MB_OK .ELSEIF eax==IDC_BTN3 invoke EndDialog, hWnd,NULL .ENDIF .ELSE mov eax,FALSE ret .ENDIF mov eax,TRUE ret DlgProc endp ; 函数? PmsjProc proc hWnd:HWND,uMsg:UINT,wParam:WPARAM,lParam:LPARAM invoke GetDlgItemText,hWnd,IDC_EDT1,ADDR lpString1,SIZEOF lpString1 mov eax,lpString1 mov lpString11,eax mov eax,lpString1[4] mov lpString11[4],eax mov eax,lpString1[8] mov lpString11[8],eax mov eax,lpString1[12] mov lpString11[12],eax mov lpString11[13],0000H mov lpString11[14],000AH mov lpString11[15],000DH invoke FpuAtoFL, ADDR lpString1, ADDR zhnum1, DEST_MEM invoke GetDlgItemText,hWnd,IDC_EDT2,ADDR lpString2,SIZEOF lpString2 mov eax,lpString2 mov lpString11[16],eax mov eax,lpString2[4] mov lpString11[20],eax mov eax,lpString2[8] mov lpString11[24],eax mov eax,lpString2[12] mov lpString11[28],eax mov lpString11[29],0000H mov lpString11[30],000AH mov lpString11[31],000DH invoke FpuAtoFL, ADDR lpString2, ADDR qdxnum1, DEST_MEM invoke GetDlgItemText,hWnd,IDC_EDT3,ADDR lpString3,SIZEOF lpString3 mov eax,lpString3 mov lpString11[32],eax mov eax,lpString3[4] mov lpString11[36],eax mov eax,lpString3[8] mov lpString11[40],eax mov eax,lpString3[12] mov lpString11[44],eax mov lpString11[45],0000H mov lpString11[46],000AH mov lpString11[47],000DH invoke FpuAtoFL, ADDR lpString3, ADDR qdynum1, DEST_MEM invoke GetDlgItemText,hWnd,IDC_EDT4,ADDR lpString4,SIZEOF lpString4 mov eax,lpString4 mov lpString11[48],eax mov eax,lpString4[4] mov lpString11[52],eax mov eax,lpString4[8] mov lpString11[56],eax mov eax,lpString4[12] mov lpString11[60],eax mov lpString11[61],0000H mov lpString11[62],000AH mov lpString11[63],000DH invoke FpuAtoFL, ADDR lpString4, ADDR hq1num1, DEST_MEM invoke GetDlgItemText,hWnd,IDC_EDT5,ADDR lpString5,SIZEOF lpString5 mov eax,lpString5 mov lpString11[64],eax mov eax,lpString5[4] mov lpString11[68],eax mov eax,lpString5[8] mov lpString11[72],eax mov eax,lpString5[12] mov lpString11[76],eax mov lpString11[77],000H mov lpString11[78],000AH mov lpString11[79],000DH invoke FpuAtoFL, ADDR lpString5, ADDR jdxnum1, DEST_MEM invoke GetDlgItemText,hWnd,IDC_EDT6,ADDR lpString6,SIZEOF lpString6 mov eax,lpString6 mov lpString11[80],eax mov eax,lpString6[4] mov lpString11[84],eax mov eax,lpString6[8] mov lpString11[88],eax mov eax,lpString6[12] mov lpString11[92],eax mov lpString11[93],0000H mov lpString11[94],000AH mov lpString11[95],000DH invoke FpuAtoFL, ADDR lpString6, ADDR jdynum1, DEST_MEM invoke GetDlgItemText,hWnd,IDC_EDT7,ADDR lpString7,SIZEOF lpString7 mov eax,lpString7 mov lpString11[96],eax mov eax,lpString7[4] mov lpString11[100],eax mov eax,lpString7[8] mov lpString11[104],eax mov eax,lpString7[12] mov lpString11[108],eax mov lpString11[109],0000H mov lpString11[110],000AH mov lpString11[111],000DH invoke FpuAtoFL, ADDR lpString7, ADDR yqnum1, DEST_MEM invoke GetDlgItemText,hWnd,IDC_EDT8,ADDR lpString8,SIZEOF lpString8 mov eax,lpString8 mov lpString11[112],eax mov eax,lpString8[4] mov lpString11[116],eax mov eax,lpString8[8] mov lpString11[120],eax mov eax,lpString8[12] mov lpString11[124],eax mov lpString11[125],0000H mov lpString11[126],000AH mov lpString11[127],000DH invoke FpuAtoFL, ADDR lpString8, ADDR zdxnum1, DEST_MEM invoke GetDlgItemText,hWnd,IDC_EDT9,ADDR lpString9,SIZEOF lpString9 mov eax,lpString9 mov lpString11[128],eax mov eax,lpString9[4] mov lpString11[132],eax mov eax,lpString9[8] mov lpString11[136],eax mov eax,lpString9[12] mov lpString11[140],eax mov lpString11[141],0000H mov lpString11[142],000AH mov lpString11[143],000DH invoke FpuAtoFL, ADDR lpString9, ADDR zdynum1, DEST_MEM invoke GetDlgItemText,hWnd,IDC_EDT10,ADDR lpString10,SIZEOF lpString10 mov eax,lpString10 mov lpString11[144],eax mov eax,lpString10[4] mov lpString11[148],eax mov eax,lpString10[8] mov lpString11[152],eax mov eax,lpString10[12] mov lpString11[156],eax mov lpString11[157],0000H mov lpString11[158],000AH mov lpString11[159],000DH invoke FpuAtoFL, ADDR lpString10, ADDR hq2num1, DEST_MEM mov eax,offset zhString--------------------------------把字符串“桩号”写入eax mov lpString11[160],eax--------------------------------把eax写入lpString11 mov eax,offset zhString[4] mov lpString11[164],eax mov eax,offset zhString[8] mov lpString11[168],eax mov eax,offset zhString[12] mov lpString11[172],eax mov lpString11[173],0000H mov lpString11[174],000AH mov lpString11[175],000DH invoke EndDialog, hWnd,NULL PrintDec eax PrintDec ebx PrintDec ecx PrintDec edx PrintDec esi PrintDec edi PrintDec esp PrintDec ebp PrintDec es PrintDec cs PrintDec ss PrintDec ds PrintDec fs PrintDec gs PrintDec zhnum1 PrintDec yqnum1 mov eax, TRUE ret PmsjProc endp end start |
|
|
|
win32asm为什么出现乱码?
mov eax,offset zhString mov lpString11[160],eax mov eax,offset zhString[4] mov lpString11[164],eax mov eax,offset zhString[8] mov lpString11[168],eax mov eax,offset zhString[12] mov lpString11[172],eax mov lpString11[173],0000H mov lpString11[174],000AH mov lpString11[175],000DH 还是不行,乱码。 |
|
|
|
|
|
|
|
[求助]调试的程序出现调试的程序无法处理异常,并停此,该怎办?
感谢坛主!!!!!!!!! |
|
|
|
[求助]调试的程序出现调试的程序无法处理异常,并停此,该怎办?
软件安装程序3M |
操作理由
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 }}
勋章
兑换勋章
证书
证书查询 >
能力值