powerbuilder防止反编译: pbkiller无法解析longlong类型而且错得一塌糊涂
pbkiller2.5.18无法解析longlong类型,一旦你申明longlong类型无法反编译出类型,值也不对,因为longlong采用类似指针的方式存放值。
只要在代码中如此写:
int aaa =100
long bbb = 1000
longlong ccc = 20000
boolean ddd = false
datawindow dwx
aaa = 2 - 3
bbb = 1 -2
ccc = ((((((aaa + ccc *aaa + ccc))))))
return 1
反编译出来是:
integer aaa = 100
long bbb = 1000
ccc = 8
boolean ddd = false
datawindow dwx
aaa = 2 - 3
bbb = 1 - 2
ccc.commit using aaa;
aaa.pbm_bmgetstate.commit using pbm_bmgetstate;
return
return
return
补充:
同样的,只要出现longlong类型的字面量,都会出现解析不到的问题
source:
return 1
return 10
return 100
return 1000
return 10000
return 100000
return 1000000
return 10000000
return 100000000
return 1000000000
return 10000000000
return 100000000000
return 1000000000000
return 10000000000000
return 100000000000000
return 1000000000000000
return 10000000000000000
return 100000000000000000
return 1000000000000000000
return 10000000000000000000
反编译后:
do
do
do
do
do
return 1
return 10
return 100
return 1000
return 10000
return 100000
return 1000000
return 10000000
return 100000000
return 1000000000
return
return
destroy(?????)
return
return
return
return
return primary
return
return
loop while 0
loop while " "
loop while
loop while
loop while
return
/*================*/
20090822:今天在写一个demo时,发现pbkiller在解析参引对象列表时存在问题:
type strc_333 from structure
blobaaa
blobaaax[255]
blobaaay[255,254,253,252]
blobaaa1
blobaaa2
booleanbbb
charccc
dateeee
datetimefff
decimalggg
decimalggg0
decimalggg1
decimalggg2
decimalggg3
decimalggg4
decimalggg5
decimalggg6
decimalggg7
decimalggg8
decimalggg9
decimalggg10
decimalggg11
decimalggg12
decimalggg13
decimalggg14
decimalggg15
decimalggg16
decimalggg17
decimalggg18
doublejjj
integerkkk
longlll
???????mmm
stringnnn
timeppp
uintqqq
ulongrrr
realsss
anyttt
accessibilityt1
accessiblestatet2
adoresultsett3
applicationt4
arrayboundst5
checkboxt6
classdefinitiont7
classdefinitionobjectt8
commandbuttont9
connectiont10
connectioninfot11
connectobjectt12
contextinformationt13
contextkeywordt14
corbabadcontextt15
corbabadinvordert16
corbabadoperationt17
corbabadparamt18
corbabadtypecodet19
corbacommfailuret20
corbacurrentt21
corbadataconversiont22
corbafreememt23
corbaimplimitt24
corbainitializet25
corbainternalt26
corbaintfrepost27
corbainvalidtransactiont28
corbainvflagt29
corbainvidentt30
corbainvobjreft31
corbamarshalt32
corbanoimplementt33
corbanomemoryt34
corbanopermissiont35
corbanoresourcest36
corbanoresponset37
corbaobjadaptert38
corbaobjectt39
corbaobjectnotexistt40
corbapersiststoret41
corbasystemexceptiont42
corbatransactionrequiredt43
corbatransactionrolledbackt44
corbatransientt45
corbauniont46
corbaunknownt47
corbauserexceptiont48
cplusplust49
datastoret50
datawindowt51
datawindowchildt52
dividebyzeroerrort53
dragobjectt54
drawobjectt55
dropdownlistboxt56
dropdownpicturelistboxt57
dwobjectt58
dwruntimeerrort59
dynamicdescriptionareat60
dynamicstagingareat61
editmaskt62
enumerationdefinitiont63
enumerationitemdefinitiont64
environmentt65
errort66
errorloggingt67
exceptiont68
extobjectt69
function_objectt70
grapht71
graphicobjectt72
graxist73
grdispattrt74
groupboxt75
hprogressbart76
hscrollbart77
htrackbart78
inett79
internetresultt80
jaguarorbt81
linet82
listboxt83
listviewt84
listviewitemt85
mailfiledescriptiont86
mailmessaget87
mailrecipientt88
mailsessiont89
mdiclientt90
menut91
menucascadet92
messaget93
multilineeditt94
nonvisualobjectt95
nullobjecterrort96
olecontrolt97
olecustomcontrolt98
oleobjectt99
oleruntimeerrort100
olestoraget101
olestreamt102
oletxnobjectt103
omcontrolt104
omcustomcontrolt105
omembeddedcontrolt106
omobjectt107
omstoraget108
omstreamt109
orbt110
ovalt111
pbtocppobjectt112
pbxruntimeerrort113
picturet114
picturebuttont115
picturehyperlinkt116
picturelistboxt117
pipelinet118
powerobjectt119
profilecallt120
profileclasst121
profilelinet122
profileroutinet123
profilingt124
radiobuttont125
rectanglet126
remoteobjectt127
resultsett128
resultsetst129
richtexteditt130
roundrectanglet131
runtimeerrort132
scriptdefinitiont133
servicet134
simpletypedefinitiont135
singlelineeditt136
sslcallbackt137
sslserviceprovidert138
statichyperlinkt139
statictextt140
structuret141
systemfunctionst142
tabt143
throwablet144
timingt145
traceactivitynodet146
tracebeginendt147
traceerrort148
traceesqlt149
tracefilet150
tracegarbagecollectt151
tracelinet152
traceobjectt153
traceroutinet154
tracetreet155
tracetreeerrort156
tracetreeesqlt157
tracetreegarbagecollectt158
tracetreelinet159
tracetreenodet160
tracetreeobjectt161
tracetreeroutinet162
tracetreeusert163
traceusert164
transactiont165
transactionservert166
treeviewt167
treeviewitemt168
typedefinitiont169
userobjectt170
variablecardinalitydefinitiont171
variabledefinitiont172
vprogressbart173
vscrollbart174
vtrackbart175
windowt176
windowobjectt177
m_1t200
m_2t201
m_3t202
m_4t203
m_5t204
m_6t205
m_7t206
m_8t207
m_9t208
m_10t209
m_11t210
m_12t211
m_13t212
m_14t213
m_15t214
m_16t215
m_17t216
m_18t217
m_19t218
m_21t220
m_22t221
m_23t222
m_24t223
m_25t224
m_26t225
m_27t226
m_28t227
m_29t228
m_31t230
m_32t231
m_33t232
m_34t233
m_35t234
m_36t235
m_37t236
m_38t237
m_39t238
m_41t240
m_42t241
m_43t242
m_44t243
m_45t244
m_46t245
m_47t246
m_48t247
m_49t248
m_51t250
m_52t251
m_53t252
m_54t253
m_55t254
m_56t255
m_57t256
m_58t257
m_59t258
m_61t260
m_62t261
m_63t262
m_64t263
m_65t264
m_66t265
m_67t266
m_68t267
m_69t268
m_71t270
m_72t271
m_73t272
m_74t273
m_75t274
m_76t275
m_77t276
m_78t277
m_79t278
m_81t280
m_82t281
m_83t282
m_84t283
m_85t284
??????t285
??????t286
??????t287
??????t288
??????t290
??????t291
??????t292
??????t293
end type
红色问号部分为无法解析的部分。一般而言,参引对象列表系统的一共177个内置对象。我又加了100个menu对象。很明显作者认为最多可以引用255个。其实不然。参引对象可以多达32768个。
//20090820:补充
type strc_111 from structure
stringccc
stringccc1[12] //source为ccc1[2 to 12];看来没有搞定所有的声明方式。
stringccc2[65535]
stringccc3[255,255]
stringccc4[255,255,255]
stringccc5[255,255,255,255]
end type
//20090821:
在uo或win的instance和shared区分别申明两个int变量:
instance : int ii_111 = 65535 //反编译为-1
shared: int si_222 = 65535//反编译为65535,从存储本质来看,是没问题,但是参与其他提升计算就会有问题。
//20090822
发现枚举类型它无法反编译得到初始值。
alignment lal_111= left!
alignment lal_222= right!
alignment lal_333= center!
//20090823
一个变量的申明格式如:{access-right,accessread,accesswrite} datatype{size}{precision} varname
pbkiller对access部分没有解析,也就是public,private,protected等。对constant也没解析,对size部分和precision部分都没有解析,就是其他篇里指出的如:blob{255} var1和dec{4} var2这样的情况没有得到解析。可见,其还是非常欠缺的。
//20090903
uing u1 = 65537 //取模应该是 u1 = 1,但是它没有处理。只是显示65537.
//20090903:
real =100.01,测试反编译值是错误的。可能是用c++的unsigned int去取值,然后转成double处理的。证明是错误的。real应该转c++的float才是正确的。我在做decompiler时也犯同样错误,后面改为
float f1;
memcpy(&f1,&uint1,4),这样处理即ok。
//20090903
ulongc3 = 4294967294 反编译为-2
ulongc4 = 4294967295 反编译为-1
dec{16} dec{17}dec{18}的变量初值错误。
很明显是用c++的unsigned __int32去取得pb的四位ulong值,但是显示时要IntToStr(),这个函数支持int和__int64两种,很明显作者并未进行强制转换,致使出现-2,-1的错误。
鉴于目前pb6-9使用很普遍。这里给大家提个醒,可以利用pbkiller的bug防止关键数据。如果作者不更新的话(目前看的使用形式看,他不会更新了,因为pb已经不热了。而且他软件是免费的,缺少原动力。)这些问题永远都会存在的。我们善加利用之。