技术宅的结界

 找回密码
 立即注册→加入我们

QQ登录

只需一步,快速开始

搜索
热搜: 下载 VB C 实现 编写
查看: 776|回复: 7
收起左侧

【VB6】将“十进制”转换为二进制字符串的函数

[复制链接]

1044

主题

2345

帖子

5万

积分

用户组: 管理员

一只技术宅

UID
1
精华
218
威望
294 点
宅币
18326 个
贡献
37543 次
宅之契约
0 份
在线时间
1749 小时
注册时间
2014-1-26
发表于 2019-7-10 14:35:05 | 显示全部楼层 |阅读模式

欢迎访问技术宅的结界,请注册或者登录吧。

您需要 登录 才可以下载或查看,没有帐号?立即注册→加入我们

x
应需给人帮忙写了这份代码,经过测试没有发现问题。
个人觉得性能上来说,应该难以被超越了,除非用Detour等方式自己hook自己,然后插入shellcode。
[Visual Basic] 纯文本查看 复制代码
Function Dec2Bin(ByVal Num As Long) As String
Dim Result() As Byte, Pos As Long, I As Long
ReDim Result(63)

If Num And &H1& Then Result(62) = &H31 Else Result(62) = &H30
If Num And &H2& Then Result(60) = &H31 Else Result(60) = &H30
If Num And &H4& Then Result(58) = &H31 Else Result(58) = &H30
If Num And &H8& Then Result(56) = &H31 Else Result(56) = &H30
If Num And &H10& Then Result(54) = &H31 Else Result(54) = &H30
If Num And &H20& Then Result(52) = &H31 Else Result(52) = &H30
If Num And &H40& Then Result(50) = &H31 Else Result(50) = &H30
If Num And &H80& Then Result(48) = &H31 Else Result(48) = &H30
If Num And &H100& Then Result(46) = &H31 Else Result(46) = &H30
If Num And &H200& Then Result(44) = &H31 Else Result(44) = &H30
If Num And &H400& Then Result(42) = &H31 Else Result(42) = &H30
If Num And &H800& Then Result(40) = &H31 Else Result(40) = &H30
If Num And &H1000& Then Result(38) = &H31 Else Result(38) = &H30
If Num And &H2000& Then Result(36) = &H31 Else Result(36) = &H30
If Num And &H4000& Then Result(34) = &H31 Else Result(34) = &H30
If Num And &H8000& Then Result(32) = &H31 Else Result(32) = &H30
If Num And &H10000 Then Result(30) = &H31 Else Result(30) = &H30
If Num And &H20000 Then Result(28) = &H31 Else Result(28) = &H30
If Num And &H40000 Then Result(26) = &H31 Else Result(26) = &H30
If Num And &H80000 Then Result(24) = &H31 Else Result(24) = &H30
If Num And &H100000 Then Result(22) = &H31 Else Result(22) = &H30
If Num And &H200000 Then Result(20) = &H31 Else Result(20) = &H30
If Num And &H400000 Then Result(18) = &H31 Else Result(18) = &H30
If Num And &H800000 Then Result(16) = &H31 Else Result(16) = &H30
If Num And &H1000000 Then Result(14) = &H31 Else Result(14) = &H30
If Num And &H2000000 Then Result(12) = &H31 Else Result(12) = &H30
If Num And &H4000000 Then Result(10) = &H31 Else Result(10) = &H30
If Num And &H8000000 Then Result(8) = &H31 Else Result(8) = &H30
If Num And &H10000000 Then Result(6) = &H31 Else Result(6) = &H30
If Num And &H20000000 Then Result(4) = &H31 Else Result(4) = &H30
If Num And &H40000000 Then Result(2) = &H31 Else Result(2) = &H30
If Num And &H80000000 Then Result(0) = &H31 Else Result(0) = &H30

Dec2Bin = Result
End Function
我一直想吐槽的几个点:
  • 输入的参数是个Long,而它并不是“十进制”,而是一个32位的有符号整数类型,在CPU中或者内存中都是以32位二进制的方式存储的。我并没有看出任何“十进制”的地方。

    对于“十进制”的说法,其实有个打擦边球的数据类型,叫“BCD数”,它用4个二进制位存储一个10进制位表示的数值。但即便如此,VB6的Long它也不是BCD数。

    所以实际上根本不存在什么转换。只需要检测Long里面的每一个bit是否为1,然后处理字符串即可。
  • 把一个数值类型的变量以十进制字符串的方式存储或者显示的时候,你需要通过不断除以10求余数和商来判断出它作为十进制的时候每个位的数值是多少。

    同样我也见过有人把Long的数值除以2,然后判断余数是不是1来得出这个位是否为1。但这种做法存在一个问题。那就是CPU做整数除法的运算其实是相当慢的,尤其是有符号整数除法,运算速率甚至比不过浮点数除法。

    判断二进制的每个位的数值,最简单的办法就是用逻辑与来筛选。为何要做除法运算?
  • Long的长度就是32个二进制位,毕竟VB6不会再有什么长进了。它的数据类型,线程结构,能用到的指令集,已经固定。Long也不会变得更长。因此,为何要使用循环语句?VB6的编译器会老老实实地做循环判断跳转的过程,而现在的CPU都不喜欢跳转指令——它意味着指令队列刷新,相当于要多浪费几个指令的周期来填满它的流水线。

    所以我直接写32条语句来判断它每一个bit的状态,并修改字符串中对应位置的字符。
  • VB6的字符串操作过程,尤其是字符串拼接的过程,每次都会造成内存分配和释放。众所周知,内存分配,它慢。频繁的内存分配是造成各种算法的性能瓶颈的理由。

    所以对于 If xxxx Then A = A & "1" Else A = A & "0" 这样的写法,每次执行的时候VB6为了存储A的字符串值,会给它重新分配内存然后在它尾部追加"1"或者"0"。

    这怎么可能快得起来呢?VB6字符串处理里最慢的基本上就是字符串拼接了。

1

主题

46

帖子

171

积分

用户组: 小·技术宅

UID
4683
精华
0
威望
0 点
宅币
125 个
贡献
0 次
宅之契约
0 份
在线时间
20 小时
注册时间
2019-2-11
发表于 2019-7-10 18:54:54 | 显示全部楼层
!!!谢谢A5.
回复

使用道具 举报

26

主题

114

帖子

1620

积分

用户组: 版主

UID
1821
精华
6
威望
67 点
宅币
1291 个
贡献
51 次
宅之契约
0 份
在线时间
258 小时
注册时间
2016-7-12
发表于 2019-7-10 22:41:19 | 显示全部楼层
本帖最后由 Ayala 于 2019-7-10 23:32 编辑

函数整体应该是十进制字符串处理成二进制字符串 不过vb可以很“神奇”的自动把"1"转换为 byval 1
传递的参数都已经是long了 用字典处理会不会更快些
"0000","0001","0010","0011","0100","0101","0110","0111",_
"1000","1001","1010","1011","1100","1101","1110","1111"
定义16个就够了
/Fo输出下asm看看
[Asm] 纯文本查看 复制代码
TITLE	C:\Users\Administrator\Desktop\Form1.frm
	.386P
include listing.inc
if @Version gt 510
.model FLAT
else
_TEXT	SEGMENT PARA USE32 PUBLIC 'CODE'
_TEXT	ENDS
_DATA	SEGMENT DWORD USE32 PUBLIC 'DATA'
_DATA	ENDS
CONST	SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST	ENDS
_BSS	SEGMENT DWORD USE32 PUBLIC 'BSS'
_BSS	ENDS
_TLS	SEGMENT DWORD USE32 PUBLIC 'TLS'
_TLS	ENDS
text$1	SEGMENT PARA USE32 PUBLIC ''
text$1	ENDS
;	COMDAT ?Dec2Bin@Form1@@AAGXXZ
text$1	SEGMENT PARA USE32 PUBLIC ''
text$1	ENDS
;	COMDAT ?Form_Load@Form1@@AAGXXZ
text$1	SEGMENT PARA USE32 PUBLIC ''
text$1	ENDS
FLAT	GROUP _DATA, CONST, _BSS
	ASSUME	CS: FLAT, DS: FLAT, SS: FLAT
endif
PUBLIC	?Dec2Bin@Form1@@AAGXXZ				; Form1::Dec2Bin
EXTRN	__imp____vbaRedim:NEAR
EXTRN	__imp____vbaGenerateBoundsError:NEAR
EXTRN	__imp_@__vbaUI1I2:NEAR
EXTRN	__imp_@__vbaStrMove:NEAR
EXTRN	__imp____vbaStrVarCopy:NEAR
EXTRN	__imp_@__vbaFreeStr:NEAR
EXTRN	__imp____vbaAryDestruct:NEAR
EXTRN	___vbaExceptHandler:NEAR
EXTRN	__except_list:DWORD
;	COMDAT CONST
; File C:\Users\Administrator\Desktop\Form1.frm
CONST	SEGMENT
$S33	DB	0bH, 00H
	DB	08H, 00H
	DD	FLAT:$L32
	DD	FLAT:$L30
	DD	FLAT:$L31
