pro*c declare cursor 问题

WaterWalker 2007-07-09 02:30:43
我发现,如果把declare cursor语句嵌入if中,结果是错误的,比如:

if( i == 1 ){
declear cursor c1 for select x from mytab where x < 10;
}else{
declear cursor c1 for select x from mytab where x > 10;
}


//处理cursor c1, 发现取出来的数据都是 x < 10; 即else子句处理失败。

请问该怎么解决这个问题,谢谢。
...全文
195 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
bjt_ 2007-07-09
  • 打赏
  • 举报
回复
declear sqlstr string;
if( i == 1 ){
sqlstr:='select x from mytab where x < 10'
}else{
sqlstr:='select x from mytab where x > 10'
}

open cur for sqlstr;
PL/SQL 基础,一个不错的 PL/SQL 参考手册。内容预览: ---- 第一章 PL/SQL 简介 ---- 1. Oracle应用编辑方法概览 1) Pro*C/C++/... : C语言和数据库打交道的方法,比OCI更常用; 2) ODBC 3) OCI: C语言和数据库打交道的方法,和Pro*C很相似,更底层,很少用 只适合ORACLE; 4) SQLJ: 很新的一种用Java访问Oracle数据库的方法,会的人不多; 5) JDBC 6) PL/SQL: 存储在数据库内运行, 其他方法为在数据库外对数据库访问,只适合ORACLE; 2. PL/SQL 1) PL/SQL(Procedual language/SQL)是在标准SQL的基础上增加了过程化处理的语言; 2) Oracle客户端工具访问Oracle服务器的操作语言; 3) Oracle对SQL的扩充; 4. PL/SQL的优缺点 优点:1) 结构化模块化编程,不是面向对象; 2) 良好的可移植性(不管Oracle运行在何种操作系统); 3) 良好的可维护性(编译通过后存储在数据库里); 4) 提升系统性能; 缺点 1) 不便于向异构数据库移植应用程序(只能用于Oracle); 5. SQL与PL/SQL的区别 SQL:1) 第四代语言(智能语言); 2) 做什么,不管怎么做; 3) 缺少过程与控制语句; 4) 无算法 PL/SQL: (相对SQL扩展部分) 1) 扩展变量和类型; 2) 扩展控制结构; 3) 扩展过程与函数; 4) 扩展对象类型与方法 ---- 第二章 PL/SQL程序结构 ---- 1. PL/SQL块 1) 申明部分, DECLARE (如果语句不需要声明任何变量,可以不写); 2) 执行部分, BEGIN <---------> END; 3) 异常处理,EXCEPTION(可以没有); 2. PL/SQL开发环境 可以运用任何纯文本的编辑器编辑,例如:VI 3. PL/SQL字符集 字母: A-Z, a-z; 数字: 0-9; 空白: TAB , SPACE , 回车; 符号: +_)(*&^%$#@!~ ; PL/SQL对大小写不敏感(注意) 4. 标识符命名规则答: 1) 字母开头; 2) 后跟任意的 非空格字符 数字 货币符号( $ ) 下划线( _ ) 或 # ; 3) 最大长度为30个字符(八个字符左右最合适); 用来给对象命名(潜规则): 变量: 以v_开头 游标: 以c_开头 类型: 子程序: 5. 分界符 1) 运算符 + - * / **(指数操作符) 2) 关系 =(相当于JAVA中的==) > < <> != ~= ^= <= >= 3) 赋值 := 例子a:=2 4) 连接 || 例: 'abc' || 123 5) 标号 << 需要的标记 >> 6) 注释 --(单行) /* */(段落) 7) 替代 6. 文字 1)字符型文字(字符串) 'tom' (单引号) 'tom''s pen' ''为2个单引号(标识转义) 为tom's pen 2)数字型 123 -4 +56 0 9.0 1.23E5 9.8e-3 3)布尔型 TRUE FALSE NULL 7. 变量声明 语法 Var_name [CONSTANT](标识常量,可选) type [NOT NULL](标识为not-null后必须在后面初始化) [:=value](赋值,初始化); Var_name [CONSTANT](标识常量,可选) type [NOT NULL] [ default value](赋值,初始化)等同于上面的语句; 注:1) 申明时可以有默认值也可以没有; 2) 如有[CONSTANT][NOT NULL], 变量一定要有一个初始值; 3) 赋值语句为“:=”; 4) 变量可以认为是数据库里一个字段; 5) 规定没有初始化的变量为NULL; ---- 第三章 变量与数据类型 ---- 1. 数据类型 1) 标量型:数字型(BINARY_INTEGER,NUMBER)(DEC,FLOAT,REAL... NUMBER的子类型)、 NUMBER(P,S) P:精度:整个的有效数位(从左边开始第一个不为0的数字起) S:刻度,可选(小数点后面的保留位数) BINARY_INTEGER:保存整数. 和NUMBER的底层的保存方式不同, BINARY_INTEGER为2进制保存,NUMBER 需要考虑其他东西不是2进制方式 BINARY_INTEGER之间做加法效率快而NUMBER要先转换2进制再计算 单纯的计算---->BINARY_INTEGER 考虑和表中其他数据的交互的话一般------->NUMBER 字符型、CHAR VARCHAR VARCHAR2 STRING LONG 一般CHAR VARCHAR2就够了 CHAR 定长(例子:CHAR(5) 如果不够5个字符的话就会用空白填充 ) ,可以不带长度规定(默认为1) VARCHAR2 变长((VARCHAR2(5)标识最长可以保存5个字符) 后面的长度规定必须要有 布尔型、BOOLEAN 日期型; DATE(后增加 TIMESTAMP(比DATE更精细点(精确到秒) INTERVAL) 一般用DATE 2) 组合型:RECORD(常用)、TABLE(常用)、VARRAY(较少用) 3) 参考型:REF CURSOR(游标)、REF object_type 4) LOB(Large Object) 2. %TYPE [变量名] [表名.字段名] [%TYPE] 表示变量具有与数据库的表中某一字段相同的类型 例:v_FirstName s_emp.first_name%TYPE; 3. RECORD类型 TYPE t_emp IS RECORD( /*其中TYPE,IS,RECORD为关键字,record_name为变量名称*/ field1 type [NOT NULL][:=expr1], /*每个等价的成员间用逗号分隔*/ field2 type [NOT NULL][:=expr2], /*如果一个字段限定NOT NULL,那么它必须拥有一个初始值*/ ... /*所有没有初始化的字段都会初始为NULL*/ fieldn type [NOT NULL][:=exprn] ); 4. %ROWTYPE 返回一个基于数据库定义的类型 DECLARE v_emp s_emp%ROWTYPE; /*s_emp为表的名字*/ 注:与RECORD类型中定一个record相比,一步就完成, 而RECORD类型中定义分二步:a. 所有的成员变量都要申明; b. 实例化变量; 可以代替RECORD类型. 5. TABLE类型 TYPE tabletype IS TABLE OF type(类型名,要保存成的数据类型) INDEX BY BINARY_INTEGER; 例:DECLARE TYPE t_emp IS TABLE OF s_emp%ROWTYPE INDEX BY BINARY_INTERGER; v_emp t_emp; BEGIN SELECT * INTO v_emp(100) FROM s_emp WHERE id = 1; SELECT * INTO v_emp(200) FROM s_emp WHERE id = 2; DBMS_OUTPUT.PUT_LINE(v_emp(200).id||' '||v_emp(200).lastname||' '||v_emp(200).salary); END; 注:1) id(索引) 的数目的限制由BINARY_INTEGER的范围决定(-2147483647<----->2147483647); 2) TABLE类型与map类似; 3) 表中的元素可以是复合类型; 4) KEY 没有必要是顺序的; 5) 当数据被插入表中的时候,表所需的空间就被分配了; 6. 变量的作用域和可见性 <> 1) 执行块里可以嵌入执行块; 2) 里层执行块的变量对外层不可见; 3) 里层执行块对外层执行块变量的修改会影响外层块变量的值 (在此里层,对其他里层则不影响,想要不影响此里层的话可以使用标号标注外层); ---- 第四章 PL/SQL控制语句 ---- 1. 条件语句 IF boolean_expression1(条件1) THEN ... ELSIF boolean_expression2(条件2) THEN /*注意是ELSIF,而不是ELSEIF*/ ... /*ELSE语句(ELSIF)不是必须的,但END IF;是必须的*/ ELSE ... END IF; 注意:1)有多个BOOLEAN表达式时候 AND(与),OR(或),NOT(非) 2)条件为FALSE与TRUE 相同; 2. 循环语句 1) Loop 循环 Loop ... (循环体) IF boolean_expr(条件) THEN /* 加条件语句,当满足条件时候退出循环*/ EXIT; /* EXIT WHEN boolean_expr */ END IF; END LOOP; 2) WHILE 循环 WHILE boolean_expr(条件) LOOP /* boolean_expr 循环条件*/ ... (循环体) END LOOP; 3) FOR循环 FOR loop_counter IN [REVERSE] low_bound..high_bound LOOP /* 范围中间用2个点表示 从 low_blound 到 high_bound */ ... (循环体) END LOOP; 例: FOR v_cnt IN 1..5 LOOP SELECT * INTO v_emp FROM s_emp WHERE id = v_cnt; 注:a. 加上REVERSE关键字 表示递减,从结束边界到起始边界,递减步长为一; 不加为递增,从起始边界到结束边界,递减步长为一; b. low_blound 起始边界; high_bound 结束边界; 3. GOTO语句 GOTO label_name; 1) 只能由内部块跳往外部块; 2) 设置标签:<< >> 3) 示例: LOOP ... IF D%ROWCOUNT = 50 THEN GOTO l_close; END IF; ... END LOOP; <>: ... 4. NULL语句 在语句块中加空语句,用于补充语句的完整性。 例:IF boolean_expr THEN ... ELSE NULL; END IF; 5. SQL in PL/SQL 1) 只有DML SQL和transaction Control SQL可以直接在PL/SQL中使用; 2) PL/SQL中的动态SQL可以使用所有有效的SQL语句,包括DDL; 3) 动态SQL在运行时动态生成SQL语句,然后分析语句并执行; 4) PL/SQL中的动态SQL有两种:本地动态SQL和DBMS_SQL包; ---- 第五章 PL/SQL游标 ---- 1. 游标(CURSOR) 游标是从数据表中提取出来的数据,以临时表的形式存放在内存中,在游标中有一个数 据指针,在初始状态下指向的是首记录,利用 fetch 语句可以移动该指针,从而对游标中的数 据进行各种操作,然后将操作结果写回数据表中。 1)分类: a)显式游标:程序员可以操作控制,是针对select 语句的,指向select 语句的结束集 b)隐式游标:程序员不可控制,但可以有限制的应用 2)作用:用于处理查询语句的结果,提取多行数据集; 3)使用步骤: a) 声明游标: a. 普通声明: DELCARE v_emp s_emp%ROWTYPE; v_did s_dept.id%TYPE; CURSOR cur_emp IS select * FROM s_emp WHERE dept_id =v_did; /* CURSOR的内容必须是一条查询语句 */ b. 带参数声明明:DELCARE CURSOR c_emp(v_did s_emp.ID%TYPE) SELECT * FROM s_emp WHERE dept_id = v_did; b) 为查询打开游标: OPEN cur_emp; /* 相当于执行select语句,且把执行结果存入CURSOR; c) 从游标中取结果,存入PL/SQL变量中: a. FETCH cur_emp INTO var1, var2, ...(变量名 1, 变量名 2,.......); /* 变量的数量、类型、顺序要和Table中字段一致; */ b. FETCH cur_emp INTO record_var(记录型变量名); 注:将值从CURSOR取出放入变量中,每FETCH一次取一条记录; d) 关闭游标: CLOSE cur_emp; 注:a. 游标使用后应该关闭; b. 关闭后的游标不能FETCH和再次CLOSE; c. 关闭游标相当于将内存中CURSOR的内容清空; 2. 游标的属性 游标名%属性名 1) %FOUND: 是否有值; 有则返回TRUE,否则返回FALSE; 2) %NOTFOUND: 是否没有值; 如果没有值则返回TRUE,否则返回FALSE; 3) %ISOPEN: 是否是处于打开状态; 处于打开状态就返回TRUE,否则返回FALSE; 4) %ROWCOUNT: CURSOR当前的记录号(当前游标的指针位移量,表示在此之前,游标所处理的数据量(多少条记录)); 3. 游标的FETCH循环 1) LOOP FETCH 游标名 INTO 定义的变量 EXIT WHEN 游标名%NOTFOUND; /* 当游标没取道记录后退出 要及时的做出判断 */ END LOOP; 2) WHILE 游标名%FOUND LOOP FETCH 游标名 INTO 定义的变量; END LOOP; 3) FOR 保存数据的变量(不用事先定义,是根据游标声明的时候SELECT 的类型来确定) IN 游标名 LOOP (FETCH 游标名 INTO ...) (可以不用FETCH 语句) END LOOP; 4.带参数的游标CURSOR DECLARE v_emp s_emp%ROWTYPE CURSOR cur_emp(p_did s_emp.dept_id%TYPE) IS /* 定义参数p_did的类型 */ SELECT * FROM s_emp WHERE dept_id= p_did FOR UPDATE OF salary; /*FOR UPDATE OF salary; 加行级锁,在我修改这些数据的时候, *其他人无法修改数据,直到游标被CLOSE后 */ BEGIN OPEN cur_emp(31); /*带的参数值 31 就是赋给参数p_did 的 */ LOOP FETCH cur_emp INTO v_emp; EXIT WHEN cur_emp%NOTFOUND; DBMS_OUTPUT.PUT_LINE(v_emp.id||' '||v_emp.first_name); END LOOP; CLOSE cur_emp; END 5.显式游标主要是用于对查询语句的处理,尤其是在查询结果为多条记录的情况下; 而对于非查询语句,如修改、删除操作,则由ORACLE 系统自动地为这些操作设置游标并创建其工作区,这些由系统隐含创建的游标称为隐式游标,隐式游标的名字为SQL,这是由ORACLE 系统定义的。 对于隐式游标的操作,如定义、打开、取值及关闭操作,都由ORACLE 系统自动地完成,无需用户进行处理。 用户只能通过隐式游标的相关属性,来完成相应的操作。 在隐式游标的工作区中,所存放的数据是与用户自定义的显示游标无关的、最新处理的一条SQL 语句所包含的数据。 格式调用为: SQL% 注:INSERT, UPDATE, DELETE, SELECT 语句中不必明确定义游标。 隐式游标属性 SQL%FOUND 布尔型属性,当最近一次读记录时成功返回,则值为true; SQL%NOTFOUND 布尔型属性,与%found相反; SQL %ROWCOUNT 数字型属性, 返回已从游标中读取得记录数; SQL %ISOPEN 布尔型属性, 取值总是FALSE。SQL命令执行完毕立即关闭隐式游标。
PL/SQL编程 pl/sql(procedural language/sql)是Oracle在标准的sql语言上的扩展。pl/sql不仅允许嵌入式sql语言,还可以定义变量和常量,允许使用条件语句和循环语句,允许使用例外处理各种错误。这样使得他的功能变的更强大。缺点是移植性不好。 编写一个存储过程,向表中添加数据。 1. create table mytest (name varchar2(30),passwd varchar2(30)); 2. create or replace procedure xxc_pro1 is begin insert into mytest values ('小红','m123'); end; 3. 调用过程 exec 过程名(参数1,参数2…)或call 过程名参数1,参数2…) ① exec xxc_pro1; 或者是 ② call xxc_pro1; pl/sql可以做什么? 块:包括过程、函数、触发器、包。 编写规范: 1. 注释 --:单行注释 eg:select * from emp where empno=7788;--取得员工信息 /*……*/多行注释 2. 表示符号(变量)的命名规范: ① 当定义变量时,建议用v_作为前缀:v_ename ② 当定义常量时,建议用c_作为前缀:c_rate ③ 当定义游标时,建议用_cursor作为后缀:emp_cursor ④ 当定义例外时,建议用e_作为前缀:e_error 块(block)是pl/sql的今本程序单元,编写pl/sql程序实际上就是在编写pl/sql块;pl/sql块由三部分组成:定义部分,执行部分,例外处理部分。 declare --可选部分 /*定义部分:定义常量,变量,游标,例外,复杂数据类型*/ begin --必选部分 /*执行部分:要执行的pl/sql语句和sql语句*/ exception --可选部分 /*例外处理部分:处理运行的各种错误*/ 实例1:只包含执行部分的pl/sql块 SQL> set serveroutput on --打开输出 SQL> begin 2 dbms_output.put_line('hello'); 3 end; 4 / 说明:dbms_output是oracle提供的包,该包包含一些过程,put_line就是其中之一。 实例2:包含定义部分和执行部分 SQL> declare 2 v_ename varchar2(5); 3 begin 4 select ename into v_ename from emp where empno = &no; 5 dbms_output.put_line('雇员名'||v_ename); 6 end; 7 / 说明:&:从控制台输入变量,会弹出一个对话框。 实例3.同时输出雇员名和工资 SQL> declare 2 v_ename varchar2(20); 3 v_sal number(10,2); 4 begin 5 select ename,sal into v_ename,v_sal from emp where empno=&no; 6 dbms_output.put_line('雇员名:'||v_ename||' 工资:'||v_sal); 7 end; 8 / 包含定义,执行,和例外处理的pl/sql块。 实例4.当输入的员工号不存在时 SQL> declare 2 v_ename varchar2(20); 3 v_sal number(10,2); 4 begin 5 select ename,sal into v_ename,v_sal from emp where empno =&no; 6 dbms_output.put_line('雇员名:'||v_ename||' 工资:'||v_sal); 7 exception --异常处理部分 8 when no_data_found then 9 dbms_output.put_line('请输入正确的员工号!'); 10 end; 11 / 以上为块的基础,下面来介绍块的各个组成:过程,函数,触发器,包。 过程 过程用于执行特定的操作,当执行过程的时候,可以指定输入参数(in),也可以指定输出参数(out)。通过在过程中使用输入参数,可以讲数据输入到执行部分,通过使用输出参数,可以将执行部分的数据输出到应用环境,在pl/sql中可以使用create procedure命令来创建过程。 编写一个存储过程,可以输入雇员名和新工资来改变员工工资。 --案例 create or replace procedure xxc_pro3(newname in varchar2,newsal in number) is begin update emp set sal=newsal where ename=newname; end;
启点CE过NP中文December 24 2018:Cheat Engine 6.8.2 Released: Here's a new version for the hollidays. Mainly minor improvements and some small bugfixes, but also a new 'ultimap like' feature called Code Filter for which you don't need any special hardware for. (Just an extensive list of addresses) Download: Cheat Engine 6.8.2 Fixes: Disassembler: Several disassembler instructions had a comma too many or too few ,fixed those Disassembler: Fixed the description for ret # Disassembler/Debug: Fixed the address that is being edited when a breakpoint hits while editing an instruction Assembler: Fixed assembling reg*2/4/8+unquotedsymbol Plugin: Fixed the SDK for C plugins that use the disassembler callback Hotkeys: Fixed the attach to foreground hotkey Memory Scan: Fixed the percentage scan Memory Scan: Fixed a rare situation that could cause an error Memory Scan: Simple values now works with groupscan Memory Scan Lua: Scanfiles now also get deleted if the memory scan object is freed before the scan is fully done Fill Memory: Now allows 64-bit addresses Structure Dissect: Fixed the popupmenu "change type" so it now affects all selected entries instead of just the first PointerOrPointee window: Fix the debug pointer or pointee window button text when using access instead of writes GUI: Fixed and restored the DPI Aware option in setting GUI: Some DPI fixes/adjustments here and there Graphical Memory view: Fixed DPI issues Symbolhandler: When the symbolhandler now waits till it's done, it won't wait for the structures to be parsed anymore Additions and Changes: Lua Engine: Added autocomplete DLL injection: On DLL injection failure CE tries to fall back on forced injection methods Assembler: Added multibyte NOP Plugins: Plugins can now have side dll's that are statically linked in their own folder (Windows 7 with updates and later) Debugging: Improved the FPU window editing when single stepping, allowing you to change the FPU registers Debugging: Threadview now updates when single stepping and cnanges made there will affect the currently debugged thread (before it didn't) Debugging: Added Code Filter. This lets you filter out code based on if it has been executed or not (Uses software breakpoints) Debugging: Added an option to chose if you wish to break on unexpected breakpoints, and if CE should break on unexpected breakpoints, or only on specified regions (like AA scripts) Disassembler: The comments now show multiple parameters Pointerscan: Add option to allow negative offset scanning Pointerscan: Add extra types to the display Advanced Options/CodeList: Now uses symbolnames Tutorial Game: Added a levelskip option when you've solved a step Tutorial Game: Added a secondary test Compare memory: Added a limit to the number of address values shown per row (can be changed) Address List: When the option to deactivate children is set, the children will get deactivated first Memory Scan: Add a lua script in autorun that lets you specify which module to scan Lua: ExecuteCodeEx(Let's you execute code in the target and pass parameters) Added 2 new parameters to getNameFromAddress (ModuleNames and Symbols) Added addModule and deleteModule to the symbollist class Added the ModuleLoader class which can force load dll's Fixed endUpdate for the listview Thanks go out to SER[G]ANT for updating the russion translation files already June 23 2018:Cheat Engine 6.8.1 Released: Apparently 6.8 contained a couple of annoying bugs, so here's an update that should hopefully resolve most issues. Also a few new features that can come handy Download: Cheat Engine 6.8.1 Fixes: Fixed several issues with the structure compare Fixed the commonality scanner from picking up unrelated registers for comparison Fixed speedhack hotkeys Fixed ultimap 1 Fixed a bunch of random access violations Fixed Lua dissectCode.getStringReferences now also returns the string Fixed Lua breakpoints that specify a specific function Fixed Lua toAddress when the 2nd parameter is an address Fixed assembling xmm,m32 Fixed issue when disassembling AVX instructions Fixed rightclicking r8-r9 in the registers window Fixed the plugin system for DBVM Fixed DBVM memory allocations when smaller than 4KB Additions and changes: Added translation strings for the all type settings You can now drop files into the auto assembler auto assembler commands allocnx (allocate no execute) and allocxo (allocate execute only) The memoryview windows's hexadecimalview now shows the allocationbase as well, and can be doubleclicked to go there Added support for mono dll's that do not export g_free Changed "make page writable" to multiple options Improved DBVM speed slightly Lua: added RemoteThread class object June 8 2018:Cheat Engine 6.8 Released: Cheat Engine 6.8 has been released. Lots of new features like structure compare, AVX disassembling support, lua functions, etc... Download: If you encounter bugs or have suggestions, please do not hesitate to report them in the forum, bugtracker or by e-mail. And if you have questions, don't hesitate to ask them in the forum Fixes: Fixed some more high dpi issues Fixed issues with the dropdown list in memory records Fixed pointer offset symbols not calculating properly Fixed registered binutils Fixed graphical issues with the tablist Fixed issue where memory blocks would get cut of before the page end Fixed some memory leaks Fixed some graphical issues in the addresslist Fixed rightclick on r8 and r9 in memoryview Fixed disassembling some instructions Fixed DBVM so it works on windows 1709 and later (tested on 1803) Fixed several DBVM offload crashes Fixed freeze with allow increase/decrease for 8 byte long values Fixed several issues where minimizing a window and then close it would hang CE Fixed file scanning Fixed crashes when editing memory in some some emulators Additions and changes: Text editor improvements Added hundreds of new cpu instructions Mono now has some new features like instancing of objects Mono instances window is now a treeview where you can see the fields and values "find what addresses this code accesses" can also be used on RET instructions now (useful to find callers) The graphical memory view now has a lot more options to set it just the way you need Codepage support in hexview structure data from PDB files can now be used, and are stored in a database for lookup later dissect structures form can now show a list of known structures (pdb, mono, ...) Added a "revert to saved scan" option (lets you undo changes) Added a "forgot scan" option (in case you forgot what you're doing) Pointerscan limit nodes is default on in a new ce install (remembers your choice when you disable it) Autoattach now happens using a thread instead of a gui blocking timer Some colorscheme enhancements Added a DBVM based "Find what writes/accesses" feature. (For pro users, enable kernelmode options for it to show) Changed the dissect data setup from seperate yes/no/value dialogs to a single window Added a bypass option for ultimap2 on windows 1709. When using ranges, do not use interrupts, or use DBVM Added find what writes/access to the foundlist Autoassembler scriptblocks are now grouped when written to memory Added {$try}/{$except} to auto assembler scripts Added an extra tutorial/practice target Added cut/copy/paste context menu items to pointer offset fields in add/change address, and added a context menu to the pointer destination Added an automated structure compare for two groups of addresses to find ways to distinguish between them lua: added automatic garbage collection and settings to configure it added new functions: gc_setPassive gc_setActive reinitializeSelfSymbolhandler registerStructureAndElementListCallback showSelectionList changed the getWindowlist output MainForm.OnProcessOpened (better use this instead of onOpenProcess) enumStructureForms cpuid getHotkeyHandlerThread bunch of dbvm_ functions (needs dbvm capable cpu, and intel only atm) and more, including class methods and fields (read celua.txt) Minor patches: 06/08/2018: 6.8.0.4 - Fixed speedhack hotkey speed asignments and some commonalityscanner issues 06/09/2018: 6.8.0.5 - Fixed only when down speedhack option 06/10/2018: 6.8.0.6 - Fixed ultimap1 - Fixed ultimap2 on some systems - Fixed enableDRM() from crashing - Fixed one disassembler instruction Russian translation has been updated November 13 2017:Can't run Cheat Engine There is apparently some malware going around that blocks execution of Cheat Engine (Saying file missing, check filename, etc...) If you have been a victim of this then try this windows repair tool to fix your windows install: Download Repair Tool November 9 2017:Spanish(Latin) translation added Manuel Ibacache M. from Chile has provided us with spanish(Latin) translation files for Cheat Engine. They can be downloaded from the download section where you can find the other translation files, or right here June 7 2017:Cheat Engine 6.7 Released: Cheat Engine 6.7 has been released. New lua functions, GUI improvements, codepage scanning, several bugfixes and more(See below). Download: Cheat Engine 6.7 If you encounter bugs or have suggestions, please do not hesitate to report them in the forum, bugtracker, irc or by e-mail. And if you have questions, don't hesitate to ask them in the forum , irc Fixes: Fixed some DPI issues at some spots Fixed the "Not" scan for ALL "simple values" now also applies to the All type Fixed not adding the 0-terminator to strings when the option was set to add it Fixed ultimap hotkeys Fixed ultimap2 filtering Changing pointers in the change address dialog won't set/override global memrec and address anymore (local now) Fixed show as signed not working for custom types Fixed several issues with the structure spider Fixed 64-bit registers in the tracer getting truncated on doubleclick, and fix r8 to r15 Fixed copy/paste in the scanvalue Fixed kernelmode QueryMemoryRegions for windows build 1607 Fixed some disassembler errors Fixed lua command fullAccess Fixed text to speech if launched from a different thread Fixed clicking on checkboxes when the dpi is different Fixed the found code dialog count size Fixed mono freezing Cheat Engine when it crashes/freezes Additions and changes: Changed the processlist and added an Applications view similar to the taskmanager Small change to the tutorial first step wording Structure Dissect: Added RLE compression (by mgr.inz.player) and other things to improve filesize Structure Dissect: If setting a name, it will also be shown in the header The symbolhandler can now deal with complex pointer notations Added support for single-ToPA systems for ultimap2 Added some more spots where the history will be remebered in memoryview Memoryrecords with auto assembler scripts can now execute their code asynchronous (rightclick and set "Execute asynchronous") Kernelmode memory reading/writing is safer now Added an option to filter out readable paths in the pointerscan rescan Added "codePage" support Added font/display options to several places in CE Added a search/replace to the script editors You can now delete addresses and reset the count from "Find what addresses this code accesses" Added a statusbar to the hexview in memoryview Pointerscan for value scans now add the results to the overflow queue Opening a file and changing bytes do not change them to the file anymore (you need to explicitly save now) Added an option to the processlist to filter out system processes Added a system to let users sign their tables so you know you can trust their tables. Memory record dropdown lists can now reference those of others. USe as entry text: (memoryrecorddescription) Added an option to notify users of new versions of Cheat Engine lua: Custom Types can now be referenced from Lua Auto assembler lua sections now have access to "memrec" which is the memory record they get executed from. Can be nil stringToMD5String now support strings with a 0 byte in them autoAssemble() now also returns a disableInfo object as 2nd parameter. You can use this to disable a script added Action and Value properties to MemoryRecordHotkey objects added screenToClient and clientToScreen for Control objects added readSmallInteger and writeSmallInteger added enableDRM() added openFileAsProcess/saveOpenedFile added saveCurrentStateAsDesign for CEForm objects added disableWithoutExecute and disableAllWithoutExecute added OnCustomDraw* events to the listview added being/endUpdate for the Strings class added SQL support added color overrides to the disassembler text added OnPaint to the CustomControl class added autoAssembleCheck to syntax check an AA script fixed the addresslist returning nil for PopupMenu (while popupMenu did work) added an timeout option for pipes added some graphical options added some low level system functions Russian translation has been updated Chinese translation has been updated May 15 2017:Korean language files Thanks to Petrus Kim there are now Korean language files for Cheat Engine. You can get them here Just extract it to the language folder in the Cheat Engine installation folder and you'll be able to use it April 13 2017:Cheat Engine for Macintosh download For the Mac users under us there is now a mac version available for download. It's based on Cheat engine 6.2 but I will be upgrading it to 6.6 and later based on the feedback I get. Tip:if you have trouble opening processes: Reboot your Mac and hold CMD+R during boot to enter the recovery console. There open the terminal (using the top menu) and enter "csrutil disable" . Then reboot and you'll be able to open most processes (Youtube video by NewAgeSoldier in case it's not clear) October 6 2016:Cheat Engine 6.6 Released: Cheat Engine 6.6 has been released. It has several fixes, new scan functionality, gui changes/improvements, Ultimap 2, better hotkeys, more programming options, and more(See below). Download: Cheat Engine 6.6 If you encounter bugs or have suggestions, please do not hesitate to report them in the forum, bugtracker, irc or by e-mail. And if you have questions, don't hesitate to ask them in the forum or irc Fixes: Fixed saving of hotkey sounds Fixed the CF flag in the disassembler stepping mode Fixed Kernelmode VirtualQueryEx for Windows 10 build 14393 Fixed DBVM for Windows 10 build 14393 Fixed the shortest assembler instruction picking for some instructions Fixed a few bugs in the break and trace routine when you'd stop it while the thread still had a single step set Fixed several ansi to UTF8 incompatbilities that poped up between 6.5 and 6.5.1 Fixed the stackview not properly setting the color, and giving an error when trying to change a color Fixed the exe generator not adding both .sys files or the .sig files when using kernel functions Fixed some places of the disassembler where it helps guessing if something is a float or not When using the code finder, it won't show the previous instruction anymore if it's on a REP MOVS* instruction Fixed an issue when editing memoryrecords with strings, where wordwrap would add newline characters Fixed D3D alpha channel for textures and fontmaps Fixed the helpfile not being searchable The installer will now mark the CE destination folder as accessible by APPS. (fixes speedhack for some APPS) Fixed the form designed crashing is resized 'wrong' Additions and changes: Ultimap 2 for Intel CPU's of generation 6 and later (no DBVM needed for those) Language select if you have multiple language files for CE Memoryrecord pointer offsets can use calculations, symbols and lua code now While stepping in the debugger you can now easily change the EIP/RIP register by pressing ctrl+f4 changed the way CE is brought to front when a hotkey is pressed Made the GUI more adaptive to different fontsizes and DPI Several font and minor GUI changes Added DPIAware and a font override to the settings window. (DPI aware is on by default, but can be turned of if experiencing issues) Added option to enable pause by default Disassembling mega jumps/calls now show the code in one line The standalone auto assembler window will now give an option to go to the first allocated memory address Changed the point where the settings are loaded in CE's startup sequence The formdesigner now allows copy and paste of multiple objects, and uses text Added scrollbox and radiogroup to the formdesigner Added Middle, MB4 and MB5 as allowable hotkeys Added controller keys as hotkeys Single stepping now shows an indication if an condition jump will be taken Added a watchlist to the debugger Added the 'align' assembler pseudo command (allocates memory so the next line is aligned on a block of the required size) Added the 'Not' option for scans, which causes all addresses that match the given entry as invalid Changed the Unicode text to UTF-16. Text scans are now UTF8/UTF16 (no codepage) Hexview can now show and edit values in 3 different textencodings. (Ascii, UTF-8 and UTF-16) Rescan pointerscans on pointerscans that where done on a range can now change the offset lua: speak(): Text to speech hookWndProc: a function that lets you hook the windows message handler of a window registerEXETrainerFeature: Lets you add extra files to the exe trainer file packer getFileVersion(): A function to get version information from a file mouse_event() : Lets you send mouse events to windows. (move, click, etc...) loadFontFromStream() : Lets you load a font from a memory stream. (Useful for trainers that use a custom font) added several thread synchronization objects control class: added bringToFront and sendToBack lua changes: dbk_writesIgnoreWriteProtection() now also disables virtualprotectex calls from CE loadTable() can now also load from a Stream object. the addresslist has some Color properties published for better customization the LUA server has had some new commands added so hooked code can do more efficient calls. (LUAClient dll has been updated to use them in a basic way) Russian translation has been updated French tutorial only translation has been updated as well 10/10/2016:6.6.0.1: Fixed align May 19 2016:Cheat Engine 6.5.1 Released: 6.5.1 has been released. It's mainly a bugfix version to replace 6.5 which had a few minor bugs that needed solving. Download: Cheat Engine 6.5.1 Fixes: Fixed increased value by/decreased value by for float values Fixed disassembling/assembling some instructions (64-bit) Fixed the autoassembler tokenizing wrong words Fixed several bugs related to the structure dissect window (mainly shown when autodestroy was on) Fixed a small saving issue Groupscans now deal with alignment issues better Fixed java support for 32-bit Additions and changes: Signed with a sha256 signature as well (for OS'es that support it) Changed Ultimap to use an official way to get the perfmon interrupt instead of IDT hooking (less BSOD on win10 and 8) Individual hotkeys can now play sounds Now compiled with fpc 3.0/lazarus 1.6 (Previously 2.7/1.1) You can now search in the string list PEInfo now has a copy to clipboard Some places can now deal better with mistakes Lazarus .LFM files can now be loaded and saved lua: Fixed several incompatibilities between lua that popped up in 6.5 (due to the lua 5.1 to 5.3 change) Fixed the OnSelectionChange callback property in the memoryview object MemoryRecords now have an Collapsed property Added TCanResizeEvent to the splitter Fixed setBreakpoint not setting a proper trigger if not provided Fixed executeCode* parameter passing Fixed several memory leaks where unregistering hooks/addons didn't free the internal call object Some tableFile additions Fixed registerAssemble assembler commands Added kernelmode alloc and (un)mapping functionality Added an easy way to add auto assembler templates Added window related functions including sendMessage Added Xbox360 controller support functions Added more thread functions Post release fixes: Dealt with several gui issues like the mainform to front on modal dialogs, header resizing stuck with the cursor, treeview item selection/deletion being weird, etc... Added a disconnect to the client in pointerscans Fixed pointerscan issue with 32-bit aligned pointers in a 64-bit process Fixed a deadlock in threads when lua custom types where used Post release fixes: Dealt with several gui issues like the mainform to front on modal dialogs, header resizing stuck with the cursor, treeview item selection/deletion being weird, etc... Added a disconnect to the client in pointerscans fixed pointerscan issue with 32-bit aligned pointers in a 64-bit process Fixed a deadlock in threads when lua custom types where used Fixed pointerscan resume 6/1/2016: (major bugfix) properly fixed resume of pointerscans and alignment fix December 31 2015:Cheat Engine 6.5 Released: I'd like to announce the release of Cheat Engine 6.5 If you encounter bugs or have suggestions, please do not hesitate to report them in the forum, bugtracker, irc or by e-mail. And if you have questions, don't hesitate to ask them in the forum or irc Fixes: Fixed page exception breakpoints from not working Fixed the save as button in the lua script assigned to the table Fixed the dotnetdatacollector from not fetching parent fields Fixed disassembling of some instructions Fixed assembling some instructions Fixed assembling instructions that referenced address 80000000 to ffffffff in 64-bit targets Fixed dealing with unexpected breakpoints Fixed several issues with the network scanner. (symbols, scanspeed, threads, etc...) Fixed "going to" 64-bit registers. Fixed pointerstrings for 64-bit Fixed the addressparser in memview's hexview not handing static 64-bit addresses Fixed r8 and r9 looking broken in the memoryview window Fixed hotkeys that set a value as hexadecimal and the value is smaller than 0x10 Fixed multiline string editing for memory records Fixed dragging cheat tables into CE Fixed VEH debug for 'Modern' apps Fixed several translation issues lua: fixed getStructureCount, writeRegionToFile, readRegionFromFile, readInteger, ListColum.GetCount fixed memoryleak in MemoryStream Several fixes to DBVM: added support for Windows 10 support for more than 8 cpu's support for newer cpu's fixed issue where calling CPUID right after setting the TF flag wouldn't trigger a breakpoint after it Additions and changes: Array of Byte's can now deal with nibble's. (e.g: 9* *0 90 is now a valid input- and scanstring) The auto assembler can now deal with some mistakes like forgetting to declare a label Added support to use binutils as assembler and disassembler, and a special scripting language for it Added support for 64-bit mono, and script support for cases where mono.dll isn't called mono.dll Added an option to get a list of all recently accessed memory regions. This is useful for the pointerscanner The pointerscanner can now use multiple snapshots (pointermaps) to do a scan. This basically lets you do a rescan during the first scan, saving your harddisk Made the pointerscan network scanner a bit easier to use. You can now join and leave a pointerscan session You can now stop pointerscans and resume them at a later time Pointerscan files can get converted to and from sqlite database files The pointerscan configuration window now has an advanced and basic mode display The all type now has a setting that lets you define what under "all" falls Custom types now also have access to the address they're being used on Split up the "(de)activating this (de)activates children" into two seperate options (one for activate, one for deactivate) Added some basic Thumb disassembling The xmplayer has been replaced with mikmod which supports many different module types (in lua you still call it xmplayer) Rightlicking on "your system supports dbvm" will let you manually load DBVM for each cpu. This is usefull if for some reason your system crashes when it's done too quickly In "Find what addresses this instruction accesses" you can now open the structure dissect window of your choice in case there are others. It will also fill in the base address, so no need to recalculate yourself AA command GlobalAlloc now has an optional 3th parameter that lets you specify the prefered region Added an option to record and undo writes. (Off by default, can be enabled in settings. Memview ctrl+z will undo the last edit) Added aobscanregion(name,startaddress,stopaddress,aob) lua: switched from Lua 5.1 to 5.3 debug_setBreakpoint can now take an OnBreakpoint parameter that lets you set a specific function just for that breakpoint added dbk_getPhysicalAddress(int) added dbk_writesIgnoreWriteProtection(bool) added getWindowList() And a bunch of other lua functions. (check out main.lua) Post release fixes (max 7 days after initial release *or 30 if a HUGE bug): 1/6/2016:Fixed structure dissect from crashing when autodestroy is on 1/6/2016:Fixed window position loading on multi monitor systems 1/6/2016:Fixed the lua customtype and 1/6/2016:Several minor gui fixe

17,086

社区成员

发帖
与我相关
我的任务
社区描述
Oracle开发相关技术讨论
社区管理员
  • 开发
  • Lucifer三思而后行
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