Skip to content

Commit

Permalink
python source code fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
pr0v3rbs committed Aug 9, 2015
1 parent 5b2d293 commit c0875da
Showing 1 changed file with 21 additions and 19 deletions.
40 changes: 21 additions & 19 deletions OpenCTF/2. moonwalk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Compare it(moonwalk) with normal zip archive, I came to know that 'moonwalk' was

Repair zip archive with my python code. And I got 'metsys.elif' file.

```
```python
# ReverseByte.py

import sys
Expand All @@ -42,23 +42,25 @@ And I was used 'Accessdata FTK imager' forensic tool to analyze 'metsys.elif' fi

Finally I found 'txt.galf' file, and I reversed it by 4bit base. I got flag.

> # Reverse4bit.py
>
> import sys
>
> if len(sys.argv) != 2 :
> print 'Usage : python Reverse4bit.py <input file>'
> exit()
>
> f = open(sys.argv[1], "rb")
> data = f.read()
> f.close()
>
> result = ''
> for i in data :
> num = ord(i)
> result = chr(((num & 0xf0) >> 4) + ((num & 0x0f) << 4)) + result
>
> print result
```python
# Reverse4bit.py

import sys

if len(sys.argv) != 2 :
print 'Usage : python Reverse4bit.py <input file>'
exit()

f = open(sys.argv[1], "rb")
data = f.read()
f.close()

result = ''
for i in data :
num = ord(i)
result = chr(((num & 0xf0) >> 4) + ((num & 0x0f) << 4)) + result

print result
```

The flag is `_ju57_7urn_Ar0unD_and_w41k_aw4y_`

0 comments on commit c0875da

Please sign in to comment.