Jump to content

Recommended Posts

  • 4 weeks later...
Posted

Hi, I am writing a clicker for L2 and stuck with smartguard. I understand that I have to use some trampoline to bypass api hook from smartguard, but I can't find good document on how using it.

 

As far as I understand, trampoline must be place in a DLL, and that DLL must inject to L2. I have to find what api guard.des is hooking and then write a trampoline to jump to original function. In my case, I need to use SendInput() or keybd_event() or SendMessage( [WM_KEYDOWN / WM_KEYUP] ). Then I must find the actual address of  these function in module User32.dll and then write a trampoline to jump back to this function. That is pretty much everything I understand about api hook / detours.

 

But It seem not right. I think I got it wrong somewhere.

 

I use hookshark to find which api detours guard.des using, and the only interesting detour I found on the L2.exe process is GetRawInputData and it doesn't make sense. So, Guard.des doesn't hook on SendInput, keybd_event or SendMessage as it is no use to write trampoline for these function.

 

This is where I stuck.

Appreciate any help :)

 

 

Posted

Why clicker? Just go for a bot. But if u really want to, the as far as i know L2 uses directinput which is resistant by nature of it to keybd_event or SendInput. Did you try inejcting messages directly to window procedure? This works in most cases. Dont use Hookshark program, write one yourself. The popular one has soem defects, doesnt show all hooks, especially cant scan ntdll where most of interesting stuff resides.

 

And what do you mean by saying "That is pretty much everything I understand about api hook" ? You have to avoid any modifications when creating a cheat, more mods = higher detect ratio and you definitel dont want it. Hooking is terrible idea (look at l2tower which hooks like 20 functions, doesnt work anywhere).

 

So right now reverse to the window creation, find the address of WndProc and try here. BTW Can you show screenshot with log from hookshark? Im interested how many did he find... :)

 

Greetz

Posted

Why clicker? Just go for a bot. But if u really want to, the as far as i know L2 uses directinput which is resistant by nature of it to keybd_event or SendInput. Did you try inejcting messages directly to window procedure? This works in most cases. Dont use Hookshark program, write one yourself. The popular one has soem defects, doesnt show all hooks, especially cant scan ntdll where most of interesting stuff resides.

 

And what do you mean by saying "That is pretty much everything I understand about api hook" ? You have to avoid any modifications when creating a cheat, more mods = higher detect ratio and you definitel dont want it. Hooking is terrible idea (look at l2tower which hooks like 20 functions, doesnt work anywhere).

 

So right now reverse to the window creation, find the address of WndProc and try here. BTW Can you show screenshot with log from hookshark? Im interested how many did he find... :)

 

Greetz

:dat: :dat:

Posted

I mean I am newb at hook and reverse engineering stuffs and that is what I've read somewhere from the internet  :D

 

Mouse hook and keyboard hook are the only kind of hook that I know. Since I am a noob clicker is easiest to code for me, and clicker is enough for me.

 

On some private high/mid rate server, there are other way to farm than hunt mobs, such as raid boss Zaken which need about 12 - 14 players (or 14 boxes on a single computer), and clicker is the best. My clicker just does SendMessage with WM_KEYDOWN / WM_KEYUP to the correct L2 hwnd(s) and everything is good: one player, one computer, 14 L2 client windows and one clicker. That's it.

 

Before L2 exilium upgraded with smartguard my clicker worked fine. You know what happened after they upgraded with smartguard  :D

 

Like I said, I am noob at this hook / detour stuffs, and the information I find on the internet is not helping much.

 

Here are the logs

post-133584-0-12635200-1443437460_thumb.png

usermodehook.txt

log.txt

Posted

The one which makes your clicker not work is most probably this:

 

[6596] L2.exe!window.dll->?StaticWndProc@WWindow@@SGJPAUHWND__@@IIJ@Z       || [0x1101C480] => guard.des [0x72FD382B]            || Inline - Detour [5 Bytes] || push ebp            || jmp 72FD3830h
 

Did you try to preapre the stack + original entry instructions and call it? This would work almost for sure

Posted (edited)

The one which makes your clicker not work is most probably this:

 

[6596] L2.exe!window.dll->?StaticWndProc@WWindow@@SGJPAUHWND__@@IIJ@Z       || [0x1101C480] => guard.des [0x72FD382B]            || Inline - Detour [5 Bytes] || push ebp            || jmp 72FD3830h

 

