Function at 0x406380
Capabilities:
Copy file
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x128
mov eax, dword [0x41c4a8]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
mov edi, dword [ebp + 8]
mov ebx, ecx
sub esp, 0x2c
lea eax, [ebx + 0x150]
mov ecx, esp
push eax
mov dword [ebp - 0xd0], edi
mov dword [ebp - 0xe0], eax
call fcn.00404640
lea eax, [ebp - 0xcc]
push eax
mov ecx, ebx
call fcn.00404db0
mov eax, dword [ebp - 0xcc]
test eax, eax
jns 0x4063e7
mov dword [edi], eax
mov eax, edi
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040b16b
mov esp, ebp
pop ebp
ret 4
mov ecx, dword [ebx + 0x3c]
xor edx, edx
add ecx, dword [ebx + 0x138]
push 0
adc edx, dword [ebx + 0x13c]
mov dword [ebp - 0xdc], ecx
mov dword [ebp - 0xd8], edx
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov ecx, dword [ebp - 0xdc]
mov edx, dword [ebx + 0x130]
push 0
lea eax, [ebp - 0xd8]
push eax
lea esi, [ebx + 0x130]
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
xor ecx, ecx
mov dword [ebp - 0xdc], eax
and eax, ecx
cmp eax, 0xffffffff
je 0x406448
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
je 0x40644e
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, dword [esi]
push 0
lea eax, [ebp - 0xcc]
push eax
push 5
lea ecx, [ebp - 0xc]
push ecx
push edx
mov dword [ebp - 0xcc], 0
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x40647c
call dword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x406485
cmp dword [ebp - 0xcc], 0
je 0x40648e
cmp dword [ebp - 0xcc], 5
je 0x4064a9
mov dword [edi], 0x8007001e
mov eax, edi
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040b16b
mov esp, ebp
pop ebp
ret 4
push 0xd0
call fcn.00408710
add esp, 4
test eax, eax
je 0x406504
mov ecx, eax
call fcn.00409080
mov edi, eax
mov dword [ebp - 0xd4], edi
test edi, edi
je 0x4064d5
mov eax, dword [edi]
mov ecx, dword [eax + 4]
push edi
call ecx
mov edx, dword [edi + 4]
mov edx, dword [edx + 0xc]
lea eax, [edi + 4]
push 5
lea ecx, [ebp - 0xc]
push ecx
push eax
call edx
test eax, eax
je 0x40650e
mov esi, dword [ebp - 0xd0]
mov dword [esi], 0x8007054f
mov eax, dword [edi]
mov ecx, dword [eax + 8]
push edi
call ecx
jmp 0x406ecb
xor edi, edi
mov dword [ebp - 0xd4], edi
jmp 0x4064d5
mov edx, dword [ebx + 0x40]
mov ecx, dword [ebx + 0x140]
mov dword [ebp - 0xf0], edx
mov edx, dword [ebx + 0x144]
mov dword [ebp - 0xe8], ecx
xor eax, eax
mov dword [ebp - 0xe4], edx
lea ecx, [ebp - 0x128]
push ecx
lea edx, [ebp - 0xe8]
push edx
lea ecx, [ebp - 0xf0]
push ecx
mov dword [ebp - 0x120], eax
mov dword [ebp - 0x118], eax
mov dword [ebp - 0x114], eax
mov dword [ebp - 0x10c], eax
mov dword [ebp - 0x108], eax
mov eax, dword [ebx + 0x44]
lea edx, [ebp - 0x124]
push edx
lea ecx, [ebp - 0xfc]
mov dword [ebp - 0x128], 0x417508
mov dword [ebp - 0x124], 0x4174f4
mov dword [ebp - 0x110], ebx
mov dword [ebp - 0x100], 0x417530
mov dword [ebp - 0xfc], 0x41751c
mov dword [ebp - 0xf4], esi
mov dword [ebp - 0xf8], 1
mov dword [ebp - 0xec], eax
mov eax, dword [edi]
mov edx, dword [eax + 0xc]
push ecx
push edi
call edx
test eax, eax
jns 0x4065da
mov esi, dword [ebp - 0xd0]
mov dword [esi], eax
mov eax, dword [edi]
mov ecx, dword [eax + 8]
push edi
call ecx
jmp 0x406ecb
cmp dword [ebx + 0x12c], 0
mov dword [ebp - 0xc0], 0
jbe 0x406884
jmp 0x406600
mov edx, dword [ebx + 0x124]
mov eax, dword [ebp - 0xc0]
mov esi, dword [edx + eax*8 + 4]
add esi, dword [ebx + 4]
mov eax, esi
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x406618
sub eax, edx
mov edi, eax
cmp edi, 0x10
jb 0x406636
lea ecx, [edi + 1]
push ecx
call fcn.0040ae86
add esp, 4
jmp 0x406639
lea eax, [ebp - 0x1c]
mov dword [ebp - 0x28], eax
inc edi
mov dword [ebp - 0x20], edi
mov dword [ebp - 0x24], 0
mov byte [eax], 0
mov edx, dword [ebp - 0x20]
mov eax, dword [ebp - 0x28]
dec edx
push edx
push esi
push eax
call fcn.0040b460
mov ecx, dword [ebp - 0x20]
add esp, 0xc
lea eax, [ecx - 1]
test ecx, ecx
jne 0x40666a
xor eax, eax
jmp 0x406671
mov ecx, dword [ebp - 0x28]
mov byte [ecx + eax], 0
lea edx, [ebp - 0x28]
mov dword [ebp - 0x24], eax
push edx
lea eax, [ebp - 0xbc]
push eax
call fcn.00401300
mov ecx, dword [ebp - 0xe0]
push eax
push ecx
lea edx, [ebp - 0x90]
push edx
call fcn.00405f30
mov eax, dword [ebp - 0xbc]
add esp, 0x14
test eax, eax
je 0x4066b8
lea ecx, [ebp - 0xb0]
cmp eax, ecx
je 0x4066b8
push eax
call fcn.0040af1a
add esp, 4
mov eax, dword [ebp - 0x28]
test eax, eax
je 0x4066cf
lea edx, [ebp - 0x1c]
cmp eax, edx
je 0x4066cf
push eax
call fcn.0040af1a
add esp, 4
mov eax, dword [ebx + 0x124]
mov ecx, dword [ebp - 0xc0]
mov esi, dword [eax + ecx*8]
add esi, dword [ebx + 4]
mov eax, esi
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x4066e6
sub eax, edx
mov edi, eax
cmp edi, 0x10
jb 0x406704
lea edx, [edi + 1]
push edx
call fcn.0040ae86
add esp, 4
jmp 0x406707
lea eax, [ebp - 0x1c]
mov dword [ebp - 0x28], eax
inc edi
mov dword [ebp - 0x20], edi
mov dword [ebp - 0x24], 0
mov byte [eax], 0
mov eax, dword [ebp - 0x20]
mov ecx, dword [ebp - 0x28]
dec eax
push eax
push esi
push ecx
call fcn.0040b460
mov ecx, dword [ebp - 0x20]
add esp, 0xc
lea eax, [ecx - 1]
test ecx, ecx
jne 0x406738
xor eax, eax
jmp 0x40673f
mov edx, dword [ebp - 0x28]
mov byte [edx + eax], 0
mov dword [ebp - 0x24], eax
lea eax, [ebp - 0x28]
push eax
lea ecx, [ebp - 0xbc]
push ecx
call fcn.00401300
mov edx, dword [ebp - 0xe0]
push eax
push edx
lea eax, [ebp - 0x64]
push eax
call fcn.00405f30
mov eax, dword [ebp - 0xbc]
add esp, 0x14
test eax, eax
je 0x406783
lea ecx, [ebp - 0xb0]
cmp eax, ecx
je 0x406783
push eax
call fcn.0040af1a
add esp, 4
mov eax, dword [ebp - 0x28]
test eax, eax
je 0x40679a
lea edx, [ebp - 0x1c]
cmp eax, edx
je 0x40679a
push eax
call fcn.0040af1a
add esp, 4
mov eax, dword [ebp - 0x64]
test eax, eax
jne 0x4067a6
mov eax, 0x41a184
push 0
push 0
push 3
push 0
push 3
push 0
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
cmp eax, 0xffffffff
je 0x4067d8
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea eax, [ebp - 0x64]
push eax
lea ecx, [ebp - 0xcc]
push ecx
call fcn.00404210
add esp, 8
cmp byte [ebx + 0x17c], 0
je 0x406837
mov ecx, dword [ebp - 0x90]
test ecx, ecx
jne 0x4067f0
mov ecx, 0x41a184
mov eax, dword [ebp - 0x64]
test eax, eax
jne 0x4067fc
mov eax, 0x41a184
push 0
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_CreateHardLinkW]
test eax, eax
jne 0x406837
mov ecx, dword [ebp - 0x64]
test ecx, ecx
jne 0x406816
mov ecx, 0x41a184
mov eax, dword [ebp - 0x90]
test eax, eax
jne 0x406825
mov eax, 0x41a184
push 0
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_CopyFileW]
test eax, eax
je 0x406994
mov eax, dword [ebp - 0x64]
test eax, eax
je 0x40684e
lea edx, [ebp - 0x58]
cmp eax, edx
je 0x40684e
push eax
call fcn.0040af1a
add esp, 4
mov eax, dword [ebp - 0x90]
test eax, eax
je 0x40686b
lea ecx, [ebp - 0x84]
cmp eax, ecx
je 0x40686b
push eax
call fcn.0040af1a
add esp, 4
mov eax, dword [ebp - 0xc0]
inc eax
mov dword [ebp - 0xc0], eax
cmp eax, dword [ebx + 0x12c]
jb 0x406600
cmp byte [ebx + 0x98], 0
mov edi, dword [sym.imp.ADVAPI32.dll_RegCreateKeyExW]
lea ecx, [ebx + 0x98]
je 0x406be0
mov eax, ecx
lea esi, [eax + 1]
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x4068a2
mov dword [ebp - 0xdc], ecx
lea ecx, [ebp - 0xdc]
push ecx
lea edx, [ebp - 0x64]
sub eax, esi
push edx
mov dword [ebp - 0xd8], eax
call fcn.00401300
mov eax, dword [ebp - 0x64]
add esp, 8
test eax, eax
jne 0x4068d6
mov eax, 0x41a184
push eax
lea eax, [ebp - 0x38]
push str.SOFTWAREFree_Software_Foundation_s
push eax
call fcn.00404740
mov ecx, dword [ebp - 0x38]
add esp, 0xc
test ecx, ecx
jne 0x4068f4
mov ecx, 0x41a184
push 0
xor eax, eax
cmp byte [ebx + 0x17e], al
lea edx, [ebp - 0xc0]
push edx
push 0
push 0xf003f
push 0
setne al
push 0
push 0
push ecx
mov dword [ebp - 0xc0], 0
add eax, 0x80000001
push eax
call edi
test eax, eax
jle 0x406938
and eax, 0xffff
or eax, 0x80070000
test eax, eax
jns 0x4069fa
mov esi, dword [ebp - 0xd0]
mov dword [esi], eax
mov eax, dword [ebp - 0xc0]
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, dword [ebp - 0x38]
test eax, eax
je 0x40696a
lea ecx, [ebp - 0x2c]
cmp eax, ecx
je 0x40696a
push eax
call fcn.0040af1a
add esp, 4
mov eax, dword [ebp - 0x64]
test eax, eax
je 0x406981
lea edx, [ebp - 0x58]
cmp eax, edx
je 0x406981
push eax
call fcn.0040af1a
add esp, 4
mov eax, dword [ebp - 0xd4]
mov ecx, dword [eax]
mov edx, dword [ecx + 8]
push eax
call edx
jmp 0x406ecb
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
je 0x4069ac
jle 0x4069b1
and eax, 0xffff
or eax, 0x80070000
jmp 0x4069b1
mov eax, 0x8007054f
mov esi, dword [ebp - 0xd0]
mov dword [esi], eax
mov eax, dword [ebp - 0x64]
test eax, eax
je 0x4069d0
lea edx, [ebp - 0x58]
cmp eax, edx
je 0x4069d0
push eax
call fcn.0040af1a
add esp, 4
mov eax, dword [ebp - 0x90]
test eax, eax
je 0x406ebd
lea ecx, [ebp - 0x84]
cmp eax, ecx
je 0x406ebd
push eax
call fcn.0040af1a
add esp, 4
jmp 0x406ebd
mov esi, dword [ebp - 0xe0]
mov ecx, dword [esi + 4]
lea eax, [ebp - 0xc0]
mov dword [ebp - 0xc4], eax
mov eax, dword [esi]
mov dword [ebp - 0xc8], str.BINUTILS
test eax, eax
jne 0x406a24
mov eax, 0x41a184
push 1
push ecx
push eax
lea ecx, [ebp - 0xd8]
push ecx
lea ecx, [ebp - 0xc8]
call fcn.00401700
mov eax, dword [esi]
mov ecx, dword [esi + 4]
lea edx, [ebp - 0xc0]
mov dword [ebp - 0xc8], 0x4179c8
mov dword [ebp - 0xc4], edx
test eax, eax
jne 0x406a5e
mov eax, 0x41a184
push 1
push ecx
push eax
lea eax, [ebp - 0xd8]
push eax
lea ecx, [ebp - 0xc8]
call fcn.00401700
mov eax, dword [esi]
lea ecx, [ebp - 0xc0]
mov dword [ebp - 0xc4], ecx
mov ecx, dword [esi + 4]
mov dword [ebp - 0xc8], 0x4179c0
test eax, eax
jne 0x406a98
mov eax, 0x41a184
push 1
push ecx
push eax
lea edx, [ebp - 0xd8]
push edx
lea ecx, [ebp - 0xc8]
call fcn.00401700
push 0
xor eax, eax
cmp byte [ebx + 0x17e], al
lea ecx, [ebp - 0xcc]
push ecx
push 0
push 0xf003f
push 0
setne al
push 0
push 0
push str.SOFTWARESysprogsGNUToolchains
mov dword [ebp - 0xcc], 0
add eax, 0x80000001
push eax
call edi
test eax, eax
jle 0x406af6
and eax, 0xffff
or eax, 0x80070000
test eax, eax
jns 0x406b69
mov edx, dword [ebp - 0xcc]
mov edi, dword [ebp - 0xd0]
mov esi, dword [sym.imp.ADVAPI32.dll_RegCloseKey]
push edx
mov dword [edi], eax
call esi
mov eax, dword [ebp - 0xc0]
push eax
call esi
mov eax, dword [ebp - 0x38]
test eax, eax
je 0x406b2f
lea ecx, [ebp - 0x2c]
cmp eax, ecx
je 0x406b2f
push eax
call fcn.0040af1a
add esp, 4
mov eax, dword [ebp - 0x64]
test eax, eax
je 0x406b46
lea edx, [ebp - 0x58]
cmp eax, edx
je 0x406b46
push eax
call fcn.0040af1a
add esp, 4
mov eax, dword [ebp - 0xd4]
mov ecx, dword [eax]
mov edx, dword [ecx + 8]
push eax
call edx
mov eax, edi
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040b16b
mov esp, ebp
pop ebp
ret 4
mov eax, dword [ebp - 0x64]
test eax, eax
jne 0x406b75
mov eax, 0x41a184
push esi
lea ecx, [ebp - 0xd8]
mov dword [ebp - 0xc8], eax
lea eax, [ebp - 0xcc]
push ecx
lea ecx, [ebp - 0xc8]
mov dword [ebp - 0xc4], eax
call fcn.00404270
mov edx, dword [ebp - 0xcc]
mov esi, dword [sym.imp.ADVAPI32.dll_RegCloseKey]
push edx
call esi
mov eax, dword [ebp - 0xc0]
push eax
call esi
mov eax, dword [ebp - 0x38]
test eax, eax
je 0x406bc9
lea ecx, [ebp - 0x2c]
cmp eax, ecx
je 0x406bc9
push eax
call fcn.0040af1a
add esp, 4
mov eax, dword [ebp - 0x64]
test eax, eax
je 0x406be0
lea edx, [ebp - 0x58]
cmp eax, edx
je 0x406be0
push eax
call fcn.0040af1a
add esp, 4
cmp byte [ebx + 0x17d], 0
je 0x406eb1
cmp byte [ebx + 0x17e], 0
mov dword [ebp - 0xc0], 0
push 0
je 0x406d54
lea eax, [ebp - 0xc0]
push eax
push 0
push 0xf003f
push 0
push 0
push 0
push str.SystemCurrentControlSetControlSession_ManagerEnvironment
push 0x80000002
call edi
test eax, eax
jle 0x406c36
and eax, 0xffff
or eax, 0x80070000
test eax, eax
jns 0x406c52
mov ecx, dword [ebp - 0xc0]
mov esi, dword [ebp - 0xd0]
push ecx
mov dword [esi], eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
jmp 0x406ebd
lea ecx, [ebp - 0xc0]
lea edx, [ebp - 0xbc]
mov dword [ebp - 0xc4], ecx
mov esi, str.Path
push edx
lea ecx, [ebp - 0xc8]
mov dword [ebp - 0xc8], esi
call fcn.00405810
lea eax, [ebp - 0xbc]
push eax
lea ecx, [ebp - 0x90]
call fcn.00404640
lea ecx, [ebp - 0xbc]
call fcn.00401000
mov ecx, dword [ebp - 0xe0]
push 0x4178e8
push ecx
lea edx, [ebp - 0x64]
push edx
call fcn.00404f50
mov eax, dword [ebp - 0x60]
mov ecx, dword [ebp - 0x64]
add esp, 0xc
push eax
push 0
push ecx
lea ecx, [ebp - 0x90]
call fcn.00401d70
cmp eax, 0xffffffff
jne 0x406d35
push 0x4178e4
lea ecx, [ebp - 0x90]
call fcn.00404850
push 0xffffffffffffffff
push 0
lea edx, [ebp - 0x64]
push edx
lea ecx, [ebp - 0x90]
call fcn.004048d0
mov eax, dword [ebp - 0x90]
test eax, eax
jne 0x406cfc
mov eax, 0x41a184
lea ecx, [ebp - 0xc0]
push eax
lea edx, [ebp - 0xd8]
mov dword [ebp - 0xc4], ecx
push edx
lea ecx, [ebp - 0xc8]
mov dword [ebp - 0xc8], esi
call fcn.00401790
push str.Environment
push 1
push 0x1a
push 0xffff
call dword [sym.imp.USER32.dll_SendMessageW]
lea ecx, [ebp - 0x64]
call fcn.00401000
lea ecx, [ebp - 0x90]
call fcn.00401000
mov eax, dword [ebp - 0xc0]
push eax
jmp 0x406eab
lea ecx, [ebp - 0xc0]
push ecx
push 0
push 0xf003f
push 0
push 0
push 0
push str.Environment
push 0x80000001
call edi
test eax, eax
jle 0x406d84
and eax, 0xffff
or eax, 0x80070000
test eax, eax
jns 0x406dae
mov edx, dword [ebp - 0xc0]
mov esi, dword [ebp - 0xd0]
push edx
mov dword [esi], eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, dword [ebp - 0xd4]
mov ecx, dword [eax]
mov edx, dword [ecx + 8]
push eax
call edx
jmp 0x406ecb
lea ecx, [ebp - 0xbc]
lea eax, [ebp - 0xc0]
push ecx
mov esi, str.Path
lea ecx, [ebp - 0xc8]
mov dword [ebp - 0xc8], esi
mov dword [ebp - 0xc4], eax
call fcn.00405810
lea edx, [ebp - 0xbc]
push edx
lea ecx, [ebp - 0x90]
call fcn.00404640
lea ecx, [ebp - 0xbc]
call fcn.00401000
mov eax, dword [ebp - 0xe0]
push 0x4178e8
push eax
lea ecx, [ebp - 0x64]
push ecx
call fcn.00404f50
mov edx, dword [ebp - 0x60]
mov eax, dword [ebp - 0x64]
add esp, 0xc
push edx
push 0
push eax
lea ecx, [ebp - 0x90]
call fcn.00401d70
cmp eax, 0xffffffff
jne 0x406e91
push 0x4178e4
lea ecx, [ebp - 0x90]
call fcn.00404850
push 0xffffffffffffffff
push 0
lea ecx, [ebp - 0x64]
push ecx
lea ecx, [ebp - 0x90]
call fcn.004048d0
mov eax, dword [ebp - 0x90]
test eax, eax
jne 0x406e58
mov eax, 0x41a184
push eax
lea eax, [ebp - 0xd8]
lea edx, [ebp - 0xc0]
push eax
lea ecx, [ebp - 0xc8]
mov dword [ebp - 0xc8], esi
mov dword [ebp - 0xc4], edx
call fcn.00401790
push str.Environment
push 0
push 0x1a
push 0xffff
call dword [sym.imp.USER32.dll_SendMessageW]
lea ecx, [ebp - 0x64]
call fcn.00401000
lea ecx, [ebp - 0x90]
call fcn.00401000
mov ecx, dword [ebp - 0xc0]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov esi, dword [ebp - 0xd0]
mov dword [esi], 0
mov eax, dword [ebp - 0xd4]
mov edx, dword [eax]
push eax
mov eax, dword [edx + 8]
call eax
mov ecx, dword [ebp - 4]
pop edi
mov eax, esi
pop esi
xor ecx, ebp
pop ebx
call fcn.0040b16b
mov esp, ebp
pop ebp
ret 4