{"id":496,"date":"2008-05-07T23:07:18","date_gmt":"2008-05-07T23:07:18","guid":{"rendered":"http:\/\/6teen.ru\/?p=695"},"modified":"2008-05-07T23:07:18","modified_gmt":"2008-05-07T23:07:18","slug":"811-2","status":"publish","type":"post","link":"http:\/\/pblog.ru\/lab\/?p=496","title":{"rendered":"\u0421\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 WinAPI\/\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u0436\u0435\u043b\u0435\u0437\u043e\u043c\/BIOS"},"content":{"rendered":"<p>\u0421\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 WinAPI\/\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u0436\u0435\u043b\u0435\u0437\u043e\u043c\/BIOS<br \/>\n<!--more--><\/p>\n<pre class=\"alt2\" style=\"margin:0px; padding:6px; border:1px inset; width:580px; height:320px; overflow:auto\"><div>\u0421\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 WinAPI\/\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u0436\u0435\u043b\u0435\u0437\u043e\u043c\/BIOS\n\n\u041a\u0430\u043a \u0443\u0437\u043d\u0430\u0442\u044c \u043d\u043e\u043c\u0435\u0440 bios \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u0432\u0438\u043d\u0434\u043e\u0432?\n\nwindows 9x\n\nwith memo1.lines do\nbegin\nadd('mainboardbiosname:'+^i+string(pchar(ptr($fe061))));\nadd('mainboardbioscopyright:'+^i+string(pchar(ptr($fe091))));\nadd('mainboardbiosdate:'+^i+string(pchar(ptr($ffff5))));\nadd('mainboardbiosserialno:'+^i+string(pchar(ptr($fec71))));\nend;\n\nwindows nt\n\nprocedure tbiosinfo.getreginfowinnt;\nvar\nregistryv : tregistry;\nregpath : string;\nsl : tstrings;\nbegin\nparams.clear;\n\nregpath := '\\hardware\\description\\system';\nregistryv:=tregistry.create;\nregistryv.rootkey:=hkey_local_machine;\nsl := nil;\ntry\nregistryv.openkey(regpath,false);\nshowmessage('bios date: '+registryv.readstring('systembiosdate'));\nsl := readmultirowkey(registryv,'systembiosversion');\nshowmessage('bios version: '+sl.text);\nexcept\nend;\nregistryv.free;\nif assigned(sl) then sl.free;\nend;\n\nfunction readmultirowkey(reg: tregistry; key: string): tstrings;\nconst bufsize = 100;\nvar\ni: integer;\ns1: string;\nsl: tstringlist;\nbin: array[1..bufsize] of char;\nbegin\ntry\nresult := nil;\nsl := nil;\nsl := tstringlist.create;\nif not assigned(reg) then\nraise exception.create('tregistry object not assigned.');\nfillchar(bin,bufsize,#0);\nreg.readbinarydata(key,bin,bufsize);\ni := 1;\ns1 := '';\nwhile i < bufsize do\nbegin\nif ord(bin[i]) >= 32 then\ns1 := s1 + bin[i]\nelse\nbegin\nif length(s1) > 0 then\nbegin\nsl.add(s1);\ns1 := '';\nend;\nend;\ninc(i);\nend;\nresult := sl;\nexcept\nsl.free;\nraise;\nend;\nend;\n\n***********************************************************\n\n\u041a\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u0430\u0442\u0443 bios?\n\nunit biosdate;\n\ninterface\n\nfunction getbiosdate: string;\n\nimplementation\n\nfunction segofstolinear(segment, offset: word): integer;\nbegin\nresult := (segment shl 4) or offset;\nend;\n\nfunction getbiosdate: string;\nbegin\nresult := string(pchar(ptr(segofstolinear($f000, $fff5))));\nend;\n\nend.\n\n**********************************************************\n\n\u041a\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e bios \u0432 windows 9x?\n\nwith memo1.lines do\nbegin\nadd('mainboardbiosname:'+^i+string(pchar(ptr($fe061))));\nadd('mainboardbioscopyright:'+^i+string(pchar(ptr($fe091))));\nadd('mainboardbiosdate:'+^i+string(pchar(ptr($ffff5))));\nadd('mainboardbiosserialno:'+^i+string(pchar(ptr($fec71))));\nend;\n\n\u041a\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e bios \u0432 windows nt\/2000\/xp?\n\u0412 nt\/2000\/xp \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u044f\u043c\u043e \u0438\u0437 bios, \u043e\u0434\u043d\u0430\u043a\u043e, \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043c\u0435\u0448\u0430\u0435\u0442 \u043d\u0430\u043c \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438\u0437 \u0440\u0435\u0435\u0441\u0442\u0440\u0430.\n\nprocedure tbiosinfo.getreginfowinnt;\nvar\nregistryv : tregistry;\nregpath : string;\nsl : tstrings;\nbegin\nparams.clear;\n\nregpath := '\\hardware\\description\\system';\nregistryv:=tregistry.create;\nregistryv.rootkey:=hkey_local_machine;\nsl := nil;\ntry\nregistryv.openkey(regpath,false);\nshowmessage('bios date: '+registryv.readstring('systembiosdate'));\nsl := readmultirowkey(registryv,'systembiosversion');\nshowmessage('bios version: '+sl.text);\nexcept\nend;\nregistryv.free;\nif assigned(sl) then sl.free;\nend;\n\n---------------------------\n\n\u041d\u0430 \u0432\u0441\u044f\u043a\u0438\u0439 \u043f\u043e\u0436\u0430\u0440\u043d\u044b\u0439:\n\n\/\/\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043c\u0435\u0442\u043e\u0434 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043c\u043d\u043e\u0433\u043e\u0441\u0442\u0440\u043e\u0447\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438\u0437 \u0440\u0435\u0435\u0441\u0442\u0440\u0430\n\/\/\u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u0438\u0445 \u0432 tstringlist\nfunction readmultirowkey(reg: tregistry; key: string): tstrings;\nconst bufsize = 100;\nvar\ni: integer;\ns1: string;\nsl: tstringlist;\nbin: array[1..bufsize] of char;\nbegin\ntry\nresult := nil;\nsl := nil;\nsl := tstringlist.create;\nif not assigned(reg) then\nraise exception.create('tregistry object not assigned.');\nfillchar(bin,bufsize,#0);\nreg.readbinarydata(key,bin,bufsize);\ni := 1;\ns1 := '';\nwhile i < bufsize do\nbegin\nif ord(bin[i]) >= 32 then\ns1 := s1 + bin[i]\nelse\nbegin\nif length(s1) > 0 then\nbegin\nsl.add(s1);\ns1 := '';\nend;\nend;\ninc(i);\nend;\nresult := sl;\nexcept\nsl.free;\nraise;\nend;\nend;\n\n\u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a: http:\/\/ogoncharenko.narod.ru\n<\/div><\/pre>\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0421\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 WinAPI\/\u0420\u0430\u0431\u043e\u0442\u0430 \u0441 \u0436\u0435\u043b\u0435\u0437\u043e\u043c\/BIOS<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[431,360],"tags":[1212,1320,1723,1035],"_links":{"self":[{"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=\/wp\/v2\/posts\/496"}],"collection":[{"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=496"}],"version-history":[{"count":0,"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=\/wp\/v2\/posts\/496\/revisions"}],"wp:attachment":[{"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=496"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=496"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=496"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}