Giter Site home page Giter Site logo

sakurakoi / battlefieldchat Goto Github PK

View Code? Open in Web Editor NEW
132.0 3.0 5.0 656 KB

External Chinese input tool for Battlefield 1 / 战地1 外置中文输入工具

License: GNU Affero General Public License v3.0

C++ 99.00% C 1.00%
battlefield battlefield-1 input-method memory keyboard

battlefieldchat's Introduction

Battlefield Chat

外置中文聊天输入工具 For Battlefield 1
External Chinese chat input tool for battlefield 1

下载最新版本 / Download latest version

showcase.png

  • 只有游戏语言为中文的客户端才能看见中文, 这意味着英文客户端看起来你打的字全是框框

  • 尽管这个工具是为了中文输入设计的, 但也能用来输入日语或韩语等多字节语言

  • Only the client whose game language is Chinese can see the Chinese text, which means that the English client looks like all the words you typed are all boxes

  • Although the tool is designed for Chinese input, it also works for Japanese. Korean, etc.

警告

  • 本工具直接读写游戏内存
  • 尽管理论上来说fairfight反作弊并不监控聊天区域的内存数据, 但仍然存在一定的风险
  • 作者不承担使用本工具造成的一切后果, USE AT YOUR OWN RISK
  • 你已经被警告过了

使用方式

  1. 打开游戏, 并以管理员权限启动输入工具
  2. 确保游戏的图形设置为 窗口化/无边框 (目前暂不支持全屏)
  3. 使用 J/K/L 打开聊天时, 输入工具会自动呼出输入窗口 (如果你改键了也一样能用)
  4. 像正常打字一样输入, 按回车发送, ESC取消
  5. Enjoy and have fun

Warning

  • This tool will directly read and write the game's memory.
  • Although in theory fairfight Anti-Cheat does not monitor memory area of the chat message, the risk is still presents.
  • The author does not assume any responsibility for the consequences of using this tool, USE AT YOUR OWN RISK
  • You have been warned

How to use

  1. Open the game, and start the input tool with administrator privileges.
  2. Make sure the game's graphics settings are set to windowed/borderless (fullscreen is not supported currently)
  3. When you use J/K/L to open chat, the input tool will automatically display the input window
  4. Type the message as you would normally type, press enter to send, ESC to cancel
  5. Enjoy and have fun

battlefieldchat's People

Contributors

sakurakoi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

battlefieldchat's Issues

全屏游戏检测

  • SHQueryUserNotificationState() == QUNS_BUSY || QUNS_RUNNING_D3D_FULL_SCREEN
  • IDirectDraw7::TestCooperativeLevel() == DDERR_EXCLUSIVEMODEALREADYSET

一局游戏结束时随机崩溃

0x140331900 -> test rcx+0xc = 1
rcx=0 因此0xC访问出错

暂且推断修改消息指针后, 游戏结束时释放内存导致的问题
懒得分析原因了, 简单粗暴解决问题
TODO: 发送消息完成后把指针恢复回去

增加根据聊天框自动切换系统输入法功能

目前按J打开聊天了,并不会切换输入法,需要玩家手动切换。玩家输入玩中文后,回到游戏要再次手动切换到美式键盘,这样每次输入都要重复上面操作,比较麻烦

希望可以:
打开聊天框自动切换输入法到中文状态,输入完成按回车回到游戏输入法切到美式键盘,依次循环

image

bug反馈及功能建议

我目前测试了v6和v7预览版本

我在使用种遇到一些问题:

  1. 如果是第一次启动中文输入工具,我在游戏里按J/K/L聊天,此时会弹出中文输入工具的输入框,但是焦点却不在中文输入工具的输入框上,而是在游戏自己的输入框上,需要玩家手动把鼠标移动到最上方的中文输入工具的输入框点击一下,焦点才会到这里,此时才可以正常输入中文,当中文输入工具的输入框获取到焦点后以后的输入都没有问题,此bug v6、v7版本均存在(不知道是不是只有我才有这个问题,我是win10 20H2)
  2. v7版本的转拼音我这里测试是这样,输入框输入的是中文,但是按回车键发送的却是空白,而不是拼音

一些输入框外观上的建议:

  1. 中文输入工具的输入框的字体可不可以改成与游戏类似的字体或者是微软雅黑,宋体看起来有点难受(当然不改也没啥影响的)
  2. 中文输入工具的输入框能不能改成那种文字颜色是白色的,背景的那种毛玻璃或者透明效果,边框弄细一点,这样看起来和游戏保持一致(当然不改也没啥影响的)

与Chrome产生冲突

有时Chrome会突然无响应,分析等待链后发现Chrome的一个进程正在等待BattlefieldChat

全屏输入的一点建议

前几天我也研究了几天战地的中文输入,做了一个玩具级别的输入工具。因为我没有逆向的相关经验,输入缓冲区的地址往上找了两级就不会了,所以我在每局开始都得先在输入框输入最长字符串,使输入缓冲区地址不再变化,自行搜索地址,然后填入我的小工具。
不过我这个工具也有好的地方,我是通过注册全局热键呼出的,程序接到热键消息后就把窗口激活然后置顶。由于战地1是全屏独占的,失去焦点后会最小化。在工具输入完成发送后,程序模拟按下键盘的 ALT+Tab,自动切回战地。
最大的痛点是不能全屏使用体验都不怎么好,所以找了很多资料,也就找到你这儿了。发现你把窗口化下的解决方案弄得比较完整了。
我分享一下我后面的研究方向:
全屏游戏似乎用 ImmDisableIME 禁用了输入法(自己写程序试过,症状和战地一样),有没有哪个 API 能够重新打开IME功能?(搜索了一段时间,没找到方案)
如果无论如何都不能打开这个窗口的 IME 功能,那么开启新的输入框架 TSF 是否可行?

如果实在不能在游戏内使用输入法,那可不可以在游戏外创建另一个拥有窗口的进程,把游戏内的击键传给这个进程(或者这个进程有办法在后台知道用户的击键)进行 IME 输入,这个进程把 IME 消息通过 SendMessage 发给游戏窗口,游戏内注入的代码就能响应IME消息了。
总之就是要么游戏窗口自己能打开输入法,要么想办法在游戏全屏不失去焦点的同时让另一个窗口能进行输入法输入。不管是谁,能产生IME消息就解决了。接收IME消息自绘输入窗口已经有现成的方案了。

最后有一个更麻烦的方法,就是在游戏内置输入法。游戏内键盘按下是有 WM_Char 消息的。
做这些有一个前提,战地的反外挂程序不会打扰我们吧?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.