It starts to make sense. So, guard.des detours the callback function that handle all the messages sent to L2 client hwnd and filters out WM_KEYUP /  WM_KEYDOWN. That is probably why message WM_CHAR still works.

 

 

 

Did you try to preapre the stack + original entry instructions and call it? This would work almost for sure

Well, that is beyond my knowledge :D

 

But at least, I have something to search for. I guess I have a lot of reading to do.

 

Thanks alot.

Edited by 1413
Posted (edited)

I've never been using the detour/retour terminology :) You have to understand how hooking works and how do the "hooker" call real function. The algorithm is to copy instructions from the functions entry and overwrite them with a jump to your code, and create a jump back to real function using the copied instructions and adding a jump to it. If you manage to find or reproduce these instructions then you are set. It may sound very compilcated at start but u need to check it carefully. Do you use a debugger? Its million times easier with one

Edited by Szakalaka
Posted

I've never been using the detour/retour terminology :) You have to understand how hooking works and how do the "hooker" call real function. The algorithm is to copy instructions from the functions entry and overwrite them with a jump to your code, and create a jump back to real function using the copied instructions and adding a jump to it. If you manage to find or reproduce these instructions then you are set. It may sound very compilcated at start but u need to check it carefully. Do you use a debugger? Its million times easier with one

 

I had a hunch a debugger could be useful someday, then I collected some, such as IDA pro, ollydbg... But never use them before because I have no idea how to read ASM :D

 

So, I have to find the address of the callback function StaticWndProc in the memory, then overwrite the first 5 bytes with my instructions that jump to my_function in my_dll and then my function will jump back to the 6th byte and run the original StaticWndProc. I think I read somewhere they call it trampoline, but actually it is access memory of other process and overwrite a part of that process' memory with my instructions, am I right?

 

I have a question, since guard.des overwrite the first 5 bytes with inline-detour which jump to a function in guard.des, is that right? I think maybe we just need to overwrite that 5 bytes with the original 5 bytes of the original function, like undo what guard.des does and bam StaticWndProc now received WM_KEYDOWN again.

Posted

Welp i wrote a big post and it did not send it somehow... So basically u are right with the jump idea, but u cannot unhook guard.des, it will detect it immidietly. You can try to disable the checking loop but without asm knowledge u wont do it, so what you need to do is to reproduce first 5 bytes, then add jump to the 6th and call function that way. I may make short video on it maybe

