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

    • This update resaves 25_25 from the original (with sounds) (without the cave below) Some emitter fixes (removed waterfalls with high-poly meshes) The geodata is old, but it works Everything else is unchanged Download P.S. The effect files are taken from the high client for Interlude, so if you're experiencing critical skills, use the default ones for your Version.  
    • GX-Ext Which file of the svn files should i edit to make blow skills to have 100% chance so i can add the settings in the IlExt.ini? because when im changing it from the skilldata.txt it just helps
    • 我们感谢您的 反馈 并希望让服务变得更加 优秀! 如果您使用过我们的服务并愿意分享您的体验(任何体验——积极或建设性),请在Trustpilot上留下评价,并获得$1作为感谢。 链接: https://www.trustpilot.com/review/socnet.pro 如何获得奖励: 1. 前往Trustpilot并留下您的评价 2. 向我们发送发布确认截图,以及带有与评价用户名一致的授权账户截图。 3. 指定哪个商店应收到这 $1 奖励。根据商店不同,可能需要您的用户名/电子邮箱。 您的反馈帮助我们成长,并让项目对社区中的每一位成员变得更好。感谢您与我们同行! 条款: 此活动仅适用于一个唯一用户。不允许多账号行为。 项目有效链接: 数字商品商店(网站): 前往 商店 Telegram 机器人: 前往 – 通过 Telegram 方便访问商店。 虚拟号码服务: 前往 用于购买 Telegram Stars 的 Telegram 机器人: 前往 – 在 Telegram 中快捷且优惠地购买 Stars。 SMM 面板: 前往 – 推广您的社交媒体账户。 我们想向您展示当前的 促销和特别优惠列表 用于购买我们提供的产品与服务: 1. 您可在首次购买时使用优惠码:SOCNET(15% 折扣) 2. 获得 $1 商店余额或 10–20% 折扣——只需在我们网站注册后,按照模板填写您的用户名:“SEND ME BONUS, MY USERNAME IS...”并在我们的论坛主题中发布! 3. 首次启动 SMM 面板可获得 $1:只需在我们的网站(Support)提交主题为 “Get Trial Bonus” 的工单。 4. 我们的 Telegram 频道以及 Stars 购买机器人中每周都有 Telegram Stars 抽奖! 新闻: ➡ Telegram 频道: https://t.me/accsforyou_shop ➡ WhatsApp 频道: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord 服务器: https://discord.gg/y9AStFFsrh 联系方式与支持: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
  • 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