CONST	ENDS
;	COMDAT ?Dec2Bin@Form1@@AAGXXZ
text$1	SEGMENT
_Me$ = 8
_Dec2Bin$ = 16
_Num$ = 12
_Result$ = -32
_Dec2Bin$ = -36
_unnamed_var1$ = -52
__$SEHRec$ = -20
?Dec2Bin@Form1@@AAGXXZ PROC NEAR			; Form1::Dec2Bin, COMDAT
; File C:\Users\Administrator\Desktop\Form1.frm
; Line 18
	push	ebp
	mov	ebp, esp
	sub	esp, 12					; 0000000cH
	push	OFFSET FLAT:___vbaExceptHandler
	mov	eax, DWORD PTR fs:__except_list
	push	eax
	mov	DWORD PTR fs:__except_list, esp
	sub	esp, 44					; 0000002cH
	push	ebx
	push	esi
	push	edi
	mov	DWORD PTR __$SEHRec$[ebp+8], esp
	mov	DWORD PTR __$SEHRec$[ebp+12], OFFSET FLAT:$S33
	xor	esi, esi
	mov	DWORD PTR __$SEHRec$[ebp+16], esi
	mov	eax, DWORD PTR _Me$[ebp]
	push	eax
	mov	ecx, DWORD PTR [eax]
	call	DWORD PTR [ecx+4]
	mov	edx, DWORD PTR _Dec2Bin$[ebp]
; Line 20
	push	esi
	push	63					; 0000003fH
	push	1
	lea	eax, DWORD PTR _Result$[ebp]
	push	17					; 00000011H
	push	eax
	push	1
	push	128					; 00000080H
	mov	DWORD PTR _Result$[ebp], esi
	mov	DWORD PTR _Dec2Bin$[ebp], esi
	mov	DWORD PTR _unnamed_var1$[ebp], esi
	mov	DWORD PTR [edx], esi
	call	DWORD PTR __imp____vbaRedim
; Line 22
	mov	al, BYTE PTR _Num$[ebp]
	add	esp, 28					; 0000001cH
	test	al, 1
	mov	eax, DWORD PTR _Result$[ebp]
	je	SHORT $L35
	cmp	eax, esi
	je	SHORT $L141
	cmp	WORD PTR [eax], 1
	jne	SHORT $L141
	mov	edx, DWORD PTR [eax+20]
	mov	ecx, DWORD PTR [eax+16]
	mov	ebx, DWORD PTR __imp____vbaGenerateBoundsError
	mov	esi, 62					; 0000003eH
	sub	esi, edx
	cmp	esi, ecx
	jb	SHORT $L144
	call	ebx
	mov	ecx, 49					; 00000031H
	jmp	SHORT $L408
$L141:
	mov	ebx, DWORD PTR __imp____vbaGenerateBoundsError
	call	ebx
	mov	esi, eax
$L144:
	mov	ecx, 49					; 00000031H
	jmp	SHORT $L408
$L35:
	cmp	eax, esi
	je	SHORT $L145
	cmp	WORD PTR [eax], 1
	jne	SHORT $L145
	mov	edx, DWORD PTR [eax+20]
	mov	ecx, DWORD PTR [eax+16]
	mov	ebx, DWORD PTR __imp____vbaGenerateBoundsError
	mov	esi, 62					; 0000003eH
	sub	esi, edx
	cmp	esi, ecx
	jb	SHORT $L148
	call	ebx
	jmp	SHORT $L148
$L145:
	mov	ebx, DWORD PTR __imp____vbaGenerateBoundsError
	call	ebx
	mov	esi, eax
$L148:
	mov	ecx, 48					; 00000030H
$L408:
	mov	edi, DWORD PTR __imp_@__vbaUI1I2
	call	edi
	mov	ecx, DWORD PTR _Result$[ebp]
	mov	edx, DWORD PTR [ecx+12]
	mov	BYTE PTR [edx+esi], al
; Line 23
	mov	al, BYTE PTR _Num$[ebp]
	test	al, 2
	mov	eax, DWORD PTR _Result$[ebp]
	je	SHORT $L39
	test	eax, eax
	je	SHORT $L149
	cmp	WORD PTR [eax], 1
	jne	SHORT $L149
	mov	edx, DWORD PTR [eax+20]
	mov	ecx, DWORD PTR [eax+16]
	mov	esi, 60					; 0000003cH
	sub	esi, edx
	cmp	esi, ecx
	jb	SHORT $L152
	call	ebx
	mov	ecx, 49					; 00000031H
	jmp	SHORT $L409
$L149:
	call	ebx
	mov	esi, eax
$L152:
	mov	ecx, 49					; 00000031H
	jmp	SHORT $L409
$L39:
	test	eax, eax
	je	SHORT $L153
	cmp	WORD PTR [eax], 1
	jne	SHORT $L153
	mov	edx, DWORD PTR [eax+20]
	mov	ecx, DWORD PTR [eax+16]
	mov	esi, 60					; 0000003cH
	sub	esi, edx
	cmp	esi, ecx
	jb	SHORT $L156
	call	ebx
	jmp	SHORT $L156
$L153:
	call	ebx
	mov	esi, eax
$L156:
	mov	ecx, 48					; 00000030H
$L409:
	call	edi
	mov	ecx, DWORD PTR _Result$[ebp]
	mov	edx, DWORD PTR [ecx+12]
	mov	BYTE PTR [edx+esi], al
; Line 24
	mov	al, BYTE PTR _Num$[ebp]
	test	al, 4
	mov	eax, DWORD PTR _Result$[ebp]
	je	SHORT $L41
	test	eax, eax
	je	SHORT $L157
	cmp	WORD PTR [eax], 1
	jne	SHORT $L157
	mov	edx, DWORD PTR [eax+20]
	mov	ecx, DWORD PTR [eax+16]
	mov	esi, 58					; 0000003aH
	sub	esi, edx
	cmp	esi, ecx
	jb	SHORT $L160
	call	ebx
	mov	ecx, 49					; 00000031H
	jmp	SHORT $L410
$L157:
	call	ebx
	mov	esi, eax
$L160:
	mov	ecx, 49					; 00000031H
	jmp	SHORT $L410
$L41:
	test	eax, eax
	je	SHORT $L161
	cmp	WORD PTR [eax], 1
	jne	SHORT $L161
	mov	edx, DWORD PTR [eax+20]
	mov	ecx, DWORD PTR [eax+16]
	mov	esi, 58					; 0000003aH
	sub	esi, edx
	cmp	esi, ecx
	jb	SHORT $L164
	call	ebx
	jmp	SHORT $L164
$L161:
	call	ebx
	mov	esi, eax
$L164:
	mov	ecx, 48					; 00000030H
$L410:
	call	edi
	mov	ecx, DWORD PTR _Result$[ebp]
	mov	edx, DWORD PTR [ecx+12]
	mov	BYTE PTR [edx+esi], al
; Line 25
	mov	al, BYTE PTR _Num$[ebp]
	test	al, 8
	mov	eax, DWORD PTR _Result$[ebp]
	je	SHORT $L43
	test	eax, eax
	je	SHORT $L165
	cmp	WORD PTR [eax], 1
	jne	SHORT $L165
	mov	edx, DWORD PTR [eax+20]
	mov	ecx, DWORD PTR [eax+16]
	mov	esi, 56					; 00000038H
	sub	esi, edx
	cmp	esi, ecx
	jb	SHORT $L168
	call	ebx
	mov	ecx, 49					; 00000031H
	jmp	SHORT $L411
$L165:
	call	ebx
	mov	esi, eax
$L168:
	mov	ecx, 49					; 00000031H
	jmp	SHORT $L411
$L43:
	test	eax, eax
	je	SHORT $L169
	cmp	WORD PTR [eax], 1
	jne	SHORT $L169
	mov	edx, DWORD PTR [eax+20]
	mov	ecx, DWORD PTR [eax+16]
	mov	esi, 56					; 00000038H
	sub	esi, edx
	cmp	esi, ecx
	jb	SHORT $L172
	call	ebx
	jmp	SHORT $L172
$L169:
	call	ebx
	mov	esi, eax
$L172:
	mov	ecx, 48					; 00000030H
$L411:
	call	edi
	mov	ecx, DWORD PTR _Result$[ebp]
	mov	edx, DWORD PTR [ecx+12]
	mov	BYTE PTR [edx+esi], al
; Line 26
	mov	al, BYTE PTR _Num$[ebp]
	test	al, 16					; 00000010H
	mov	eax, DWORD PTR _Result$[ebp]
	je	SHORT $L45
	test	eax, eax
	je	SHORT $L173
	cmp	WORD PTR [eax], 1
	jne	SHORT $L173
	mov	edx, DWORD PTR [eax+20]
	mov	ecx, DWORD PTR [eax+16]
	mov	esi, 54					; 00000036H
	sub	esi, edx
	cmp	esi, ecx
	jb	SHORT $L176
	call	ebx
	mov	ecx, 49					; 00000031H
	jmp	SHORT $L412
$L173:
	call	ebx
	mov	esi, eax
