当前位置:网站首页>Flash multi open
Flash multi open
2022-07-22 03:37:00 【friendan】
some flash Call after the user logs in SharedObject.getLocal("browserSO");
Put the user KEY Save information to file browserSO.sol
And keep reading browserSO.sol file , According to the read KEY And stored in memory after login KEY Compare ,
If it's not the same , It means that the user has opened more , here flash Will automatically exit ....
I know why , See how to solve it
The first thing that comes to mind HOOK CreateFileW Replace file path , In this way, each process saves and reads different files , You can drive more
Do as you say , After replacing the file path , I can't find out ,TrueCreateFileW Calls always return failures , Unknown cause ...
So replacing the file path doesn't work , Then try another way :
1、HOOK CreateFileW preservation browserSO.sol The handle of
2、HOOK WriteFile Write browserSO.sol Save a copy of the data
3、HOOK ReadFile Back in the HOOK WriteFile The saved browserSO.sol data
This will ensure that each flash Each process reads its own browserSO.sol The file , That is, you can open more ...
The main codes are as follows :
HANDLE WINAPI MyCreateFileW(
LPCWSTR lpFileName,
DWORD dwDesiredAccess,
DWORD dwShareMode,
LPSECURITY_ATTRIBUTES lpSecurityAttributes,
DWORD dwCreationDisposition,
DWORD dwFlagsAndAttributes,
HANDLE hTemplateFile)
{
HANDLE hRet = TrueCreateFileW(
lpFileName,
dwDesiredAccess,
dwShareMode,
lpSecurityAttributes,
dwCreationDisposition,
dwFlagsAndAttributes,
hTemplateFile);
// flash More open
// SharedObject.getLocal("browserSO");
// I wanted to replace lpFileName The path of
// Replace lpFileName After the path of , Discovery call TrueCreateFileW Always fail ,
// Error code :3 The system could not find the specified path The actual path exists , Compare the files you created manually
// Therefore, we can only save the country by curving
// 1、 preservation browserSO.sol Handle to the file
// 2、WriteFile Copy a copy of data when
// 3、ReadFile Shi Ba Zai WriteFile The data copied in is returned to Flash that will do
// namely Flash Write what data Return the written data when reading data In this way, you can open more
if (wcsstr(lpFileName, L"browserSO.sol") != NULL)
{
gBrowserSO = hRet;
//OutputDebugStringA("MyCreateFileW");
}
return hRet;
}
BOOL WINAPI MyWriteFile(
HANDLE hFile,
LPCVOID lpBuffer,
DWORD nNumberOfBytesToWrite,
LPDWORD lpNumberOfBytesWritten,
LPOVERLAPPED lpOverlapped)
{
if (hFile == gBrowserSO)
{
/*char szLog[1024] = { 0 };
sprintf(szLog, "hook MyWriteFile nNumberOfBytesToWrite=%d", nNumberOfBytesToWrite);
OutputDebugStringA(szLog);*/
memcpy(gDataBrowserSO, lpBuffer, nNumberOfBytesToWrite);
gDataBrowserSOLen = nNumberOfBytesToWrite;
}
return TrueWriteFile(hFile, lpBuffer, nNumberOfBytesToWrite, lpNumberOfBytesWritten, lpOverlapped);
}
BOOL WINAPI MyReadFile(
HANDLE hFile,
LPVOID lpBuffer,
DWORD nNumberOfBytesToRead,
LPDWORD lpNumberOfBytesRead,
LPOVERLAPPED lpOverlapped)
{
if (hFile == gBrowserSO && gDataBrowserSOLen > 0)
{
/*char szLog[1024] = { 0 };
sprintf(szLog, "hook MyReadFile nNumberOfBytesToRead=%d", nNumberOfBytesToRead);
OutputDebugStringA(szLog);*/
memcpy(lpBuffer, gDataBrowserSO, gDataBrowserSOLen);
if (lpNumberOfBytesRead != NULL)
{
*lpNumberOfBytesRead = gDataBrowserSOLen;
}
return TRUE;
}
return TrueReadFile(hFile, lpBuffer, nNumberOfBytesToRead, lpNumberOfBytesRead, lpOverlapped);
}
边栏推荐
- Resttemplate returns character garbled
- Baidu map, Gaode map, Tencent map Trinity map positioning development
- 决策树_ID3_C4.5_CART
- How to make the demand unable to go online smoothly as scheduled (I) overall strategy
- 训练精度媲美 AlphaFold2、速度翻倍,飞桨螺旋桨HelixFold训练和推理代码全面开源...
- Part 101 blind box smart contract (erc1155)
- yii2 JsBlock::begin 无效问题
- SystemVerilog:如何指定仿真源文件?
- ModelArts、盘古大模型、ModelBox…详解华为云AI开发生产线
- 3D basis of mathematics in games
猜你喜欢
訓練精度媲美 AlphaFold2、速度翻倍,飛槳螺旋槳HelixFold訓練和推理代碼全面開源...
Multimodal model clip4clip takes you to realize mutual search between text and video
Discussion on the practice of layaair
[first launch in the whole network] redis series 4: sentinel (sentinel mode) with high availability
Mathematical angles, radians and trigonometric functions in the game
Neural network GCNN of drawing machine
Jenkins installs and configures the accelerator
JS tutorial practice (JS Foundation)
浅谈npm 构建流程及package.json和 package.lock.json的工作流程
阿里云技术专家杨泽强:弹性计算云上可观测能力构建
随机推荐
Nacos配置中心之环境准备
Comptroller in compound, part 105
Try to divide to find the divisor
Series operation of deque container (detailed explanation)
Implementing DDD based on ABP -- domain service, application service and dto practice
怎样才能让需求无法如期顺利上线(一)整体策略
第98篇 Truffle
Base64 encryption and decryption
迅为龙芯开发板流程运行busybox,buildroot,loognix,QT5.12系统
Simple special effect production byunityparticlesystem
Redis master-slave replication and sentinel mode
Various interpolation of mathematics in the game
GBDT框架
Instrumentation, three-phase ammeter LCD segment code LCD low-power anti-interference drive ic-vk2c23a/b (dic/cob can be output)
Yarn 的 Plug‘n‘Play 特性
JS tutorial practice (JS Foundation)
第95篇 笔记-solidity中的继承(Inheritance)
CLion配置WSL工具链
【已解决】cvc-datatype-valid.1.2.1: ‘‘ 不是 ‘NCName‘ 的有效值。
(数论板子)约数个数与约数之和