写了个开心网的外挂,同时学习了些开心网的一些小技巧
版权声明本声明 http://eric925.blogbus.com/logs/36785846.html 最近做blogbus插件广场项目,闲暇之余写了个开心网的抢车位外挂,在开心网的程序架构上学到了一些经验。 首先我注意到抢车位这个游戏停留在页面上数据是会即时更新的,而第一反映是ajax,然而
版权声明本声明
http://eric925.blogbus.com/logs/36785846.html
最近做blogbus插件广场项目,闲暇之余写了个开心网的抢车位外挂,在开心网的程序架构上学到了一些经验。
首先我注意到抢车位这个游戏停留在页面上数据是会即时更新的,而第一反映是ajax,然而为了控制服务器负载,是不应该不停产生请求的,分析后发现果然没有反复请求,而是在第一次访问页面的时候,把每个车位的盈利上限、下限、单位时间增长值等参数交给客户端,通过客户端js进行页面数据的更新。这样能有效降低请求数,同时提高用户体验。
其二,开心网的很多数据通过json传输给客户端,客户端js拼装数据展现给用户。比如侧边栏、还有很多插件的内容页。这样的好处是数据和页面的耦合度降低,调整显示效果和实现用户自定义化更容易,同时一定程度上减轻了服务器端的处理逻辑,提高开发的效率。在这方面,blogbus很多地方是通过document.write来实现,而不是json数据,虽然简化了服务器端处理逻辑,但在把数据部署在页面上的灵活性大大减少。
其三,开心网抢车位的反外挂代码。在抓包的时候看到一个acc变量,但它的值通过明文却没有搜索到,于是我意识到这是一个js生成的anti-bot校验码。最后在抢车位的页面找到如下代码:
- var gab16 = "c0af48b44127";
- var acc3 = "cbaktr0f1";
- function acc()
- {
- var acc = d7d65.length + gab16.charCodeAt(2);
- return acc;
- }
- var d7d65 = "7ec2d7bd3de3";
- var g761c = "90fc480bdfca";
- var acc3 = "cbaktr0f1";
- function acc()
- {
- var acc = d8a22.charCodeAt(1) + g761c.length;
- return acc;
- }
- var d8a22 = "640240afe45c";
var gab16 = "c0af48b44127"; var acc3 = "cbaktr0f1"; function acc() { var acc = d7d65.length + gab16.charCodeAt(2); return acc; } var d7d65 = "7ec2d7bd3de3"; var g761c = "90fc480bdfca"; var acc3 = "cbaktr0f1"; function acc() { var acc = d8a22.charCodeAt(1) + g761c.length; return acc; } var d8a22 = "640240afe45c";
反复测试后,发现这段代码通过随机的变量名和随机的方法来构造出acc值。有的时候是charCodeAt,有的时候是length,有的时候是substr。不过语法太过简单,轻而易举就能转化成php语法,一算就出来了。相比之下很多广告联盟的anti-bot代码更复杂很多。
其四,最近我们技术部在讨论静态文件的permanent link问题,看了看开心网这样包含不少图片/flash的页面,发现没有特别的部署permanent link,一些可能经常升级的js文件采用了filename-n.js这样的版本号部署,可是这个方案已经被我们否决了,原因是改一个静态文件得修改相关的动态程序模板。这种模式要求上线后的静态文件不能隔三岔五的修改,否则修改版本就要死人。不过开心网通过chinacdn来cdn的静态文件,流量压力有所减少吧。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Win11 Tips Sharing: One trick to skip Microsoft account login Windows 11 is the latest operating system launched by Microsoft, with a new design style and many practical functions. However, for some users, having to log in to their Microsoft account every time they boot up the system can be a bit annoying. If you are one of them, you might as well try the following tips, which will allow you to skip logging in with a Microsoft account and enter the desktop interface directly. First, we need to create a local account in the system to log in instead of a Microsoft account. The advantage of doing this is

In C language, it represents a pointer, which stores the address of other variables; & represents the address operator, which returns the memory address of a variable. Tips for using pointers include defining pointers, dereferencing pointers, and ensuring that pointers point to valid addresses; tips for using address operators & include obtaining variable addresses, and returning the address of the first element of the array when obtaining the address of an array element. A practical example demonstrating the use of pointer and address operators to reverse a string.

We often create and edit tables in excel, but as a novice who has just come into contact with the software, how to use excel to create tables is not as easy as it is for us. Below, we will conduct some drills on some steps of table creation that novices, that is, beginners, need to master. We hope it will be helpful to those in need. A sample form for beginners is shown below: Let’s see how to complete it! 1. There are two methods to create a new excel document. You can right-click the mouse on a blank location on the [Desktop] - [New] - [xls] file. You can also [Start]-[All Programs]-[Microsoft Office]-[Microsoft Excel 20**] 2. Double-click our new ex

VSCode (Visual Studio Code) is an open source code editor developed by Microsoft. It has powerful functions and rich plug-in support, making it one of the preferred tools for developers. This article will provide an introductory guide for beginners to help them quickly master the skills of using VSCode. In this article, we will introduce how to install VSCode, basic editing operations, shortcut keys, plug-in installation, etc., and provide readers with specific code examples. 1. Install VSCode first, we need

When editing text content in Word, you sometimes need to enter formula symbols. Some guys don’t know how to input the root number in Word, so Xiaomian asked me to share with my friends a tutorial on how to input the root number in Word. Hope it helps my friends. First, open the Word software on your computer, then open the file you want to edit, and move the cursor to the location where you need to insert the root sign, refer to the picture example below. 2. Select [Insert], and then select [Formula] in the symbol. As shown in the red circle in the picture below: 3. Then select [Insert New Formula] below. As shown in the red circle in the picture below: 4. Select [Radical Formula], and then select the appropriate root sign. As shown in the red circle in the picture below:

Win11 tricks revealed: How to bypass Microsoft account login Recently, Microsoft launched a new operating system Windows11, which has attracted widespread attention. Compared with previous versions, Windows 11 has made many new adjustments in terms of interface design and functional improvements, but it has also caused some controversy. The most eye-catching point is that it forces users to log in to the system with a Microsoft account. For some users, they may be more accustomed to logging in with a local account and are unwilling to bind their personal information to a Microsoft account.

Title: PHP Programming Tips: How to Jump to a Web Page within 3 Seconds In web development, we often encounter situations where we need to automatically jump to another page within a certain period of time. This article will introduce how to use PHP to implement programming techniques to jump to a page within 3 seconds, and provide specific code examples. First of all, the basic principle of page jump is realized through the Location field in the HTTP response header. By setting this field, the browser can automatically jump to the specified page. Below is a simple example demonstrating how to use P

Title: Learn the main function in Go language from scratch. As a simple and efficient programming language, Go language is favored by developers. In the Go language, the main function is an entry function, and every Go program must contain the main function as the entry point of the program. This article will introduce how to learn the main function in Go language from scratch and provide specific code examples. 1. First, we need to install the Go language development environment. You can go to the official website (https://golang.org