$L176:
	mov	ecx, 49					; 00000031H
	jmp	SHORT $L412
$L45:
	test	eax, eax
	je	SHORT $L177
	cmp	WORD PTR [eax], 1
	jne	SHORT $L177
	mov	edx, DWORD PTR [eax+20]
	mov	ecx, DWORD PTR [eax+16]
	mov	esi, 54					; 00000036H
	sub	esi, edx
	cmp	esi, ecx
	jb	SHORT $L180
	call	ebx
	jmp	SHORT $L180
$L177:
	call	ebx
	mov	esi, eax
$L180:
	mov	ecx, 48					; 00000030H
$L412:
	call	edi
	mov	ecx, DWORD PTR _Result$[ebp]
	mov	edx, DWORD PTR [ecx+12]
	mov	BYTE PTR [edx+esi], al
; Line 27
	mov	al, BYTE PTR _Num$[ebp]
	test	al, 32					; 00000020H
	mov	eax, DWORD PTR _Result$[ebp]
	je	SHORT $L47
	test	eax, eax
	je	SHORT $L181
	cmp	WORD PTR [eax], 1
	jne	SHORT $L181
	mov	edx, DWORD PTR [eax+20]
	mov	ecx, DWORD PTR [eax+16]
	mov	esi, 52					; 00000034H
	sub	esi, edx
	cmp	esi, ecx
	jb	SHORT $L184
	call	ebx
	mov	ecx, 49					; 00000031H
	jmp	SHORT $L413
$L181:
	call	ebx
	mov	esi, eax
$L184:
	mov	ecx, 49					; 00000031H
	jmp	SHORT $L413
$L47:
	test	eax, eax
	je	SHORT $L185
	cmp	WORD PTR [eax], 1
	jne	SHORT $L185
	mov	edx, DWORD PTR [eax+20]
	mov	ecx, DWORD PTR [eax+16]
	mov	esi, 52					; 00000034H
	sub	esi, edx
	cmp	esi, ecx
	jb	SHORT $L188
	call	ebx
	jmp	SHORT $L188
$L185:
	call	ebx
	mov	esi, eax
$L188:
	mov	ecx, 48					; 00000030H
$L413:
	call	edi
	mov	ecx, DWORD PTR _Result$[ebp]
	mov	edx, DWORD PTR [ecx+12]
	mov	BYTE PTR [edx+esi], al
; Line 28
	mov	al, BYTE PTR _Num$[ebp]
	test	al, 64					; 00000040H
	mov	eax, DWORD PTR _Result$[ebp]
	je	SHORT $L49
	test	eax, eax
	je	SHORT $L189
	cmp	WORD PTR [eax], 1
	jne	SHORT $L189
	mov	edx, DWORD PTR [eax+20]
	mov	ecx, DWORD PTR [eax+16]
	mov	esi, 50					; 00000032H
	sub	esi, edx
	cmp	esi, ecx
	jb	SHORT $L192
	call	ebx
	mov	ecx, 49					; 00000031H
	jmp	SHORT $L414
$L189:
	call	ebx
	mov	esi, eax
$L192:
	mov	ecx, 49					; 00000031H
	jmp	SHORT $L414
$L49:
	test	eax, eax
	je	SHORT $L193
	cmp	WORD PTR [eax], 1
	jne	SHORT $L193
	mov	edx, DWORD PTR [eax+20]
	mov	ecx, DWORD PTR [eax+16]
	mov	esi, 50					; 00000032H
	sub	esi, edx
	cmp	esi, ecx
	jb	SHORT $L196
	call	ebx
	jmp	SHORT $L196
$L193:
	call	ebx
	mov	esi, eax
$L196:
	mov	ecx, 48					; 00000030H
$L414:
	call	edi
	mov	ecx, DWORD PTR _Result$[ebp]
	mov	edx, DWORD PTR [ecx+12]
	mov	BYTE PTR [edx+esi], al
; Line 29
	mov	al, BYTE PTR _Num$[ebp]
	test	al, -128				; ffffff80H
	mov	eax, DWORD PTR _Result$[ebp]
	je	SHORT $L51
	test	eax, eax
	je	SHORT $L197
	cmp	WORD PTR [eax], 1
	jne	SHORT $L197
	mov	edx, DWORD PTR [eax+20]
	mov	ecx, DWORD PTR [eax+16]
	mov	esi, 48					; 00000030H
	sub	esi, edx
	cmp	esi, ecx
	jb	SHORT $L200
	call	ebx
	mov	ecx, 49					; 00000031H
	jmp	SHORT $L415
$L197:
	call	ebx
	mov	esi, eax
$L200:
	mov	ecx, 49					; 00000031H
	jmp	SHORT $L415
$L51:
	test	eax, eax
	je	SHORT $L201
	cmp	WORD PTR [eax], 1
	jne	SHORT $L201
	mov	edx, DWORD PTR [eax+20]
	mov	ecx, DWORD PTR [eax+16]
	mov	esi, 48					; 00000030H
	sub	esi, edx
	cmp	esi, ecx
	jb	SHORT $L204
	call	ebx
	jmp	SHORT $L204
$L201:
	call	ebx
	mov	esi, eax
$L204:
	mov	ecx, 48					; 00000030H
$L415:
	call	edi
	mov	ecx, DWORD PTR _Result$[ebp]
	mov	edx, DWORD PTR [ecx+12]
	mov	BYTE PTR [edx+esi], al
; Line 30
	mov	eax, DWORD PTR _Num$[ebp]
	test	ah, 1
	mov	eax, DWORD PTR _Result$[ebp]
	je	SHORT $L53
	test	eax, eax
	je	SHORT $L205
	cmp	WORD PTR [eax], 1
	jne	SHORT $L205
	mov	edx, DWORD PTR [eax+20]
	mov	ecx, DWORD PTR [eax+16]
	mov	esi, 46					; 0000002eH
	sub	esi, edx
	cmp	esi, ecx
	jb	SHORT $L208
	call	ebx
	mov	ecx, 49					; 00000031H
	jmp	SHORT $L416
$L205:
	call	ebx
	mov	esi, eax
$L208:
	mov	ecx, 49					; 00000031H
	jmp	SHORT $L416
$L53:
	test	eax, eax
	je	SHORT $L209
	cmp	WORD PTR [eax], 1
	jne	SHORT $L209
	mov	edx, DWORD PTR [eax+20]
	mov	ecx, DWORD PTR [eax+16]
	mov	esi, 46					; 0000002eH
	sub	esi, edx
	cmp	esi, ecx
	jb	SHORT $L212
	call	ebx
	jmp	SHORT $L212
$L209:
	call	ebx
	mov	esi, eax
$L212:
	mov	ecx, 48					; 00000030H
$L416:
	call	edi
	mov	ecx, DWORD PTR _Result$[ebp]
	mov	edx, DWORD PTR [ecx+12]
	mov	BYTE PTR [edx+esi], al
; Line 31
	mov	eax, DWORD PTR _Num$[ebp]
	test	ah, 2
	mov	eax, DWORD PTR _Result$[ebp]
	je	SHORT $L55
	test	eax, eax
	je	SHORT $L213
	cmp	WORD PTR [eax], 1
	jne	SHORT $L213
	mov	edx, DWORD PTR [eax+20]
	mov	ecx, DWORD PTR [eax+16]
	mov	esi, 44					; 0000002cH
	sub	esi, edx
	cmp	esi, ecx
	jb	SHORT $L216
	call	ebx
	mov	ecx, 49					; 00000031H
	jmp	SHORT $L417
$L213:
	call	ebx
	mov	esi, eax
$L216:
	mov	ecx, 49					; 00000031H
	jmp	SHORT $L417
$L55:
	test	eax, eax
	je	SHORT $L217
	cmp	WORD PTR [eax], 1
	jne	SHORT $L217
	mov	edx, DWORD PTR [eax+20]
	mov	ecx, DWORD PTR [eax+16]
	mov	esi, 44					; 0000002cH
	sub	esi, edx
	cmp	esi, ecx
	jb	SHORT $L220
	call	ebx
	jmp	SHORT $L220
$L217:
	call	ebx
	mov	esi, eax
$L220:
	mov	ecx, 48					; 00000030H
$L417:
	call	edi
	mov	ecx, DWORD PTR _Result$[ebp]
	mov	edx, DWORD PTR [ecx+12]
	mov	BYTE PTR [edx+esi], al
; Line 32
	mov	eax, DWORD PTR _Num$[ebp]
	test	ah, 4
	mov	eax, DWORD PTR _Result$[ebp]
	je	SHORT $L57
	test	eax, eax
	je	SHORT $L221
	cmp	WORD PTR [eax], 1
	jne	SHORT $L221
	mov	edx, DWORD PTR [eax+20]
	mov	ecx, DWORD PTR [eax+16]
	mov	esi, 42					; 0000002aH
	sub	esi, edx
	cmp	esi, ecx
	jb	SHORT $L224
	call	ebx
	mov	ecx, 49					; 00000031H
	jmp	SHORT $L418
$L221:
	call	ebx
	mov	esi, eax
$L224:
	mov	ecx, 49					; 00000031H
	jmp	SHORT $L418
