Skip to content

Commit

Permalink
fix spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
Ali Razmjoo committed Jul 17, 2016
1 parent bc1e3d3 commit 7ade80f
Showing 1 changed file with 71 additions and 69 deletions.
140 changes: 71 additions & 69 deletions lib/opcoder/windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,75 +13,77 @@
from core.compatible import version
_version = version()
replace_values_static = {
'xor %ebx,%ebx':'31 db',
'xor %ecx,%ecx':'31 c9',
'xor %eax,%ebx':'31 c3',
'xor %ecx,%ebx':'31 cb',
'xor %ebx,%eax':'31 d8',
'xor %eax,%eax':'31 c0',
'xor %ebx,%edx':'31 da',
'xor %edx,%edx':'31 d2',
'xor %ebx,%ecx':'31 d9',
'xor %esi,%esi':'31 f6',
'xor %edi,%edi':'31 ff',
'mov %esp,%ebx':'89 e3',
'mov $0x1,%al':'b0 01',
'mov $0x01,%al':'b0 01',
'mov $0x1,%bl':'b3 01',
'mov $0x01,%bl':'b3 01',
'mov $0xb,%al':'b0 0b',
'mov %eax,%ebx':'89 c3',
'mov %esp,%ecx':'89 e1',
'mov %esp,%esi':'89 e6',
'mov %esp,%edi':'89 e7',
'mov %esp,%edx':'89 e2',
'mov %edx,%esi':'89 d6',
'mov %eax,%edi':'89 c7',
'mov %esi,%edx':'89 f2',
'shr $0x10,%ebx':'c1 eb 10',
'shr $0x08,%ebx':'c1 eb 08',
'shr $0x8,%ebx':'c1 eb 08',
'shr $0x10,%eax':'c1 e8 10',
'shr $0x08,%eax':'c1 e8 08',
'shr $0x8,%eax':'c1 e8 08',
'shr $0x10,%ecx':'c1 e9 10',
'shr $0x8,%ecx':'c1 e9 08',
'shr $0x08,%ecx':'c1 e9 08',
'shr $0x10,%edx':'c1 ea 10',
'shr $0x8,%edx':'c1 ea 08',
'shr $0x08,%edx':'c1 ea 08',
'inc %ecx':'41',
'add %ecx,%ebx':'01 cb',
'add %eax,%ebx':'01 c3',
'add %eax,%ecx':'01 c1',
'add %ebx,%edx':'01 da',
'add %ebx,%eax':'01 d8',
'add %ebx,%ecx':'01 d9',
'push %eax':'50',
'push %ebx':'53',
'push %ecx':'51',
'push %edx':'52',
'push %esi':'56',
'push %edi':'57',
'pop %eax':'58',
'pop %ebx':'5b',
'pop %ecx':'59',
'pop %edx':'5a',
'dec %ecx':'49',
'neg %ecx':'f7 d9',
'neg %eax':'f7 d8',
'subl $0x61,0x3(%esp)':'83 6c 24 03 61',
'lods %ds:(%esi),%eax':'ad',
'add %ebx,%esi':'01 de',
'push %esp':'54',
'call *%edx':'ff d2',
'call *%eax':'ff d0',
'call *%esi':'ff d6',
'xchg %eax,%esi':'96',
'mov %fs:0x30(%ecx),%eax':'64 8b 41 30',
'mov (%esi,%ecx,2),%cx':'66 8b 0c 4e',
'mov (%esi,%ecx,4),%edx':'8b 14 8e',
}
'xor %ebx,%ebx':'31 db',
'xor %ecx,%ecx':'31 c9',
'xor %eax,%ebx':'31 c3',
'xor %ecx,%ebx':'31 cb',
'xor %ebx,%eax':'31 d8',
'xor %eax,%eax':'31 c0',
'xor %ebx,%edx':'31 da',
'xor %edx,%edx':'31 d2',
'xor %ebx,%ecx':'31 d9',
'xor %esi,%esi':'31 f6',
'xor %edi,%edi':'31 ff',
'mov %esp,%ebx':'89 e3',
'mov $0x1,%al':'b0 01',
'mov $0x01,%al':'b0 01',
'mov $0x1,%bl':'b3 01',
'mov $0x01,%bl':'b3 01',
'mov $0xb,%al':'b0 0b',
'mov %eax,%ebx':'89 c3',
'mov %esp,%ecx':'89 e1',
'mov %esp,%esi':'89 e6',
'mov %esp,%edi':'89 e7',
'mov %esp,%edx':'89 e2',
'mov %edx,%esi':'89 d6',
'mov %eax,%edi':'89 c7',
'mov %esi,%edx':'89 f2',
'shr $0x10,%ebx':'c1 eb 10',
'shr $0x08,%ebx':'c1 eb 08',
'shr $0x8,%ebx':'c1 eb 08',
'shr $0x10,%eax':'c1 e8 10',
'shr $0x08,%eax':'c1 e8 08',
'shr $0x8,%eax':'c1 e8 08',
'shr $0x10,%ecx':'c1 e9 10',
'shr $0x8,%ecx':'c1 e9 08',
'shr $0x08,%ecx':'c1 e9 08',
'shr $0x10,%edx':'c1 ea 10',
'shr $0x8,%edx':'c1 ea 08',
'shr $0x08,%edx':'c1 ea 08',
'inc %ecx':'41',
'add %ecx,%ebx':'01 cb',
'add %eax,%ebx':'01 c3',
'add %eax,%ecx':'01 c1',
'add %ebx,%edx':'01 da',
'add %ebx,%eax':'01 d8',
'add %ebx,%ecx':'01 d9',
'push %eax':'50',
'push %ebx':'53',
'push %ecx':'51',
'push %edx':'52',
'push %esi':'56',
'push %edi':'57',
'pop %eax':'58',
'pop %ebx':'5b',
'pop %ecx':'59',
'pop %edx':'5a',
'dec %ecx':'49',
'neg %ecx':'f7 d9',
'neg %eax':'f7 d8',
'subl $0x61,0x3(%esp)':'83 6c 24 03 61',
'lods %ds:(%esi),%eax':'ad',
'add %ebx,%esi':'01 de',
'push %esp':'54',
'call *%edx':'ff d2',
'call *%eax':'ff d0',
'call *%esi':'ff d6',
'xchg %eax,%esi':'96',
'mov %fs:0x30(%ecx),%eax':'64 8b 41 30',
'mov (%esi,%ecx,2),%cx':'66 8b 0c 4e',
'mov (%esi,%ecx,4),%edx':'8b 14 8e',
}


def convert(shellcode):
shellcode = shellcode.replace('\n\n','\n').replace('\n\n','\n').replace(' ',' ').replace(' ',' ')
for data in replace_values_static:
Expand Down

4 comments on commit 7ade80f

@jack17529
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey Ali can you please tell me what to read to understand this code?
I am trying to solve the tab completion error.

@Ali-Razmjoo
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jack17529 hey jack, do you need a description for code ? which lines ?

@jack17529
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ali I have no idea about shellcoding only I know python , c and shell scripting please guide .

@Ali-Razmjoo
Copy link
Collaborator

@Ali-Razmjoo Ali-Razmjoo commented on 7ade80f Dec 24, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is some guide, please check the developer's section. and readline problem could be here! (i think). regards.

Please sign in to comment.