Skip to content

Commit

Permalink
Update code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
sawzeeyy committed Dec 25, 2023
1 parent 09d4316 commit 3ef69d2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Frida 0xA/Solution/Solution.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,14 130,14 @@ var adr = Module.findBaseAddress("libfrida0xa.so").add(0x18BB0)
Next let's create the NativePointer object.

```javascript
var adr = Module.findBaseAddress("libfrida0xa.so").add(0x18BB0) //Address of the get_flag() function
var adr = Module.findBaseAddress("libfrida0xa.so").add(0x18BB0) // Address of the get_flag() function
var get_flag_ptr = new NativePointer(adr);
```

Now let's create the `NativeFunction` object. The first argument is `get_flag_ptr`. The second argument is the data type; here, `get_flag` is a void function, so we will pass `void`. Lastly, the `get_flag` function has two arguments, both of which are integers, so we will pass `['int', 'int']` as the third argument.

```javascript
var adr = Module.findBaseAddress("libfrida0xa.so").add(0x18BB0) //Address of the get_flag() function
var adr = Module.findBaseAddress("libfrida0xa.so").add(0x18BB0) // Address of the get_flag() function
var get_flag_ptr = new NativePointer(adr);
const get_flag = new NativeFunction(get_flag_ptr, 'void', ['int', 'int']);
```
Expand All @@ -161,7 161,7 @@ if (param_1 param_2 == 3) {
We need the sum of our arguments to equal `3` to pass the `if` check. So, we can pass `1` and `2` as the arguments and call the method. So the final script will look like.

```javascript
var adr = Module.findBaseAddress("libfrida0xa.so").add(0x18BB0) //Address of the get_flag() function
var adr = Module.findBaseAddress("libfrida0xa.so").add(0x18BB0) // Address of the get_flag() function
var get_flag_ptr = new NativePointer(adr);
const get_flag = new NativeFunction(get_flag_ptr, 'void', ['int', 'int']);
get_flag(1,2);
Expand Down

0 comments on commit 3ef69d2

Please sign in to comment.