Function at 0x40839d
Capabilities:
Copy file
Delete file
Get common file path
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x48
push ebx
push esi
push edi
mov eax, 0x4542e0
lea ecx, [ebp - 0x48]
mov dx, word [eax]
mov word [ecx], dx
mov al, byte [eax + 2]
mov byte [ecx + 2], al
mov esi, str.device_SystemRoot__system32haspdos.sys
lea edi, [ebp - 0x44]
mov ecx, 0xa
rep movsd dword es:[edi], dword [esi]
movsb byte es:[edi], byte [esi]
push 0x2710
push 0x40
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov dword [0x4230c0], eax
cmp dword [0x4230c0], 0
jne 0x4083fd
push 5
call fcn.004054a2
add esp, 4
mov eax, 0xffffffff
jmp 0x408b02
push 0x64
push 0x423050
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
push 0x454310
push 0x423050
call fcn.0041a84c
add esp, 8
push 0x423050
push 0x422ee0
call fcn.0041a850
add esp, 8
push 0x454314
push 0x423050
call fcn.0041a84c
add esp, 8
push str.config.hsp
push 0x422ee0
call fcn.0041a84c
add esp, 8
cmp dword [ebp + 8], 0
jne 0x40846e
push 0
push 0x422ee0
push 0x423050
call dword [sym.imp.KERNEL32.dll_CopyFileA]
push 0
push pe_nt_image_headers32
push 4
push 0x423140
push 0
push 0x80000000
push 0x423050
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [0x4230b4], eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
jne 0x4084ac
push 0
call dword [sym.imp.KERNEL32.dll_SetLastError]
cmp dword [0x4230b4], 0xffffffff
jne 0x4084dc
push 0x40003
call fcn.004054a2
add esp, 4
mov eax, dword [0x4230c0]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov eax, 0xffffffff
jmp 0x408b02
push 0
lea eax, [ebp - 8]
push eax
push 0x270f
mov eax, dword [0x4230c0]
push eax
mov eax, dword [0x4230b4]
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0
jne 0x408535
push 0x4000a
call fcn.004054a2
add esp, 4
mov eax, dword [0x4230c0]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov eax, dword [0x4230b4]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, 0xffffffff
jmp 0x408b02
mov eax, dword [0x4230b4]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
jne 0x40856c
push 0x40005
call fcn.004054a2
add esp, 4
mov eax, dword [0x4230c0]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov eax, 0xffffffff
jmp 0x408b02
mov dword [ebp - 4], 1
mov dword [ebp - 0x14], 0
jmp 0x408582
inc dword [ebp - 0x14]
mov eax, dword [ebp - 0x14]
cmp dword [ebp - 8], eax
jbe 0x40860f
cmp dword [ebp - 4], 1
jne 0x40860f
mov eax, dword [ebp - 0x14]
mov ecx, dword [0x4230c0]
mov al, byte [eax + ecx]
and eax, 0xff
movsx ecx, byte [0x454090]
cmp eax, ecx
jne 0x40860a
mov dword [ebp - 4], 0
mov dword [ebp - 0x18], 0
jmp 0x4085ce
inc dword [ebp - 0x18]
cmp dword [ebp - 0x18], 0xb
jae 0x40860a
mov eax, dword [ebp - 0x18]
add eax, dword [ebp - 0x14]
mov ecx, dword [0x4230c0]
mov al, byte [eax + ecx]
and eax, 0xff
mov ecx, dword [ebp - 0x18]
movsx ecx, byte [ecx + 0x454090]
cmp eax, ecx
je 0x408605
mov dword [ebp - 4], 1
jmp 0x4085cb
jmp 0x40857f
mov eax, dword [ebp - 0x14]
cmp dword [ebp - 8], eax
jne 0x40880b
cmp dword [ebp - 4], 1
jne 0x40880b
cmp dword [ebp + 8], 0
jne 0x4087f3
mov eax, dword [ebp - 8]
mov ecx, dword [0x4230c0]
mov al, byte [eax + ecx - 1]
and eax, 0xff
cmp eax, 0x1a
jne 0x408652
dec dword [ebp - 8]
jmp 0x408672
mov eax, dword [ebp - 8]
mov ecx, dword [0x4230c0]
mov byte [eax + ecx], 0xd
inc dword [ebp - 8]
mov eax, dword [ebp - 8]
mov ecx, dword [0x4230c0]
mov byte [eax + ecx], 0xa
inc dword [ebp - 8]
mov dword [ebp - 0x18], 0
mov eax, dword [ebp - 8]
mov dword [ebp - 0x14], eax
jmp 0x40868a
inc dword [ebp - 0x14]
inc dword [ebp - 0x18]
mov eax, dword [ebp - 0x18]
mov al, byte [ebp + eax - 0x44]
and eax, 0xff
test eax, eax
je 0x4086b6
mov eax, dword [ebp - 0x18]
mov al, byte [ebp + eax - 0x44]
mov ecx, dword [ebp - 0x14]
mov edx, dword [0x4230c0]
mov byte [ecx + edx], al
jmp 0x408684
mov eax, dword [ebp - 0x14]
mov ecx, dword [0x4230c0]
mov byte [eax + ecx], 0xd
mov eax, dword [ebp - 0x14]
mov ecx, dword [0x4230c0]
mov byte [eax + ecx + 1], 0xa
push 0x64
push 0x423050
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
push 0x45432c
push 0x423050
call fcn.0041a84c
add esp, 8
push 0x454330
push 0x423050
call fcn.0041a84c
add esp, 8
push 0
push pe_nt_image_headers32
push 4
push 0x423140
push 0
push 0xc0000000
push 0x423050
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [0x4230b4], eax
cmp dword [0x4230b4], 0xffffffff
jne 0x408757
push 0x40003
call fcn.004054a2
add esp, 4
mov eax, dword [0x4230c0]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov eax, 0xffffffff
jmp 0x408b02
push 0
lea eax, [ebp - 8]
push eax
mov eax, dword [ebp - 0x14]
inc eax
push eax
mov eax, dword [0x4230c0]
push eax
mov eax, dword [0x4230b4]
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0
jne 0x4087a4
push 0x40004
call fcn.004054a2
add esp, 4
mov eax, dword [0x4230c0]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov eax, 0xffffffff
jmp 0x408b02
mov eax, dword [0x4230b4]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
jne 0x4087db
push 0x40005
call fcn.004054a2
add esp, 4
mov eax, dword [0x4230c0]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov eax, 0xffffffff
jmp 0x408b02
mov eax, dword [0x4230c0]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
xor eax, eax
jmp 0x408b02
mov eax, dword [0x4230c0]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
xor eax, eax
jmp 0x408b02
dec dword [ebp - 0x14]
jmp 0x408816
dec dword [ebp - 0x14]
mov eax, dword [ebp - 0x14]
mov ecx, dword [0x4230c0]
mov al, byte [eax + ecx]
and eax, 0xff
cmp eax, 0xa
je 0x408835
jmp 0x408813
inc dword [ebp - 0x14]
jmp 0x408840
inc dword [ebp - 0x14]
mov eax, dword [ebp - 0x14]
mov ecx, dword [0x4230c0]
mov al, byte [eax + ecx]
and eax, 0xff
cmp eax, 0x14
jne 0x40885f
jmp 0x40883d
mov dword [ebp - 4], 0
mov dword [ebp - 0x18], 0
jmp 0x408875
inc dword [ebp - 0x18]
cmp dword [ebp - 0x18], 3
jae 0x4088e0
mov eax, dword [ebp - 0x18]
add eax, dword [ebp - 0x14]
mov ecx, dword [0x4230c0]
mov al, byte [eax + ecx]
and eax, 0xff
mov ecx, dword [ebp - 0x18]
mov cl, byte [ebp + ecx - 0x48]
and ecx, 0xff
cmp eax, ecx
je 0x4088db
mov eax, dword [ebp - 0x18]
add eax, dword [ebp - 0x14]
mov ecx, dword [0x4230c0]
mov al, byte [eax + ecx]
and eax, 0xff
mov ecx, dword [ebp - 0x18]
mov cl, byte [ebp + ecx - 0x48]
and ecx, 0xff
sub ecx, 0x20
cmp eax, ecx
je 0x4088db
mov dword [ebp - 4], 1
jmp 0x408872
cmp dword [ebp - 4], 1
jne 0x408929
cmp dword [ebp + 8], 1
jne 0x408929
mov eax, dword [0x4230c0]
push eax
mov eax, dword [ebp - 8]
push eax
mov eax, dword [ebp - 0x14]
push eax
call fcn.00408b07
add esp, 0xc
cmp eax, 0xffffffff
jne 0x408929
mov eax, dword [0x4230c0]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov eax, 0xffffffff
jmp 0x408b02
cmp dword [ebp - 4], 1
jne 0x408944
cmp dword [ebp + 8], 0
jne 0x408944
xor eax, eax
jmp 0x408b02
cmp dword [ebp - 4], 0
jne 0x40896b
cmp dword [ebp + 8], 1
jne 0x40896b
mov eax, dword [0x4230c0]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
xor eax, eax
jmp 0x408b02
cmp dword [ebp - 4], 0
jne 0x408aef
cmp dword [ebp + 8], 0
jne 0x408aef
jmp 0x408987
inc dword [ebp - 0x14]
mov eax, dword [ebp - 0x14]
cmp dword [ebp - 8], eax
jbe 0x4089b1
mov eax, dword [ebp - 0x14]
mov ecx, dword [0x4230c0]
mov al, byte [eax + ecx + 4]
mov ecx, dword [ebp - 0x14]
mov edx, dword [0x4230c0]
mov byte [ecx + edx], al
jmp 0x408984
sub dword [ebp - 0x14], 4
mov eax, dword [ebp - 0x14]
mov ecx, dword [0x4230c0]
mov byte [eax + ecx], 0xd
mov eax, dword [ebp - 0x14]
mov ecx, dword [0x4230c0]
mov byte [eax + ecx + 1], 0xa
add dword [ebp - 0x14], 2
push 0x64
push 0x423050
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
push 0x45433c
push 0x423050
call fcn.0041a84c
add esp, 8
push 0x454340
push 0x423050
call fcn.0041a84c
add esp, 8
push 0x423050
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
push 0
push pe_nt_image_headers32
push 2
push 0x423140
push 0
push 0xc0000000
push 0x423050
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [0x4230b4], eax
cmp dword [0x4230b4], 0xffffffff
jne 0x408a65
push 0x40003
call fcn.004054a2
add esp, 4
mov eax, dword [0x4230c0]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov eax, 0xffffffff
jmp 0x408b02
push 0
lea eax, [ebp - 0xc]
push eax
mov eax, dword [ebp - 0x14]
push eax
mov eax, dword [0x4230c0]
push eax
mov eax, dword [0x4230b4]
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0
jne 0x408ab1
push 0x40003
call fcn.004054a2
add esp, 4
mov eax, dword [0x4230c0]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov eax, 0xffffffff
jmp 0x408b02
mov eax, dword [0x4230b4]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
jne 0x408ae8
push 0x40005
call fcn.004054a2
add esp, 4
mov eax, dword [0x4230c0]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov eax, 0xffffffff
jmp 0x408b02
xor eax, eax
jmp 0x408b02
mov eax, dword [0x4230c0]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
xor eax, eax
jmp 0x408b02
pop edi
pop esi
pop ebx
leave
ret