Function at 0x518633
Capabilities:
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c
mov dword [ebp - 0x18], ecx
mov eax, dword [ebp - 0x18]
mov dword [eax], 1
and dword [ebp - 0x14], 0
mov eax, dword [ebp - 0x18]
mov byte [eax + 0x84], 0
mov eax, dword [ebp - 0x18]
mov byte [eax + 0x85], 0
mov eax, dword [ebp - 0x18]
mov byte [eax + 0x86], 0
mov eax, dword [ebp - 0x18]
cmp dword [eax + 0x1c], 0
je 0x518682
push 0
mov eax, dword [ebp - 0x18]
mov eax, dword [eax + 0x1c]
mov ecx, dword [ebp - 0x18]
mov ecx, dword [ecx + 0x1c]
mov eax, dword [eax]
call dword [eax]
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov eax, dword [ebp - 0x18]
push dword [eax + 0x28]
call dword [sym.imp.KERNEL32.dll_SetEvent]
mov eax, dword [ebp - 0x18]
cmp dword [eax + 4], 0
je 0x5186a9
mov eax, dword [ebp - 0x18]
push dword [eax + 0x38]
call dword [sym.imp.KERNEL32.dll_SetEvent]
cmp dword [ebp - 0x14], 0
jne 0x51899b
push 0xffffffffffffffff
push 0
mov eax, dword [ebp - 0x18]
add eax, 0x20
push eax
push 7
call dword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x10]
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0
jl 0x5186db
cmp dword [ebp - 0x10], 7
jl 0x5186e7
mov dword [ebp - 0x14], 1
jmp 0x518996
mov eax, dword [ebp - 0x10]
mov dword [ebp - 0x1c], eax
cmp dword [ebp - 0x1c], 0
je 0x518730
cmp dword [ebp - 0x1c], 1
je 0x5187a1
cmp dword [ebp - 0x1c], 2
je 0x51873c
cmp dword [ebp - 0x1c], 3
je 0x518869
cmp dword [ebp - 0x1c], 4
je 0x51881c
cmp dword [ebp - 0x1c], 5
je 0x518930
cmp dword [ebp - 0x1c], 6
je 0x5188d2
jmp 0x518996
mov dword [ebp - 0x14], 1
jmp 0x518996
mov eax, dword [ebp - 0x18]
movsx eax, byte [eax + 0x85]
test eax, eax
jne 0x51879c
mov eax, dword [ebp - 0x18]
mov byte [eax + 0x85], 1
mov eax, dword [ebp - 0x18]
add eax, 0x48
push eax
lea eax, [ebp - 0xc]
push eax
mov eax, dword [ebp - 0x18]
push dword [eax + 0x188]
mov eax, dword [ebp - 0x18]
add eax, 0x87
push eax
mov eax, dword [ebp - 0x18]
push dword [eax + 0x40]
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov byte [ebp - 5], al
movsx eax, byte [ebp - 5]
test eax, eax
jne 0x51879c
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
je 0x51879c
mov dword [ebp - 0x14], 1
jmp 0x518996
push 0
lea eax, [ebp - 4]
push eax
mov eax, dword [ebp - 0x18]
add eax, 0x48
push eax
mov eax, dword [ebp - 0x18]
push dword [eax + 0x40]
call dword [sym.imp.KERNEL32.dll_GetOverlappedResult]
test eax, eax
je 0x518803
mov eax, dword [ebp - 0x18]
push dword [eax + 0x24]
call dword [sym.imp.KERNEL32.dll_ResetEvent]
mov eax, dword [ebp - 0x18]
mov ecx, dword [ebp - 4]
mov dword [eax + 0x18c], ecx
mov eax, dword [ebp - 0x18]
mov byte [eax + 0x85], 0
cmp dword [ebp - 4], 0
je 0x518801
mov eax, dword [ebp - 0x18]
cmp dword [eax + 0x1c], 0
je 0x518801
push 3
mov eax, dword [ebp - 0x18]
mov eax, dword [eax + 0x1c]
mov ecx, dword [ebp - 0x18]
mov ecx, dword [ecx + 0x1c]
mov eax, dword [eax]
call dword [eax]
jmp 0x518817
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
je 0x518817
mov dword [ebp - 0x14], 1
jmp 0x518996
mov eax, dword [ebp - 0x18]
add eax, 0x5c
push eax
lea eax, [ebp - 4]
push eax
mov eax, dword [ebp - 0x18]
push dword [eax + 0x290]
mov eax, dword [ebp - 0x18]
add eax, 0x190
push eax
mov eax, dword [ebp - 0x18]
push dword [eax + 0x40]
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov byte [ebp - 5], al
movsx eax, byte [ebp - 5]
test eax, eax
jne 0x518864
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
je 0x518864
mov dword [ebp - 0x14], 1
jmp 0x518996
push 0
lea eax, [ebp - 4]
push eax
mov eax, dword [ebp - 0x18]
add eax, 0x5c
push eax
mov eax, dword [ebp - 0x18]
push dword [eax + 0x40]
call dword [sym.imp.KERNEL32.dll_GetOverlappedResult]
test eax, eax
je 0x5188b9
mov eax, dword [ebp - 0x18]
push dword [eax + 0x2c]
call dword [sym.imp.KERNEL32.dll_ResetEvent]
mov eax, dword [ebp - 0x18]
mov byte [eax + 0x84], 0
mov eax, dword [ebp - 0x18]
cmp dword [eax + 0x1c], 0
je 0x5188b7
push 2
mov eax, dword [ebp - 0x18]
mov eax, dword [eax + 0x1c]
mov ecx, dword [ebp - 0x18]
mov ecx, dword [ecx + 0x1c]
mov eax, dword [eax]
call dword [eax]
jmp 0x5188cd
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
je 0x5188cd
mov dword [ebp - 0x14], 1
jmp 0x518996
mov eax, dword [ebp - 0x18]
movsx eax, byte [eax + 0x86]
test eax, eax
jne 0x51892e
mov eax, dword [ebp - 0x18]
cmp dword [eax + 4], 0
je 0x51892e
mov eax, dword [ebp - 0x18]
mov byte [eax + 0x86], 1
mov eax, dword [ebp - 0x18]
add eax, 0x70
push eax
mov eax, dword [ebp - 0x18]
add eax, 0x294
push eax
mov eax, dword [ebp - 0x18]
push dword [eax + 0x40]
call dword [sym.imp.KERNEL32.dll_WaitCommEvent]
mov byte [ebp - 5], al
movsx eax, byte [ebp - 5]
test eax, eax
jne 0x51892e
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
je 0x51892e
mov dword [ebp - 0x14], 1
jmp 0x518996
push 0
lea eax, [ebp - 4]
push eax
mov eax, dword [ebp - 0x18]
add eax, 0x70
push eax
mov eax, dword [ebp - 0x18]
push dword [eax + 0x40]
call dword [sym.imp.KERNEL32.dll_GetOverlappedResult]
test eax, eax
je 0x518982
mov eax, dword [ebp - 0x18]
push dword [eax + 0x34]
call dword [sym.imp.KERNEL32.dll_ResetEvent]
mov eax, dword [ebp - 0x18]
mov byte [eax + 0x86], 0
mov eax, dword [ebp - 0x18]
push dword [eax + 0x294]
mov ecx, dword [ebp - 0x18]
call fcn.005185a0
mov eax, dword [ebp - 0x18]
push dword [eax + 0x38]
call dword [sym.imp.KERNEL32.dll_SetEvent]
jmp 0x518996
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
je 0x518996
mov dword [ebp - 0x14], 1
jmp 0x5186a9
mov eax, dword [ebp - 0x18]
and dword [eax], 0
mov eax, dword [ebp - 0x18]
cmp dword [eax + 0x40], 0xffffffff
je 0x5189b6
mov eax, dword [ebp - 0x18]
push dword [eax + 0x40]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x18]
or dword [eax + 0x40], 0xffffffff
mov eax, dword [ebp - 0x18]
cmp dword [eax + 0x1c], 0
je 0x5189d8
push 1
mov eax, dword [ebp - 0x18]
mov eax, dword [eax + 0x1c]
mov ecx, dword [ebp - 0x18]
mov ecx, dword [ecx + 0x1c]
mov eax, dword [eax]
call dword [eax]
leave
ret