$L57:
	test	eax, eax
	je	SHORT $L225
	cmp	WORD PTR [eax], 1
	jne	SHORT $L225
	mov	edx, DWORD PTR [eax+20]
	mov	ecx, DWORD PTR [eax+16]
	mov	esi, 42					; 0000002aH
	sub	esi, edx
	cmp	esi, ecx
	jb	SHORT $L228
	call	ebx
	jmp	SHORT $L228
$L225:
	call	ebx
	mov	esi, eax
$L228:
	mov	ecx, 48					; 00000030H
$L418:
	call	edi
	mov	ecx, DWORD PTR _Result$[ebp]
	mov	edx, DWORD PTR [ecx+12]
	mov	BYTE PTR [edx+esi], al
; Line 33
	mov	eax, DWORD PTR _Num$[ebp]
	test	ah, 8
	mov	eax, DWORD PTR _Result$[ebp]
	je	SHORT $L59
	test	eax, eax
	je	SHORT $L229
	cmp	WORD PTR [eax], 1
	jne	SHORT $L229
	mov	edx, DWORD PTR [eax+20]
	mov	ecx, DWORD PTR [eax+16]
	mov	esi, 40					; 00000028H
	sub	esi, edx
	cmp	esi, ecx
	jb	SHORT $L232
	call	ebx
	mov	ecx, 49					; 00000031H
	jmp	SHORT $L419
$L229:
	call	ebx
	mov	esi, eax
$L232:
	mov	ecx, 49					; 00000031H
	jmp	SHORT $L419
$L59:
	test	eax, eax
	je	SHORT $L233
	cmp	WORD PTR [eax], 1
	jne	SHORT $L233
	mov	edx, DWORD PTR [eax+20]
	mov	ecx, DWORD PTR [eax+16]
	mov	esi, 40					; 00000028H
	sub	esi, edx
	cmp	esi, ecx
	jb	SHORT $L236
	call	ebx
	jmp	SHORT $L236
$L233:
	call	ebx
	mov	esi, eax
$L236:
	mov	ecx, 48					; 00000030H
$L419:
	call	edi
	mov	ecx, DWORD PTR _Result$[ebp]
	mov	edx, DWORD PTR [ecx+12]
	mov	BYTE PTR [edx+esi], al
; Line 34
	mov	eax, DWORD PTR _Num$[ebp]
	test	ah, 16					; 00000010H
	mov	eax, DWORD PTR _Result$[ebp]
	je	SHORT $L61
	test	eax, eax
	je	SHORT $L237
	cmp	WORD PTR [eax], 1
	jne	SHORT $L237
	mov	edx, DWORD PTR [eax+20]
	mov	ecx, DWORD PTR [eax+16]
	mov	esi, 38					; 00000026H
	sub	esi, edx
	cmp	esi, ecx
	jb	SHORT $L240
	call	ebx
	mov	ecx, 49					; 00000031H
	jmp	SHORT $L420
$L237:
	call	ebx
	mov	esi, eax
$L240:
	mov	ecx, 49					; 00000031H
	jmp	SHORT $L420
$L61:
	test	eax, eax
	je	SHORT $L241
	cmp	WORD PTR [eax], 1
	jne	SHORT $L241
	mov	edx, DWORD PTR [eax+20]
	mov	ecx, DWORD PTR [eax+16]
	mov	esi, 38					; 00000026H
	sub	esi, edx
	cmp	esi, ecx
	jb	SHORT $L244
	call	ebx
	jmp	SHORT $L244
$L241:
	call	ebx
	mov	esi, eax
$L244:
	mov	ecx, 48					; 00000030H
$L420:
	call	edi
	mov	ecx, DWORD PTR _Result$[ebp]
	mov	edx, DWORD PTR [ecx+12]
	mov	BYTE PTR [edx+esi], al
; Line 35
	mov	eax, DWORD PTR _Num$[ebp]
	test	ah, 32					; 00000020H
	mov	eax, DWORD PTR _Result$[ebp]
	je	SHORT $L63
	test	eax, eax
	je	SHORT $L245
	cmp	WORD PTR [eax], 1
	jne	SHORT $L245
	mov	edx, DWORD PTR [eax+20]
	mov	ecx, DWORD PTR [eax+16]
	mov	esi, 36					; 00000024H
	sub	esi, edx
	cmp	esi, ecx
	jb	SHORT $L248
	call	ebx
	mov	ecx, 49					; 00000031H
	jmp	SHORT $L421
$L245:
	call	ebx
	mov	esi, eax
$L248:
	mov	ecx, 49					; 00000031H
	jmp	SHORT $L421
$L63:
	test	eax, eax
	je	SHORT $L249
	cmp	WORD PTR [eax], 1
	jne	SHORT $L249
	mov	edx, DWORD PTR [eax+20]
	mov	ecx, DWORD PTR [eax+16]
	mov	esi, 36					; 00000024H
	sub	esi, edx
	cmp	esi, ecx
	jb	SHORT $L252
	call	ebx
	jmp	SHORT $L252
$L249:
	call	ebx
	mov	esi, eax
$L252:
	mov	ecx, 48					; 00000030H
$L421:
	call	edi
	mov	ecx, DWORD PTR _Result$[ebp]
	mov	edx, DWORD PTR [ecx+12]
	mov	BYTE PTR [edx+esi], al
; Line 36
	mov	eax, DWORD PTR _Num$[ebp]
	test	ah, 64					; 00000040H
	mov	eax, DWORD PTR _Result$[ebp]
	je	SHORT $L65
	test	eax, eax
	je	SHORT $L253
	cmp	WORD PTR [eax], 1
	jne	SHORT $L253
	mov	edx, DWORD PTR [eax+20]
	mov	ecx, DWORD PTR [eax+16]
	mov	esi, 34					; 00000022H
	sub	esi, edx
	cmp	esi, ecx
	jb	SHORT $L256
	call	ebx
	mov	ecx, 49					; 00000031H
	jmp	SHORT $L422
$L253:
	call	ebx
	mov	esi, eax
$L256:
	mov	ecx, 49					; 00000031H
	jmp	SHORT $L422
$L65:
	test	eax, eax
	je	SHORT $L257
	cmp	WORD PTR [eax], 1
	jne	SHORT $L257
	mov	edx, DWORD PTR [eax+20]
	mov	ecx, DWORD PTR [eax+16]
	mov	esi, 34					; 00000022H
	sub	esi, edx
	cmp	esi, ecx
	jb	SHORT $L260
	call	ebx
	jmp	SHORT $L260
$L257:
	call	ebx
	mov	esi, eax
$L260:
	mov	ecx, 48					; 00000030H
$L422:
	call	edi
	mov	ecx, DWORD PTR _Result$[ebp]
	mov	edx, DWORD PTR [ecx+12]
	mov	BYTE PTR [edx+esi], al
; Line 37
	mov	eax, DWORD PTR _Num$[ebp]
	test	ah, -128				; ffffff80H
	mov	eax, DWORD PTR _Result$[ebp]
	je	SHORT $L67
	test	eax, eax
	je	SHORT $L261
	cmp	WORD PTR [eax], 1
	jne	SHORT $L261
	mov	edx, DWORD PTR [eax+20]
	mov	ecx, DWORD PTR [eax+16]
	mov	esi, 32					; 00000020H
	sub	esi, edx
	cmp	esi, ecx
	jb	SHORT $L264
	call	ebx
	mov	ecx, 49					; 00000031H
	jmp	SHORT $L423
$L261:
	call	ebx
	mov	esi, eax
$L264:
	mov	ecx, 49					; 00000031H
	jmp	SHORT $L423
$L67:
	test	eax, eax
	je	SHORT $L265
	cmp	WORD PTR [eax], 1
	jne	SHORT $L265
	mov	edx, DWORD PTR [eax+20]
	mov	ecx, DWORD PTR [eax+16]
	mov	esi, 32					; 00000020H
	sub	esi, edx
	cmp	esi, ecx
	jb	SHORT $L268
	call	ebx
	jmp	SHORT $L268
$L265:
	call	ebx
	mov	esi, eax
$L268:
	mov	ecx, 48					; 00000030H
$L423:
	call	edi
	mov	ecx, DWORD PTR _Result$[ebp]
	mov	edx, DWORD PTR [ecx+12]
	mov	BYTE PTR [edx+esi], al
; Line 38
	mov	eax, DWORD PTR _Num$[ebp]
	test	eax, 65536				; 00010000H
	mov	eax, DWORD PTR _Result$[ebp]
	je	SHORT $L69
	test	eax, eax
	je	SHORT $L269
	cmp	WORD PTR [eax], 1
	jne	SHORT $L269
	mov	edx, DWORD PTR [eax+20]
	mov	ecx, DWORD PTR [eax+16]
	mov	esi, 30					; 0000001eH
	sub	esi, edx
	cmp	esi, ecx
	jb	SHORT $L272
	call	ebx
	mov	ecx, 49					; 00000031H
	jmp	SHORT $L424
$L269:
	call	ebx
	mov	esi, eax
