jideco 发表于 2022-12-6 08:57

jideco 发表于 2022-12-6 09:35

bester 发表于 2022-12-6 10:49

010edit   hexworkshop   Hex Editor Neo Ultimate Edition 都试过了不行?

jideco 发表于 2022-12-6 11:25

boxer 发表于 2022-12-6 11:37

会编程的自己写个啊, 几行代码的事

jyjjf 发表于 2022-12-6 14:27

查找替换控件本身的字符长度限制,真没办法了

jideco 发表于 2022-12-6 14:27

思想者 发表于 2023-2-14 11:35

偶然看到这个贴, 不然我都不知道winhex在搜索长度有限制50字节, 这个限制有点奇怪, 不应该限制才对, 我现在用的v20.7也是会, 搞不懂官方.

冥界3大法王 发表于 2023-2-14 16:24

本帖最后由 冥界3大法王 于 2023-2-14 16:27 编辑

bester 发表于 2022-12-6 10:49
010edit   hexworkshop   Hex Editor Neo Ultimate Edition 都试过了不行?哥们,你也来了,哈哈。
010editor的脚本,貌似没有Hex Editor Neo的厉害
比如完成以下功能:(粗看了一下帮助,貌似后者可以做到,是真的吗?){:301_997:}
查找0x985A地址 ,往前1000byte之间有特征码,替换之,有几个就输出几个补丁

最新版本7.2.7的HOOK,注册成功,没几分钟就程序就重启了。
导致刚才的着色分析白忙了,调试的有点名堂了,差点给我弄死机。。有时间研究下吧。。。

@jideco
Q群他们说我是踩坑儿和破暗桩的高手,于是我就冒出来了。我来回答你的问题吧。
一次偶尔的机会,在Delphi的某控件的批处理破解了发现了如下的命令:
我感觉可行,你可以试一下。自己试着做了几个批处理的补丁,感觉省地轻快。这里边用winrar解开竟然是*.xml文件,不知是什么鬼?
命令行却也不影响使用。
https://wwgc.lanzouy.com/iBEQ30njrr8f

@echo off
setlocal enabledelayedexpansion

TITLE

net session >nul 2>&1
if NOT %errorLevel% == 0 (
    echo INFO: Administrative permissions required.
    echo.
    echo       Run AutoPatch.cmd as ADMIN:
    echo.
    echo.      * Right-click file "AutoPatch.cmd" in explorer and
    echo.      * Choose "Run as administrator"
    echo.
    pause
    exit /b
)

%~d0
cd %~p0

dir "%~dp0EurekaLogCore*.bpl" /s /b 1>NUL 2>NUL
if errorlevel 1 (
   echo INFO: Current directory is not installdir
   echo.
   echo       Run AutoPatch.cmd in installdir ...
   echo.
   pause
   exit /b      
)

set "DelphiIDE="

dir "%~dp0EurekaLogCore280.bpl" /s /b 1>NUL 2>NUL
if not errorlevel 1 (
   set "DelphiIDE=Delphi 11 Alexandria"
)

dir "%~dp0EurekaLogCore270.bpl" /s /b 1>NUL 2>NUL
if not errorlevel 1 (
   set "DelphiIDE=!DelphiIDE!   Delphi 10.4 Sydney"
)

dir "%~dp0EurekaLogCore260.bpl" /s /b 1>NUL 2>NUL
if not errorlevel 1 (
   set "DelphiIDE=!DelphiIDE!   DX10.3 Rio"
)

dir "%~dp0EurekaLogCore250.bpl" /s /b 1>NUL 2>NUL
if not errorlevel 1 (
   set "DelphiIDE=!DelphiIDE!   DX10.2 Tokyo"
)

dir "%~dp0EurekaLogCore70.bpl" /s /b 1>NUL 2>NUL
if not errorlevel 1 (
   set "DelphiIDE=!DelphiIDE!   Delphi 7"
)

if "%DelphiIDE%"=="" (
   echo INFO: No supported version of EurekaLog found.
   echo.
   echo       AutoPatch.cmd will be terminated now ...
   echo.
   pause
   exit /b      
)

