I tried use changed 'charclass.zir' as i posted above.
This for test:
program RAW_IMAGE 'test';
#set bits 32;
#include 'charclass.zir';
eax = IsDigit(ord('5')); nop;
//ax = IsDigit(ord('5')); nop; // Operand is invalid
//ah = IsDigit(ord('5')); nop; // Operand is invalid
//al = IsDigit(ord('5')); nop; // Operand is invalid
if (IsDigit(ord('5')) == true) {} ; nop;
while (IsDigit(ord('5')) == true) {} ; nop;
repeat {} until (IsDigit(ord('5')) == true) ; nop;
case (true) {
state IsDigit(ord('5')): break;
state IsWhiteSpace(ord('5')): break;
state IsLetter(ord('5')): break;
default:
}
Result(i post only part without table):
00000000 33C0 xor eax,eax
00000002 B035 mov al,0x35
00000004 8A806F000000 mov al,[eax+0x6f]
0000000A 2401 and al,0x1
0000000C 90 nop
0000000D 33C0 xor eax,eax
0000000F B035 mov al,0x35
00000011 F6806F00000001 test byte [eax+0x6f],0x1
00000018 7400 jz 0x1a
0000001A 90 nop
0000001B 33C0 xor eax,eax
0000001D B035 mov al,0x35
0000001F F6806F00000001 test byte [eax+0x6f],0x1
00000026 7402 jz 0x2a
00000028 EBF1 jmp short 0x1b
0000002A 90 nop
0000002B 33C0 xor eax,eax
0000002D B035 mov al,0x35
0000002F F6806F00000001 test byte [eax+0x6f],0x1
00000036 74F3 jz 0x2b
00000038 90 nop
00000039 33C0 xor eax,eax
0000003B B035 mov al,0x35
0000003D 8A806F000000 mov al,[eax+0x6f]
00000043 2401 and al,0x1
00000045 85C0 test eax,eax
00000047 740E jz 0x57
00000049 EB24 jmp short 0x6f
0000004B 33C0 xor eax,eax
0000004D B035 mov al,0x35
0000004F 8A806F000000 mov al,[eax+0x6f]
00000055 2410 and al,0x10
00000057 85C0 test eax,eax
00000059 750E jnz 0x69
0000005B EB12 jmp short 0x6f
0000005D 33C0 xor eax,eax
0000005F B035 mov al,0x35
00000061 8A806F000000 mov al,[eax+0x6f]
00000067 2406 and al,0x6
00000069 85C0 test eax,eax
0000006B 7502 jnz 0x6f
0000006D EB00 jmp short 0x6f
; .........................................................
Seems that "case" statement not use "just test" i.e.
0000001B 33C0 xor eax,eax
0000001D B035 mov al,0x35
0000001F F6806F00000001 test byte [eax+0x6f],0x1
00000026 7402 jz 0x2a
it use "and + test"
0000005D 33C0 xor eax,eax
0000005F B035 mov al,0x35
00000061 8A806F000000 mov al,[eax+0x6f]
00000067 2406 and al,0x6
00000069 85C0 test eax,eax
0000006B 7502 jnz 0x6f
Is it possible to do "case" statement such as others?