$L272:
	mov	ecx, 49					; 00000031H
	jmp	SHORT $L424
$L69:
	test	eax, eax
	je	SHORT $L273
	cmp	WORD PTR [eax], 1
	jne	SHORT $L273
	mov	edx, DWORD PTR [eax+20]
	mov	ecx, DWORD PTR [eax+16]
	mov	esi, 30					; 0000001eH
	sub	esi, edx
	cmp	esi, ecx
	jb	SHORT $L276
	call	ebx
	jmp	SHORT $L276
$L273:
	call	ebx
	mov	esi, eax
$L276:
	mov	ecx, 48					; 00000030H
$L424:
	call	edi
	mov	ecx, DWORD PTR _Result$[ebp]
	mov	edx, DWORD PTR [ecx+12]
	mov	BYTE PTR [edx+esi], al
; Line 39
	mov	eax, DWORD PTR _Num$[ebp]
	test	eax, 131072				; 00020000H
	mov	eax, DWORD PTR _Result$[ebp]
	je	SHORT $L71
	test	eax, eax
	je	SHORT $L277
	cmp	WORD PTR [eax], 1
	jne	SHORT $L277
	mov	edx, DWORD PTR [eax+20]
	mov	ecx, DWORD PTR [eax+16]
	mov	esi, 28					; 0000001cH
	sub	esi, edx
	cmp	esi, ecx
	jb	SHORT $L280
	call	ebx
	mov	ecx, 49					; 00000031H
	jmp	SHORT $L425
$L277:
	call	ebx
	mov	esi, eax
$L280:
	mov	ecx, 49					; 00000031H
	jmp	SHORT $L425
$L71:
	test	eax, eax
	je	SHORT $L281
	cmp	WORD PTR [eax], 1
	jne	SHORT $L281
	mov	edx, DWORD PTR [eax+20]
	mov	ecx, DWORD PTR [eax+16]
	mov	esi, 28					; 0000001cH
	sub	esi, edx
	cmp	esi, ecx
	jb	SHORT $L284
	call	ebx
	jmp	SHORT $L284
$L281:
	call	ebx
	mov	esi, eax
$L284:
	mov	ecx, 48					; 00000030H
$L425:
	call	edi
	mov	ecx, DWORD PTR _Result$[ebp]
	mov	edx, DWORD PTR [ecx+12]
	mov	BYTE PTR [edx+esi], al
; Line 40
	mov	eax, DWORD PTR _Num$[ebp]
	test	eax, 262144				; 00040000H
	mov	eax, DWORD PTR _Result$[ebp]
	je	SHORT $L73
	test	eax, eax
	je	SHORT $L285
	cmp	WORD PTR [eax], 1
	jne	SHORT $L285
	mov	edx, DWORD PTR [eax+20]
	mov	ecx, DWORD PTR [eax+16]
	mov	esi, 26					; 0000001aH
	sub	esi, edx
	cmp	esi, ecx
	jb	SHORT $L288
	call	ebx
	mov	ecx, 49					; 00000031H
	jmp	SHORT $L426
$L285:
	call	ebx
	mov	esi, eax
$L288:
	mov	ecx, 49					; 00000031H
	jmp	SHORT $L426
$L73:
	test	eax, eax
	je	SHORT $L289
	cmp	WORD PTR [eax], 1
	jne	SHORT $L289
	mov	edx, DWORD PTR [eax+20]
	mov	ecx, DWORD PTR [eax+16]
	mov	esi, 26					; 0000001aH
	sub	esi, edx
	cmp	esi, ecx
	jb	SHORT $L292
	call	ebx
	jmp	SHORT $L292
$L289:
	call	ebx
	mov	esi, eax
$L292:
	mov	ecx, 48					; 00000030H
$L426:
	call	edi
	mov	ecx, DWORD PTR _Result$[ebp]
	mov	edx, DWORD PTR [ecx+12]
	mov	BYTE PTR [edx+esi], al
; Line 41
	mov	eax, DWORD PTR _Num$[ebp]
	test	eax, 524288				; 00080000H
	mov	eax, DWORD PTR _Result$[ebp]
	je	SHORT $L75
	test	eax, eax
	je	SHORT $L293
	cmp	WORD PTR [eax], 1
	jne	SHORT $L293
	mov	edx, DWORD PTR [eax+20]
	mov	ecx, DWORD PTR [eax+16]
	mov	esi, 24					; 00000018H
	sub	esi, edx
	cmp	esi, ecx
	jb	SHORT $L296
	call	ebx
	mov	ecx, 49					; 00000031H
	jmp	SHORT $L427
$L293:
	call	ebx
	mov	esi, eax
$L296:
	mov	ecx, 49					; 00000031H
	jmp	SHORT $L427
$L75:
	test	eax, eax
	je	SHORT $L297
	cmp	WORD PTR [eax], 1
	jne	SHORT $L297
	mov	edx, DWORD PTR [eax+20]
	mov	ecx, DWORD PTR [eax+16]
	mov	esi, 24					; 00000018H
	sub	esi, edx
	cmp	esi, ecx
	jb	SHORT $L300
	call	ebx
	jmp	SHORT $L300
$L297:
	call	ebx
	mov	esi, eax
$L300:
	mov	ecx, 48					; 00000030H
$L427:
	call	edi
	mov	ecx, DWORD PTR _Result$[ebp]
	mov	edx, DWORD PTR [ecx+12]
	mov	BYTE PTR [edx+esi], al
; Line 42
	mov	eax, DWORD PTR _Num$[ebp]
	test	eax, 1048576				; 00100000H
	mov	eax, DWORD PTR _Result$[ebp]
	je	SHORT $L77
	test	eax, eax
	je	SHORT $L301
	cmp	WORD PTR [eax], 1
	jne	SHORT $L301
	mov	edx, DWORD PTR [eax+20]
	mov	ecx, DWORD PTR [eax+16]
	mov	esi, 22					; 00000016H
	sub	esi, edx
	cmp	esi, ecx
	jb	SHORT $L304
	call	ebx
	mov	ecx, 49					; 00000031H
	jmp	SHORT $L428
$L301:
	call	ebx
	mov	esi, eax
$L304:
	mov	ecx, 49					; 00000031H
	jmp	SHORT $L428
$L77:
	test	eax, eax
	je	SHORT $L305
	cmp	WORD PTR [eax], 1
	jne	SHORT $L305
	mov	edx, DWORD PTR [eax+20]
	mov	ecx, DWORD PTR [eax+16]
	mov	esi, 22					; 00000016H
	sub	esi, edx
	cmp	esi, ecx
	jb	SHORT $L308
	call	ebx
	jmp	SHORT $L308
$L305:
	call	ebx
	mov	esi, eax
$L308:
	mov	ecx, 48					; 00000030H
$L428:
	call	edi
	mov	ecx, DWORD PTR _Result$[ebp]
	mov	edx, DWORD PTR [ecx+12]
	mov	BYTE PTR [edx+esi], al
; Line 43
	mov	eax, DWORD PTR _Num$[ebp]
	test	eax, 2097152				; 00200000H
	mov	eax, DWORD PTR _Result$[ebp]
	je	SHORT $L79
	test	eax, eax
	je	SHORT $L309
	cmp	WORD PTR [eax], 1
	jne	SHORT $L309
	mov	edx, DWORD PTR [eax+20]
	mov	ecx, DWORD PTR [eax+16]
	mov	esi, 20					; 00000014H
	sub	esi, edx
	cmp	esi, ecx
	jb	SHORT $L312
	call	ebx
	mov	ecx, 49					; 00000031H
	jmp	SHORT $L429
$L309:
	call	ebx
	mov	esi, eax
$L312:
	mov	ecx, 49					; 00000031H
	jmp	SHORT $L429
$L79:
	test	eax, eax
	je	SHORT $L313
	cmp	WORD PTR [eax], 1
	jne	SHORT $L313
	mov	edx, DWORD PTR [eax+20]
	mov	ecx, DWORD PTR [eax+16]
	mov	esi, 20					; 00000014H
	sub	esi, edx
	cmp	esi, ecx
	jb	SHORT $L316
	call	ebx
	jmp	SHORT $L316
$L313:
	call	ebx
	mov	esi, eax
$L316:
	mov	ecx, 48					; 00000030H
$L429:
	call	edi
	mov	ecx, DWORD PTR _Result$[ebp]
	mov	edx, DWORD PTR [ecx+12]
	mov	BYTE PTR [edx+esi], al
; Line 44
	mov	eax, DWORD PTR _Num$[ebp]
	test	eax, 4194304				; 00400000H
	mov	eax, DWORD PTR _Result$[ebp]
	je	SHORT $L81
	test	eax, eax
	je	SHORT $L317
	cmp	WORD PTR [eax], 1
	jne	SHORT $L317
	mov	edx, DWORD PTR [eax+20]
	mov	ecx, DWORD PTR [eax+16]
	mov	esi, 18					; 00000012H
	sub	esi, edx
	cmp	esi, ecx
	jb	SHORT $L320
	call	ebx
	mov	ecx, 49					; 00000031H
	jmp	SHORT $L430
