Posted February 2, 200817 yr I am playing around a little with Masm @ Winasm trying to get the computername I tried this .data?ComputerName db 255 dup(?)lSize db 255 dup(?).Codeinvoke GetComputerName,addr ComputerName,addr lSizeIt compiles and runs but no return, what am I doing wrong? Edited February 2, 200817 yr by dustyh1981
February 2, 200817 yr .data?ComputerName db 255 dup(?)lSize dd ?.codeinvoke RtlZeroMemory, OFFSET ComputerName, SIZEOF ComputerNamemov lSize, SIZEOF ComputerNameinvoke GetComputerName,addr ComputerName,addr lSizeA. iSize needs to be of DWORD size.B. Before calling GetComputerName, iSize needs to hold the size of the buffer pointed by the 1st parameter of the GetComputerName API (in this case, the size of ComputerName buffer).C. After calling GetComputerName, iSize holds the length of the Computer name. Edited February 2, 200817 yr by HVC
Create an account or sign in to comment