Function at 0x405460
Capabilities:
Enumerate files on windows
Get file size
Print debug messages
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x104b4
call fcn.00419e90
mov eax, dword [0x424008]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
mov edi, ecx
mov dword [ebp - 0x10474], edx
lea eax, [ebp - 0x110]
lea ebx, [edi + 2]
push ebx
push 0x42520c
push 0x420870
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x10
push ebx
call dword [sym.imp.KERNEL32.dll_lstrlenA]
mov esi, eax
test esi, esi
je 0x4054bc
nop dword [eax]
cmp byte [edi + esi + 1], 0x5c
je 0x4054bc
sub esi, 1
jne 0x4054b0
push 0x104
lea eax, [ebp - 0x320]
push 0
push eax
call fcn.0040bcd0
add esp, 0xc
lea eax, [ebp - 0x320]
push esi
push ebx
push eax
call fcn.0040d140
add esp, 0xc
lea eax, [ebp - 0x10460]
push eax
lea eax, [ebp - 0x110]
push eax
call dword [sym.imp.KERNEL32.dll_FindFirstFileA]
mov esi, eax
mov dword [ebp - 0x10470], esi
cmp esi, 0xffffffff
jne 0x40552a
push 0x30
push edi
push dword [0x4207cc]
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
xor eax, eax
xor edx, edx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040aa0f
mov esp, ebp
pop ebp
ret
xorps xmm0, xmm0
xor edi, edi
movlpd qword [ebp - 0x10490], xmm0
mov ebx, dword [ebp - 0x1048c]
mov dword [ebp - 0x1046c], ebx
mov ebx, dword [ebp - 0x10490]
mov dword [ebp - 0x10468], ebx
nop
mov ecx, 0x4211c4
lea eax, [ebp - 0x10434]
nop dword [eax + eax]
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x405580
test dl, dl
je 0x40557c
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x405580
add eax, 2
add ecx, 2
test dl, dl
jne 0x405560
xor eax, eax
jmp 0x405585
sbb eax, eax
or eax, 1
test eax, eax
je 0x4058fd
mov ecx, 0x4211c8
lea eax, [ebp - 0x10434]
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x4055b8
test dl, dl
je 0x4055b4
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x4055b8
add eax, 2
add ecx, 2
test dl, dl
jne 0x405598
xor eax, eax
jmp 0x4055bd
sbb eax, eax
or eax, 1
test eax, eax
je 0x4058fd
test byte [ebp - 0x10460], 0x10
jne 0x4058fd
mov ebx, dword [ebp - 0x10474]
mov esi, 1
mov dword [ebp - 0x10478], 0xa
nop word [eax + eax]
lea eax, [ebp - 0x10434]
push eax
lea eax, [ebp - 0x320]
push eax
lea eax, [ebp - 0x110]
push str._s_s
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
mov edx, ebx
lea ecx, [ebp - 0x110]
call fcn.00404ea0
mov dword [ebp - 0x1048c], eax
lea eax, [ebp - 0x110]
push eax
push 0x42520c
lea eax, [ebp - 0x218]
push 0x420870
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x20
lea eax, [ebp - 0x218]
push 0
push 0x80
push 3
push 0
push 1
push 0x80000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 0x10464], eax
cmp eax, 0xffffffff
jne 0x4056ce
mov ecx, dword [ebp - 0x10478]
mov eax, ecx
dec ecx
mov dword [ebp - 0x10478], ecx
test eax, eax
jne 0x4058ef
mov dl, 0x46
lea ecx, [ebp - 0x110]
call fcn.00404990
push 0x30
lea eax, [ebp - 0x218]
push eax
push dword [0x4207cc]
push dword [0x425188]
call dword [sym.imp.USER32.dll_MessageBoxA]
push dword [ebp - 0x10470]
call dword [sym.imp.KERNEL32.dll_FindClose]
xor eax, eax
xor edx, edx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040aa0f
mov esp, ebp
pop ebp
ret
lea eax, [ebp - 0x110]
push eax
push 0x425854
lea eax, [ebp - 0x218]
push 0x420870
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x10
lea eax, [ebp - 0x218]
push 0
push 0x80
push 2
push 0
push 2
push 0x40000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
xor esi, esi
mov dword [ebp - 0x1047c], eax
push esi
push dword [ebp - 0x10464]
mov dword [ebp - 0x10488], esi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ecx, eax
mov dword [ebp - 0x10480], eax
sub ecx, dword [ebx + 8]
xor edx, edx
mov dword [ebx + 8], ecx
mov ecx, eax
or ecx, edx
mov dword [ebp - 0x10484], edx
je 0x405878
nop dword [eax]
mov ebx, dword [ebp - 0x10464]
lea eax, [ebp - 0x10494]
push 0
push eax
push 0xfffc
lea eax, [ebp - 0x10320]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x405991
mov ebx, dword [ebp - 0x10494]
add dword [ebp - 0x10468], ebx
adc dword [ebp - 0x1046c], 0
sub dword [ebp - 0x10480], ebx
sbb dword [ebp - 0x10484], 0
cmp dword [ebp - 0x1048c], 0
je 0x4057e9
xor eax, eax
test ebx, ebx
je 0x4057e9
mov ecx, dword [ebp - 0x10474]
mov edx, dword [ecx + 0xc]
test edx, edx
je 0x4057c2
cmp edx, esi
jne 0x4057c2
mov edi, 0xc
dec edi
jmp 0x4057dd
test edi, edi
je 0x4057c9
dec edi
jmp 0x4057dd
movzx ecx, byte [ebp + eax - 0x10320]
add dword [ebp - 0x10488], ecx
mov ecx, dword [ebp - 0x10474]
inc esi
add dword [ecx + 8], 0xffffffff
je 0x4057e9
inc eax
cmp eax, ebx
jb 0x4057b2
push 0
lea eax, [ebp - 0x10498]
push eax
push ebx
mov ebx, dword [ebp - 0x1047c]
lea eax, [ebp - 0x10320]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x405937
mov ecx, dword [ebp - 0x10468]
add ecx, dword [ebp + 8]
mov eax, dword [ebp - 0x1046c]
adc eax, dword [ebp + 0xc]
push eax
push ecx
call fcn.00404b20
add esp, 8
lea eax, [ebp - 0x104b4]
push 1
push 0
push 0
push 0
push eax
call dword [sym.imp.USER32.dll_PeekMessageA]
test eax, eax
je 0x40585e
lea eax, [ebp - 0x104b4]
push eax
call dword [sym.imp.USER32.dll_TranslateMessage]
lea eax, [ebp - 0x104b4]
push eax
call dword [sym.imp.USER32.dll_DispatchMessageA]
mov eax, dword [ebp - 0x10480]
mov edx, dword [ebp - 0x10484]
or eax, edx
jne 0x405750
mov ebx, dword [ebp - 0x10474]
cmp dword [ebp - 0x1048c], 0
je 0x4058c8
mov eax, dword [ebp - 0x10488]
cmp dword [ebx + 4], eax
je 0x4058bb
sub dword [ebp - 0x10478], 1
je 0x4059eb
push 0
push dword [ebp - 0x10464]
call dword [sym.imp.KERNEL32.dll_GetFileSize]
sub dword [ebp - 0x10468], eax
mov esi, 1
sbb dword [ebp - 0x1046c], 0
jmp 0x4058d7
lea eax, [ebp - 0x110]
push eax
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
mov dl, 0x46
lea ecx, [ebp - 0x110]
call fcn.00404990
xor esi, esi
push dword [ebp - 0x10464]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push dword [ebp - 0x1047c]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test esi, esi
jne 0x4055f0
mov esi, dword [ebp - 0x10470]
lea eax, [ebp - 0x10460]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_FindNextFileA]
test eax, eax
jne 0x405550
push esi
call dword [sym.imp.KERNEL32.dll_FindClose]
mov eax, dword [ebp - 0x10468]
mov edx, dword [ebp - 0x1046c]
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040aa0f
mov esp, ebp
pop ebp
ret
mov dl, 0x46
lea ecx, [ebp - 0x110]
call fcn.00404990
push 0x30
lea eax, [ebp - 0x218]
push eax
push dword [0x4207d0]
push dword [0x425188]
call dword [sym.imp.USER32.dll_MessageBoxA]
push dword [ebp - 0x10464]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call esi
push ebx
call esi
push dword [ebp - 0x10470]
call dword [sym.imp.KERNEL32.dll_FindClose]
xor eax, eax
xor edx, edx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040aa0f
mov esp, ebp
pop ebp
ret
mov dl, 0x46
lea ecx, [ebp - 0x110]
call fcn.00404990
push 0x30
lea eax, [ebp - 0x218]
push eax
push dword [0x4207d4]
push dword [0x425188]
call dword [sym.imp.USER32.dll_MessageBoxA]
push ebx
mov ebx, dword [sym.imp.KERNEL32.dll_CloseHandle]
call ebx
push dword [ebp - 0x1047c]
call ebx
push dword [ebp - 0x10470]
call dword [sym.imp.KERNEL32.dll_FindClose]
mov ecx, dword [ebp - 4]
xor eax, eax
pop edi
pop esi
xor ecx, ebp
xor edx, edx
pop ebx
call fcn.0040aa0f
mov esp, ebp
pop ebp
ret
mov dl, 0x46
lea ecx, [ebp - 0x110]
call fcn.00404990
push 0x30
lea eax, [ebp - 0x218]
push eax
push dword [0x4207d8]
push dword [0x425188]
call dword [sym.imp.USER32.dll_MessageBoxA]
push dword [ebp - 0x10464]
jmp 0x4059ba