$L317:
	call	ebx
	mov	esi, eax
$L320:
	mov	ecx, 49					; 00000031H
	jmp	SHORT $L430
$L81:
	test	eax, eax
	je	SHORT $L321
	cmp	WORD PTR [eax], 1
	jne	SHORT $L321
	mov	edx, DWORD PTR [eax+20]
	mov	ecx, DWORD PTR [eax+16]
	mov	esi, 18					; 00000012H
	sub	esi, edx
	cmp	esi, ecx
	jb	SHORT $L324
	call	ebx
	jmp	SHORT $L324
$L321:
	call	ebx
	mov	esi, eax
$L324:
	mov	ecx, 48					; 00000030H
$L430:
	call	edi
	mov	ecx, DWORD PTR _Result$[ebp]
	mov	edx, DWORD PTR [ecx+12]
	mov	BYTE PTR [edx+esi], al
; Line 45
	mov	eax, DWORD PTR _Num$[ebp]
	test	eax, 8388608				; 00800000H
	mov	eax, DWORD PTR _Result$[ebp]
	je	SHORT $L83
	test	eax, eax
	je	SHORT $L325
	cmp	WORD PTR [eax], 1
	jne	SHORT $L325
	mov	edx, DWORD PTR [eax+20]
	mov	ecx, DWORD PTR [eax+16]
	mov	esi, 16					; 00000010H
	sub	esi, edx
	cmp	esi, ecx
	jb	SHORT $L328
	call	ebx
	mov	ecx, 49					; 00000031H
	jmp	SHORT $L431
$L325:
	call	ebx
	mov	esi, eax
$L328:
	mov	ecx, 49					; 00000031H
	jmp	SHORT $L431
$L83:
	test	eax, eax
	je	SHORT $L329
	cmp	WORD PTR [eax], 1
	jne	SHORT $L329
	mov	edx, DWORD PTR [eax+20]
	mov	ecx, DWORD PTR [eax+16]
	mov	esi, 16					; 00000010H
	sub	esi, edx
	cmp	esi, ecx
	jb	SHORT $L332
	call	ebx
	jmp	SHORT $L332
$L329:
	call	ebx
	mov	esi, eax
$L332:
	mov	ecx, 48					; 00000030H
$L431:
	call	edi
	mov	ecx, DWORD PTR _Result$[ebp]
	mov	edx, DWORD PTR [ecx+12]
	mov	BYTE PTR [edx+esi], al
; Line 46
	mov	eax, DWORD PTR _Num$[ebp]
	test	eax, 16777216				; 01000000H
	mov	eax, DWORD PTR _Result$[ebp]
	je	SHORT $L85
	test	eax, eax
	je	SHORT $L333
	cmp	WORD PTR [eax], 1
	jne	SHORT $L333
	mov	edx, DWORD PTR [eax+20]
	mov	ecx, DWORD PTR [eax+16]
	mov	esi, 14					; 0000000eH
	sub	esi, edx
	cmp	esi, ecx
	jb	SHORT $L336
	call	ebx
	mov	ecx, 49					; 00000031H
	jmp	SHORT $L432
$L333:
	call	ebx
	mov	esi, eax
$L336:
	mov	ecx, 49					; 00000031H
	jmp	SHORT $L432
$L85:
	test	eax, eax
	je	SHORT $L337
	cmp	WORD PTR [eax], 1
	jne	SHORT $L337
	mov	edx, DWORD PTR [eax+20]
	mov	ecx, DWORD PTR [eax+16]
	mov	esi, 14					; 0000000eH
	sub	esi, edx
	cmp	esi, ecx
	jb	SHORT $L340
	call	ebx
	jmp	SHORT $L340
$L337:
	call	ebx
	mov	esi, eax
$L340:
	mov	ecx, 48					; 00000030H
$L432:
	call	edi
	mov	ecx, DWORD PTR _Result$[ebp]
	mov	edx, DWORD PTR [ecx+12]
	mov	BYTE PTR [edx+esi], al
; Line 47
	mov	eax, DWORD PTR _Num$[ebp]
	test	eax, 33554432				; 02000000H
	mov	eax, DWORD PTR _Result$[ebp]
	je	SHORT $L87
	test	eax, eax
	je	SHORT $L341
	cmp	WORD PTR [eax], 1
	jne	SHORT $L341
	mov	edx, DWORD PTR [eax+20]
	mov	ecx, DWORD PTR [eax+16]
	mov	esi, 12					; 0000000cH
	sub	esi, edx
	cmp	esi, ecx
	jb	SHORT $L344
	call	ebx
	mov	ecx, 49					; 00000031H
	jmp	SHORT $L433
$L341:
	call	ebx
	mov	esi, eax
$L344:
	mov	ecx, 49					; 00000031H
	jmp	SHORT $L433
$L87:
	test	eax, eax
	je	SHORT $L345
	cmp	WORD PTR [eax], 1
	jne	SHORT $L345
	mov	edx, DWORD PTR [eax+20]
	mov	ecx, DWORD PTR [eax+16]
	mov	esi, 12					; 0000000cH
	sub	esi, edx
	cmp	esi, ecx
	jb	SHORT $L348
	call	ebx
	jmp	SHORT $L348
$L345:
	call	ebx
	mov	esi, eax
$L348:
	mov	ecx, 48					; 00000030H
$L433:
	call	edi
	mov	ecx, DWORD PTR _Result$[ebp]
	mov	edx, DWORD PTR [ecx+12]
	mov	BYTE PTR [edx+esi], al
; Line 48
	mov	eax, DWORD PTR _Num$[ebp]
	test	eax, 67108864				; 04000000H
	mov	eax, DWORD PTR _Result$[ebp]
	je	SHORT $L89
	test	eax, eax
	je	SHORT $L349
	cmp	WORD PTR [eax], 1
	jne	SHORT $L349
	mov	edx, DWORD PTR [eax+20]
	mov	ecx, DWORD PTR [eax+16]
	mov	esi, 10					; 0000000aH
	sub	esi, edx
	cmp	esi, ecx
	jb	SHORT $L352
	call	ebx
	mov	ecx, 49					; 00000031H
	jmp	SHORT $L434
$L349:
	call	ebx
	mov	esi, eax
$L352:
	mov	ecx, 49					; 00000031H
	jmp	SHORT $L434
$L89:
	test	eax, eax
	je	SHORT $L353
	cmp	WORD PTR [eax], 1
	jne	SHORT $L353
	mov	edx, DWORD PTR [eax+20]
	mov	ecx, DWORD PTR [eax+16]
	mov	esi, 10					; 0000000aH
	sub	esi, edx
	cmp	esi, ecx
	jb	SHORT $L356
	call	ebx
	jmp	SHORT $L356
$L353:
	call	ebx
	mov	esi, eax
$L356:
	mov	ecx, 48					; 00000030H
$L434:
	call	edi
	mov	ecx, DWORD PTR _Result$[ebp]
	mov	edx, DWORD PTR [ecx+12]
	mov	BYTE PTR [edx+esi], al
; Line 49
	mov	eax, DWORD PTR _Num$[ebp]
	test	eax, 134217728				; 08000000H
	mov	eax, DWORD PTR _Result$[ebp]
	je	SHORT $L91
	test	eax, eax
	je	SHORT $L357
	cmp	WORD PTR [eax], 1
	jne	SHORT $L357
	mov	edx, DWORD PTR [eax+20]
	mov	ecx, DWORD PTR [eax+16]
	mov	esi, 8
	sub	esi, edx
	cmp	esi, ecx
	jb	SHORT $L360
	call	ebx
	mov	ecx, 49					; 00000031H
	jmp	SHORT $L435
$L357:
	call	ebx
	mov	esi, eax
$L360:
	mov	ecx, 49					; 00000031H
	jmp	SHORT $L435
$L91:
	test	eax, eax
	je	SHORT $L361
	cmp	WORD PTR [eax], 1
	jne	SHORT $L361
	mov	edx, DWORD PTR [eax+20]
	mov	ecx, DWORD PTR [eax+16]
	mov	esi, 8
	sub	esi, edx
	cmp	esi, ecx
	jb	SHORT $L364
	call	ebx
	jmp	SHORT $L364
$L361:
	call	ebx
	mov	esi, eax
$L364:
	mov	ecx, 48					; 00000030H
$L435:
	call	edi
	mov	ecx, DWORD PTR _Result$[ebp]
	mov	edx, DWORD PTR [ecx+12]
	mov	BYTE PTR [edx+esi], al
; Line 50
	mov	eax, DWORD PTR _Num$[ebp]
	test	eax, 268435456				; 10000000H
	mov	eax, DWORD PTR _Result$[ebp]
	je	SHORT $L93
	test	eax, eax
	je	SHORT $L365
	cmp	WORD PTR [eax], 1
	jne	SHORT $L365
	mov	edx, DWORD PTR [eax+20]
	mov	ecx, DWORD PTR [eax+16]
	mov	esi, 6
	sub	esi, edx
	cmp	esi, ecx
	jb	SHORT $L368
	call	ebx
	mov	ecx, 49					; 00000031H
	jmp	SHORT $L436