Guest
This topic is now closed to further replies.



  • Posts

    • IOThread [3][47] (good) good IOThread [3][47] (good) good IOThread [3][47] (good) good     IOThread [6][78] (ahehe): ahehe
    • rly swired...leave low npcmakers ,its worked..not crash L2server.exe.   A:I:S:E:PE:DI:DE:BO=1.000000:1.000000:1.000000:1.000000:1.000000:0:0:0 L:Y:X:H=0:0:0:0:0 Crashed Thread[6]. Server Up Time : Wed Oct 15 13:11:08 2025 Current Time : Wed Oct 15 13:13:35 2025 Elapsed Time : 0 days 0 hours 2 minutes 27 seconds IOBufferPool - 39989 / 40000, PendingWrite 0 bytes [0] =============== object report user[0/0], npc[820/0], item[0/0], usersocket[0] =============== npc server connection log Connect : Wed Oct 15 13:13:34 2025 [(16328) 2025/10/15 13:13:35]: ======================= an Access Violation in module L2Server.exe at 0033:00518eef. start at 2025/10/15 13:11:08 Read from location ffffffff caused an access violation. Registers: EAX=0003dc7b CS=0033 EIP=00518eef EFLGS=00010207 EBX=a2228c44 SS=002b ESP=7da7f870 EBP=00000000 ECX=0003dc7b DS=002b ESI=00000000 FS=0053 EDX=00400000 ES=002b EDI=0c200dc0 GS=002b Bytes at CS:EIP: 48 8b 0c f0 80 79 5d 00 74 23 44 39 69 10 7f 1d Stack dump: 7da7f870: a2228c44 00000000 0004c158 00000000 009b2a10 00000000 00400000 00000000 7da7f890: 00000001 00000000 00000000 00000000 fffffffe ffffffff 00000000 40cae180 7da7f8b0: 00000000 40d11740 00000000 c0b1be00 00000000 00000000 00000000 00000000 7da7f8d0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 7da7f8f0: 3b19e2dc 00000000 0078e4c8 00000000 3b19e2dc 00000000 00400000 00000000 7da7f910: 0004c158 00000000 00000000 00000000 00000000 00000000 006c688a 00000000 7da7f930: a2228c44 00000000 00000000 00000000 00000000 00000000 00a2aa10 00000000 7da7f950: 012e6dc0 00000000 9beaee10 00000000 00000000 00000000 0004c158 00000000 7da7f970: 00000000 00000000 00a12d50 00000000 fffffffe ffffffff 0064dd24 00000000 7da7f990: fffffffe ffffffff 00000000 00000000 00000000 00000000 00000000 00000000 ver = Dec 16 2005_22:03:13 GuardInfo : IOThread [0][63] (good): void IOThread_common(void *arglist) -> bool NpcEnterWorldPacket(NpcSocket* pSocket, const unsigned char *pPacket) Lock Stack : IOThread [1][63] (good): void IOThread_common(void *arglist) -> bool NpcEnterWorldPacket(NpcSocket* pSocket, const unsigned char *pPacket) Lock Stack : IOThread [2][78] (good): void IOThread_common(void *arglist) -> bool NpcEnterWorldPacket(NpcSocket* pSocket, const unsigned char *pPacket) Lock Stack : IOThread [3][47] (good): void IOThread_common(void *arglist) -> bool NpcEnterWorldPacket(NpcSocket* pSocket, const unsigned char *pPacket) Lock Stack : IOThread [4][78] (good): void IOThread_common(void *arglist) -> bool NpcEnterWorldPacket(NpcSocket* pSocket, const unsigned char *pPacket) Lock Stack : IOThread [5][78] (good): void IOThread_common(void *arglist) -> bool NpcEnterWorldPacket(NpcSocket* pSocket, const unsigned char *pPacket) Lock Stack : IOThread [6][78] (ahehe): void IOThread_common(void *arglist) -> void CIOObject::TimerDispatch(bool bRootLoop) -> void CThreadLocalTimer::Dispath -> void CEnterWorldSerializer::TimerExpired(int id) -> void CNPC::EnterWorld(bool bSetDefaultParam, int nHP, int nMP) -> CCreature::EnterWorld Lock Stack : .\NpcSocket.cpp(278[116]) IOThread [7][78] (good): void IOThread_common(void *arglist) -> bool NpcEnterWorldPacket(NpcSocket* pSocket, const unsigned char *pPacket) -> void Push(int index, int x, int y, int z, int dir, int nSetDefaultParam, int nHP, int nMP) Lock Stack : .\NpcSocket.cpp(389[185]) ListenThread [13][141] (good): void ListenThread_common() -> unsigned __stdcall WaitThread(void *) Lock Stack : MainThread [12][156] (good): Lock Stack : GuardInfo end [(16328) 2025/10/15 13:13:35]: *.\ioc.cpp:648(Tue Dec 13 02:52:40 2005) exception  
    • We can help your Telegram channel, group, bot, or account appear first in Telegram search.   Our safe Telegram SEO service helps you rank your Telegram channel or bot for any keyword in just 72 hours.   No spam, no fake traffic — only real Telegram keyword ranking using premium user signals and smart optimization.   ✅ What We Offer • Top 1 Telegram Search Ranking Service (Channels · Groups · Bots · Accounts) • Rank Telegram channel, group, or bot safely with real engagement • Appear first in Telegram search for your target keyword • Pay-per-keyword with refund-backed guarantee • Global targeting (USA, EU, India)   🧩 Works Best For • Projects that need to appear first in Telegram search • Brands, crypto/NFT groups, trading or SaaS communities • Bot owners who want ranked visibility for their bot • Channels and groups needing more exposure   💡 Why Choose Us   We use safe Telegram SEO techniques — not spam — to deliver fast, stable Telegram top search results.   Our process helps your project gain organic visibility and steady traffic from real Telegram users.   📩 To Get More Information   Telegram: @TeleLoopPulse   Website : https://telegramgrowthstudio.com/telegram-search-ranking.html
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock