cea-sec/miasm

View on GitHub
miasm/os_dep/win_api_x86_32.py

Summary

Maintainability
F
1 mo
Test Coverage

File win_api_x86_32.py has 2634 lines of code (exceeds 250 allowed). Consider refactoring.
Open

from __future__ import print_function
#
# Copyright (C) 2011 EADS France, Fabrice Desclaux <fabrice.desclaux@eads.net>
#
# This program is free software; you can redistribute it and/or modify
Severity: Major
Found in miasm/os_dep/win_api_x86_32.py - About 1 wk to fix

    Function kernel32_CreateFile has a Cognitive Complexity of 78 (exceeds 5 allowed). Consider refactoring.
    Open

    def kernel32_CreateFile(jitter, funcname, get_str):
        ret_ad, args = jitter.func_args_stdcall(["lpfilename", "access",
                                                 "dwsharedmode",
                                                 "lpsecurityattr",
                                                 "dwcreationdisposition",
    Severity: Minor
    Found in miasm/os_dep/win_api_x86_32.py - About 1 day to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function kernel32_GetStringTypeW has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
    Open

    def kernel32_GetStringTypeW(jitter):
        """
            BOOL GetStringTypeW(
              DWORD                         dwInfoType,
              _In_NLS_string_(cchSrc)LPCWCH lpSrcStr,
    Severity: Minor
    Found in miasm/os_dep/win_api_x86_32.py - About 5 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function kernel32_VirtualProtect has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

    def kernel32_VirtualProtect(jitter):
        ret_ad, args = jitter.func_args_stdcall(['lpvoid', 'dwsize',
                                                 'flnewprotect',
                                                 'lpfloldprotect'])
        # XXX mask hpart
    Severity: Minor
    Found in miasm/os_dep/win_api_x86_32.py - About 2 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function __init__ has 49 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def __init__(self):
            self.alloc_ad = 0x20000000
            self.alloc_align = 0x1000
            self.heap = heap()
            self.handle_toolhelpsnapshot = 0xaaaa00
    Severity: Minor
    Found in miasm/os_dep/win_api_x86_32.py - About 1 hr to fix

      Function kernel32_WaitForSingleObject has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

      def kernel32_WaitForSingleObject(jitter):
          ret_ad, args = jitter.func_args_stdcall(['handle', 'dwms'])
      
          t_start = time.time() * 1000
          found = False
      Severity: Minor
      Found in miasm/os_dep/win_api_x86_32.py - About 1 hr to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function ntdll_RtlFindCharInUnicodeString has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

      def ntdll_RtlFindCharInUnicodeString(jitter):
          ret_ad, args = jitter.func_args_stdcall(["flags", "main_str_ad",
                                                   "search_chars_ad", "pos_ad"])
      
          if args.flags != 0:
      Severity: Minor
      Found in miasm/os_dep/win_api_x86_32.py - About 1 hr to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function kernel32_MultiByteToWideChar has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

      def kernel32_MultiByteToWideChar(jitter):
          MB_ERR_INVALID_CHARS = 0x8
          CP_ACP  = 0x000
          CP_1252 = 0x4e4
      
      
      Severity: Minor
      Found in miasm/os_dep/win_api_x86_32.py - About 1 hr to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function kernel32_CreateMutex has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

      def kernel32_CreateMutex(jitter, funcname, get_str):
          ret_ad, args = jitter.func_args_stdcall(["mutexattr", "initowner",
                                                   "lpname"])
      
          if args.lpname:
      Severity: Minor
      Found in miasm/os_dep/win_api_x86_32.py - About 1 hr to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function kernel32_ReadFile has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

      def kernel32_ReadFile(jitter):
          ret_ad, args = jitter.func_args_stdcall(["hwnd", "lpbuffer",
                                                   "nnumberofbytestoread",
                                                   "lpnumberofbytesread",
                                                   "lpoverlapped"])
      Severity: Minor
      Found in miasm/os_dep/win_api_x86_32.py - About 55 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function kernel32_SetFilePointerEx has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      def kernel32_SetFilePointerEx(jitter):
          ret_ad, args = jitter.func_args_stdcall(["hwnd", "dinstance_l",
                                                   "dinstance_h",
                                                   "pnewfileptr",
                                                   "movemethod"])
      Severity: Minor
      Found in miasm/os_dep/win_api_x86_32.py - About 45 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function advapi32_RegOpenKeyEx has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      def advapi32_RegOpenKeyEx(jitter, funcname, get_str):
          ret_ad, args = jitter.func_args_stdcall(["hkey", "subkey",
                                                   "reserved", "access",
                                                   "phandle"])
          s_subkey = get_str(args.subkey).lower() if args.subkey else ""
      Severity: Minor
      Found in miasm/os_dep/win_api_x86_32.py - About 45 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Avoid deeply nested control flow statements.
      Open

                          if stat.S_ISDIR(s.st_mode):
                              ret = winobjs.handle_pool.add(sb_fname, 0x1337)
                          else:
                              h = open(sb_fname, 'r+b')
                              ret = winobjs.handle_pool.add(sb_fname, h)
      Severity: Major
      Found in miasm/os_dep/win_api_x86_32.py - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                            if stat.S_ISDIR(s.st_mode):
                                ret = winobjs.handle_pool.add(sb_fname, 0x1337)
                            else:
                                open_mode = 'rb'
                                if (args.access & 0x40000000) or args.access == 2:
        Severity: Major
        Found in miasm/os_dep/win_api_x86_32.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                              if stat.S_ISDIR(s.st_mode):
                                  # open dir
                                  ret = winobjs.handle_pool.add(sb_fname, 0x1337)
                              else:
                                  h = open(sb_fname, 'wb')
          Severity: Major
          Found in miasm/os_dep/win_api_x86_32.py - About 45 mins to fix

            Function kernel32_GetModuleFileName has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

            def kernel32_GetModuleFileName(jitter, funcname, set_str):
                ret_ad, args = jitter.func_args_stdcall(["hmodule", "lpfilename", "nsize"])
            
                if args.hmodule in [0, winobjs.hcurmodule]:
                    p = winobjs.module_path[:]
            Severity: Minor
            Found in miasm/os_dep/win_api_x86_32.py - About 45 mins to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Function my_GetEnvironmentVariable has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            def my_GetEnvironmentVariable(jitter, funcname, get_str, set_str, mylen):
            Severity: Minor
            Found in miasm/os_dep/win_api_x86_32.py - About 35 mins to fix

              Function my_FindFirstFile has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              def my_FindFirstFile(jitter, pfilepattern, pfindfiledata, get_win_str, encode_str):
              Severity: Minor
              Found in miasm/os_dep/win_api_x86_32.py - About 35 mins to fix

                Function kernel32_WriteFile has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                def kernel32_WriteFile(jitter):
                    ret_ad, args = jitter.func_args_stdcall(["hwnd", "lpbuffer",
                                                             "nnumberofbytestowrite",
                                                             "lpnumberofbyteswrite",
                                                             "lpoverlapped"])
                Severity: Minor
                Found in miasm/os_dep/win_api_x86_32.py - About 35 mins to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Function kernel32_CreateFileMapping has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                def kernel32_CreateFileMapping(jitter, funcname, get_str):
                    ret_ad, args = jitter.func_args_stdcall(["hfile", "lpattr", "flprotect",
                                                             "dwmaximumsizehigh",
                                                             "dwmaximumsizelow", "lpname"])
                
                
                Severity: Minor
                Found in miasm/os_dep/win_api_x86_32.py - About 25 mins to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Function kernel32_SetFilePointer has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                def kernel32_SetFilePointer(jitter):
                    ret_ad, args = jitter.func_args_stdcall(["hwnd", "dinstance",
                                                             "p_dinstance_high",
                                                             "movemethod"])
                
                
                Severity: Minor
                Found in miasm/os_dep/win_api_x86_32.py - About 25 mins to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Function my_GetVolumeInformation has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                def my_GetVolumeInformation(jitter, funcname, get_str, set_str):
                    ret_ad, args = jitter.func_args_stdcall(["lprootpathname",
                                                             "lpvolumenamebuffer",
                                                             "nvolumenamesize",
                                                             "lpvolumeserialnumber",
                Severity: Minor
                Found in miasm/os_dep/win_api_x86_32.py - About 25 mins to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Function kernel32_VirtualAlloc has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                def kernel32_VirtualAlloc(jitter):
                    ret_ad, args = jitter.func_args_stdcall(['lpvoid', 'dwsize',
                                                             'alloc_type', 'flprotect'])
                
                
                
                Severity: Minor
                Found in miasm/os_dep/win_api_x86_32.py - About 25 mins to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                    if args.hwnd == winobjs.module_cur_hwnd:
                        l = len(open(winobjs.module_fname_nux, "rb").read())
                    elif args.hwnd in winobjs.handle_pool:
                        wh = winobjs.handle_pool[args.hwnd]
                        l = len(open(wh.name, "rb").read())
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 1 other location - About 5 hrs to fix
                miasm/os_dep/win_api_x86_32.py on lines 754..760

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 92.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                    if args.hwnd == winobjs.module_cur_hwnd:
                        ret = len(open(winobjs.module_fname_nux, "rb").read())
                    elif args.hwnd in winobjs.handle_pool:
                        wh = winobjs.handle_pool[args.hwnd]
                        ret = len(open(wh.name, "rb").read())
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 1 other location - About 5 hrs to fix
                miasm/os_dep/win_api_x86_32.py on lines 770..776

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 92.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                def msvcrt_fclose(jitter):
                    ret_ad, args = jitter.func_args_cdecl(['stream'])
                    fd = jitter.vm.get_u32(args.stream + 0x10)
                
                    if not fd in winobjs.handle_pool:
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 1 other location - About 5 hrs to fix
                miasm/os_dep/win_api_x86_32.py on lines 2963..2970

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 89.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                def msvcrt_rewind(jitter):
                    ret_ad, args = jitter.func_args_cdecl(["stream"])
                    fd = jitter.vm.get_u32(args.stream + 0x10)
                    if not fd in winobjs.handle_pool:
                        raise NotImplementedError("Untested case")
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 1 other location - About 5 hrs to fix
                miasm/os_dep/win_api_x86_32.py on lines 2995..3003

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 89.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                    if args.algid == 0x00008003:
                        log.debug('algo is MD5')
                        jitter.vm.set_u32(
                            args.phhash,
                            winobjs.cryptcontext_bnum + winobjs.cryptcontext_num
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 1 other location - About 5 hrs to fix
                miasm/os_dep/win_api_x86_32.py on lines 517..526

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 88.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                    elif args.algid == 0x00008004:
                        log.debug('algo is SHA1')
                        jitter.vm.set_u32(
                            args.phhash,
                            winobjs.cryptcontext_bnum + winobjs.cryptcontext_num
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 1 other location - About 5 hrs to fix
                miasm/os_dep/win_api_x86_32.py on lines 507..516

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 88.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                            elif args.dwcreationdisposition == 4:
                                # open_always
                                if os.access(sb_fname, os.R_OK):
                                    s = os.stat(sb_fname)
                                    if stat.S_ISDIR(s.st_mode):
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 1 other location - About 4 hrs to fix
                miasm/os_dep/win_api_x86_32.py on lines 681..693

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 83.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                                if is_original_file:
                                    # cannot open self in write mode!
                                    pass
                                elif os.access(sb_fname, os.R_OK):
                                    s = os.stat(sb_fname)
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 1 other location - About 4 hrs to fix
                miasm/os_dep/win_api_x86_32.py on lines 664..674

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 83.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                def kernel32_RtlMoveMemory(jitter):
                    ret_ad, args = jitter.func_args_stdcall(["ad_dst", "ad_src", "m_len"])
                    data = jitter.vm.get_mem(args.ad_src, args.m_len)
                    jitter.vm.set_mem(args.ad_dst, data)
                    jitter.func_ret_stdcall(ret_ad, 0)
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 1 other location - About 3 hrs to fix
                miasm/os_dep/win_api_x86_32.py on lines 1876..1880

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 66.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                def ntdll_RtlMoveMemory(jitter):
                    ret_ad, args = jitter.func_args_stdcall(["dst", "src", "l"])
                    s = jitter.vm.get_mem(args.src, args.l)
                    jitter.vm.set_mem(args.dst, s)
                    jitter.func_ret_stdcall(ret_ad, 1)
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 1 other location - About 3 hrs to fix
                miasm/os_dep/win_api_x86_32.py on lines 1240..1244

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 66.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                def ntdll_memset(jitter):
                    ret_ad, args = jitter.func_args_cdecl(['addr', 'c', 'size'])
                    jitter.vm.set_mem(args.addr, int_to_byte(args.c) * args.size)
                    jitter.func_ret_cdecl(ret_ad, args.addr)
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 1 other location - About 3 hrs to fix
                miasm/os_dep/win_api_x86_32.py on lines 2022..2025

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 64.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                def msvcrt_memset(jitter):
                    ret_ad, args = jitter.func_args_cdecl(['addr', 'c', 'size'])
                    jitter.vm.set_mem(args.addr, int_to_byte(args.c) * args.size)
                    jitter.func_ret_cdecl(ret_ad, args.addr)
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 1 other location - About 3 hrs to fix
                miasm/os_dep/win_api_x86_32.py on lines 2016..2019

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 64.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                def kernel32_GetSystemTime(jitter):
                    ret_ad, args = jitter.func_args_stdcall(["lpsystemtime"])
                    systemtime = datetime_to_systemtime(winobjs.current_datetime)
                    jitter.vm.set_mem(args.lpsystemtime, systemtime)
                    jitter.func_ret_stdcall(ret_ad, args.lpsystemtime)
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 1 other location - About 2 hrs to fix
                miasm/os_dep/win_api_x86_32.py on lines 2633..2637

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 59.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                def kernel32_GetLocalTime(jitter):
                    ret_ad, args = jitter.func_args_stdcall(["lpsystemtime"])
                    systemtime = datetime_to_systemtime(winobjs.current_datetime)
                    jitter.vm.set_mem(args.lpsystemtime, systemtime)
                    jitter.func_ret_stdcall(ret_ad, args.lpsystemtime)
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 1 other location - About 2 hrs to fix
                miasm/os_dep/win_api_x86_32.py on lines 2640..2644

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 59.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                    if args.cchwidechar > 0:
                        # return value is number of bytes written
                        retval = min(args.cchwidechar, len(s))
                        jitter.vm.set_mem(args.lpwidecharstr, s[:retval])
                    else:
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 1 other location - About 2 hrs to fix
                miasm/os_dep/win_api_x86_32.py on lines 1746..1753

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 58.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                    if args.cbMultiByte > 0:
                        # return value is the number of bytes written
                        retval = min(args.cbMultiByte, len(dst))
                        jitter.vm.set_mem(args.lpMultiByteStr, dst[:retval])
                    else:
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 1 other location - About 2 hrs to fix
                miasm/os_dep/win_api_x86_32.py on lines 1707..1714

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 58.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                def kernel32_GetNativeSystemInfo(jitter):
                    ret_ad, args = jitter.func_args_stdcall(["sys_ptr"])
                    sysinfo = systeminfo()
                    jitter.vm.set_mem(args.sys_ptr, sysinfo.pack())
                    jitter.func_ret_stdcall(ret_ad, 0)
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 1 other location - About 2 hrs to fix
                miasm/os_dep/win_api_x86_32.py on lines 1128..1132

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 57.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                def kernel32_GetSystemInfo(jitter):
                    ret_ad, args = jitter.func_args_stdcall(["sys_ptr"])
                    sysinfo = systeminfo()
                    jitter.vm.set_mem(args.sys_ptr, sysinfo.pack())
                    jitter.func_ret_stdcall(ret_ad, 0)
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 1 other location - About 2 hrs to fix
                miasm/os_dep/win_api_x86_32.py on lines 3182..3186

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 57.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Identical blocks of code found in 2 locations. Consider refactoring.
                Open

                    if args.initowner:
                        if name in winobjs.mutex:
                            raise NotImplementedError("Untested case")
                            # ret = 0
                        else:
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 1 other location - About 2 hrs to fix
                miasm/os_dep/win_api_x86_32.py on lines 952..965

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 56.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                def kernel32_FindFirstFileExW(jitter):
                    ret_ad, args = jitter.func_args_stdcall([
                        "lpFileName",
                        "fInfoLevelId",
                        "lpFindFileData",
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 1 other location - About 2 hrs to fix
                miasm/os_dep/win_api_x86_32.py on lines 3143..3153

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 54.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                def kernel32_FindFirstFileExA(jitter):
                    ret_ad, args = jitter.func_args_stdcall([
                        "lpFileName",
                        "fInfoLevelId",
                        "lpFindFileData",
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 1 other location - About 2 hrs to fix
                miasm/os_dep/win_api_x86_32.py on lines 3155..3165

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 54.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                def user32_IsCharUpperA(jitter):
                    ret_ad, args = jitter.func_args_stdcall(["c"])
                    ret = 0 if args.c & 0x20 else 1
                    jitter.func_ret_stdcall(ret_ad, ret)
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 1 other location - About 2 hrs to fix
                miasm/os_dep/win_api_x86_32.py on lines 2919..2922

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 51.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                def user32_IsCharLowerA(jitter):
                    ret_ad, args = jitter.func_args_stdcall(["c"])
                    ret = 1 if args.c & 0x20 else 0
                    jitter.func_ret_stdcall(ret_ad, ret)
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 1 other location - About 2 hrs to fix
                miasm/os_dep/win_api_x86_32.py on lines 2913..2916

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 51.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                def kernel32_EncodePointer(jitter):
                    """
                        PVOID EncodePointer(
                            _In_ PVOID Ptr
                        );
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 1 other location - About 2 hrs to fix
                miasm/os_dep/win_api_x86_32.py on lines 444..455

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 50.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                def kernel32_FindFirstFileA(jitter):
                    ret_ad, args = jitter.func_args_stdcall(["pfilepattern", "pfindfiledata"])
                    h = my_FindFirstFile(jitter, args.pfilepattern, args.pfindfiledata,
                                           get_win_str_a, encode_win_str_a)
                    jitter.func_ret_stdcall(ret_ad, h)
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 1 other location - About 2 hrs to fix
                miasm/os_dep/win_api_x86_32.py on lines 3137..3141

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 50.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                def kernel32_DecodePointer(jitter):
                    """
                        PVOID DecodePointer(
                           PVOID Ptr
                        );
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 1 other location - About 2 hrs to fix
                miasm/os_dep/win_api_x86_32.py on lines 426..442

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 50.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                def kernel32_FindFirstFileW(jitter):
                    ret_ad, args = jitter.func_args_stdcall(["pfilepattern", "pfindfiledata"])
                    h = my_FindFirstFile(jitter, args.pfilepattern, args.pfindfiledata,
                                           get_win_str_w, encode_win_str_w)
                    jitter.func_ret_stdcall(ret_ad, h)
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 1 other location - About 2 hrs to fix
                miasm/os_dep/win_api_x86_32.py on lines 3131..3135

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 50.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                def kernel32_LocalAlloc(jitter):
                    ret_ad, args = jitter.func_args_stdcall(["uflags", "msize"])
                    alloc_addr = winobjs.heap.alloc(jitter, args.msize)
                    jitter.func_ret_stdcall(ret_ad, alloc_addr)
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 1 other location - About 1 hr to fix
                miasm/os_dep/win_api_x86_32.py on lines 287..290

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 49.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                def kernel32_GlobalAlloc(jitter):
                    ret_ad, args = jitter.func_args_stdcall(["uflags", "msize"])
                    alloc_addr = winobjs.heap.alloc(jitter, args.msize)
                    jitter.func_ret_stdcall(ret_ad, alloc_addr)
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 1 other location - About 1 hr to fix
                miasm/os_dep/win_api_x86_32.py on lines 298..301

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 49.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 3 locations. Consider refactoring.
                Open

                def msvcrt_malloc(jitter):
                    ret_ad, args = jitter.func_args_cdecl(["msize"])
                    addr = winobjs.heap.alloc(jitter, args.msize)
                    jitter.func_ret_cdecl(ret_ad, addr)
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 2 other locations - About 1 hr to fix
                miasm/os_dep/linux_stdlib.py on lines 191..194
                miasm/os_dep/win_api_x86_32.py on lines 303..306

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 48.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 3 locations. Consider refactoring.
                Open

                def msvcrt_new(jitter):
                    ret_ad, args = jitter.func_args_cdecl(["size"])
                    alloc_addr = winobjs.heap.alloc(jitter, args.size)
                    jitter.func_ret_cdecl(ret_ad, alloc_addr)
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 2 other locations - About 1 hr to fix
                miasm/os_dep/linux_stdlib.py on lines 191..194
                miasm/os_dep/win_api_x86_32.py on lines 2930..2933

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 48.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                def msvcrt_strlen(jitter):
                    ret_ad, args = jitter.func_args_cdecl(["src"])
                
                    s = get_win_str_a(jitter, args.src)
                    jitter.func_ret_cdecl(ret_ad, len(s))
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 1 other location - About 1 hr to fix
                miasm/os_dep/win_api_x86_32.py on lines 2810..2813

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 48.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                def msvcrt_wcslen(jitter):
                    ret_ad, args = jitter.func_args_cdecl(["pwstr"])
                    s = get_win_str_w(jitter, args.pwstr)
                    jitter.func_ret_cdecl(ret_ad, len(s))
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 1 other location - About 1 hr to fix
                miasm/os_dep/win_api_x86_32.py on lines 3256..3260

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 48.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                def kernel32_GetEnvironmentVariableA(jitter):
                    my_GetEnvironmentVariable(jitter, whoami(),
                                              lambda addr:get_win_str_a(jitter, addr),
                                              lambda addr,value: set_win_str_a(jitter, addr, value),
                                              len)
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 1 other location - About 1 hr to fix
                miasm/os_dep/win_api_x86_32.py on lines 1779..1783

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 43.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                    if args.geoclass == 14:
                        ret = 12345678
                    elif args.geoclass == 16:
                        ret = 55667788
                    else:
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 1 other location - About 1 hr to fix
                miasm/arch/x86/sem.py on lines 4374..4379

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 43.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                def kernel32_GetEnvironmentVariableW(jitter):
                    my_GetEnvironmentVariable(jitter, whoami(),
                                              lambda addr:get_win_str_w(jitter, addr),
                                              lambda addr,value: set_win_str_w(jitter, addr, value),
                                              len)
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 1 other location - About 1 hr to fix
                miasm/os_dep/win_api_x86_32.py on lines 1772..1776

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 43.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 7 locations. Consider refactoring.
                Open

                def kernel32_lstrcpyA(jitter):
                    my_strcpy(jitter, whoami(), lambda addr:get_win_str_a(jitter, addr), lambda addr,value: set_win_str_a(jitter, addr, value))
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 6 other locations - About 1 hr to fix
                miasm/os_dep/win_api_x86_32.py on lines 1553..1554
                miasm/os_dep/win_api_x86_32.py on lines 1561..1562
                miasm/os_dep/win_api_x86_32.py on lines 1613..1614
                miasm/os_dep/win_api_x86_32.py on lines 1617..1618
                miasm/os_dep/win_api_x86_32.py on lines 1666..1668
                miasm/os_dep/win_api_x86_32.py on lines 1671..1672

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 42.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 7 locations. Consider refactoring.
                Open

                def kernel32_GetVolumeInformationW(jitter):
                    my_GetVolumeInformation(jitter, whoami(), lambda addr:get_win_str_w(jitter, addr), lambda addr,value: set_win_str_w(jitter, addr, value))
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 6 other locations - About 1 hr to fix
                miasm/os_dep/win_api_x86_32.py on lines 1553..1554
                miasm/os_dep/win_api_x86_32.py on lines 1557..1558
                miasm/os_dep/win_api_x86_32.py on lines 1561..1562
                miasm/os_dep/win_api_x86_32.py on lines 1613..1614
                miasm/os_dep/win_api_x86_32.py on lines 1617..1618
                miasm/os_dep/win_api_x86_32.py on lines 1666..1668

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 42.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 7 locations. Consider refactoring.
                Open

                def kernel32_lstrcpyW(jitter):
                    my_strcpy(jitter, whoami(), lambda addr:get_win_str_w(jitter, addr), lambda addr,value: set_win_str_w(jitter, addr, value))
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 6 other locations - About 1 hr to fix
                miasm/os_dep/win_api_x86_32.py on lines 1557..1558
                miasm/os_dep/win_api_x86_32.py on lines 1561..1562
                miasm/os_dep/win_api_x86_32.py on lines 1613..1614
                miasm/os_dep/win_api_x86_32.py on lines 1617..1618
                miasm/os_dep/win_api_x86_32.py on lines 1666..1668
                miasm/os_dep/win_api_x86_32.py on lines 1671..1672

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 42.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 7 locations. Consider refactoring.
                Open

                def kernel32_GetVolumeInformationA(jitter):
                    my_GetVolumeInformation(
                        jitter, whoami(), lambda addr:get_win_str_a(jitter, addr), lambda addr,value: set_win_str_a(jitter, addr, value))
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 6 other locations - About 1 hr to fix
                miasm/os_dep/win_api_x86_32.py on lines 1553..1554
                miasm/os_dep/win_api_x86_32.py on lines 1557..1558
                miasm/os_dep/win_api_x86_32.py on lines 1561..1562
                miasm/os_dep/win_api_x86_32.py on lines 1613..1614
                miasm/os_dep/win_api_x86_32.py on lines 1617..1618
                miasm/os_dep/win_api_x86_32.py on lines 1671..1672

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 42.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 7 locations. Consider refactoring.
                Open

                def kernel32_lstrcatW(jitter):
                    my_lstrcat(jitter, whoami(), lambda addr:get_win_str_w(jitter, addr), lambda addr,value: set_win_str_w(jitter, addr, value))
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 6 other locations - About 1 hr to fix
                miasm/os_dep/win_api_x86_32.py on lines 1553..1554
                miasm/os_dep/win_api_x86_32.py on lines 1557..1558
                miasm/os_dep/win_api_x86_32.py on lines 1561..1562
                miasm/os_dep/win_api_x86_32.py on lines 1613..1614
                miasm/os_dep/win_api_x86_32.py on lines 1666..1668
                miasm/os_dep/win_api_x86_32.py on lines 1671..1672

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 42.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 7 locations. Consider refactoring.
                Open

                def kernel32_lstrcatA(jitter):
                    my_lstrcat(jitter, whoami(), lambda addr:get_win_str_a(jitter, addr), lambda addr,value: set_win_str_a(jitter, addr, value))
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 6 other locations - About 1 hr to fix
                miasm/os_dep/win_api_x86_32.py on lines 1553..1554
                miasm/os_dep/win_api_x86_32.py on lines 1557..1558
                miasm/os_dep/win_api_x86_32.py on lines 1561..1562
                miasm/os_dep/win_api_x86_32.py on lines 1617..1618
                miasm/os_dep/win_api_x86_32.py on lines 1666..1668
                miasm/os_dep/win_api_x86_32.py on lines 1671..1672

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 42.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 7 locations. Consider refactoring.
                Open

                def kernel32_lstrcpy(jitter):
                    my_strcpy(jitter, whoami(), lambda addr:get_win_str_a(jitter, addr), lambda addr,value: set_win_str_a(jitter, addr, value))
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 6 other locations - About 1 hr to fix
                miasm/os_dep/win_api_x86_32.py on lines 1553..1554
                miasm/os_dep/win_api_x86_32.py on lines 1557..1558
                miasm/os_dep/win_api_x86_32.py on lines 1613..1614
                miasm/os_dep/win_api_x86_32.py on lines 1617..1618
                miasm/os_dep/win_api_x86_32.py on lines 1666..1668
                miasm/os_dep/win_api_x86_32.py on lines 1671..1672

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 42.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Identical blocks of code found in 2 locations. Consider refactoring.
                Open

                            jitter.vm.add_memory_page(
                                alloc_addr, ACCESS_DICT[args.flprotect], b"\x00" * args.dwsize,
                                "Alloc in %s ret 0x%X" % (whoami(), ret_ad))
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 1 other location - About 1 hr to fix
                miasm/os_dep/win_api_x86_32.py on lines 867..869

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 41.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Identical blocks of code found in 2 locations. Consider refactoring.
                Open

                        jitter.vm.add_memory_page(
                            alloc_addr, ACCESS_DICT[args.flprotect], b"\x00" * args.dwsize,
                            "Alloc in %s ret 0x%X" % (whoami(), ret_ad))
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 1 other location - About 1 hr to fix
                miasm/os_dep/win_api_x86_32.py on lines 879..881

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 41.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                def kernel32_GetTickCount(jitter):
                    ret_ad, _ = jitter.func_args_stdcall(0)
                    winobjs.tickcount += 1
                    jitter.func_ret_stdcall(ret_ad, winobjs.tickcount)
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 1 other location - About 1 hr to fix
                miasm/os_dep/win_api_x86_32.py on lines 2423..2426

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 41.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                def kernel32_TlsAlloc(jitter):
                    ret_ad, _ = jitter.func_args_stdcall(0)
                    winobjs.tls_index += 1
                    jitter.func_ret_stdcall(ret_ad, winobjs.tls_index)
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 1 other location - About 1 hr to fix
                miasm/os_dep/win_api_x86_32.py on lines 368..371

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 41.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Identical blocks of code found in 4 locations. Consider refactoring.
                Open

                    if args.hwnd == winobjs.module_cur_hwnd:
                        pass
                    elif args.hwnd in winobjs.handle_pool:
                        pass
                    else:
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 3 other locations - About 1 hr to fix
                miasm/os_dep/win_api_x86_32.py on lines 726..731
                miasm/os_dep/win_api_x86_32.py on lines 2848..2853
                miasm/os_dep/win_api_x86_32.py on lines 2892..2897

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 39.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Identical blocks of code found in 4 locations. Consider refactoring.
                Open

                    if args.hwnd == winobjs.module_cur_hwnd:
                        pass
                    elif args.hwnd in winobjs.handle_pool:
                        pass
                    else:
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 3 other locations - About 1 hr to fix
                miasm/os_dep/win_api_x86_32.py on lines 2820..2825
                miasm/os_dep/win_api_x86_32.py on lines 2848..2853
                miasm/os_dep/win_api_x86_32.py on lines 2892..2897

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 39.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Identical blocks of code found in 4 locations. Consider refactoring.
                Open

                    if args.hwnd == winobjs.module_cur_hwnd:
                        pass
                    elif args.hwnd in winobjs.handle_pool:
                        pass
                    else:
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 3 other locations - About 1 hr to fix
                miasm/os_dep/win_api_x86_32.py on lines 726..731
                miasm/os_dep/win_api_x86_32.py on lines 2820..2825
                miasm/os_dep/win_api_x86_32.py on lines 2848..2853

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 39.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Identical blocks of code found in 4 locations. Consider refactoring.
                Open

                    if args.hwnd == winobjs.module_cur_hwnd:
                        pass
                    elif args.hwnd in winobjs.handle_pool:
                        pass
                    else:
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 3 other locations - About 1 hr to fix
                miasm/os_dep/win_api_x86_32.py on lines 726..731
                miasm/os_dep/win_api_x86_32.py on lines 2820..2825
                miasm/os_dep/win_api_x86_32.py on lines 2892..2897

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 39.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                    C1_CNTRL_SET = ['\x00', '\x01', '\x02', '\x03', '\x04', '\x05', '\x06',
                            '\x07', '\x08', '\t', '\n', '\x0b', '\x0c', '\r', '\x0e', '\x0f',
                            '\x10', '\x11', '\x12', '\x13', '\x14', '\x15', '\x16', '\x17',
                            '\x18', '\x19', '\x1a', '\x1b', '\x1c', '\x1d', '\x1e', '\x1f',
                            '\x7f']
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 1 other location - About 1 hr to fix
                miasm/arch/mep/regs.py on lines 40..43

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 39.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Identical blocks of code found in 5 locations. Consider refactoring.
                Open

                    if not ad2mdl(args.p_mdl) in winobjs.nt_mdl:
                        raise ValueError('unk mdl', hex(args.p_mdl))
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 4 other locations - About 50 mins to fix
                miasm/os_dep/win_api_x86_32.py on lines 1423..1424
                miasm/os_dep/win_api_x86_32.py on lines 1433..1434
                miasm/os_dep/win_api_x86_32.py on lines 1441..1442
                miasm/os_dep/win_api_x86_32.py on lines 1449..1450

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 36.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Identical blocks of code found in 5 locations. Consider refactoring.
                Open

                    if not ad2mdl(args.p_mdl) in winobjs.nt_mdl:
                        raise ValueError('unk mdl', hex(args.p_mdl))
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 4 other locations - About 50 mins to fix
                miasm/os_dep/win_api_x86_32.py on lines 1423..1424
                miasm/os_dep/win_api_x86_32.py on lines 1433..1434
                miasm/os_dep/win_api_x86_32.py on lines 1449..1450
                miasm/os_dep/win_api_x86_32.py on lines 1457..1458

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 36.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Identical blocks of code found in 5 locations. Consider refactoring.
                Open

                    if not ad2mdl(args.p_mdl) in winobjs.nt_mdl:
                        raise ValueError('unk mdl', hex(args.p_mdl))
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 4 other locations - About 50 mins to fix
                miasm/os_dep/win_api_x86_32.py on lines 1423..1424
                miasm/os_dep/win_api_x86_32.py on lines 1441..1442
                miasm/os_dep/win_api_x86_32.py on lines 1449..1450
                miasm/os_dep/win_api_x86_32.py on lines 1457..1458

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 36.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Identical blocks of code found in 5 locations. Consider refactoring.
                Open

                    if not ad2mdl(args.p_mdl) in winobjs.nt_mdl:
                        raise ValueError('unk mdl', hex(args.p_mdl))
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 4 other locations - About 50 mins to fix
                miasm/os_dep/win_api_x86_32.py on lines 1433..1434
                miasm/os_dep/win_api_x86_32.py on lines 1441..1442
                miasm/os_dep/win_api_x86_32.py on lines 1449..1450
                miasm/os_dep/win_api_x86_32.py on lines 1457..1458

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 36.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Identical blocks of code found in 5 locations. Consider refactoring.
                Open

                    if not ad2mdl(args.p_mdl) in winobjs.nt_mdl:
                        raise ValueError('unk mdl', hex(args.p_mdl))
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 4 other locations - About 50 mins to fix
                miasm/os_dep/win_api_x86_32.py on lines 1423..1424
                miasm/os_dep/win_api_x86_32.py on lines 1433..1434
                miasm/os_dep/win_api_x86_32.py on lines 1441..1442
                miasm/os_dep/win_api_x86_32.py on lines 1457..1458

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 36.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                def kernel32_LeaveCriticalSection(jitter):
                    '''
                    void LeaveCriticalSection(
                      LPCRITICAL_SECTION lpCriticalSection
                    );
                Severity: Minor
                Found in miasm/os_dep/win_api_x86_32.py and 1 other location - About 45 mins to fix
                miasm/os_dep/win_api_x86_32.py on lines 3279..3286

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 35.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                def kernel32_CreateToolhelp32Snapshot(jitter):
                    ret_ad, _ = jitter.func_args_stdcall(["dwflags", "th32processid"])
                    jitter.func_ret_stdcall(ret_ad, winobjs.handle_toolhelpsnapshot)
                Severity: Minor
                Found in miasm/os_dep/win_api_x86_32.py and 1 other location - About 45 mins to fix
                miasm/os_dep/win_api_x86_32.py on lines 892..894

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 35.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                def user32_GetWindowLongA(jitter):
                    ret_ad, _ = jitter.func_args_stdcall(["hwnd", "nindex"])
                    jitter.func_ret_stdcall(ret_ad, winobjs.windowlong_dw)
                Severity: Minor
                Found in miasm/os_dep/win_api_x86_32.py and 1 other location - About 45 mins to fix
                miasm/os_dep/win_api_x86_32.py on lines 326..328

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 35.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                def kernel32_EnterCriticalSection(jitter):
                    '''
                    void EnterCriticalSection(
                      LPCRITICAL_SECTION lpCriticalSection
                    );
                Severity: Minor
                Found in miasm/os_dep/win_api_x86_32.py and 1 other location - About 45 mins to fix
                miasm/os_dep/win_api_x86_32.py on lines 3289..3296

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 35.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 3 locations. Consider refactoring.
                Open

                def kernel32_VirtualFree(jitter):
                    ret_ad, _ = jitter.func_args_stdcall(["lpvoid", "dwsize", "alloc_type"])
                    jitter.func_ret_stdcall(ret_ad, 0)
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 2 other locations - About 40 mins to fix
                miasm/os_dep/win_api_x86_32.py on lines 282..284
                miasm/os_dep/win_api_x86_32.py on lines 785..787

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 34.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                    if args.lpfilesystemnamebuffer:
                        s = "filesystemname"
                        s = s[:args.nfilesystemnamesize]
                        set_str(args.lpfilesystemnamebuffer, s)
                Severity: Minor
                Found in miasm/os_dep/win_api_x86_32.py and 1 other location - About 40 mins to fix
                miasm/os_dep/win_api_x86_32.py on lines 1646..1649

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 34.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 3 locations. Consider refactoring.
                Open

                def kernel32_HeapFree(jitter):
                    ret_ad, _ = jitter.func_args_stdcall(["heap", "flags", "pmem"])
                    jitter.func_ret_stdcall(ret_ad, 1)
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 2 other locations - About 40 mins to fix
                miasm/os_dep/win_api_x86_32.py on lines 785..787
                miasm/os_dep/win_api_x86_32.py on lines 887..889

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 34.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 3 locations. Consider refactoring.
                Open

                def kernel32_FlushInstructionCache(jitter):
                    ret_ad, _ = jitter.func_args_stdcall(["hprocess", "lpbasead", "dwsize"])
                    jitter.func_ret_stdcall(ret_ad, 0x1337)
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 2 other locations - About 40 mins to fix
                miasm/os_dep/win_api_x86_32.py on lines 282..284
                miasm/os_dep/win_api_x86_32.py on lines 887..889

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 34.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                    if args.lpvolumenamebuffer:
                        s = "volumename"
                        s = s[:args.nvolumenamesize]
                        set_str(args.lpvolumenamebuffer, s)
                Severity: Minor
                Found in miasm/os_dep/win_api_x86_32.py and 1 other location - About 40 mins to fix
                miasm/os_dep/win_api_x86_32.py on lines 1658..1661

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 34.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 5 locations. Consider refactoring.
                Open

                def advapi32_CryptReleaseContext(jitter):
                    ret_ad, _ = jitter.func_args_stdcall(["hhash", "flags"])
                    jitter.func_ret_stdcall(ret_ad, 0)
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 4 other locations - About 35 mins to fix
                miasm/os_dep/win_api_x86_32.py on lines 417..419
                miasm/os_dep/win_api_x86_32.py on lines 1097..1099
                miasm/os_dep/win_api_x86_32.py on lines 1353..1355
                miasm/os_dep/win_api_x86_32.py on lines 1358..1360

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 33.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 5 locations. Consider refactoring.
                Open

                def kernel32_IsBadReadPtr(jitter):
                    ret_ad, _ = jitter.func_args_stdcall(['lp', 'ucb'])
                    jitter.func_ret_stdcall(ret_ad, 0)
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 4 other locations - About 35 mins to fix
                miasm/os_dep/win_api_x86_32.py on lines 417..419
                miasm/os_dep/win_api_x86_32.py on lines 570..572
                miasm/os_dep/win_api_x86_32.py on lines 1097..1099
                miasm/os_dep/win_api_x86_32.py on lines 1353..1355

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 33.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 5 locations. Consider refactoring.
                Open

                def kernel32_SetPriorityClass(jitter):
                    ret_ad, _ = jitter.func_args_stdcall(["hwnd", "dwpclass"])
                    jitter.func_ret_stdcall(ret_ad, 0)
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 4 other locations - About 35 mins to fix
                miasm/os_dep/win_api_x86_32.py on lines 570..572
                miasm/os_dep/win_api_x86_32.py on lines 1097..1099
                miasm/os_dep/win_api_x86_32.py on lines 1353..1355
                miasm/os_dep/win_api_x86_32.py on lines 1358..1360

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 33.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 5 locations. Consider refactoring.
                Open

                def ntdll_ZwUnmapViewOfSection(jitter):
                    ret_ad, _ = jitter.func_args_stdcall(['h', 'ad'])
                    jitter.func_ret_stdcall(ret_ad, 0)
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 4 other locations - About 35 mins to fix
                miasm/os_dep/win_api_x86_32.py on lines 417..419
                miasm/os_dep/win_api_x86_32.py on lines 570..572
                miasm/os_dep/win_api_x86_32.py on lines 1097..1099
                miasm/os_dep/win_api_x86_32.py on lines 1358..1360

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 33.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 5 locations. Consider refactoring.
                Open

                def kernel32_VirtualLock(jitter):
                    ret_ad, _ = jitter.func_args_stdcall(["lpaddress", "dwsize"])
                    jitter.func_ret_stdcall(ret_ad, 1)
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 4 other locations - About 35 mins to fix
                miasm/os_dep/win_api_x86_32.py on lines 417..419
                miasm/os_dep/win_api_x86_32.py on lines 570..572
                miasm/os_dep/win_api_x86_32.py on lines 1353..1355
                miasm/os_dep/win_api_x86_32.py on lines 1358..1360

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 33.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 16 locations. Consider refactoring.
                Open

                def kernel32_TlsFree(jitter):
                    ret_ad, _ = jitter.func_args_stdcall(["tlsindex"])
                    jitter.func_ret_stdcall(ret_ad, 0)
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 15 other locations - About 30 mins to fix
                miasm/os_dep/linux_stdlib.py on lines 197..199
                miasm/os_dep/win_api_x86_32.py on lines 293..295
                miasm/os_dep/win_api_x86_32.py on lines 310..312
                miasm/os_dep/win_api_x86_32.py on lines 316..318
                miasm/os_dep/win_api_x86_32.py on lines 412..414
                miasm/os_dep/win_api_x86_32.py on lines 422..424
                miasm/os_dep/win_api_x86_32.py on lines 473..475
                miasm/os_dep/win_api_x86_32.py on lines 478..480
                miasm/os_dep/win_api_x86_32.py on lines 590..592
                miasm/os_dep/win_api_x86_32.py on lines 1348..1350
                miasm/os_dep/win_api_x86_32.py on lines 1994..1998
                miasm/os_dep/win_api_x86_32.py on lines 2556..2558
                miasm/os_dep/win_api_x86_32.py on lines 2806..2808
                miasm/os_dep/win_api_x86_32.py on lines 2936..2938
                miasm/os_dep/win_api_x86_32.py on lines 3006..3008

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 32.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 16 locations. Consider refactoring.
                Open

                def kernel32_GlobalFree(jitter):
                    ret_ad, _ = jitter.func_args_stdcall(["addr"])
                    jitter.func_ret_stdcall(ret_ad, 0)
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 15 other locations - About 30 mins to fix
                miasm/os_dep/linux_stdlib.py on lines 197..199
                miasm/os_dep/win_api_x86_32.py on lines 293..295
                miasm/os_dep/win_api_x86_32.py on lines 310..312
                miasm/os_dep/win_api_x86_32.py on lines 412..414
                miasm/os_dep/win_api_x86_32.py on lines 422..424
                miasm/os_dep/win_api_x86_32.py on lines 473..475
                miasm/os_dep/win_api_x86_32.py on lines 478..480
                miasm/os_dep/win_api_x86_32.py on lines 590..592
                miasm/os_dep/win_api_x86_32.py on lines 1348..1350
                miasm/os_dep/win_api_x86_32.py on lines 1994..1998
                miasm/os_dep/win_api_x86_32.py on lines 2429..2431
                miasm/os_dep/win_api_x86_32.py on lines 2556..2558
                miasm/os_dep/win_api_x86_32.py on lines 2806..2808
                miasm/os_dep/win_api_x86_32.py on lines 2936..2938
                miasm/os_dep/win_api_x86_32.py on lines 3006..3008

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 32.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 16 locations. Consider refactoring.
                Open

                def kernel32_InitializeCriticalSection(jitter):
                    ret_ad, _ = jitter.func_args_stdcall(["lpcritic"])
                    jitter.func_ret_stdcall(ret_ad, 0)
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 15 other locations - About 30 mins to fix
                miasm/os_dep/linux_stdlib.py on lines 197..199
                miasm/os_dep/win_api_x86_32.py on lines 293..295
                miasm/os_dep/win_api_x86_32.py on lines 310..312
                miasm/os_dep/win_api_x86_32.py on lines 316..318
                miasm/os_dep/win_api_x86_32.py on lines 412..414
                miasm/os_dep/win_api_x86_32.py on lines 422..424
                miasm/os_dep/win_api_x86_32.py on lines 473..475
                miasm/os_dep/win_api_x86_32.py on lines 478..480
                miasm/os_dep/win_api_x86_32.py on lines 590..592
                miasm/os_dep/win_api_x86_32.py on lines 1348..1350
                miasm/os_dep/win_api_x86_32.py on lines 1994..1998
                miasm/os_dep/win_api_x86_32.py on lines 2429..2431
                miasm/os_dep/win_api_x86_32.py on lines 2806..2808
                miasm/os_dep/win_api_x86_32.py on lines 2936..2938
                miasm/os_dep/win_api_x86_32.py on lines 3006..3008

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 32.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 16 locations. Consider refactoring.
                Open

                def msvcrt_atexit(jitter):
                    ret_ad, _ = jitter.func_args_cdecl(["func"])
                    jitter.func_ret_cdecl(ret_ad, 0)
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 15 other locations - About 30 mins to fix
                miasm/os_dep/linux_stdlib.py on lines 197..199
                miasm/os_dep/win_api_x86_32.py on lines 293..295
                miasm/os_dep/win_api_x86_32.py on lines 310..312
                miasm/os_dep/win_api_x86_32.py on lines 316..318
                miasm/os_dep/win_api_x86_32.py on lines 412..414
                miasm/os_dep/win_api_x86_32.py on lines 422..424
                miasm/os_dep/win_api_x86_32.py on lines 473..475
                miasm/os_dep/win_api_x86_32.py on lines 478..480
                miasm/os_dep/win_api_x86_32.py on lines 590..592
                miasm/os_dep/win_api_x86_32.py on lines 1348..1350
                miasm/os_dep/win_api_x86_32.py on lines 1994..1998
                miasm/os_dep/win_api_x86_32.py on lines 2429..2431
                miasm/os_dep/win_api_x86_32.py on lines 2556..2558
                miasm/os_dep/win_api_x86_32.py on lines 2806..2808
                miasm/os_dep/win_api_x86_32.py on lines 2936..2938

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 32.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 6 locations. Consider refactoring.
                Open

                def kernel32_GetLastError(jitter):
                    ret_ad, _ = jitter.func_args_stdcall(0)
                    jitter.func_ret_stdcall(ret_ad, winobjs.lastwin32error)
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 5 other locations - About 30 mins to fix
                miasm/os_dep/win_api_x86_32.py on lines 321..323
                miasm/os_dep/win_api_x86_32.py on lines 331..333
                miasm/os_dep/win_api_x86_32.py on lines 336..338
                miasm/os_dep/win_api_x86_32.py on lines 374..376
                miasm/os_dep/win_api_x86_32.py on lines 457..459

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 32.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 16 locations. Consider refactoring.
                Open

                def advapi32_CryptDestroyHash(jitter):
                    ret_ad, _ = jitter.func_args_stdcall(["hhash"])
                    jitter.func_ret_stdcall(ret_ad, 1)
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 15 other locations - About 30 mins to fix
                miasm/os_dep/linux_stdlib.py on lines 197..199
                miasm/os_dep/win_api_x86_32.py on lines 293..295
                miasm/os_dep/win_api_x86_32.py on lines 310..312
                miasm/os_dep/win_api_x86_32.py on lines 316..318
                miasm/os_dep/win_api_x86_32.py on lines 412..414
                miasm/os_dep/win_api_x86_32.py on lines 422..424
                miasm/os_dep/win_api_x86_32.py on lines 473..475
                miasm/os_dep/win_api_x86_32.py on lines 478..480
                miasm/os_dep/win_api_x86_32.py on lines 1348..1350
                miasm/os_dep/win_api_x86_32.py on lines 1994..1998
                miasm/os_dep/win_api_x86_32.py on lines 2429..2431
                miasm/os_dep/win_api_x86_32.py on lines 2556..2558
                miasm/os_dep/win_api_x86_32.py on lines 2806..2808
                miasm/os_dep/win_api_x86_32.py on lines 2936..2938
                miasm/os_dep/win_api_x86_32.py on lines 3006..3008

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 32.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 6 locations. Consider refactoring.
                Open

                def kernel32_IsDebuggerPresent(jitter):
                    ret_ad, _ = jitter.func_args_stdcall(0)
                    jitter.func_ret_stdcall(ret_ad, winobjs.dbg_present)
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 5 other locations - About 30 mins to fix
                miasm/os_dep/win_api_x86_32.py on lines 331..333
                miasm/os_dep/win_api_x86_32.py on lines 336..338
                miasm/os_dep/win_api_x86_32.py on lines 374..376
                miasm/os_dep/win_api_x86_32.py on lines 457..459
                miasm/os_dep/win_api_x86_32.py on lines 1002..1004

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 32.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 6 locations. Consider refactoring.
                Open

                def kernel32_GetCurrentProcess(jitter):
                    ret_ad, _ = jitter.func_args_stdcall(0)
                    jitter.func_ret_stdcall(ret_ad, winobjs.handle_curprocess)
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 5 other locations - About 30 mins to fix
                miasm/os_dep/win_api_x86_32.py on lines 321..323
                miasm/os_dep/win_api_x86_32.py on lines 336..338
                miasm/os_dep/win_api_x86_32.py on lines 374..376
                miasm/os_dep/win_api_x86_32.py on lines 457..459
                miasm/os_dep/win_api_x86_32.py on lines 1002..1004

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 32.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 16 locations. Consider refactoring.
                Open

                def msvcrt_srand(jitter):
                    ret_ad, _ = jitter.func_args_cdecl(['seed'])
                    jitter.func_ret_stdcall(ret_ad, 0)
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 15 other locations - About 30 mins to fix
                miasm/os_dep/linux_stdlib.py on lines 197..199
                miasm/os_dep/win_api_x86_32.py on lines 293..295
                miasm/os_dep/win_api_x86_32.py on lines 310..312
                miasm/os_dep/win_api_x86_32.py on lines 316..318
                miasm/os_dep/win_api_x86_32.py on lines 412..414
                miasm/os_dep/win_api_x86_32.py on lines 422..424
                miasm/os_dep/win_api_x86_32.py on lines 473..475
                miasm/os_dep/win_api_x86_32.py on lines 478..480
                miasm/os_dep/win_api_x86_32.py on lines 590..592
                miasm/os_dep/win_api_x86_32.py on lines 1348..1350
                miasm/os_dep/win_api_x86_32.py on lines 1994..1998
                miasm/os_dep/win_api_x86_32.py on lines 2429..2431
                miasm/os_dep/win_api_x86_32.py on lines 2556..2558
                miasm/os_dep/win_api_x86_32.py on lines 2936..2938
                miasm/os_dep/win_api_x86_32.py on lines 3006..3008

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 32.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 16 locations. Consider refactoring.
                Open

                def msvcrt_free(jitter):
                    ret_ad, _ = jitter.func_args_cdecl(["ptr"])
                    jitter.func_ret_cdecl(ret_ad, 0)
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 15 other locations - About 30 mins to fix
                miasm/os_dep/linux_stdlib.py on lines 197..199
                miasm/os_dep/win_api_x86_32.py on lines 293..295
                miasm/os_dep/win_api_x86_32.py on lines 310..312
                miasm/os_dep/win_api_x86_32.py on lines 316..318
                miasm/os_dep/win_api_x86_32.py on lines 412..414
                miasm/os_dep/win_api_x86_32.py on lines 422..424
                miasm/os_dep/win_api_x86_32.py on lines 473..475
                miasm/os_dep/win_api_x86_32.py on lines 478..480
                miasm/os_dep/win_api_x86_32.py on lines 590..592
                miasm/os_dep/win_api_x86_32.py on lines 1348..1350
                miasm/os_dep/win_api_x86_32.py on lines 1994..1998
                miasm/os_dep/win_api_x86_32.py on lines 2429..2431
                miasm/os_dep/win_api_x86_32.py on lines 2556..2558
                miasm/os_dep/win_api_x86_32.py on lines 2806..2808
                miasm/os_dep/win_api_x86_32.py on lines 3006..3008

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 32.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 16 locations. Consider refactoring.
                Open

                def kernel32_CloseHandle(jitter):
                    ret_ad, _ = jitter.func_args_stdcall(["hwnd"])
                    jitter.func_ret_stdcall(ret_ad, 1)
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 15 other locations - About 30 mins to fix
                miasm/os_dep/linux_stdlib.py on lines 197..199
                miasm/os_dep/win_api_x86_32.py on lines 293..295
                miasm/os_dep/win_api_x86_32.py on lines 310..312
                miasm/os_dep/win_api_x86_32.py on lines 316..318
                miasm/os_dep/win_api_x86_32.py on lines 412..414
                miasm/os_dep/win_api_x86_32.py on lines 473..475
                miasm/os_dep/win_api_x86_32.py on lines 478..480
                miasm/os_dep/win_api_x86_32.py on lines 590..592
                miasm/os_dep/win_api_x86_32.py on lines 1348..1350
                miasm/os_dep/win_api_x86_32.py on lines 1994..1998
                miasm/os_dep/win_api_x86_32.py on lines 2429..2431
                miasm/os_dep/win_api_x86_32.py on lines 2556..2558
                miasm/os_dep/win_api_x86_32.py on lines 2806..2808
                miasm/os_dep/win_api_x86_32.py on lines 2936..2938
                miasm/os_dep/win_api_x86_32.py on lines 3006..3008

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 32.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 16 locations. Consider refactoring.
                Open

                def user32_BlockInput(jitter):
                    ret_ad, _ = jitter.func_args_stdcall(["blockit"])
                    jitter.func_ret_stdcall(ret_ad, 1)
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 15 other locations - About 30 mins to fix
                miasm/os_dep/linux_stdlib.py on lines 197..199
                miasm/os_dep/win_api_x86_32.py on lines 293..295
                miasm/os_dep/win_api_x86_32.py on lines 310..312
                miasm/os_dep/win_api_x86_32.py on lines 316..318
                miasm/os_dep/win_api_x86_32.py on lines 412..414
                miasm/os_dep/win_api_x86_32.py on lines 422..424
                miasm/os_dep/win_api_x86_32.py on lines 473..475
                miasm/os_dep/win_api_x86_32.py on lines 590..592
                miasm/os_dep/win_api_x86_32.py on lines 1348..1350
                miasm/os_dep/win_api_x86_32.py on lines 1994..1998
                miasm/os_dep/win_api_x86_32.py on lines 2429..2431
                miasm/os_dep/win_api_x86_32.py on lines 2556..2558
                miasm/os_dep/win_api_x86_32.py on lines 2806..2808
                miasm/os_dep/win_api_x86_32.py on lines 2936..2938
                miasm/os_dep/win_api_x86_32.py on lines 3006..3008

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 32.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 16 locations. Consider refactoring.
                Open

                def msvcrt_delete(jitter):
                    ret_ad, args = jitter.func_args_cdecl(["ptr"])
                    jitter.func_ret_cdecl(ret_ad, 0)
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 15 other locations - About 30 mins to fix
                miasm/os_dep/linux_stdlib.py on lines 197..199
                miasm/os_dep/win_api_x86_32.py on lines 293..295
                miasm/os_dep/win_api_x86_32.py on lines 316..318
                miasm/os_dep/win_api_x86_32.py on lines 412..414
                miasm/os_dep/win_api_x86_32.py on lines 422..424
                miasm/os_dep/win_api_x86_32.py on lines 473..475
                miasm/os_dep/win_api_x86_32.py on lines 478..480
                miasm/os_dep/win_api_x86_32.py on lines 590..592
                miasm/os_dep/win_api_x86_32.py on lines 1348..1350
                miasm/os_dep/win_api_x86_32.py on lines 1994..1998
                miasm/os_dep/win_api_x86_32.py on lines 2429..2431
                miasm/os_dep/win_api_x86_32.py on lines 2556..2558
                miasm/os_dep/win_api_x86_32.py on lines 2806..2808
                miasm/os_dep/win_api_x86_32.py on lines 2936..2938
                miasm/os_dep/win_api_x86_32.py on lines 3006..3008

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 32.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 16 locations. Consider refactoring.
                Open

                def kernel32_GetPriorityClass(jitter):
                    ret_ad, _ = jitter.func_args_stdcall(["hwnd"])
                    jitter.func_ret_stdcall(ret_ad, 0)
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 15 other locations - About 30 mins to fix
                miasm/os_dep/linux_stdlib.py on lines 197..199
                miasm/os_dep/win_api_x86_32.py on lines 293..295
                miasm/os_dep/win_api_x86_32.py on lines 310..312
                miasm/os_dep/win_api_x86_32.py on lines 316..318
                miasm/os_dep/win_api_x86_32.py on lines 422..424
                miasm/os_dep/win_api_x86_32.py on lines 473..475
                miasm/os_dep/win_api_x86_32.py on lines 478..480
                miasm/os_dep/win_api_x86_32.py on lines 590..592
                miasm/os_dep/win_api_x86_32.py on lines 1348..1350
                miasm/os_dep/win_api_x86_32.py on lines 1994..1998
                miasm/os_dep/win_api_x86_32.py on lines 2429..2431
                miasm/os_dep/win_api_x86_32.py on lines 2556..2558
                miasm/os_dep/win_api_x86_32.py on lines 2806..2808
                miasm/os_dep/win_api_x86_32.py on lines 2936..2938
                miasm/os_dep/win_api_x86_32.py on lines 3006..3008

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 32.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 6 locations. Consider refactoring.
                Open

                def kernel32_GetCurrentProcessId(jitter):
                    ret_ad, _ = jitter.func_args_stdcall(0)
                    jitter.func_ret_stdcall(ret_ad, winobjs.dw_pid_cur)
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 5 other locations - About 30 mins to fix
                miasm/os_dep/win_api_x86_32.py on lines 321..323
                miasm/os_dep/win_api_x86_32.py on lines 331..333
                miasm/os_dep/win_api_x86_32.py on lines 374..376
                miasm/os_dep/win_api_x86_32.py on lines 457..459
                miasm/os_dep/win_api_x86_32.py on lines 1002..1004

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 32.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 16 locations. Consider refactoring.
                Open

                def user32_GetTopWindow(jitter):
                    ret_ad, _ = jitter.func_args_stdcall(["hwnd"])
                    jitter.func_ret_stdcall(ret_ad, 0)
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 15 other locations - About 30 mins to fix
                miasm/os_dep/linux_stdlib.py on lines 197..199
                miasm/os_dep/win_api_x86_32.py on lines 293..295
                miasm/os_dep/win_api_x86_32.py on lines 310..312
                miasm/os_dep/win_api_x86_32.py on lines 316..318
                miasm/os_dep/win_api_x86_32.py on lines 412..414
                miasm/os_dep/win_api_x86_32.py on lines 422..424
                miasm/os_dep/win_api_x86_32.py on lines 478..480
                miasm/os_dep/win_api_x86_32.py on lines 590..592
                miasm/os_dep/win_api_x86_32.py on lines 1348..1350
                miasm/os_dep/win_api_x86_32.py on lines 1994..1998
                miasm/os_dep/win_api_x86_32.py on lines 2429..2431
                miasm/os_dep/win_api_x86_32.py on lines 2556..2558
                miasm/os_dep/win_api_x86_32.py on lines 2806..2808
                miasm/os_dep/win_api_x86_32.py on lines 2936..2938
                miasm/os_dep/win_api_x86_32.py on lines 3006..3008

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 32.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 16 locations. Consider refactoring.
                Open

                def kernel32_LocalFree(jitter):
                    ret_ad, _ = jitter.func_args_stdcall(["lpvoid"])
                    jitter.func_ret_stdcall(ret_ad, 0)
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 15 other locations - About 30 mins to fix
                miasm/os_dep/linux_stdlib.py on lines 197..199
                miasm/os_dep/win_api_x86_32.py on lines 310..312
                miasm/os_dep/win_api_x86_32.py on lines 316..318
                miasm/os_dep/win_api_x86_32.py on lines 412..414
                miasm/os_dep/win_api_x86_32.py on lines 422..424
                miasm/os_dep/win_api_x86_32.py on lines 473..475
                miasm/os_dep/win_api_x86_32.py on lines 478..480
                miasm/os_dep/win_api_x86_32.py on lines 590..592
                miasm/os_dep/win_api_x86_32.py on lines 1348..1350
                miasm/os_dep/win_api_x86_32.py on lines 1994..1998
                miasm/os_dep/win_api_x86_32.py on lines 2429..2431
                miasm/os_dep/win_api_x86_32.py on lines 2556..2558
                miasm/os_dep/win_api_x86_32.py on lines 2806..2808
                miasm/os_dep/win_api_x86_32.py on lines 2936..2938
                miasm/os_dep/win_api_x86_32.py on lines 3006..3008

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 32.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 16 locations. Consider refactoring.
                Open

                def kernel32_Sleep(jitter):
                    ret_ad, _ = jitter.func_args_stdcall(['t'])
                    jitter.func_ret_stdcall(ret_ad, 0)
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 15 other locations - About 30 mins to fix
                miasm/os_dep/linux_stdlib.py on lines 197..199
                miasm/os_dep/win_api_x86_32.py on lines 293..295
                miasm/os_dep/win_api_x86_32.py on lines 310..312
                miasm/os_dep/win_api_x86_32.py on lines 316..318
                miasm/os_dep/win_api_x86_32.py on lines 412..414
                miasm/os_dep/win_api_x86_32.py on lines 422..424
                miasm/os_dep/win_api_x86_32.py on lines 473..475
                miasm/os_dep/win_api_x86_32.py on lines 478..480
                miasm/os_dep/win_api_x86_32.py on lines 590..592
                miasm/os_dep/win_api_x86_32.py on lines 1994..1998
                miasm/os_dep/win_api_x86_32.py on lines 2429..2431
                miasm/os_dep/win_api_x86_32.py on lines 2556..2558
                miasm/os_dep/win_api_x86_32.py on lines 2806..2808
                miasm/os_dep/win_api_x86_32.py on lines 2936..2938
                miasm/os_dep/win_api_x86_32.py on lines 3006..3008

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 32.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 16 locations. Consider refactoring.
                Open

                def ntdll_RtlFreeUnicodeString(jitter):
                    ret_ad, args = jitter.func_args_stdcall(['src'])
                    # l1, l2, p_src = struct.unpack('HHI', jitter.vm.get_mem(args.src, 0x8))
                    # s = get_win_str_w(jitter, p_src)
                    jitter.func_ret_stdcall(ret_ad, 0)
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 15 other locations - About 30 mins to fix
                miasm/os_dep/linux_stdlib.py on lines 197..199
                miasm/os_dep/win_api_x86_32.py on lines 293..295
                miasm/os_dep/win_api_x86_32.py on lines 310..312
                miasm/os_dep/win_api_x86_32.py on lines 316..318
                miasm/os_dep/win_api_x86_32.py on lines 412..414
                miasm/os_dep/win_api_x86_32.py on lines 422..424
                miasm/os_dep/win_api_x86_32.py on lines 473..475
                miasm/os_dep/win_api_x86_32.py on lines 478..480
                miasm/os_dep/win_api_x86_32.py on lines 590..592
                miasm/os_dep/win_api_x86_32.py on lines 1348..1350
                miasm/os_dep/win_api_x86_32.py on lines 2429..2431
                miasm/os_dep/win_api_x86_32.py on lines 2556..2558
                miasm/os_dep/win_api_x86_32.py on lines 2806..2808
                miasm/os_dep/win_api_x86_32.py on lines 2936..2938
                miasm/os_dep/win_api_x86_32.py on lines 3006..3008

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 32.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 6 locations. Consider refactoring.
                Open

                def user32_GetForegroundWindow(jitter):
                    ret_ad, _ = jitter.func_args_stdcall(0)
                    jitter.func_ret_stdcall(ret_ad, winobjs.getforegroundwindow)
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 5 other locations - About 30 mins to fix
                miasm/os_dep/win_api_x86_32.py on lines 321..323
                miasm/os_dep/win_api_x86_32.py on lines 331..333
                miasm/os_dep/win_api_x86_32.py on lines 336..338
                miasm/os_dep/win_api_x86_32.py on lines 374..376
                miasm/os_dep/win_api_x86_32.py on lines 1002..1004

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 32.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 6 locations. Consider refactoring.
                Open

                def kernel32_GetVersion(jitter):
                    ret_ad, _ = jitter.func_args_stdcall(0)
                    jitter.func_ret_stdcall(ret_ad, winobjs.getversion)
                Severity: Major
                Found in miasm/os_dep/win_api_x86_32.py and 5 other locations - About 30 mins to fix
                miasm/os_dep/win_api_x86_32.py on lines 321..323
                miasm/os_dep/win_api_x86_32.py on lines 331..333
                miasm/os_dep/win_api_x86_32.py on lines 336..338
                miasm/os_dep/win_api_x86_32.py on lines 457..459
                miasm/os_dep/win_api_x86_32.py on lines 1002..1004

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 32.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 3 locations. Consider refactoring.
                Open

                def kernel32_lstrcmpiA(jitter):
                    my_lstrcmp(jitter, whoami(), lambda x: get_win_str_a(jitter, x).lower())
                Severity: Minor
                Found in miasm/os_dep/win_api_x86_32.py and 2 other locations - About 30 mins to fix
                miasm/os_dep/win_api_x86_32.py on lines 1537..1538
                miasm/os_dep/win_api_x86_32.py on lines 1541..1542

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 32.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 3 locations. Consider refactoring.
                Open

                def kernel32_lstrcmpi(jitter):
                    my_lstrcmp(jitter, whoami(), lambda x: get_win_str_a(jitter, x).lower())
                Severity: Minor
                Found in miasm/os_dep/win_api_x86_32.py and 2 other locations - About 30 mins to fix
                miasm/os_dep/win_api_x86_32.py on lines 1529..1530
                miasm/os_dep/win_api_x86_32.py on lines 1537..1538

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 32.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 3 locations. Consider refactoring.
                Open

                def kernel32_lstrcmpiW(jitter):
                    my_lstrcmp(jitter, whoami(), lambda x: get_win_str_w(jitter, x).lower())
                Severity: Minor
                Found in miasm/os_dep/win_api_x86_32.py and 2 other locations - About 30 mins to fix
                miasm/os_dep/win_api_x86_32.py on lines 1529..1530
                miasm/os_dep/win_api_x86_32.py on lines 1541..1542

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 32.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                There are no issues that match your filters.

                Category
                Status