This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

How wireshark is generating GUID(Globally unique identifier)?

0

I created one plugin in lua. now i am making installer for that using NSIS At the time of uninstallation of my plugin i want to check if wireshark is running than donot uninstall it. I got logic todo that from wireshark.nsi(logic is defined in common.nsh) file.But in that logic there is mentioned one GUID Number {9CA78EEA-EA4D-4490-9240-FC01FCEF464B}. The logic of that file is mentioned below

${Do}

System::Call 'kernel32::OpenMutex(i 0x100000, b 0, t "Global${PROGRAM_NAME}-is-running-{9CA78EEA-EA4D-4490-9240-FC01FCEF464B}") i .R0' IntCmp $R0 0 checkRunningSession System::Call 'kernel32::CloseHandle(i $R0)' Goto isRunning

checkRunningSession: System::Call 'kernel32::OpenMutex(i 0x100000, b 0, t "${PROGRAM_NAME}-is-running-{9CA78EEA-EA4D-4490-9240-FC01FCEF464B}") i .R0' IntCmp $R0 0 notRunning System::Call 'kernel32::CloseHandle(i $R0)'

isRunning: ; You'd better go catch it. MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION "${PROGRAM_NAME} or one of its associated programs is running.$\r$\nPlease close it first." /SD IDCANCEL IDRETRY continueChecking Quit

notRunning: ${ExitDo}

I want to this GUID no is constant for wireshark?I mean is it same for platforms? If it so how it is integrated with Wireshark? Is it mentioned in wireshark source code?

asked 15 Jul ‘15, 02:42

ankit's gravatar image

ankit
65232328
accept rate: 25%


One Answer:

0

Yes it's a constant for all versions of Wireshark running on Windows and is defined in wsutil\file_util.c:

#define WIRESHARK_IS_RUNNING_UUID "9CA78EEA-EA4D-4490-9240-FC01FCEF464B"

arguably it should be in a header so it can be picked up by wireshark.nsi instead of being hard-coded, but it's unlikely to ever change.

answered 15 Jul '15, 03:42

grahamb's gravatar image

grahamb ♦
19.8k330206
accept rate: 22%

Thanks @grahamb for quick reply.May be my next question to you is not specific to wireshark. but i am just curious to know that how you guys generated this ID and integrated with wireshark? because as far as i know about GUID. it is generated by system itself randomly or by GUIDgen tool

(15 Jul '15, 04:00) ankit

Probably via a tool. The commit message is here.

Generating and using a GUID in this manner is perfectly safe, what's your concern?

(15 Jul '15, 05:39) grahamb ♦

Actually we have our own tool which is developed in Qt same as wireshark and it has problem like when the tool is open user can uninstall that but ideally it should not happen. then i have referred wireshark code to implement same logic to generate GUID. that's why i was asking. But now i get idea how to do that from your previous answer. Thanks again @grahamb

(16 Jul '15, 20:29) ankit