Jump to content

Mark-

Members
  • Content Count

    38
  • Joined

  • Last visited

Community Reputation

3 Neutral

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Mark-

    brcc32 and rc file format...

    Hello, Bingo. Thank you. OK, is that a better resource compiler? It only had the string table as shown above. The file encoding was the issue. Everyone, thanks for the help. Mark
  2. Mark-

    brcc32 and rc file format...

    Hello, Thanks timfrost for the response. I copied/pasted the example code into the RC file, complied (Shift F9) and got the same error message. Perhaps string table or RCDATA, I have not decided. At this point I am just trying to get anything to compile. Mark
  3. Mark-

    brcc32 and rc file format...

    Hello, Thanks for the response. I added in the first post, the error is on the first line. Every example I could find on the web, in many formats. I could not find a single working example. Mark
  4. Hello, Delphi 10.2 I am trying to compile an RC file included with the project. {$R 'ResStr.res' 'ResStr.rc'} Regardless of what I put in the RC file I get [on the first line]: [BRCC32 Error] ResStr.rc(1): Fatal error Expecting resource name or resource type name Ideas or anyone have a sample RC file that complies without error? Thanks, Mark
  5. Sockets without a doubt. Plus if the request comes in for source and destination on different computers, no or very few changes required.
  6. Happy Holidays & Merry Christmas!
  7. Mark-

    Unit uDGVMUtils and 64 bit...

    Thanks for the response. Why do you think/know those registry values cannot be changed without causing a failure of the the guest OS or host program?
  8. Mark-

    Unit uDGVMUtils and 64 bit...

    Thanks for the reply. The issue with 64 bit support is the "asm" portions for two reasons. 64 bit assembly uses different opcodes from 32 bit and different register notation. Delphi does not allow the mixing of asm and Pascal in 64 bit.
  9. Hello, Has anyone converted this unit to work on 64 bit and 32 bit? Thanks, Mark unit uDGVMUtils; interface (******************************************************************************* uDGVMUtils -- is an attempt to create one of the best virtual machine detector methods, feel free to contribute in any way you wish. Version 1.1, 2010-01-15 Copyright© you are free to use it for comercial, private or both purposes Contributors: Dorin Duminica Chee Meng *******************************************************************************) type TVMWareVersion = ( vvExpress = 1, vvESX, vvGSX, vvWorkstation, vvUnknown, vvNative); const VMWARE_VERSION_STRINGS: array [TVMWareVersion] of string = ( 'Express', 'ESX', 'GSX', 'Workstation', 'Unknown', 'Native'); type TVirtualMachineType = ( vmNative, vmVMWare, vmWine, vmVirtualPC, vmVirtualBox); const VIRTUALMACHINE_STRINGS: array[TVirtualMachineType] of string = ( 'Native', 'VMWare', 'Wine', 'Virtual PC', 'Virtual Box'); function IsRunningVMWare(var AVMWareVersion: TVMWareVersion): Boolean; overload; function IsRunningVMWare: Boolean; overload; function IsRunningWine(var AWineVersion: string): Boolean; overload; function IsRunningWine: Boolean; overload; function IsRunningVirtualPC: Boolean; function IsRunningVBox: Boolean; function IsRunningVM(var AVMVersion: string): Boolean; overload; function IsRunningVM: Boolean; overload; implementation uses SysUtils,Windows,Vcl.Dialogs; function IsRunningVMWare(var AVMWareVersion: TVMWareVersion): Boolean; const CVMWARE_FLAG = $564D5868; var LFlag: Cardinal; LVersion: Cardinal; begin LFlag := 0; try asm push eax push ebx push ecx push edx mov eax, 'VMXh' mov ecx, 0Ah mov dx, 'VX' in eax, dx mov LFlag, ebx mov LVersion, ecx pop edx pop ecx pop ebx pop eax end; except // uncomment next two lines if you wish to see exception // on E: Exception do // ShowMessage(E.message); end; // trye if LFlag = CVMWARE_FLAG then begin Result := True; case LVersion of 1: AVMWareVersion := vvExpress; 2: AVMWareVersion := vvESX; 3: AVMWareVersion := vvGSX; 4: AVMWareVersion := vvWorkstation; else AVMWareVersion := vvUnknown; end end else begin Result := False; AVMWareVersion := vvNative; end; // if LFlag = CVMWARE_FLAG then begin end; function IsRunningVMWare: Boolean; var LVMWareVersion: TVMWareVersion; begin Result := IsRunningVMWare(LVMWareVersion); end; function IsRunningWine(var AWineVersion: string): Boolean; type TWineGetVersion = function: PAnsiChar;{$IFDEF Win32}stdcall;{$ENDIF} TWineNTToUnixFileName = procedure (P1: Pointer; P2: Pointer);{$IFDEF Win32}stdcall;{$ENDIF} var LHandle: THandle; LWineGetVersion: TWineGetVersion; LWineNTToUnixFileName: TWineNTToUnixFileName; begin Result := False; AWineVersion := 'Unknown'; LHandle := LoadLibrary('ntdll.dll'); if LHandle > 32 then begin LWineGetVersion := GetProcAddress(LHandle, 'wine_get_version'); LWineNTToUnixFileName := GetProcAddress(LHandle, 'wine_nt_to_unix_file_name'); if Assigned(LWineGetVersion) or Assigned(LWineNTToUnixFileName) then begin Result := True; if Assigned(LWineGetVersion) then AWineVersion := ANSIString(LWineGetVersion); // AWineVersion := StrPas(LWineGetVersion); end; // if Assigned(LWineGetVersion) or ... FreeLibrary(LHandle); end; // if LHandle > 32 then begin end; function IsRunningWine: Boolean; var LWineVersion: string; begin Result := IsRunningWine(LWineVersion); end; function IsRunningVirtualPC: Boolean; asm push ebp; mov ebp, esp; mov ecx, offset @exception_handler; push ebx; push ecx; push dword ptr fs:[0]; mov dword ptr fs:[0], esp; mov ebx, 0; // Flag mov eax, 1; // VPC function number // call VPC db $0F, $3F, $07, $0B mov eax, dword ptr ss:[esp]; mov dword ptr fs:[0], eax; add esp, 8; test ebx, ebx; setz al; lea esp, dword ptr ss:[ebp-4]; mov ebx, dword ptr ss:[esp]; mov ebp, dword ptr ss:[esp+4]; add esp, 8; jmp @ret1; @exception_handler: mov ecx, [esp+0Ch]; mov dword ptr [ecx+0A4h], -1; // EBX = -1 ->; not running, ebx = 0 -> running add dword ptr [ecx+0B8h], 4; // ->; skip past the call to VPC xor eax, eax; // exception is handled @ret1: end; function IsRunningVBox: Boolean; function Test1: Boolean; var LHandle: Cardinal; begin Result := False; try LHandle := LoadLibrary('VBoxHook.dll'); Result := (LHandle <> 0); if Result then FreeLibrary(LHandle); except end; // trye end; // function Test1: Boolean; function Test2: Boolean; var LHandle: Cardinal; begin Result := False; try LHandle := CreateFile( '\\\\.\\\VBoxMiniRdrDN', GENERIC_READ, FILE_SHARE_READ, NIL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0); Result := (LHandle <> INVALID_HANDLE_VALUE); if Result then CloseHandle(LHandle); except end; // trye end; // function Test2: Boolean; begin Result := Test1 or Test2; end; function IsRunningVM(var AVMVersion: string): Boolean; begin AVMVersion := VIRTUALMACHINE_STRINGS[vmNative]; Result := True; if IsRunningWine then AVMVersion := VIRTUALMACHINE_STRINGS[vmWine] else if IsRunningVMWare then AVMVersion := VIRTUALMACHINE_STRINGS[vmVMWare] else if IsRunningVirtualPC then AVMVersion := VIRTUALMACHINE_STRINGS[vmWine] else if IsRunningVBox then AVMVersion := VIRTUALMACHINE_STRINGS[vmVirtualBox] else begin AVMVersion := VIRTUALMACHINE_STRINGS[vmNative]; Result := False; end; end; function IsRunningVM: Boolean; var LVMVersion: string; begin Result := IsRunningVM(LVMVersion); end; end.
  10. Right but you can set the properties individually, right? (not referring to the sample)
  11. Thanks. No SSL for this project. I was planning on updating the Wiki with data. Proxy is the IP address or host name. ProxyConnection is 'Keep-Alive' or blank ProxyURL is as you say. I updated the Wiki. Let me know if any of the above is incorrect.
  12. Hello, I will control both ends of the data pipe and payload. A customer has informed me a proxy is used. Never used a proxy so scoping out what requires attention for success. From the server end it appears nothing to do. Perhaps that is wrong. For the client end I see: ProxyAuth, select one of the options. ProxyPassword, a password if ProxyAuth is other than httpAuthNone. ProxyUername, a username if ProxyAuth is other than httpAuthNone. ProxyPort, the port of the proxy server. Proxy, seems to be the IP address or host name. ProxyConnection, seems to be a keep-alive setting, not sure ProxyURL, not sure perhaps can specify all needed properties in one url string. The last three, not sure what to do with them. Any documents I can read or anyone shed some light? Thanks, Mark
  13. Mark-

    Windows product ID (from the registry)...

    Thanks very much for the code. It is very interesting. Am I wrong to think that some values, while using WMI to fetch the values, WMI retrieves the values from the registry?
×