echo ******************************************************************
echo AutoPatch forv7.10.2.0 (D7/Tokyo/Rio/Sydney/Alexandria)
echo ******************************************************************
echo.

set starttime=%time%

set "INSTDIR=%~dp0"
set INSTDIR=%INSTDIR:~0,-1%

set "SYSDIR=C:\Windows\System32"

set "WOW64="
if exist "!PROGRAMFILES(X86)!" (
   set "SYSDIR=C:\Windows\SysWOW64"
   set "WOW64=WOW6432Node\"
)

echo Please wait a few seconds ...
echo.
echo Step 1/2: Patching EurekaLog for %DelphiIDE%
echo.

sfk189.exe rep -bin /75033B04245A5874/75033B04245A58EB/-quiet -dir . -yes -file EurekaLogExpert*.bpl
sfk189.exe rep -bin /558BECB9080000006A006A004975F9515333C055/C38BECB9080000006A006A004975F9515333C055/-quiet -dir . -yes -file EModules.dcu
sfk189.exe rep -bin /558BECB9090000006A006A004975F9535633C055/C38BECB9090000006A006A004975F9535633C055/-quiet -dir . -yes -file EModules.dcu
sfk189.exe rep -bin /55534881ECC8000000488BEC48C7452800000000/C3534881ECC8000000488BEC48C7452800000000/-quiet -dir . -yes -file EModules.dcu
sfk189.exe rep -bin /55534881EC28010000488BEC48C7453800000000/C3534881EC28010000488BEC48C7453800000000/-quiet -dir . -yes -file EModules.dcu
sfk189.exe rep -bin /0300008B4068BAFF000000/0300008B4068BA0099FF00/ -quiet -dir . -yes -file EurekaLogExpert70.bpl
sfk189.exe rep -bin /0400008B4074BAFF000000/0400008B4074BA0099FF00/ -quiet -dir . -yes -file EurekaLogExpert250.bpl EurekaLogExpert260.bpl EurekaLogExpert270.bpl EurekaLogExpert280.bpl                     
sfk189.exe rep -bin /00E88474FFFFB2018B86680300/00E88474FFFFB2008B86680300/-quiet -dir . -yes -file EurekaLogExpert70.bpl
sfk189.exe rep -bin /8B8040040000B201E8FA53FFFF/8B8040040000B200E8FA53FFFF/-quiet -dir . -yes -file EurekaLogExpert250.bpl
sfk189.exe rep -bin /8B8040040000B201E88653FFFF/8B8040040000B200E88653FFFF/-quiet -dir . -yes -file EurekaLogExpert260.bpl
sfk189.exe rep -bin /8B8650040000B201E8DE4FFFFF/8B8650040000B200E8DE4FFFFF/-quiet -dir . -yes -file EurekaLogExpert270.bpl
sfk189.exe rep -bin /8B8658040000B201E8D64FFFFF/8B8658040000B200E8D64FFFFF/-quiet -dir . -yes -file EurekaLogExpert280.bpl
sfk189.exe rep -bin /8B8094080000B201/8B8094080000B200/-quiet -dir . -yes -file EurekaLogExpert70.bpl
sfk189.exe rep -bin /8B806C090000B201/8B806C090000B200/-quiet -dir . -yes -file EurekaLogExpert250.bpl EurekaLogExpert260.bpl
sfk189.exe rep -bin /8B807C090000B201/8B807C090000B200/-quiet -dir . -yes -file EurekaLogExpert270.bpl
sfk189.exe rep -bin /8B8084090000B201/8B8084090000B200/-quiet -dir . -yes -file EurekaLogExpert280.bpl               
sfk189.exe rep -bin /E89BF1FFFF598B45085068AC/B89BF1FFFF598B45085068AC/-quiet -dir . -yes -file EurekaLogExpert70.bpl
sfk189.exe rep -bin /E8AFECFFFF5933C05568BA3D/B8AFECFFFF5933C05568BA3D/-quiet -dir . -yes -file EurekaLogExpert250.bpl
sfk189.exe rep -bin /E867ECFFFF5933C05568CA41/B867ECFFFF5933C05568CA41/-quiet -dir . -yes -file EurekaLogExpert260.bpl
sfk189.exe rep -bin /E8DEECFFFF598D5584A108F7/B8DEECFFFF598D5584A108F7/-quiet -dir . -yes -file EurekaLogExpert270.bpl
sfk189.exe rep -bin /E8AEE3FFFF598D5584A110F7/B8AEE3FFFF598D5584A110F7/-quiet -dir . -yes -file EurekaLogExpert280.bpl
sfk189.exe rep -bin /54007200690061006C000000B0040200FFFFFFFF0E0000004C00610074006500730074002000760065007200730069006F006E/460075006C006C0020000000B0040200FFFFFFFF0E0000004C00610074006500730074002000760065007200730069006F006E/-quiet -dir . -yes -file EOption.dcu EurekaLogExpert*.bpl
sfk189.exe rep -bin /54007200690061006C0000/460075006C006C00200000/-quiet -dir . -yes -file EOption.dcu EurekaLogExpert*.bpl
sfk189.exe rep -bin /55004E004C004900430045004E00530045004400/4C004900430045004E0053004500440020002000/-quiet -dir . -yes -file EOption.dcu EurekaLogExpert*.bpl
sfk189.exe rep -bin /55004E005200450047004900530054004500520045004400/520045004700490053005400450052004500440020002000/-quiet -dir "!INSTDIR!" "C:\Windows\System32" "!SYSDIR!" -yes -file EOption.dcu EurekaLogCore*.bpl EurekaLogExpert*.bpl
sfk189.exe rep -bin /547269616C000000FFFFFFFF0E0000004C61746573742076657273696F6E/46756C6C20000000FFFFFFFF0E0000004C61746573742076657273696F6E/-quiet -dir . -yes -file EOption.dcu EurekaLogExpert*.bpl                           
sfk189.exe rep -bin /547269616C/46756C6C20/-quiet -dir . -yes -file EOption.dcu EurekaLogExpert*.bpl
sfk189.exe rep -bin /554E4C4943454E534544/4C4943454E5345442020/-quiet -dir . -yes -file EOption.dcu EurekaLogExpert*.bpl
sfk189.exe rep -bin /554E52454749535445524544/524547495354455245442020/-quiet -dir . -yes -file EOption.dcu EurekaLogExpert*.bpl         
sfk189.exe rep -bin /4E004F005400200052004500470049005300540045005200450044002000560045005200530049004F004E/2000200052004500470049005300540045005200450044002000560045005200530049004F004E00200020/-quiet -dir . -yes -file*.dcu EurekaLogExpert*.bpl
sfk189.exe rep -bin /4E4F5420524547495354455245442056455253494F4E/2020524547495354455245442056455253494F4E2020/-quiet -dir . -yes -file*.dcu EurekaLogExpert*.bpl
sfk189.exe rep -bin /450076006500720079002000700072006F006A00650063007400200063006F006D00700069006C006500640020007700690074006800200045007500720065006B0061004C006F006700200054007200690061006C000D000A006500780070006900720065007300200061006600740065007200200033003000200064006100790073002E/20002000200020002000200020002000200020002000200020002000200020002000200020002000200020002000200020002000200020002000200020002000200020002000200020002000200020002000200020002000200020002000200020002000200020002000200020002000200020002000200020002000200020002000200020/-quiet -dir . -yes -file *.dcu EurekaLogExpert*.bpl
sfk189.exe rep -bin /54007200690061006C000000558BEC53/460055004C004C0020000000558BEC53/-quiet -dir "!INSTDIR!" "C:\Windows\System32" "!SYSDIR!" -yes -file EurekaLogCore*.bpl
sfk189.exe rep -bin /547269616C000000558BEC53/46554C4C20000000558BEC53/-quiet -dir "!INSTDIR!" "C:\Windows\System32" "!SYSDIR!" -yes -file EurekaLogCore*.bpl
sfk189.exe rep -bin /54007200690061006C000000B0040200FFFFFFFF03000000540052004C/200020002000200020000000B0040200FFFFFFFF03000000540052004C/-quiet -dir "!INSTDIR!" "C:\Windows\System32" "!SYSDIR!" -yes -file EurekaLogCore*.bpl
sfk189.exe rep -bin /547269616C000000FFFFFFFF0300000054524C/2020202020000000FFFFFFFF0300000054524C/-quiet -dir "!INSTDIR!" "C:\Windows\System32" "!SYSDIR!" -yes -file EurekaLogCore*.bpl
sfk189.exe rep -bin /4500760065007200790020006100700070006C00690063006100740069006F006E00200063006F006D00700069006C006500640020007700690074006800200045007500720065006B0061004C006F006700200054007200690061006C000D000A006500780070006900720065007300200061006600740065007200200033003000200064006100790073002E/200020002000200020002000200020002000200020002000200020002000200020002000200020002000200020002000200020002000200020002000200052006500670069007300740065007200650064002000200020002000200020002000200020002000200020002000200020002000200020002000200020002000200020002000200020002000200020/-quiet -dir . -yes -file EurekaLogExpert*.bpl

