<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Получение SID, переименование всех имен связанных с ahk]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=15812&amp;type=atom" />
	<updated>2020-11-11T13:38:14Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=15812</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Получение SID, переименование всех имен связанных с ahk]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=143433#p143433" />
			<content type="html"><![CDATA[<p>В таком случае должно быть официальное согласие что ты со своим ПО собираешь некую информацию у клиента, в противном случае это ничем не лучше обычного воровства. А в таком случае согласятся ли они его приобретать, если оно не будет столь уж уникальным, чтобы другие не смогли его повторить.</p>]]></content>
			<author>
				<name><![CDATA[AlexPidor]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=41190</uri>
			</author>
			<updated>2020-11-11T13:38:14Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=143433#p143433</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Получение SID, переименование всех имен связанных с ahk]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=143432#p143432" />
			<content type="html"><![CDATA[<p><strong>AlexPidor</strong> Можно получать SID и заносить его в базу на сайте, а потом ограничивать использование на копию скрипта. Ну это в теории, сейчас есть пару способов получения SID, а вот дальше пока не знаю как реализовать.</p>]]></content>
			<author>
				<name><![CDATA[Botsy]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=41069</uri>
			</author>
			<updated>2020-11-11T09:54:29Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=143432#p143432</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Получение SID, переименование всех имен связанных с ahk]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=143431#p143431" />
			<content type="html"><![CDATA[<p>Т.е. ты как-то должен себе сначала сид клиента запросить? Чтобы он тебе его сам дал? Или ты через сайт будешь передавать?</p>]]></content>
			<author>
				<name><![CDATA[AlexPidor]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=41190</uri>
			</author>
			<updated>2020-11-11T09:48:19Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=143431#p143431</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Получение SID, переименование всех имен связанных с ahk]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=143429#p143429" />
			<content type="html"><![CDATA[<p>Проблема решена: <br /></p><div class="codebox"><pre><code>
F11::

strComputer := &quot;.&quot;
strNamespace := &quot;\root\cimv2&quot;
strClass := &quot;Win32_Process&quot;
strHandle := DllCall(&quot;GetCurrentProcessId&quot;)    

objSWbemServices := ComObjGet(&quot;winmgmts:\\&quot;  strComputer  strNamespace)
objService := objSWbemServices.Get(&quot;Win32_Process.Handle=&#039;&quot; strHandle &quot;&#039;&quot;)
Sid := ComVar()
Result := objService.GetOwnerSid(Sid.ref)
if !Result
  MsgBox, % sid[]

ComVar(Type=0xC)
{
    static base := { __Get: &quot;ComVarGet&quot;, __Set: &quot;ComVarSet&quot;, __Delete: &quot;ComVarDel&quot; }
    ; Create an array of 1 VARIANT.  This method allows built-in code to take
    ; care of all conversions between VARIANT and AutoHotkey internal types.
    arr := ComObjArray(Type, 1)
    ; Lock the array and retrieve a pointer to the VARIANT.
    DllCall(&quot;oleaut32\SafeArrayAccessData&quot;, &quot;ptr&quot;, ComObjValue(arr), &quot;ptr*&quot;, arr_data)
    ; Store the array and an object which can be used to pass the VARIANT ByRef.
    return { ref: ComObjParameter(0x4000|Type, arr_data), _: arr, base: base }
}
ComVarGet(cv, p*) { ; Called when script accesses an unknown field.
    if p.MaxIndex() = &quot;&quot; ; No name/parameters, i.e. cv[]
        return cv._[0]
}
ComVarSet(cv, v, p*) { ; Called when script sets an unknown field.
    if p.MaxIndex() = &quot;&quot; ; No name/parameters, i.e. cv[]:=v
        return cv._[0] := v
}
ComVarDel(cv) { ; Called when the object is being freed.
    ; This must be done to allow the internal array to be freed.
    DllCall(&quot;oleaut32\SafeArrayUnaccessData&quot;, &quot;ptr&quot;, ComObjValue(cv._))
}

return

F12::exitApp
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Botsy]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=41069</uri>
			</author>
			<updated>2020-11-11T09:41:10Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=143429#p143429</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Получение SID, переименование всех имен связанных с ahk]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=143312#p143312" />
			<content type="html"><![CDATA[<p>- Можно ли изменить как-то номер SID через реестр, чтобы код не работал ? (ну если бы там была проверка на первоначальный SID). <br />- Еще можно получить этот SID через cmd/powershell -&gt; whoami /user . Если окажется, что можно изменять SID через реестр, то можно ли в коде получать этот SID через cmd ? </p><div class="codebox"><pre><code>
#NoEnv 

F10::

regSID := rgtSID() 
msgbox, %regSID%

rgtSID()
{
	loop,HKLM,SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList,1,1
	{
		if(a_loopRegName=&quot;ProfileImagePath&quot;)
		{
        regRead,rProf
        if(inStr(rProf,a_userName))
		stringReplace,SID,a_loopRegSubKey,SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\,,
		}
	}
	return % SID
}

return
</code></pre></div><p>Подумал не создавать две темы, а написать в одну. Всё таки это относиться к недавнему обсуждению про сохранение информации.<br />- Как можно переименовать все, что связано с AHK ? Например имя процесса, иконку и остальное, чем можно связать программу с AHK.</p><p>Вроде логично это переименовать, чтобы затормозить определение, на чем именно была написана программа. Когда запускаешь другое ПО, там же не написаны инициалы языка или софта, благодаря которому, она была сделана. <br />Нашел на этом форуме одну тему <a href="http://forum.script-coding.com/viewtopic.php?id=7472">http://forum.script-coding.com/viewtopic.php?id=7472</a>, но это немного не то, прятать же ничего не надо. </p><p>Если уже есть где-то эта информация, буду благодарен за ссылку или наводку.</p>]]></content>
			<author>
				<name><![CDATA[Botsy]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=41069</uri>
			</author>
			<updated>2020-11-07T19:08:36Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=143312#p143312</id>
		</entry>
</feed>
