ANSSI-FR/polichombr

View on GitHub

Showing 1,243 of 1,244 total issues

Use snake_case for variable names.
Open

  cfunctionDecoder = @functionsDecoders[strFunc]

This cop makes sure that all variables use the configured style, snake_case or camelCase, for their names.

Example: EnforcedStyle: snake_case (default)

# bad
fooBar = 1

# good
foo_bar = 1

Example: EnforcedStyle: camelCase

# bad
foo_bar = 1

# good
fooBar = 1

Use snake_case for variable names.
Open

      strArg = '' if strArg.nil?

This cop makes sure that all variables use the configured style, snake_case or camelCase, for their names.

Example: EnforcedStyle: snake_case (default)

# bad
fooBar = 1

# good
foo_bar = 1

Example: EnforcedStyle: camelCase

# bad
foo_bar = 1

# good
fooBar = 1

Use snake_case for variable names.
Open

  argStr = argStr.gsub(/[\x00]/n, '') unless argStr.nil?

This cop makes sure that all variables use the configured style, snake_case or camelCase, for their names.

Example: EnforcedStyle: snake_case (default)

# bad
fooBar = 1

# good
foo_bar = 1

Example: EnforcedStyle: camelCase

# bad
foo_bar = 1

# good
fooBar = 1

Use snake_case for variable names.
Open

dasm.sections.each do |secAddr, secDatas|

This cop makes sure that all variables use the configured style, snake_case or camelCase, for their names.

Example: EnforcedStyle: snake_case (default)

# bad
fooBar = 1

# good
foo_bar = 1

Example: EnforcedStyle: camelCase

# bad
foo_bar = 1

# good
fooBar = 1

Use snake_case for variable names.
Open

@tbFuncName.each do |cFuncAddr, cName|

This cop makes sure that all variables use the configured style, snake_case or camelCase, for their names.

Example: EnforcedStyle: snake_case (default)

# bad
fooBar = 1

# good
foo_bar = 1

Example: EnforcedStyle: camelCase

# bad
foo_bar = 1

# good
fooBar = 1

Use each_value instead of each.
Open

dasm.decoded.each do |_addr, di|

This cop checks for uses of each_key and each_value Hash methods.

Note: If you have an array of two-element arrays, you can put parentheses around the block arguments to indicate that you're not working with a hash, and suppress RuboCop offenses.

Example:

# bad
hash.keys.each { |k| p k }
hash.values.each { |v| p v }
hash.each { |k, _v| p k }
hash.each { |_k, v| p v }

# good
hash.each_key { |k| p k }
hash.each_value { |v| p v }

Do not introduce global variables.
Open

      tdi = $gdasm.di_at(tdi_addr)

This cops looks for uses of global variables. It does not report offenses for built-in global variables. Built-in global variables are allowed by default. Additionally users can allow additional variables via the AllowedVariables option.

Note that backreferences like $1, $2, etc are not global variables.

Example:

# bad
$foo = 2
bar = $foo + 5

# good
FOO = 2
foo = 2
$stdin.read

Do not introduce global variables.
Open

        strArg = format('{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}', $gdasm.decode_dword(carg), ($gdasm.decode_dword(carg + 4) & 0xffff), ($gdasm.decode_dword(carg + 6) & 0xffff), $gdasm.decode_byte(carg + 8), $gdasm.decode_byte(carg + 9), $gdasm.decode_byte(carg + 10), $gdasm.decode_byte(carg + 11), $gdasm.decode_byte(carg + 12), $gdasm.decode_byte(carg + 13), $gdasm.decode_byte(carg + 14), $gdasm.decode_byte(carg + 15), $gdasm.decode_byte(carg + 16))

This cops looks for uses of global variables. It does not report offenses for built-in global variables. Built-in global variables are allowed by default. Additionally users can allow additional variables via the AllowedVariables option.

Note that backreferences like $1, $2, etc are not global variables.

Example:

# bad
$foo = 2
bar = $foo + 5

# good
FOO = 2
foo = 2
$stdin.read

Do not introduce global variables.
Open

        strArg = format('{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}', $gdasm.decode_dword(carg), ($gdasm.decode_dword(carg + 4) & 0xffff), ($gdasm.decode_dword(carg + 6) & 0xffff), $gdasm.decode_byte(carg + 8), $gdasm.decode_byte(carg + 9), $gdasm.decode_byte(carg + 10), $gdasm.decode_byte(carg + 11), $gdasm.decode_byte(carg + 12), $gdasm.decode_byte(carg + 13), $gdasm.decode_byte(carg + 14), $gdasm.decode_byte(carg + 15), $gdasm.decode_byte(carg + 16))

This cops looks for uses of global variables. It does not report offenses for built-in global variables. Built-in global variables are allowed by default. Additionally users can allow additional variables via the AllowedVariables option.

Note that backreferences like $1, $2, etc are not global variables.

Example:

# bad
$foo = 2
bar = $foo + 5

# good
FOO = 2
foo = 2
$stdin.read

Use snake_case for variable names.
Open

dasm.sections.each do |secAddr, secDatas|

This cop makes sure that all variables use the configured style, snake_case or camelCase, for their names.

Example: EnforcedStyle: snake_case (default)

# bad
fooBar = 1

# good
foo_bar = 1