echo Step 2/2: Writing license data to registry
echo.
REG ADD HKLM\SOFTWARE\!WOW64!EurekaLab\EurekaLog\7.0 /v AppName /d "EurekaLog 7.10.2.0 Professional" /F 1>NUL 2>NUL
REG ADD HKLM\SOFTWARE\!WOW64!EurekaLab\EurekaLog\7.0 /v AppDir/d "!INSTDIR!" /F 1>NUL 2>NUL
REG ADD HKLM\SOFTWARE\!WOW64!EurekaLab\EurekaLog\7.0 /v AppType /d "Professional" /F 1>NUL 2>NUL
REG ADD HKLM\SOFTWARE\!WOW64!EurekaLab\EurekaLog\7.0 /v AppDate /d "none" /F 1>NUL 2>NUL
REG ADD HKCU\SOFTWARE\EurekaLab\EurekaLog\7.0 /v AppName /d "EurekaLog 7.10.2.0 Professional" /F 1>NUL 2>NUL
REG ADD HKCU\SOFTWARE\EurekaLab\EurekaLog\7.0 /v AppType /d "Professional" /F 1>NUL 2>NUL
REG ADD HKCU\SOFTWARE\EurekaLab\EurekaLog\7.0\License /v Edition /d "Professional" /F 1>NUL 2>NUL
REG ADD HKCU\SOFTWARE\EurekaLab\EurekaLog\7.0\License /v UserName /d "EurekaLog" /F 1>NUL 2>NUL
REG ADD HKCU\SOFTWARE\EurekaLab\EurekaLog\7.0\License /v UID /d "{20e8e8c4-6789-4a49-8e78-c02d739e6d5e}" /F 1>NUL 2>NUL
REG ADD HKCU\SOFTWARE\EurekaLab\EurekaLog\7.0\License /v ID/d "{20e8e8c4-6789-4a49-8e78-c02d739e6d5f}" /F 1>NUL 2>NUL

set endtime=%time%
echo Startedat: %starttime%
echo Finished at: %endtime%

echo.
echo Patching finished ...
echo.

pause

exit

ctacy 发表于 2023-2-15 13:52

如果要在一个十六进制字符串中进行大规模的替换,可能会导致新字符串的长度大于50个十六进制字符,这时候可以考虑将这个字符串拆分成多个小段进行处理。

例如,假设要将一个长度为100个十六进制字符的字符串中的所有"AB"替换成"CD",可以将这个字符串分成两个长度为50的小段,分别进行替换操作。具体实现方法可以使用循环,每次取出一个小段进行替换,替换完之后再将替换后的小段拼接起来。

另外,如果只需要替换一次,可以使用字符串中的Replace方法,将要替换的子串和替换后的子串作为参数传递给Replace方法即可。如果要替换多次,可以使用正则表达式替换,这样可以更加灵活地进行替换操作。

以上是人工智能给的答案 {:1_926:}
页: [1] 2
查看完整版本: HEX中替换的十六进制长度大于50如何处理