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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x100a82c8
mov eax, dword fs:[0]
push eax
mov eax, 0xcc60
call fcn.100982b0
mov eax, dword [0x100cef80]
xor eax, ebp
mov dword [ebp - 0x10], eax
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
xor edi, edi
mov byte [ebp - 0xc641], 1
mov dword [ebp - 0xc648], edi
push 0xc350
lea eax, [ebp - 0xc378]
mov dword [ebp - 0xc654], 0
push 0
push eax
call sub.msvcrt.dll_memset
add esp, 0xc
or esi, 0xffffffff
mov dword [ebp - 0xc64c], esi
mov dword [ebp - 4], 2
test esi, esi
je 0x100048db
cmp esi, 0xffffffff
je 0x100048db
mov eax, dword [0x100ce080]
test eax, eax
je 0x100048db
cmp eax, 0xffffffff
jne 0x10004dd6
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
push eax
lea eax, [ebp - 0xc3c0]
push eax
call fcn.10003730
or edi, 1
add esp, 8
mov dword [ebp - 0xc648], edi
push 0x13
xorps xmm0, xmm0
mov byte [ebp - 4], 3
push str.LUNA_PIPE_AVAILABLE
lea ecx, [ebp - 0xc3a8]
mov dword [ebp - 0xc398], 0
movups xmmword [ebp - 0xc3a8], xmm0
mov dword [ebp - 0xc394], 0
call fcn.10003450
lea eax, [ebp - 0xc3c0]
mov byte [ebp - 4], 4
push eax
lea eax, [ebp - 0xc3a8]
push eax
push dword [ebp - 0xc650]
lea ecx, [ebp - 0xc390]
call fcn.100038a0
cmp dword [ebp - 0xc37c], 7
lea eax, [ebp - 0xc390]
cmova eax, dword [ebp - 0xc390]
push eax
push 0
push 0
push 0x100d2e58
call dword [sym.imp.KERNEL32.dll_CreateEventW]
mov edi, eax
push 0xffffffffffffffff
push edi
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov byte [ebp - 4], 5
test edi, edi
je 0x10004994
cmp edi, 0xffffffff
je 0x10004994
push edi
call dword [0x100b3788]
mov ecx, dword [ebp - 0xc37c]
mov byte [ebp - 4], 4
cmp ecx, 7
jbe 0x100049d8
mov edx, dword [ebp - 0xc390]
lea ecx, [ecx*2 + 2]
mov eax, edx
cmp ecx, 0x1000
jb 0x100049ce
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x10005259
push ecx
push edx
call fcn.1009832f
add esp, 8
mov ecx, dword [ebp - 0xc394]
xor eax, eax
mov dword [ebp - 0xc380], 0
mov dword [ebp - 0xc37c], 7
mov word [ebp - 0xc390], ax
mov byte [ebp - 4], 3
cmp ecx, 7
jbe 0x10004a39
mov edx, dword [ebp - 0xc3a8]
lea ecx, [ecx*2 + 2]
mov eax, edx
cmp ecx, 0x1000
jb 0x10004a2f
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x10005259
push ecx
push edx
call fcn.1009832f
add esp, 8
mov ecx, dword [ebp - 0xc3ac]
mov byte [ebp - 4], 2
cmp ecx, 7
jbe 0x10004a7d
mov edx, dword [ebp - 0xc3c0]
lea ecx, [ecx*2 + 2]
mov eax, edx
cmp ecx, 0x1000
jb 0x10004a73
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x10005259
push ecx
push edx
call fcn.1009832f
add esp, 8
mov edi, dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
call edi
push eax
lea eax, [ebp - 0xc3c0]
push eax
call fcn.10003730
add esp, 8
push 0x12
xorps xmm0, xmm0
mov byte [ebp - 4], 6
push str..pipeLUNA_HOST
lea ecx, [ebp - 0xc3a8]
mov dword [ebp - 0xc398], 0
movups xmmword [ebp - 0xc3a8], xmm0
mov dword [ebp - 0xc394], 0
call fcn.10003450
lea eax, [ebp - 0xc3c0]
mov byte [ebp - 4], 7
push eax
lea eax, [ebp - 0xc3a8]
push eax
push dword [ebp - 0xc650]
lea ecx, [ebp - 0xc390]
call fcn.100038a0
cmp dword [ebp - 0xc37c], 7
lea eax, [ebp - 0xc390]
push 0
cmova eax, dword [ebp - 0xc390]
push 0x80
push 3
push 0
push 1
push 0x80000100
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ecx, esi
mov byte [ebp - 4], 8
mov esi, eax
mov dword [ebp - 0xc64c], esi
test ecx, ecx
je 0x10004b37
cmp ecx, 0xffffffff
je 0x10004b37
push ecx
call dword [0x100b3788]
mov ecx, dword [ebp - 0xc37c]
mov byte [ebp - 4], 7
cmp ecx, 7
jbe 0x10004b7b
mov edx, dword [ebp - 0xc390]
lea ecx, [ecx*2 + 2]
mov eax, edx
cmp ecx, 0x1000
jb 0x10004b71
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x10005259
push ecx
push edx
call fcn.1009832f
add esp, 8
mov ecx, dword [ebp - 0xc394]
xor eax, eax
mov dword [ebp - 0xc380], 0
mov dword [ebp - 0xc37c], 7
mov word [ebp - 0xc390], ax
mov byte [ebp - 4], 6
cmp ecx, 7
jbe 0x10004bdc
mov edx, dword [ebp - 0xc3a8]
lea ecx, [ecx*2 + 2]
mov eax, edx
cmp ecx, 0x1000
jb 0x10004bd2
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x10005259
push ecx
push edx
call fcn.1009832f
add esp, 8
mov ecx, dword [ebp - 0xc3ac]
mov byte [ebp - 4], 2
cmp ecx, 7
jbe 0x10004c20
mov edx, dword [ebp - 0xc3c0]
lea ecx, [ecx*2 + 2]
mov eax, edx
cmp ecx, 0x1000
jb 0x10004c16
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x10005259
push ecx
push edx
call fcn.1009832f
add esp, 8
call edi
push eax
lea eax, [ebp - 0xc3c0]
push eax
call fcn.10003730
add esp, 8
push 0x12
xorps xmm0, xmm0
mov byte [ebp - 4], 0xa
push str..pipeLUNA_HOOK
lea ecx, [ebp - 0xc3a8]
mov dword [ebp - 0xc398], 0
movups xmmword [ebp - 0xc3a8], xmm0
mov dword [ebp - 0xc394], 0
call fcn.10003450
lea eax, [ebp - 0xc3c0]
mov byte [ebp - 4], 0xb
push eax
lea eax, [ebp - 0xc3a8]
push eax
push dword [ebp - 0xc650]
lea ecx, [ebp - 0xc390]
call fcn.100038a0
mov edi, dword [ebp - 0xc648]
lea eax, [ebp - 0xc390]
push 0
push 0x80
push 3
push 0
or edi, 0x3e
cmp dword [ebp - 0xc37c], 7
push 1
cmova eax, dword [ebp - 0xc390]
push 0x40000000
push eax
mov dword [ebp - 0xc648], edi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ecx, dword [0x100ce080]
mov byte [ebp - 4], 0xc
mov dword [0x100ce080], eax
test ecx, ecx
je 0x10004ce4
cmp ecx, 0xffffffff
je 0x10004ce4
push ecx
call dword [0x100b3788]
mov ecx, dword [ebp - 0xc37c]
mov byte [ebp - 4], 0xb
cmp ecx, 7
jbe 0x10004d28
mov edx, dword [ebp - 0xc390]
lea ecx, [ecx*2 + 2]
mov eax, edx
cmp ecx, 0x1000
jb 0x10004d1e
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x10005259
push ecx
push edx
call fcn.1009832f
add esp, 8
mov ecx, dword [ebp - 0xc394]
xor eax, eax
mov dword [ebp - 0xc380], 0
mov dword [ebp - 0xc37c], 7
mov word [ebp - 0xc390], ax
mov byte [ebp - 4], 0xa
cmp ecx, 7
jbe 0x10004d89
mov edx, dword [ebp - 0xc3a8]
lea ecx, [ecx*2 + 2]
mov eax, edx
cmp ecx, 0x1000
jb 0x10004d7f
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x10005259
push ecx
push edx
call fcn.1009832f
add esp, 8
mov ecx, dword [ebp - 0xc3ac]
mov byte [ebp - 4], 2
cmp ecx, 7
jbe 0x100048c0
mov edx, dword [ebp - 0xc3c0]
lea ecx, [ecx*2 + 2]
mov eax, edx
cmp ecx, 0x1000
jb 0x10004dc7
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x10005259
push ecx
push edx
call fcn.1009832f
add esp, 8
jmp 0x100048c0
push 0
push 0
lea eax, [ebp - 0xc650]
mov dword [ebp - 0xc650], 2
push eax
push esi
call dword [sym.imp.KERNEL32.dll_SetNamedPipeHandleState]
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
push 0
mov dword [ebp - 0xc378], eax
lea eax, [ebp - 0xc654]
push eax
push 4
lea eax, [ebp - 0xc378]
push eax
push dword [0x100ce080]
call dword [sym.imp.KERNEL32.dll_WriteFile]
push dword [0x100cebe0]
call fcn.10003f50
add esp, 4
call fcn.1006e470
cmp byte [ebp - 0xc641], 0
mov byte [0x100d2dd9], 1
je 0x1000519a
push 0
lea eax, [ebp - 0xc654]
push eax
push 0xc350
lea eax, [ebp - 0xc378]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x10005194
mov eax, dword [ebp - 0xc378]
cmp eax, 5
ja case.0x10004e72.3
jmp dword [eax*4 + 0x10005264]
mov eax, dword [0x100d2e64]
lea esi, [ebp - 0xc378]
mov ecx, 0x184
lea edi, [ebp - 0xcc6c]
add eax, 1
rep movsd dword es:[edi], dword [esi]
mov dword [0x100d2e64], eax
jns 0x10004eb1
neg eax
push eax
lea eax, [ebp - 0x13]
push eax
call fcn.100036f0
add esp, 8
mov byte [eax - 1], 0x2d
dec eax
jmp 0x10004ebe
push eax
lea eax, [ebp - 0x13]
push eax
call fcn.100036f0
add esp, 8
lea ecx, [ebp - 0x13]
mov dword [ebp - 0xc65c], eax
mov dword [ebp - 0xc398], 0
xorps xmm0, xmm0
mov dword [ebp - 0xc394], 0
movups xmmword [ebp - 0xc3a8], xmm0
cmp eax, ecx
jne 0x10004f09
mov dword [ebp - 0xc398], 0
mov dword [ebp - 0xc394], 0xf
mov byte [ebp - 0xc3a8], 0
jmp 0x10004faf
lea edi, [ebp - 0x13]
sub edi, eax
cmp edi, 0x7fffffff
ja 0x1000525e
mov dword [ebp - 0xc394], 0xf
cmp edi, 0xf
ja 0x10004f4a
push edi
push eax
lea eax, [ebp - 0xc3a8]
mov dword [ebp - 0xc398], edi
push eax
call sub.msvcrt.dll_memcpy
add esp, 0xc
mov byte [ebp + edi - 0xc3a8], 0
jmp 0x10004faf
mov eax, edi
or eax, 0xf
cmp eax, 0x7fffffff
jbe 0x10004f5d
mov eax, 0x7fffffff
jmp 0x10004f68
cmp eax, 0x16
mov ecx, 0x16
cmovb eax, ecx
mov dword [ebp - 0xc658], eax
lea eax, [ebp - 0xc658]
push eax
lea eax, [ebp - 0xc3a8]
push eax
call fcn.10003330
mov ecx, dword [ebp - 0xc658]
mov esi, eax
push edi
push dword [ebp - 0xc65c]
mov dword [ebp - 0xc3a8], esi
push esi
mov dword [ebp - 0xc398], edi
mov dword [ebp - 0xc394], ecx
call sub.msvcrt.dll_memcpy
add esp, 0x14
mov byte [esi + edi], 0
mov esi, dword [ebp - 0xc648]
or esi, 0xc0
push 8
push str.UserHook
push 0
lea ecx, [ebp - 0xc3a8]
mov byte [ebp - 4], 0xe
call fcn.10005940
mov dword [ebp - 0xc380], 0
xorps xmm0, xmm0
movups xmmword [ebp - 0xc390], xmm0
mov dword [ebp - 0xc37c], 0
or esi, 0x100
movups xmm0, xmmword [eax]
mov dword [ebp - 0xc648], esi
movups xmmword [ebp - 0xc390], xmm0
movq xmm0, qword [eax + 0x10]
movq qword [ebp - 0xc380], xmm0
mov dword [eax + 0x10], 0
mov dword [eax + 0x14], 0xf
mov byte [eax], 0
cmp dword [ebp - 0xc37c], 0xf
lea eax, [ebp - 0xc390]
mov ecx, 0x182
mov byte [ebp - 4], 0xf
cmova eax, dword [ebp - 0xc390]
lea esi, [ebp - 0xcc64]
push eax
sub esp, 0x608
mov edi, esp
rep movsd dword es:[edi], dword [esi]
call fcn.100041c0
mov ecx, dword [ebp - 0xc37c]
add esp, 0x60c
mov byte [ebp - 4], 0xe
cmp ecx, 0xf
jbe 0x1000509c
mov edx, dword [ebp - 0xc390]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x10005092
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x10005259
push ecx
push edx
call fcn.1009832f
add esp, 8
mov ecx, dword [ebp - 0xc394]
mov esi, dword [ebp - 0xc64c]
mov dword [ebp - 0xc380], 0
mov dword [ebp - 0xc37c], 0xf
mov byte [ebp - 0xc390], 0
mov byte [ebp - 4], 2
cmp ecx, 0xf
jbe case.0x10004e72.3
mov edx, dword [ebp - 0xc3a8]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x100050f5
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x10005259
push ecx
push edx
call fcn.1009832f
mov esi, dword [ebp - 0xc64c]
add esp, 8
jmp case.0x10004e72.3
push 0
push dword [ebp - 0xc36c]
push dword [ebp - 0xc370]
call fcn.10005280
add esp, 0xc
jmp case.0x10004e72.3
cmp word [ebp - 0xc138], 0
lea esi, [ebp - 0xc378]
mov ecx, 0xa0
lea edi, [ebp - 0xc640]
rep movsd dword es:[edi], dword [esi]
je 0x10005162
push dword [ebp - 0xc338]
lea eax, [ebp - 0xc400]
push eax
call fcn.10007eb0
mov esi, dword [ebp - 0xc64c]
add esp, 8
jmp case.0x10004e72.3
sub esp, 0x278
lea esi, [ebp - 0xc370]
mov ecx, 0x9e
mov edi, esp
rep movsd dword es:[edi], dword [esi]
call fcn.10007dc0
mov esi, dword [ebp - 0xc64c]
add esp, 0x278
jmp case.0x10004e72.3
mov byte [ebp - 0xc641], 0
mov edi, dword [ebp - 0xc648]
mov dword [ebp - 4], 0x10
test esi, esi
je 0x100051b1
cmp esi, 0xffffffff
je 0x100051b1
push esi
call dword [0x100b3788]
mov eax, dword [0x100ce080]
mov dword [ebp - 4], 0
mov dword [0x100ce080], 0xffffffff
test eax, eax
je 0x100051d7
cmp eax, 0xffffffff
je 0x100051d7
push eax
call dword [0x100b3788]
cmp byte [ebp - 0xc641], 0
mov dword [ebp - 4], 0xffffffff
jne 0x10004890
cmp byte [0x100d2dd8], 0
je 0x1000521f
push 0
mov byte [0x100d2dd9], 0
call fcn.10004850
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.1009833d
mov esp, ebp
pop ebp
ret 4
call fcn.100756d0
mov esi, dword [0x100d2de0]
lea edi, [esi + 0x41eb00]
cmp esi, edi
je 0x10005245
mov ecx, esi
call fcn.10005d70
add esi, 0x6c0
cmp esi, edi
jne 0x10005234
push 0
push str.LunaHook32
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
push eax
call dword [sym.imp.KERNEL32.dll_FreeLibraryAndExitThread]
call fcn.10099820
call fcn.10005910
nop
jns 0x100052b4
add byte [eax], dl
or dl, byte [ecx]
adc byte [1125122129], ah
dec esi
add byte [eax], dl
inc ebx
dec esi
add byte [eax], dl
lea edx, [ecx]
adc ah, cl
int3
ret 0xf233