HEX2ASCII && ASCII2HEX

; Author: Jake Commander
; Copyright The GeneSys Development System

HexEncode proc uses edi esi ebx pBuff:dword,dwLen:dword,pOutBuff:dword
;---------------------------------------
    mov    ebx, dwLen
    mov    edi, pOutBuff
    test    ebx, ebx
    mov    esi, pBuff
    jz      @F
    .repeat
      movzx  eax, byte ptr [esi]
      mov    ecx, eax
      add    edi, 2
      shr    ecx, 4
      and    eax, 1111b
      and    ecx, 1111b
      cmp    eax, 10
      sbb    edx, edx
      adc    eax, 0
      lea    eax, [eax+edx*8+'7']
      cmp    ecx, 10
      sbb    edx, edx
      adc    ecx, 0
      shl    eax, 8
      lea    ecx, [ecx+edx*8+'7']
      or      eax, ecx
      inc    esi
      mov    [edi-2], ax
      dec    ebx
    .until ZERO?
@@: mov    eax, edi
    mov    byte ptr [edi], 0
    sub    eax, pOutBuff
    ret
;---------------------------------------
HexEncode endp
Continue Reading

Embarcadero.Delphi.XE2.RTM.v16.0.4256.43595.Lite.v5.0

Embarcadero.Delphi.XE2.RTM.v16.0.4256.43595.Lite.v5.0
——————————————————————————–

作者:lsuper
——————————————————————————–
发布历史:
2011.09.09 – v5.0
1、根据 RTM v16.0.4256.43595 原版制作
2011.08.08 – v5.0 Beta8
1、根据 beta8 v16.0.4223.41907 原版制作
2、为便于大家试用,写了一个 XE2Resetter 外挂
——————————————————————————–

Continue Reading

MASM – error A2042: statement too complex

在定义比较长的数据的时候会因为数据超过行限制而出现statement too complex或者line to long的错误提示,可以使用下面的代码:

; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
    include \masm32\include\masm32rt.inc
; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
    .data
      kostka1 real4 -1.0,-1.0, 1.0, 1.0,-1.0, 1.0, 1.0, 1.0, 1.0
              real4 -1.0, 1.0, 1.0,-1.0,-1.0,-1.0,-1.0, 1.0,-1.0
              real4  1.0, 1.0,-1.0, 1.0,-1.0,-1.0,-1.0, 1.0,-1.0
              real4 -1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0,-1.0
              real4 -1.0,-1.0,-1.0, 1.0,-1.0,-1.0, 1.0,-1.0, 1.0
              real4 -1.0,-1.0, 1.0, 1.0,-1.0,-1.0, 1.0, 1.0,-1.0
              real4  1.0, 1.0, 1.0, 1.0,-1.0, 1.0,-1.0,-1.0,-1.0
              real4 -1.0,-1.0, 1.0,-1.0, 1.0, 1.0,-1.0, 1.0,-1.0

      _SIZEOF_kostka1 = ($ - kostka1)
      dd_SIZEOF_kostka1 dd ($ - kostka1)

      tmp TEXTEQU %_SIZEOF_kostka1
      % echo _SIZEOF_kostka1 = tmp

    .code
; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
start:
; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
    print ustr$(dd_SIZEOF_kostka1),13,10
    mov   eax, input(13,10,"Press enter to exit...")
    exit
; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
end start
Continue Reading

Delphi Get HDD Serial Number


program keygenme;

uses
Windows,Messages,CommCtrl;

{$R software.RES}
var WinClass: TWndClassA;
Inst: HINST;
hWindow: HWND;
TheMessage: TMsg;

hDrive:HWND;
hID:HWND;
hf:THandle;

htitle:HWND;

cmbChange: HWND;
cmbAbout: HWND;
cmbExit: HWND;

PaintStruct: TPaintStruct;
PaintDC: HDC;
hFont1: HFONT;
isNT:Boolean;

function StrToInt(const S: string):Integer;
var
E: Integer;
begin
Val(S, Result, E);
end;

Continue Reading

从RegQueryValueExA到ZwQueryValueKey

对于注册表的REG_MULTI_SZ类型的数据个人感觉一直比较蛋疼,一个是因为在Delphi下竟然没有相关的函数,第二个是因为对于这类型的数据在使用ssdt hook修改数据的时候出现了很多问题。

为了明白到底是怎么处理的,于是就把相关的调用流程跟踪了一遍。至于是什么程序调用的这里就不提了,直接贴代码吧。

103B29D8    8B4C24 18       mov ecx,dword ptr ss:[esp+0x18]
103B29DC    8B3D 34F0EE10   mov edi,dword ptr ds:[<&ADVAPI32.RegQuer>; ADVAPI32.RegQueryValueExA
103B29E2    894424 14       mov dword ptr ss:[esp+0x14],eax
103B29E6    8D4424 14       lea eax,dword ptr ss:[esp+0x14]
103B29EA    50              push eax
103B29EB    6A 00           push 0x0
103B29ED    6A 00           push 0x0
103B29EF    6A 00           push 0x0
103B29F1    68 088FFD10     push iTunes_1.10FD8F08                   ; ASCII "SystemBiosVersion"
103B29F6    51              push ecx
103B29F7    FFD7            call edi
103B29F9    85C0            test eax,eax
103B29FB    75 48           jnz XiTunes_1.103B2A45
103B29FD    8B5424 14       mov edx,dword ptr ss:[esp+0x14]
103B2A01    52              push edx
103B2A02    50              push eax
103B2A03    E8 7820CDFF     call iTunes_1.10084A80
103B2A08    50              push eax
103B2A09    FF15 84FEEE10   call dword ptr ds:[<&KERNEL32.HeapAlloc>>; ntdll.RtlAllocateHeap
103B2A0F    8B4C24 18       mov ecx,dword ptr ss:[esp+0x18]
103B2A13    8BF0            mov esi,eax
103B2A15    8D4424 14       lea eax,dword ptr ss:[esp+0x14]
103B2A19    50              push eax
103B2A1A    56              push esi
103B2A1B    6A 00           push 0x0
103B2A1D    6A 00           push 0x0
103B2A1F    68 088FFD10     push iTunes_1.10FD8F08                   ; ASCII "SystemBiosVersion"
103B2A24    51              push ecx
103B2A25    FFD7            call edi

这里是应用层的第一次调用,在调用的时候第一次并没有分配相应的缓冲区来存放数据。这次调用的根本目的是为了获取注册表中对应的数据的大小。

Continue Reading

笔记本War3全屏设置工具

用笔记本玩过War3的都知道笔记本下War3可能无法全屏显示,周末的时候我就遇到了这个问题。于是自己写了一个小工具来测试了一下,效果还是可以了。

smile 猛击此处下载程序!

文件校验信息:

文件名: F:\Delphi Project\War III FullScreen\War3 Screen.exe
文件大小: 723087 字节 (706.14 KB)
修改日期: 2011-07-04 11:09
版本: 1.0.0.0
MD5: bcd29e08c9b034edb789f2d662a4f409
SHA1: e49d6b02b1c7f2cd86565832e7ea00f2f7d43326
SHA256: 5e156bcfa8716b38cc4d6ad6cc7a2becbfe90bf3516468dd9de36357811d4400
CRC32: 69ea5d87