From cf121fb1f9733afcddfa7691e35886386cc78e20 Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Sat, 18 Jan 2025 11:38:43 -0300 Subject: [PATCH 1/8] Publishing updated version 1.3.4 --- rpm/vmdetect.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpm/vmdetect.spec b/rpm/vmdetect.spec index 0d678f9..fb0b813 100644 --- a/rpm/vmdetect.spec +++ b/rpm/vmdetect.spec @@ -17,7 +17,7 @@ Summary: Detect virtual machine environments Name: vmdetect -Version: 1.3.4+git20250117 +Version: 1.3.4 Release: 0 License: LGPL-3.0 Source: %{name}-%{version}.tar.xz From 6a03d7a81fc48b44fbbe679bd388205fea1344c4 Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Wed, 5 Feb 2025 10:58:39 -0300 Subject: [PATCH 2/8] Fixing legacy builds. --- src/vmdetect/vmdetect.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/vmdetect/vmdetect.cc b/src/vmdetect/vmdetect.cc index f428ce4..2999d87 100644 --- a/src/vmdetect/vmdetect.cc +++ b/src/vmdetect/vmdetect.cc @@ -17,7 +17,9 @@ * along with this program. If not, see . */ - #include + #ifdef HAVE_CONFIG_H + #include + #endif // HAVE_CONFIG_H #include #include From 4fde10f1f6a9373701fe73eec7b0517cc6bd2463 Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Sun, 16 Feb 2025 14:11:08 -0300 Subject: [PATCH 3/8] Adding static fields on standard pkg-config file. --- .vscode/settings.json | 5 +- meson.build | 2 + po/POTFILES.in | 1 + po/pt_BR.po | 485 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 492 insertions(+), 1 deletion(-) create mode 100644 po/pt_BR.po diff --git a/.vscode/settings.json b/.vscode/settings.json index 57da0c5..2527704 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,8 @@ { "C_Cpp.default.compileCommands": "/home/perry/project/udjat/vmdetect/.build/compile_commands.json", "C_Cpp.default.configurationProvider": "mesonbuild.mesonbuild", - "cmake.sourceDirectory": "/home/perry/project/udjat/vmdetect/wmi" + "cmake.sourceDirectory": "/home/perry/project/udjat/vmdetect/wmi", + "files.associations": { + "cstring": "cpp" + } } \ No newline at end of file diff --git a/meson.build b/meson.build index 7666432..be97117 100644 --- a/meson.build +++ b/meson.build @@ -197,6 +197,8 @@ if cxx.get_id() != 'msvc' pkg.generate( name: meson.project_name(), description: project_description, + requires_private: [ lib_deps ], + libraries_private: [ lib_deps ], libraries: [ '-lvmdetect' ] ) diff --git a/po/POTFILES.in b/po/POTFILES.in index 96566fa..fce09eb 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -3,3 +3,4 @@ src/libvmdetect/os/linux/virtualmachine.cc src/libvmdetect/os/windows/virtualmachine.cc src/python/get.cc src/vmdetect/vmdetect.cc +src/python/init.c diff --git a/po/pt_BR.po b/po/pt_BR.po new file mode 100644 index 0000000..27946e7 --- /dev/null +++ b/po/pt_BR.po @@ -0,0 +1,485 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# Perry Werneck , 2022-2024. +# +msgid "" +msgstr "" +"Project-Id-Version: libudjat 1.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-01-13 22:59-0300\n" +"PO-Revision-Date: 2025-01-10 15:10-0300\n" +"Last-Translator: Perry Werneck \n" +"Language-Team: Brazilian Portuguese \n" +"Language: pt_BR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Poedit-SourceCharset: utf-8\n" +"X-Generator: Poedit 3.5\n" + +#~ msgid "default" +#~ msgstr "padrão" + +#~ msgid "Normal" +#~ msgstr "Normal" + +#~ msgid "Agent has nothing to report" +#~ msgstr "Agente não tem nada a informar" + +#~ msgid "Agent controller" +#~ msgstr "Controlador de agentes" + +#~ msgid "Core/Module subsystem failed to initialize" +#~ msgstr "Inicialização do módulo principal falhou" + +#~ msgid "Get agent properties" +#~ msgstr "Obtém propriedades do agente" + +#~ msgid "System is ready" +#~ msgstr "Sistema em funcionamento" + +#~ msgid "No abnormal state was detected" +#~ msgstr "Nenhum estado anormal foi reportado" + +#~ msgid "Error activating state" +#~ msgstr "Erro ao ativar estado" + +#~ msgid "Unexpected error activating state" +#~ msgstr "Erro inesperado ao ativar estado" + +#, c++-format +#~ msgid "Module '{}' is not loaded" +#~ msgstr "Modulo '{}' não foi carregado" + +#, c++-format +#~ msgid "I dont know how to execute '{}'" +#~ msgstr "Não sei como executar '{}'" + +#~ msgid "System error" +#~ msgstr "Erro de sistema" + +#~ msgid "Operation failed" +#~ msgstr "Operação falhou" + +#~ msgid "on" +#~ msgstr "ligado" + +#~ msgid "off" +#~ msgstr "desligado" + +#~ msgid "Unable to set environment variable" +#~ msgstr "Incapaz de setar variável de ambiente" + +#, c++-format +#~ msgid "Usage:\t{} [options]" +#~ msgstr "Usage:\t{} [opções]" + +#~ msgid "Invalid property" +#~ msgstr "Propriedade inválida" + +#~ msgid "yes" +#~ msgstr "sim" + +#~ msgid "true" +#~ msgstr "verdadeiro" + +#~ msgid "no" +#~ msgstr "não" + +#~ msgid "false" +#~ msgstr "falso" + +#~ msgid "Operation has failed" +#~ msgstr "Operação falhou" + +#~ msgid "System Error" +#~ msgstr "Erro de sistema" + +#~ msgid "Information" +#~ msgstr "Informação" + +#~ msgid "Ok" +#~ msgstr "Ok" + +#~ msgid "The request succeeded." +#~ msgstr "Requisição concluída com sucesso." + +#~ msgid "Redirected" +#~ msgstr "Redirecionado" + +#~ msgid "The request was redirected to another URL." +#~ msgstr "Requisição foi redirecionada para outra URL." + +#~ msgid "Bad Request" +#~ msgstr "Requisição inválida" + +#~ msgid "" +#~ "The server cannot or will not process the request due to an apparent " +#~ "client error (e.g., malformed request syntax, size too large, invalid " +#~ "request message framing, or deceptive request routing)." +#~ msgstr "" +#~ "O servidor não pode ou não processará o pedido devido a um possível erro " +#~ "do cliente, por exemplo, requisição com sintaxe errada, resultado muito " +#~ "grande, enquadramento inválido or problema de rota." + +#~ msgid "Unauthorized" +#~ msgstr "Não autorizado" + +#~ msgid "" +#~ "Authentication is required and has failed or has not yet been provided." +#~ msgstr "Autenticação falhou ou não foi fornecida." + +#~ msgid "Forbidden" +#~ msgstr "Proibido" + +#~ msgid "" +#~ "The request contained valid data and was understood by the server, but " +#~ "the server is refusing action." +#~ msgstr "" +#~ "A requisição contem dados válidos e foi reconhecida pelo servidor, porem, " +#~ "o servidor se recusou a atuar." + +#~ msgid "Not found" +#~ msgstr "Não encontrado" + +#~ msgid "" +#~ "The requested resource could not be found but may be available in the " +#~ "future." +#~ msgstr "" +#~ "O recurso pedido não foi encontrado mas pode ficar disponível no futuro." + +#~ msgid "Proxy Authentication Required" +#~ msgstr "Proxy exige autenticação" + +#~ msgid "The client must first authenticate itself with the proxy." +#~ msgstr "O cliente deve primeiro autenticar no proxy." + +#~ msgid "Request Timeout" +#~ msgstr "Tempo da requisição esgotado" + +#~ msgid "" +#~ "The client did not produce a request within the time that the server was " +#~ "prepared to wait." +#~ msgstr "" +#~ "O cliente não gerou uma requisição no tempo que o servidor estava " +#~ "preparado para esperar." + +#~ msgid "Gone" +#~ msgstr "Gone" + +#~ msgid "" +#~ "The resource requested was previously in use but is no longer available " +#~ "and will not be available again." +#~ msgstr "O recurso pedido foi usado antes mas não estão mais disponívei." + +#~ msgid "Too many requests" +#~ msgstr "Muitas requisições" + +#~ msgid "" +#~ "Something is making your server work too hard, and it just can’t keep up" +#~ msgstr "Algo está fazendo seu servidor trabalhar além do limite" + +#~ msgid "Client error" +#~ msgstr "Erro de cliente" + +#~ msgid "Internal error" +#~ msgstr "Erro interno" + +#~ msgid "" +#~ "The server has encountered a situation it does not know how to handle." +#~ msgstr "O servidor encontrou uma situação que ele não sabe como resolver." + +#~ msgid "Not Implemented" +#~ msgstr "Não implementado" + +#~ msgid "" +#~ "The request method is not supported by the server and cannot be handled." +#~ msgstr "" +#~ "O método usado na requisição não é suportado pelo servidor e não pode ser " +#~ "atendido." + +#~ msgid "Bad gateway" +#~ msgstr "Gateway inválido" + +#~ msgid "" +#~ "The server, while working as a gateway to get a response needed to handle " +#~ "the request, got an invalid response." +#~ msgstr "O servidor está atuando como proxy e recebeu uma resposta inválida." + +#~ msgid "Service Unavailable" +#~ msgstr "Serviço indisponível" + +#~ msgid "" +#~ "The server is not ready to handle the request. Common causes are a server " +#~ "that is down for maintenance or that is overloaded." +#~ msgstr "" +#~ "O servidor não está pronto para atender à requisição. Pode estar inativo " +#~ "para manutenção ou sobrecarregado." + +#~ msgid "Gateway timeout" +#~ msgstr "Timeout no acesso ao gateway" + +#~ msgid "The server is acting as a gateway and cannot get a response in time." +#~ msgstr "" +#~ "O servidor está atuando como proxy e não conseguiu obter uma resposta no " +#~ "tempo esperado." + +#~ msgid "HTTP Version Not Supported" +#~ msgstr "Versão HTTP não suportada" + +#~ msgid "The HTTP version used in the request is not supported by the server." +#~ msgstr "A versão HTTP usada na requisição não é suportada pelo servidor." + +#~ msgid "Server error" +#~ msgstr "Erro de servidor" + +#~ msgid "Unexpected HTTP error code" +#~ msgstr "Código de erro HTTP inesperado" + +#~ msgid "The HTTP error code is unknown" +#~ msgstr "Código de erro HTTP desconhecido" + +#~ msgid "one second" +#~ msgstr "um segundo" + +#~ msgid "one hour" +#~ msgstr "uma hora" + +#, c++-format +#~ msgid "{} hours" +#~ msgstr "{} horas" + +#~ msgid "one minute" +#~ msgstr "um minuto" + +#, c++-format +#~ msgid "{} minutes" +#~ msgstr "{} minutos" + +#, c++-format +#~ msgid " {} seconds" +#~ msgstr " {} segundos" + +#, c++-format +#~ msgid " {} milliseconds" +#~ msgstr " {} millisegundos" + +#~ msgid "The message template is invalid" +#~ msgstr "O template de mensagem não é válido" + +#, c++-format +#~ msgid "Unable to get value of '{}'" +#~ msgstr "Incapaz de obter valor para '{}'" + +#~ msgid "\\StringFileInfo\\080904B0\\FileDescription" +#~ msgstr "\\StringFileInfo\\041604B0\\FileDescription" + +#~ msgid "The request has timed out" +#~ msgstr "Tempo da requisição esgotado" + +#~ msgid "Cant resolve hostname" +#~ msgstr "Não foi possivel resolver nome do host" + +#~ msgid "\t\tStart service" +#~ msgstr "\t\tIniciar serviço" + +#~ msgid "\t\tStop service" +#~ msgstr "\t\tParar serviço" + +#~ msgid "\t\tInstall service" +#~ msgstr "\t\tInstalar serviço" + +#~ msgid "\t\tUninstall service" +#~ msgstr "\t\tDesinstalar serviço" + +#~ msgid "\t\tReinstall service" +#~ msgstr "\t\tReinstalar serviço" + +#~ msgid "\t\tBlock access to 'net stop' on this request" +#~ msgstr "\t\tBloquear acesso a 'net stop' no serviço" + +#~ msgid "Yes" +#~ msgstr "Sim" + +#~ msgid "No" +#~ msgstr "Não" + +#~ msgid "Less than one minute" +#~ msgstr "Menos de um minuto" + +#~ msgid "{d} {D}" +#~ msgstr "{d} {D}" + +#~ msgid "{h} {H}" +#~ msgstr "{h} {H}" + +#~ msgid "{d} {D} and {h} {H}" +#~ msgstr "{d} {D} e {h} {H}" + +#~ msgid "{m} {M}" +#~ msgstr "{m} {M}" + +#~ msgid "{d} {D} and {m} {M}" +#~ msgstr "{d} {D} e {m} {M}" + +#~ msgid "{h} {H} and {m} {M}" +#~ msgstr "{h} {H} e {m} {M}" + +#~ msgid "{d} {D}, {h} {H} and {m} {M}" +#~ msgstr "{d} {D}, {h} {H} e {m} {M}" + +#~ msgid "days" +#~ msgstr "dias" + +#~ msgid "day" +#~ msgstr "dia" + +#~ msgid "hours" +#~ msgstr "horas" + +#~ msgid "hour" +#~ msgstr "hora" + +#~ msgid "minutes" +#~ msgstr "minutos" + +#~ msgid "minute" +#~ msgstr "minuto" + +#~ msgid "second" +#~ msgstr "segundo" + +#~ msgid "seconds" +#~ msgstr "segundos" + +#~ msgid "File protocol" +#~ msgstr "Protocolo de arquivo" + +#~ msgid "Subprocess/Script protocol" +#~ msgstr "Protocolo para subprocesso ou script" + +#~ msgid "undefined" +#~ msgstr "indefinido" + +#~ msgid "object" +#~ msgstr "objeto" + +#~ msgid "string" +#~ msgstr "texto" + +#~ msgid "signed" +#~ msgstr "com sinal" + +#~ msgid "unsigned" +#~ msgstr "sem sinal" + +#~ msgid "real" +#~ msgstr "ponto flutuante" + +#~ msgid "boolean" +#~ msgstr "condicional" + +#~ msgid "fraction" +#~ msgstr "fração" + +#~ msgid "icon" +#~ msgstr "ícone" + +#~ msgid "integer" +#~ msgstr "inteiro" + +#~ msgid "number" +#~ msgstr "numérico" + +#~ msgid "Unknown" +#~ msgstr "Desconhecido" + +#, c++-format +#~ msgid "Required attribute '{}' is missing" +#~ msgstr "Atributo necessário '{}' não foi encontrado" + +#~ msgid "The required attribute 'cmdline' is missing" +#~ msgstr "Atributo necessário 'cmdline' não está disponível" + +#~ msgid "Cant set subprocess user id" +#~ msgstr "Incapaz de definir o usuário do subprocesso" + +#~ msgid "Cant set subprocess group id" +#~ msgstr "Incapaz de definir o grupo do subprocesso" + +#~ msgid "System is not ready" +#~ msgstr "Sistema não está em funcionamento" + +#~ msgid "Invalid response type" +#~ msgstr "Resposta de tipo inválido" + +#~ msgid "Alert controller" +#~ msgstr "Controlador de alertas" + +#, c++-format +#~ msgid "Unable to determine internal alert type for node <{}>" +#~ msgstr "Incapaz de determinar o tipo de alerta interno para o nó <{}>" + +#, c++-format +#~ msgid "Unable to create alert for node <{}>" +#~ msgstr "Incapaz de criar alerta para o nó <{}>" + +#~ msgid "Abstract value is unable to handle items" +#~ msgstr "Valor abstrato não consegue manipular items" + +#, c++-format +#~ msgid "Cant find child '{}'" +#~ msgstr "Não encontrei elemento '{}'" + +#, c++-format +#~ msgid "Unable to append '{}' on abstract value" +#~ msgstr "Incapaz de adicionar '{}' em um valor abstrato" + +#, c++-format +#~ msgid "Unable to set '{}' as '{}' on abstract value" +#~ msgstr "Incapaz de setar '{}' como '{}' em um valor abstrato" + +#~ msgid "Agent subsystem is inactive" +#~ msgstr "Subsistema de agentes está inativo" + +#~ msgid "B" +#~ msgstr "B" + +#~ msgid "GB" +#~ msgstr "GB" + +#~ msgid "Gb" +#~ msgstr "Gb" + +#~ msgid "Invalid timer value" +#~ msgstr "Valor de timer inválido" + +#~ msgid "Kb" +#~ msgstr "Kb" + +#~ msgid "Mb" +#~ msgstr "Mb" + +#~ msgid "No reports on this path" +#~ msgstr "Nenhum relatório no caminho informado" + +#~ msgid "System is configured" +#~ msgstr "Sistema está configurado" + +#~ msgid "Tb" +#~ msgstr "Tb" + +#~ msgid "This request has no arguments" +#~ msgstr "A requisição não tem argumentos" + +#~ msgid "Unable to determine alert type for node <{}>" +#~ msgstr "Incapaz de determinar o tipo de alerta para o nó <{}>" + +#~ msgid "Unexpected error during reconfiguration" +#~ msgstr "Erro inesperado durante a configuração" + +#~ msgid "b" +#~ msgstr "b" From 63d272e86eeb8e67691afa81d2719a9c93f386b4 Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Thu, 8 May 2025 19:02:03 -0300 Subject: [PATCH 4/8] Debugging lto. --- meson.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index be97117..5d3aa14 100644 --- a/meson.build +++ b/meson.build @@ -56,7 +56,6 @@ compiler_flags = [ '-fvisibility=hidden', '-fPIC', '-ggdb3', - '-ffat-lto-objects', '-fvisibility=hidden', '-fPIC' ] @@ -221,6 +220,7 @@ static = static_library( config_src + lib_src, install: true, dependencies: lib_deps, + cpp_args: [ '-fno-lto' ], include_directories: includes_dir, link_args: linker_flags ) @@ -243,6 +243,7 @@ else config_src + lib_src, install: true, version : libversion, + cpp_args: [ '-ffat-lto-objects' ], gnu_symbol_visibility: 'hidden', dependencies: lib_deps, include_directories: includes_dir, From 4a8c21d911d301a630aceb799398201e9d42d3d6 Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Thu, 26 Jun 2025 21:21:32 -0300 Subject: [PATCH 5/8] Adding dependency. --- meson.build | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/meson.build b/meson.build index 5d3aa14..1ba2c80 100644 --- a/meson.build +++ b/meson.build @@ -225,6 +225,11 @@ static = static_library( link_args: linker_flags ) +static_library = declare_dependency( + link_with : static, + include_directories : includes_dir, +) + if cxx.get_id() == 'msvc' executable( From 80f5946a095922ee38c0bce928a3f65d179c741c Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Thu, 26 Jun 2025 21:28:44 -0300 Subject: [PATCH 6/8] Adding dynamic library dependency. --- meson.build | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/meson.build b/meson.build index 1ba2c80..06ae493 100644 --- a/meson.build +++ b/meson.build @@ -255,6 +255,11 @@ else link_args: linker_flags ) + dynamic_library = declare_dependency( + link_with : dynamic, + include_directories : includes_dir, + ) + executable( 'vmdetect', config_src + app_src, From 5a7199abf00d8ae6fce7943b4ba55bd258729176 Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Thu, 26 Jun 2025 22:57:23 -0300 Subject: [PATCH 7/8] Removing submodule. --- .gitmodules | 3 --- wmi | 1 - 2 files changed, 4 deletions(-) delete mode 100644 .gitmodules delete mode 160000 wmi diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index d9ea951..0000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "wmi"] - path = wmi - url = https://github.com/PerryWerneck/wmi.git diff --git a/wmi b/wmi deleted file mode 160000 index 72888c2..0000000 --- a/wmi +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 72888c2702f7d31a86e5b22f9019fff88207fe70 From b5c3aa29b6ca1fc4ae378c659ef3c00d59f56a70 Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Thu, 26 Jun 2025 23:11:11 -0300 Subject: [PATCH 8/8] Moving wmi source. --- .gitmodules | 3 +++ meson.build | 24 +++++++++--------------- src/wmi | 1 + 3 files changed, 13 insertions(+), 15 deletions(-) create mode 100644 .gitmodules create mode 160000 src/wmi diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..efe9321 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "src/wmi"] + path = src/wmi + url = https://github.com/PerryWerneck/wmi.git diff --git a/meson.build b/meson.build index 06ae493..6d3d2fa 100644 --- a/meson.build +++ b/meson.build @@ -142,21 +142,15 @@ if host_machine.system() == 'windows' 'src/libvmdetect/os/windows/virtualmachine.cc' ] - wmi = dependency('wmi++',required:false) - if wmi.found() - lib_deps += [ - dependency('wmi++') - ] - else - lib_src += [ - 'wmi/diaa_sami_comsupp/diaa_sami_comsupp.cpp', - 'wmi/src/wmi.cpp', - 'wmi/src/wmiresult.cpp', - ] - lib_includes += [ 'wmi/include' ] - if cxx.get_id() != 'msvc' - linker_flags += [ '-lwbemuuid', '-loleaut32', '-lole32' ] - endif + lib_src += [ + 'src/wmi/diaa_sami_comsupp/diaa_sami_comsupp.cpp', + 'src/wmi/src/wmi.cpp', + 'src/wmi/src/wmiresult.cpp', + ] + lib_includes += [ 'src/wmi/include' ] + + if cxx.get_id() != 'msvc' + linker_flags += [ '-lwbemuuid', '-loleaut32', '-lole32' ] endif else diff --git a/src/wmi b/src/wmi new file mode 160000 index 0000000..72888c2 --- /dev/null +++ b/src/wmi @@ -0,0 +1 @@ +Subproject commit 72888c2702f7d31a86e5b22f9019fff88207fe70