Example: EnforcedStyle: camelCase

# bad
foo_bar = 1

# good
fooBar = 1

Use snake_case for variable names.
Open

@instrAntiVM = []

This cop makes sure that all variables use the configured style, snake_case or camelCase, for their names.

Example: EnforcedStyle: snake_case (default)

# bad
fooBar = 1

# good
foo_bar = 1

Example: EnforcedStyle: camelCase

# bad
foo_bar = 1

# good
fooBar = 1

Use snake_case for variable names.
Open

@strAntiDBG = []

This cop makes sure that all variables use the configured style, snake_case or camelCase, for their names.

Example: EnforcedStyle: snake_case (default)

# bad
fooBar = 1

# good
foo_bar = 1

Example: EnforcedStyle: camelCase

# bad
foo_bar = 1

# good
fooBar = 1

Use snake_case for variable names.
Open

      numToInj = $gdasm.normalize(tdi.instruction.args.last)

This cop makes sure that all variables use the configured style, snake_case or camelCase, for their names.

Example: EnforcedStyle: snake_case (default)

# bad
fooBar = 1

# good
foo_bar = 1

Example: EnforcedStyle: camelCase

# bad
foo_bar = 1

# good
fooBar = 1

Use each_value instead of each.
Open

  $gdasm.decoded.each do |_addr, di|

This cop checks for uses of each_key and each_value Hash methods.

Note: If you have an array of two-element arrays, you can put parentheses around the block arguments to indicate that you're not working with a hash, and suppress RuboCop offenses.

Example:

# bad
hash.keys.each { |k| p k }
hash.values.each { |v| p v }
hash.each { |k, _v| p k }
hash.each { |_k, v| p v }

# good
hash.each_key { |k| p k }
hash.each_value { |v| p v }

Use each_key instead of each.
Open

dasm.function.each do |addr, _symb|

This cop checks for uses of each_key and each_value Hash methods.

Note: If you have an array of two-element arrays, you can put parentheses around the block arguments to indicate that you're not working with a hash, and suppress RuboCop offenses.

Example:

# bad
hash.keys.each { |k| p k }
hash.values.each { |v| p v }
hash.each { |k, _v| p k }
hash.each { |_k, v| p v }

# good
hash.each_key { |k| p k }
hash.each_value { |v| p v }

Do not introduce global variables.
Open

      strArg = if $gdasm.decode_strz(carg)

This cops looks for uses of global variables. It does not report offenses for built-in global variables. Built-in global variables are allowed by default. Additionally users can allow additional variables via the AllowedVariables option.

Note that backreferences like $1, $2, etc are not global variables.

Example:

# bad
$foo = 2
bar = $foo + 5

# good
FOO = 2
foo = 2
$stdin.read

Do not introduce global variables.
Open

        strArg = format('{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}', $gdasm.decode_dword(carg), ($gdasm.decode_dword(carg + 4) & 0xffff), ($gdasm.decode_dword(carg + 6) & 0xffff), $gdasm.decode_byte(carg + 8), $gdasm.decode_byte(carg + 9), $gdasm.decode_byte(carg + 10), $gdasm.decode_byte(carg + 11), $gdasm.decode_byte(carg + 12), $gdasm.decode_byte(carg + 13), $gdasm.decode_byte(carg + 14), $gdasm.decode_byte(carg + 15), $gdasm.decode_byte(carg + 16))

This cops looks for uses of global variables. It does not report offenses for built-in global variables. Built-in global variables are allowed by default. Additionally users can allow additional variables via the AllowedVariables option.

Note that backreferences like $1, $2, etc are not global variables.

Example:

# bad
$foo = 2
bar = $foo + 5

# good
FOO = 2
foo = 2
$stdin.read

Do not introduce global variables.
Open

          puts "    [+] Pattern found at 0x#{(secAddr + i + pattAddr).to_s(16)} fast disassembling in process..." if defined?($VERBOSEOPT)

This cops looks for uses of global variables. It does not report offenses for built-in global variables. Built-in global variables are allowed by default. Additionally users can allow additional variables via the AllowedVariables option.

Note that backreferences like $1, $2, etc are not global variables.

Example:

# bad
$foo = 2
bar = $foo + 5

# good
FOO = 2
foo = 2
$stdin.read

Do not introduce global variables.
Open

  funcname = $gdasm.get_label_at(addr).gsub('iat_', '') if defined?($gdasm.get_label_at(addr)) && $gdasm.get_label_at(addr) =~ /^iat_/

This cops looks for uses of global variables. It does not report offenses for built-in global variables. Built-in global variables are allowed by default. Additionally users can allow additional variables via the AllowedVariables option.

Note that backreferences like $1, $2, etc are not global variables.

Example:

# bad
$foo = 2
bar = $foo + 5

# good
FOO = 2
foo = 2
$stdin.read

Use a guard clause instead of wrapping the code inside a conditional expression.
Open

    if di.opcode.name == 'mov'

Use a guard clause instead of wrapping the code inside a conditional expression

Example:

# bad
def test
  if something
    work
  end
end

# good
def test
  return unless something
  work
end

# also good
def test
  work if something
end

# bad
if something
  raise 'exception'
else
  ok
end

# good
raise 'exception' if something
ok
Severity
Category
Status
Source
Language