$L365:
	call	ebx
	mov	esi, eax
$L368:
	mov	ecx, 49					; 00000031H
	jmp	SHORT $L436
$L93:
	test	eax, eax
	je	SHORT $L369
	cmp	WORD PTR [eax], 1
	jne	SHORT $L369
	mov	edx, DWORD PTR [eax+20]
	mov	ecx, DWORD PTR [eax+16]
	mov	esi, 6
	sub	esi, edx
	cmp	esi, ecx
	jb	SHORT $L372
	call	ebx
	jmp	SHORT $L372
$L369:
	call	ebx
	mov	esi, eax
$L372:
	mov	ecx, 48					; 00000030H
$L436:
	call	edi
	mov	ecx, DWORD PTR _Result$[ebp]
	mov	edx, DWORD PTR [ecx+12]
	mov	BYTE PTR [edx+esi], al
; Line 51
	mov	eax, DWORD PTR _Num$[ebp]
	test	eax, 536870912				; 20000000H
	mov	eax, DWORD PTR _Result$[ebp]
	je	SHORT $L95
	test	eax, eax
	je	SHORT $L373
	cmp	WORD PTR [eax], 1
	jne	SHORT $L373
	mov	edx, DWORD PTR [eax+20]
	mov	ecx, DWORD PTR [eax+16]
	mov	esi, 4
	sub	esi, edx
	cmp	esi, ecx
	jb	SHORT $L376
	call	ebx
	mov	ecx, 49					; 00000031H
	jmp	SHORT $L437
$L373:
	call	ebx
	mov	esi, eax
$L376:
	mov	ecx, 49					; 00000031H
	jmp	SHORT $L437
$L95:
	test	eax, eax
	je	SHORT $L377
	cmp	WORD PTR [eax], 1
	jne	SHORT $L377
	mov	edx, DWORD PTR [eax+20]
	mov	ecx, DWORD PTR [eax+16]
	mov	esi, 4
	sub	esi, edx
	cmp	esi, ecx
	jb	SHORT $L380
	call	ebx
	jmp	SHORT $L380
$L377:
	call	ebx
	mov	esi, eax
$L380:
	mov	ecx, 48					; 00000030H
$L437:
	call	edi
	mov	ecx, DWORD PTR _Result$[ebp]
	mov	edx, DWORD PTR [ecx+12]
	mov	BYTE PTR [edx+esi], al
; Line 52
	mov	eax, DWORD PTR _Num$[ebp]
	test	eax, 1073741824				; 40000000H
	mov	eax, DWORD PTR _Result$[ebp]
	je	SHORT $L97
	test	eax, eax
	je	SHORT $L381
	cmp	WORD PTR [eax], 1
	jne	SHORT $L381
	mov	edx, DWORD PTR [eax+20]
	mov	ecx, DWORD PTR [eax+16]
	mov	esi, 2
	sub	esi, edx
	cmp	esi, ecx
	jb	SHORT $L384
	call	ebx
	mov	ecx, 49					; 00000031H
	jmp	SHORT $L438
$L381:
	call	ebx
	mov	esi, eax
$L384:
	mov	ecx, 49					; 00000031H
	jmp	SHORT $L438
$L97:
	test	eax, eax
	je	SHORT $L385
	cmp	WORD PTR [eax], 1
	jne	SHORT $L385
	mov	edx, DWORD PTR [eax+20]
	mov	ecx, DWORD PTR [eax+16]
	mov	esi, 2
	sub	esi, edx
	cmp	esi, ecx
	jb	SHORT $L388
	call	ebx
	jmp	SHORT $L388
$L385:
	call	ebx
	mov	esi, eax
$L388:
	mov	ecx, 48					; 00000030H
$L438:
	call	edi
	mov	ecx, DWORD PTR _Result$[ebp]
	mov	edx, DWORD PTR [ecx+12]
	mov	BYTE PTR [edx+esi], al
; Line 53
	mov	eax, DWORD PTR _Num$[ebp]
	test	eax, -2147483648			; 80000000H
	mov	eax, DWORD PTR _Result$[ebp]
	je	SHORT $L99
	test	eax, eax
	je	SHORT $L389
	cmp	WORD PTR [eax], 1
	jne	SHORT $L389
	mov	esi, DWORD PTR [eax+20]
	mov	ecx, DWORD PTR [eax+16]
	neg	esi
	cmp	esi, ecx
	jb	SHORT $L392
	call	ebx
	mov	ecx, 49					; 00000031H
	jmp	SHORT $L439
$L389:
	call	ebx
	mov	esi, eax
$L392:
	mov	ecx, 49					; 00000031H
	jmp	SHORT $L439
$L99:
	test	eax, eax
	je	SHORT $L393
	cmp	WORD PTR [eax], 1
	jne	SHORT $L393
	mov	esi, DWORD PTR [eax+20]
	mov	ecx, DWORD PTR [eax+16]
	neg	esi
	cmp	esi, ecx
	jb	SHORT $L396
	call	ebx
	jmp	SHORT $L396
$L393:
	call	ebx
	mov	esi, eax
$L396:
	mov	ecx, 48					; 00000030H
$L439:
	call	edi
	mov	ecx, DWORD PTR _Result$[ebp]
	mov	edx, DWORD PTR [ecx+12]
; Line 55
	lea	ecx, DWORD PTR _unnamed_var1$[ebp]
	push	ecx
	mov	BYTE PTR [edx+esi], al
	mov	eax, DWORD PTR _Result$[ebp]
	mov	DWORD PTR _unnamed_var1$[ebp+8], eax
	mov	DWORD PTR _unnamed_var1$[ebp], 8209	; 00002011H
	call	DWORD PTR __imp____vbaStrVarCopy
	mov	edx, eax
	lea	ecx, DWORD PTR _Dec2Bin$[ebp]
	call	DWORD PTR __imp_@__vbaStrMove
$L32:
	push	$L402
	jmp	SHORT $L397
$L31:
; Line 56
	lea	ecx, DWORD PTR _Dec2Bin$[ebp]
	call	DWORD PTR __imp_@__vbaFreeStr
	ret	0
$L397:
$L30:
	lea	edx, DWORD PTR _Result$[ebp]
	push	edx
	push	0
	call	DWORD PTR __imp____vbaAryDestruct
$L400:
	ret	0
$L402:
	mov	eax, DWORD PTR _Me$[ebp]
	push	eax
	mov	ecx, DWORD PTR [eax]
	call	DWORD PTR [ecx+8]
	mov	edx, DWORD PTR _Dec2Bin$[ebp]
	mov	eax, DWORD PTR _Dec2Bin$[ebp]
	mov	DWORD PTR [edx], eax
	mov	eax, DWORD PTR __$SEHRec$[ebp+16]
	mov	ecx, DWORD PTR __$SEHRec$[ebp]
	pop	edi
	pop	esi
	mov	DWORD PTR fs:__except_list, ecx
	pop	ebx
	mov	esp, ebp
	pop	ebp
	ret	12					; 0000000cH
?Dec2Bin@Form1@@AAGXXZ ENDP				; Form1::Dec2Bin
text$1	ENDS
PUBLIC	?Form_Load@Form1@@AAGXXZ			; Form1::Form_Load
EXTRN	__imp____vba@051DF814:NEAR
EXTRN	__imp____vbaHresultCheckObj:NEAR
EXTRN	___vba@006A2A78:BYTE
EXTRN	__imp____vbaFreeVarList:NEAR
;	COMDAT CONST
; File C:\Users\Administrator\Desktop\Form1.frm
CONST	SEGMENT
$S120	DB	05H, 00H
	DB	08H, 00H
	DD	FLAT:$L119
	DB	00H, 00H, 00H, 00H
	DD	FLAT:$L118
CONST	ENDS
;	COMDAT ?Form_Load@Form1@@AAGXXZ
text$1	SEGMENT
_Me$ = 8
_unnamed_var1$ = -24
_unnamed_var1$ = -40
_unnamed_var1$ = -56
_unnamed_var1$ = -72
_unnamed_var1$ = -88
__$SEHRec$ = -20
?Form_Load@Form1@@AAGXXZ PROC NEAR			; Form1::Form_Load, COMDAT
; File C:\Users\Administrator\Desktop\Form1.frm
; Line 58
	push	ebp
	mov	ebp, esp
	sub	esp, 12					; 0000000cH
	push	OFFSET FLAT:___vbaExceptHandler
	mov	eax, DWORD PTR fs:__except_list
	push	eax
	mov	DWORD PTR fs:__except_list, esp
	sub	esp, 132				; 00000084H
	push	ebx
	push	esi
	push	edi
	mov	DWORD PTR __$SEHRec$[ebp+8], esp
	mov	DWORD PTR __$SEHRec$[ebp+12], OFFSET FLAT:$S120
	mov	esi, DWORD PTR _Me$[ebp]
	mov	eax, esi
	and	eax, 1
	mov	DWORD PTR __$SEHRec$[ebp+16], eax
	and	esi, -2					; fffffffeH
	push	esi
	mov	DWORD PTR _Me$[ebp], esi
	mov	ecx, DWORD PTR [esi]
	call	DWORD PTR [ecx+4]
