From c7515f15d7d7100ee0954dd381eac5bda702d445 Mon Sep 17 00:00:00 2001 From: kris <> Date: Mon, 13 Jul 2009 22:26:27 +0000 Subject: [PATCH] a few simple changes (e.g., pack('V') -> pack_dword() where applicable) git-svn-id: file:///home/svn/framework3/trunk@6785 4d416f70-5f16-0410-b530-b9f4589650da --- lib/rex/arch/x86.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/rex/arch/x86.rb b/lib/rex/arch/x86.rb index 94535cf4d3..af11aa4861 100644 --- a/lib/rex/arch/x86.rb +++ b/lib/rex/arch/x86.rb @@ -41,7 +41,7 @@ module X86 # This method adds/subs a packed long integer # def self.dword_adjust(dword, amount=0) - [dword.unpack('V')[0] + amount].pack('V') + pack_dword(dword.unpack('V')[0] + amount) end # @@ -70,7 +70,7 @@ module X86 stub = "\xeb\x0f"+ # jmp _end - "\x68" + [len].pack('V')+ # push n + push_dword(len)+ # push n "\x59"+ # pop ecx "\x5e"+ # pop esi "\x29\xcc"+ # sub esp, ecx @@ -211,7 +211,7 @@ module X86 if val < 0 || val > 0xffff raise RangeError, "Can only take unsigned word values!", caller() end - return "\x66" + (0xb8 | reg).chr + [ val ].pack('v') + return "\x66" + (0xb8 | reg).chr + pack_word(val) end # @@ -220,7 +220,7 @@ module X86 # def self.mov_dword(reg, val) _check_reg(reg) - return (0xb8 | reg).chr + [ val ].pack('V') + return (0xb8 | reg).chr + pack_dword(val) end #