fritzone / obfy

A tiny C++ obfuscation framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cases: not work

opened this issue · comments

Before

After

and it does not work

Error

'add_default': identifier not found

BREAK statement should come before DONE

It's not WHEN(DEFAULT) or OBF_DEFAULT just plain DEFAULT :

CASE (<variable>)
    WHEN(<value>) [OR WHEN(<other_value>)] DO
    ....statements
    ....[BREAK]
    DONE
    [DEFAULT
    ....statements
    DONE]
ENDCASE

@fritzone DEFAULT equal 0 (typedef enum)

@fritzone I think cases not work correctly.

Check https://github.com/lurumdare/VM_Crackme/blob/master/VM_CrackMe/vm.cpp#L356 this project.
retv error again.

Code

DWORD OldVirtualMachine::GetRegValue(int regs)
{
	OBF_BEGIN
	CASE ((regs))
	WHEN (eax) DO
		RETURN (reg.eax);
		DONE
	WHEN (ecx) DO
		RETURN (reg.ecx);
		DONE
	WHEN (edx) DO
		RETURN (reg.edx);
		DONE
	WHEN (ebx) DO
		RETURN (reg.ebx);
		DONE
	WHEN (ebp) DO
		RETURN (reg.ebp);
		DONE
	WHEN (esp) DO
		RETURN (reg.esp);
		DONE
	WHEN (eip) DO
		RETURN (reg.eip);
		DONE
	DEFAULT
		//бесполезно - надо генерить исключение
		RETURN(false);
	DONE
	ENDCASE
	OBF_END
}