; Line 59
	mov	edx, DWORD PTR [esi]
	xor	edi, edi
	mov	eax, 10					; 0000000aH
	mov	DWORD PTR _unnamed_var1$[ebp], edi
	mov	DWORD PTR _unnamed_var1$[ebp], edi
	mov	DWORD PTR _unnamed_var1$[ebp], edi
	mov	DWORD PTR _unnamed_var1$[ebp], eax
	mov	DWORD PTR _unnamed_var1$[ebp], eax
	mov	DWORD PTR _unnamed_var1$[ebp], eax
	lea	eax, DWORD PTR _unnamed_var1$[ebp]
	push	eax
	mov	ecx, -2147352572			; 80020004H
	push	1
	push	esi
	mov	DWORD PTR _unnamed_var1$[ebp], edi
	mov	DWORD PTR _unnamed_var1$[ebp], edi
	mov	DWORD PTR _unnamed_var1$[ebp+8], ecx
	mov	DWORD PTR _unnamed_var1$[ebp+8], ecx
	mov	DWORD PTR _unnamed_var1$[ebp+8], ecx
	call	DWORD PTR [edx+1784]
	cmp	eax, edi
	jge	SHORT $L443
	push	1784					; 000006f8H
	push	OFFSET FLAT:___vba@006A2A78
	push	esi
	push	eax
	call	DWORD PTR __imp____vbaHresultCheckObj
$L443:
	mov	eax, DWORD PTR _unnamed_var1$[ebp]
	lea	ecx, DWORD PTR _unnamed_var1$[ebp]
	mov	DWORD PTR _unnamed_var1$[ebp+8], eax
	lea	edx, DWORD PTR _unnamed_var1$[ebp]
	push	ecx
	lea	eax, DWORD PTR _unnamed_var1$[ebp]
	push	edx
	push	eax
	lea	ecx, DWORD PTR _unnamed_var1$[ebp]
	push	edi
	push	ecx
	mov	DWORD PTR _unnamed_var1$[ebp], edi
	mov	DWORD PTR _unnamed_var1$[ebp], 8
	call	DWORD PTR __imp____vba@051DF814
	lea	edx, DWORD PTR _unnamed_var1$[ebp]
	lea	eax, DWORD PTR _unnamed_var1$[ebp]
	push	edx
	lea	ecx, DWORD PTR _unnamed_var1$[ebp]
	push	eax
	lea	edx, DWORD PTR _unnamed_var1$[ebp]
	push	ecx
	push	edx
	push	4
	call	DWORD PTR __imp____vbaFreeVarList
	add	esp, 20					; 00000014H
; Line 60
	mov	DWORD PTR __$SEHRec$[ebp+16], edi
$L119:
	push	$L450
	jmp	SHORT $L445
$L118:
	lea	ecx, DWORD PTR _unnamed_var1$[ebp]
	call	DWORD PTR __imp_@__vbaFreeStr
	lea	eax, DWORD PTR _unnamed_var1$[ebp]
	lea	ecx, DWORD PTR _unnamed_var1$[ebp]
	push	eax
	lea	edx, DWORD PTR _unnamed_var1$[ebp]
	push	ecx
	lea	eax, DWORD PTR _unnamed_var1$[ebp]
	push	edx
	push	eax
	push	4
	call	DWORD PTR __imp____vbaFreeVarList
	add	esp, 20					; 00000014H
	ret	0
$L445:
$L448:
	ret	0
$L450:
	mov	eax, DWORD PTR _Me$[ebp]
	push	eax
	mov	ecx, DWORD PTR [eax]
	call	DWORD PTR [ecx+8]
	mov	eax, DWORD PTR __$SEHRec$[ebp+16]
	mov	ecx, DWORD PTR __$SEHRec$[ebp]
	pop	edi
	pop	esi
	mov	DWORD PTR fs:__except_list, ecx
	pop	ebx
	mov	esp, ebp
	pop	ebp
	ret	4
?Form_Load@Form1@@AAGXXZ ENDP				; Form1::Form_Load
text$1	ENDS
END

26

主题

114

帖子

1620

积分

用户组: 版主

UID
1821
精华
6
威望
67 点
宅币
1291 个
贡献
51 次
宅之契约
0 份
在线时间
258 小时
注册时间
2016-7-12
发表于 2019-7-11 20:02:34 | 显示全部楼层
本帖最后由 Ayala 于 2019-7-11 20:17 编辑

伪代码 不知道速度怎样 太多年不写vb了 不知道怎么玩了
Dim s() As String
Dim nums(4) As Byte
s() = Array("00000000", "00000001", "00000010", "00000011", "00000100", "00000101", "00000110", "00000111", _
        "00001000", "00001001", "00001010", "00001011", "00001100", "00001101", "00001110", "00001111", _
             ...
                                                                                                "11111111")

memcpy nums(0),num
d2cbin =  s(nums(3)) & s(nums(2)) & s(nums(1)) & (nums(0))
Dec2Bin = Result

1044

主题

2345

帖子

5万

积分

用户组: 管理员

一只技术宅

UID
1
精华
218
威望
294 点
宅币
18326 个
贡献
37543 次
宅之契约
0 份
在线时间
1749 小时
注册时间
2014-1-26
 楼主| 发表于 2019-7-13 15:58:04 | 显示全部楼层
Ayala 发表于 2019-7-11 20:02
伪代码 不知道速度怎样 太多年不写vb了 不知道怎么玩了
Dim s() As String
Dim nums(4) As Byte

这个是最快的。但这个表的初始化不能重复执行。

我测试过65536个表项的,并且使用整数除法而非CopyMemory等玩意儿。

确实查表法是最快的。

26

主题

114

帖子

1620

积分

用户组: 版主

UID
1821
精华
6
威望
67 点
宅币
1291 个
贡献
51 次
宅之契约
0 份
在线时间
258 小时
注册时间
2016-7-12
发表于 2019-7-14 12:14:16 | 显示全部楼层
本帖最后由 Ayala 于 2019-7-14 19:25 编辑
0xAA55 发表于 2019-7-13 15:58
这个是最快的。但这个表的初始化不能重复执行。

我测试过65536个表项的,并且使用整数除法而非CopyMemor ...


65536个就太占内存了不是很必要256个就可以处理任意位数的16进制数据了,可以不用copymemeory,可以利用vb的__vbaCopyBytes或者直接GetMem4

0

主题

35

帖子

109

积分

用户组: 小·技术宅

UID
1457
精华
0
威望
2 点
宅币
70 个
贡献
0 次
宅之契约
0 份
在线时间
6 小时
注册时间
2016-1-29
发表于 2019-7-20 17:31:22 | 显示全部楼层
老外的原始代码如下:
[Visual Basic] 纯文本查看 复制代码
Public Static Function Dec2Bin(ByVal L As Long) As String
' by Peter Nierop, [email]pnierop.pnc@inter.nl.net[/email], 20001226
    Dim lDone&, sNibble(0 To 15) As String, sByte(0 To 255) As String
    If lDone = 0 Then
        sNibble(0) = "0000"
        sNibble(1) = "0001"
        sNibble(2) = "0010"
        sNibble(3) = "0011"
        sNibble(4) = "0100"
        sNibble(5) = "0101"
        sNibble(6) = "0110"
        sNibble(7) = "0111"
        sNibble(8) = "1000"
        sNibble(9) = "1001"
        sNibble(10) = "1010"
        sNibble(11) = "1011"
        sNibble(12) = "1100"
        sNibble(13) = "1101"
        sNibble(14) = "1110"
        sNibble(15) = "1111"
        For lDone = 0 To 255
            sByte(lDone) = sNibble(lDone \ &H10) & sNibble(lDone And &HF)
        Next
    End If
    If L < 0 Then
        L = L And &H7FFFFFFF
        Dec2Bin = sByte(128 + L \ &H1000000 And &HFF) _
                  & sByte(L \ &H10000 And &HFF) _
                  & sByte(L \ &H100 And &HFF) _
                  & sByte(L And &HFF)
    Else
        Dec2Bin = sByte(L \ &H1000000 And &HFF) _
                  & sByte(L \ &H10000 And &HFF) _
                  & sByte(L \ &H100 And &HFF) _
                  & sByte(L And &HFF)
    End If
End Function

26

主题

114

帖子

1620

积分

用户组: 版主

UID
1821
精华
6
威望
67 点
宅币
1291 个
贡献
51 次
宅之契约
0 份
在线时间
258 小时
注册时间
2016-7-12
发表于 2019-7-20 19:49:09 | 显示全部楼层
搬砖工 发表于 2019-7-20 17:31
老外的原始代码如下:
[mw_shl_code=vb,true]Public Static Function Dec2Bin(ByVal L As Long) As String
...

这个效率并不如楼主的效率高

本版积分规则

QQ|申请友链||Archiver|手机版|小黑屋|技术宅的结界 ( 滇ICP备16008837号|网站地图

GMT+8, 2019-11-14 17:18 , Processed in 0.123380 second(s), 36 queries , Gzip On.

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表