'vm'에 해당되는 글 3건
- 2021.05.14 Remote Debugging
- 2013.11.07 run Hyper-V on VMWare
- 2013.10.22 How to determine physical machine
2021. 5. 14. 13:11
Remote Debugging
2021. 5. 14. 13:11 in link/Mac
- Remote Side(e.g. 192.168.129.2)
- Install Command Line Tools for Xcode
- Run debugserver(/Library/Developer/CommandLineTools/Library/PrivateFrameworks/LLDB.framework/Versions/A/Resources ver 12.5)
-
Usage:
debugserver host:port [program-name program-arg1 program-arg2 ...]
debugserver /path/file [program-name program-arg1 program-arg2 ...]
debugserver host:port --attach=<pid>
debugserver /path/file --attach=<pid>
debugserver host:port --attach=<process_name>
debugserver /path/file --attach=<process_name>host: Local Side
e.g.: debugserver 192.168.129.1:1600 --attach=1234
Attaching to process 2051...
Listening to port 1600 for a connection from 192.168.129.1...
- Local Side(e.g. 192.168.129.1)
- Run lldb
- Then enter this command: process connect connect://192.168.129.2:1600
- Set the entitlement
- The debugee should have 'com.apple.security.get-task-allow' entitlement in order to be attached by debuggers.
- In debug mode it is set, but in release mode it is stripped.
- Build Settings > Signing > Code Signing inject Base Entitlements > 'Yes'
2013. 11. 7. 13:37
run Hyper-V on VMWare
2013. 11. 7. 13:37 in text/develop environment
1. install Windows 8 on VMWare
2. check "Virtualize Intel VT-x/EPT or AMD-V/RVI" item ( VMware setting / Processors )
3. add hypervisor.cpuid.v0 = "FALSE" item in .vmx
2013. 10. 22. 19:45
How to determine physical machine
2013. 10. 22. 19:45 in link/security
Using system manufacture name
CMD : SYSTEMINFO
WMI
http://msdn.microsoft.com/en-us/library/windows/desktop/aa389762%28v=vs.85%29.aspx
http://msdn.microsoft.com/en-us/library/windows/desktop/aa390418%28v=vs.85%29.aspx
Registry
http://www.rohitab.com/discuss/topic/35915-win32-api-to-get-system-information/
#include <windows.h>
#include <commctrl.h>
#include <shlwapi.h>
UINT
GetComputerManufacturer(
LPSTR
lpBuffer,
UINT
uSize)
{
HKEY
hkData;
HANDLE
hHeap;
LPSTR
lpString = NULL;
LPBYTE
lpData = NULL;
DWORD
dwType = 0, dwSize = 0;
UINT
uIndex, uStart, uEnd, uString, uLength, uState = 0;
LONG
lErr;
if
((lErr = RegOpenKeyEx(HKEY_LOCAL_MACHINE, TEXT(
"SYSTEM\\CurrentControlSet\\Services\\mssmbios\\Data"
),
0, KEY_QUERY_VALUE, &hkData)) != ERROR_SUCCESS){
SetLastError(lErr);
return
0;
}
if
((lErr = RegQueryValueEx(hkData, TEXT(
"SMBiosData"
), NULL, &dwType, NULL, &dwSize)) == ERROR_SUCCESS){
if
(dwSize == 0 || dwType != REG_BINARY) lErr = ERROR_BADKEY;
else
{
hHeap = GetProcessHeap();
lpData = (
LPBYTE
)HeapAlloc(hHeap, 0, dwSize);
if
(!lpData) lErr = ERROR_NOT_ENOUGH_MEMORY;
else
lErr = RegQueryValueEx(hkData, TEXT(
"SMBiosData"
),
NULL, NULL, lpData, &dwSize);
}
}
RegCloseKey(hkData);
if
(lErr == ERROR_SUCCESS){
uIndex = 8 + *(
WORD
*)(lpData + 6);
uEnd = 8 + *(
WORD
*)(lpData + 4);
while
(lpData[uIndex] != 0x7F && uIndex < uEnd){
uIndex += lpData[(uStart = uIndex) + 1];
uString = 1;
do
{
if
(lpData[uStart] == 0x01 && uState == 0){
if
( lpData[uStart + 4] == uString ||
lpData[uStart + 5] == uString ||
lpData[uStart + 6] == uString){
lpString = (
LPSTR
)(lpData + uIndex);
if
(!StrCmpI(lpString,
"System manufacturer"
)){
lpString = NULL;
uState++;
}
}
}
else
if
(lpData[uStart] == 0x02 && uState == 1){
if
( lpData[uStart + 4] == uString ||
lpData[uStart + 5] == uString ||
lpData[uStart + 6] == uString)
lpString = (
LPSTR
)(lpData + uIndex);
}
else
if
(lpData[uStart] == 0x03 && uString == 1){
switch
(lpData[uStart + 5])
{
default
: lpString =
"(Other)"
;
break
;
case
0x02: lpString =
"(Unknown)"
;
break
;
case
0x03: lpString =
"(Desktop)"
;
break
;
case
0x04: lpString =
"(Low Profile Desktop)"
;
break
;
case
0x06: lpString =
"(Mini Tower)"
;
break
;
case
0x07: lpString =
"(Tower)"
;
break
;
case
0x08: lpString =
"(Portable)"
;
break
;
case
0x09: lpString =
"(Laptop)"
;
break
;
case
0x0A: lpString =
"(Notebook)"
;
break
;
case
0x0E: lpString =
"(Sub Notebook)"
;
break
;
}
}
if
(lpString != NULL){
uLength =
strlen
(lpString) + 1;
if
(uSize > uLength + 1)
lpBuffer += wsprintf(lpBuffer,
"%s "
, lpString);
uSize -= uLength;
lpString = NULL;
}
uString++;
while
(lpData[uIndex++]);
}
while
(lpData[uIndex] && uIndex < uEnd);
uIndex++;
}
}
if
(lpData)
HeapFree(hHeap, 0, lpData);
SetLastError(lErr);
return
uSize;
}
int
APIENTRY WinMain(
HINSTANCE
hInst,
HINSTANCE
hPrev,
LPSTR
lpCmdLine,
int
nShowCmd)
{
TCHAR
szBuffer[128];
szBuffer[0] = 0;
InitCommonControls();
if
(GetComputerManufacturer(szBuffer, 128) < 0)
wsprintf(szBuffer,
"Failed: %d"
, GetLastError());
MessageBox(HWND_DESKTOP, szBuffer, TEXT(
"Manufacturer"
), MB_OK);
return
0;
}