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

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
mov eax, 0x1090
call fcn.10007633
mov eax, dword [0x10032138]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
or dword [ebp - reloc.ADVAPI32.dll_TraceMessage], 0xffffffff
or dword [ebp - reloc.ADVAPI32.dll_TraceMessage], 0xffffffff
or dword [ebp - reloc.ADVAPI32.dll_TraceMessage], 0xffffffff
mov dword [ebp - reloc.ADVAPI32.dll_TraceMessage], eax
mov eax, dword [ebp + 0xc]
mov dword [ebp - reloc.ADVAPI32.dll_TraceMessage], eax
mov eax, dword [ebp + 0x10]
push esi
mov dword [ebp - reloc.ADVAPI32.dll_TraceMessage], eax
mov eax, dword [ebp + 0x28]
push edi
xor edi, edi
mov dword [ebp - reloc.ADVAPI32.dll_TraceMessage], eax
mov eax, dword [ebp + 0x44]
mov esi, ecx
mov dword [ebp - reloc.ADVAPI32.dll_TraceMessage], eax
mov dword [ebp - reloc.ADVAPI32.dll_TraceMessage], edi
cmp dword [ebx + 0x38], edi
jne 0x10012b6a
xor eax, eax
inc eax
jmp 0x10012fa2
lea eax, [ebx + 4]
push eax
mov dword [ebp - reloc.ADVAPI32.dll_TraceMessage], eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov ecx, dword [ebx + 0x2c]
lea eax, [ecx + 1]
mov dword [ebp - reloc.ADVAPI32.dll_TraceMessage], ecx
mov dword [ebx + 0x2c], eax
cmp dword [ebx + 0x28], edi
je 0x10012cb9
test esi, esi
je 0x10012bc0
push dword [ebx + 0x28]
mov eax, dword [ebx + 0x30]
push 1
push dword [ebp + 0x24]
mov dword [ebp - reloc.ADVAPI32.dll_TraceMessage], eax
push esi
call dword [sym.imp.msvcrt.dll_fwrite]
add esp, 0x10
cmp eax, 1
jne 0x10012f8f
mov eax, dword [ebp + 0x24]
add dword [ebx + 0x30], eax
cmp dword [ebx + 0x3c], edi
je 0x10012c7f
mov esi, dword [ebp - reloc.ADVAPI32.dll_TraceMessage]
test esi, esi
je 0x10012c7f
mov eax, dword [esi]
lea ecx, reloc.ADVAPI32.dll_TraceMessage
push ecx
push edi
push edi
mov ecx, esi
call dword [eax + 0xc]
test eax, eax
js 0x10012c7f
mov eax, dword [ebx + 0x30]
push edi
lea ecx, reloc.ADVAPI32.dll_TraceMessage
push ecx
lea ecx, reloc.ADVAPI32.dll_TraceMessage
mov edx, esi
push 0x1000
mov dword [ebp - reloc.ADVAPI32.dll_TraceMessage], eax
mov eax, dword [edx]
push ecx
mov dword [ebp - reloc.ADVAPI32.dll_TraceMessage], edi
mov ecx, edx
jmp 0x10012c69
cmp dword [ebp - reloc.ADVAPI32.dll_TraceMessage], edi
je 0x10012c70
push dword [ebx + 0x28]
lea eax, reloc.ADVAPI32.dll_TraceMessage
push 1
push dword [ebp - 0x105c]
push eax
call dword [sym.imp.msvcrt.dll_fwrite]
add esp, 0x10
cmp eax, 1
jne 0x10012c70
mov eax, dword [ebp - reloc.ADVAPI32.dll_TraceMessage]
add dword [ebx + 0x30], eax
add dword [ebp - reloc.ADVAPI32.dll_TraceMessage], eax
push edi
lea edx, reloc.ADVAPI32.dll_TraceMessage
push edx
mov ecx, esi
mov eax, dword [ecx]
push 0x1000
lea edx, reloc.ADVAPI32.dll_TraceMessage
push edx
call dword [eax + 4]
test eax, eax
jns 0x10012c1a
push edi
push edi
push dword [ebp - 0x1090]
mov ecx, esi
mov eax, dword [ecx]
call dword [eax + 0xc]
mov eax, dword [ebp - reloc.ADVAPI32.dll_TraceMessage]
test eax, eax
je 0x10012cb3
push dword [ebx + 0x28]
mov ecx, dword [ebx + 0x30]
push 1
push dword [ebp + 0x48]
mov dword [ebp - reloc.ADVAPI32.dll_TraceMessage], ecx
push eax
call dword [sym.imp.msvcrt.dll_fwrite]
add esp, 0x10
cmp eax, 1
jne 0x10012f8f
mov eax, dword [ebp + 0x48]
add dword [ebx + 0x30], eax
mov ecx, dword [ebp - reloc.ADVAPI32.dll_TraceMessage]
cmp dword [ebx + 0x24], edi
je 0x10012d6e
mov esi, dword [sym.imp.msvcrt.dll_fwprintf]
push ecx
push 0x10012fb4
push dword [ebx + 0x24]
call esi
add esp, 0xc
test eax, eax
js 0x10012f8f
mov ecx, dword [ebp - reloc.ADVAPI32.dll_TraceMessage]
mov edx, 0x1000c624
test ecx, ecx
jne 0x10012cef
mov ecx, edx
mov eax, dword [ebx + 0x1c]
test eax, eax
jne 0x10012cf8
mov eax, edx
push dword [ebp - 0x1068]
push dword [ebp + 0x4c]
push dword [ebp + 0x48]
push dword [ebp + 0x40]
push dword [ebp + 0x3c]
push dword [ebp + 0x38]
push dword [ebp + 0x34]
push dword [ebp + 0x30]
push dword [ebp + 0x2c]
push dword [ebp - 0x1074]
push dword [ebp - 0x1060]
push dword [ebp - 0x1070]
push dword [ebp + 0x24]
push dword [ebp + 0x20]
push dword [ebp + 0x1c]
push dword [ebp + 0x18]
push dword [ebp + 0x14]
push ecx
push dword [ebp - 0x1084]
push dword [ebp - 0x1080]
push eax
push 0x10012fd8
push dword [ebx + 0x24]
call esi
add esp, 0x5c
test eax, eax
js 0x10012f8f
push 0x10013340
push dword [ebx + 0x24]
call esi
pop ecx
pop ecx
test eax, eax
js 0x10012f8f
cmp dword [ebx + 0x20], edi
je 0x10012f94
push edi
push edi
push dword [ebx + 0x20]
call dword [sym.imp.msvcrt.dll_fseek]
add esp, 0xc
test eax, eax
jne 0x10012f8f
push dword [ebx + 0x20]
lea eax, reloc.ADVAPI32.dll_TraceMessage
push 1
push 0x50
push eax
call dword [sym.imp.msvcrt.dll_fread]
mov ecx, eax
add esp, 0x10
test ecx, ecx
jne 0x10012dca
push 0x50
lea eax, reloc.ADVAPI32.dll_TraceMessage
push edi
push eax
call sub.msvcrt.dll_memset
add esp, 0xc
push 3
pop eax
xor ecx, ecx
mov dword [ebp - reloc.ADVAPI32.dll_TraceMessage], eax
inc ecx
jmp 0x10012dd0
mov eax, dword [ebp - reloc.ADVAPI32.dll_TraceMessage]
cmp ecx, 1
jne 0x10012f8f
cmp eax, 3
jne 0x10012f61
mov ecx, dword [ebp - reloc.ADVAPI32.dll_TraceMessage]
mov eax, ecx
imul eax, dword [ebp - reloc.ADVAPI32.dll_TraceMessage]
add eax, dword [ebp + 0x14]
xor edx, edx
lea esi, [ecx + 1]
div esi
xor edx, edx
mov dword [ebp - reloc.ADVAPI32.dll_TraceMessage], esi
mov dword [ebp - reloc.ADVAPI32.dll_TraceMessage], eax
mov eax, dword [ebp - reloc.ADVAPI32.dll_TraceMessage]
imul eax, ecx
add eax, dword [ebp + 0x18]
div esi
mov edx, dword [ebp + 0x24]
mov dword [ebp - reloc.ADVAPI32.dll_TraceMessage], eax
test edx, edx
je 0x10012eab
mov esi, dword [ebp - reloc.ADVAPI32.dll_TraceMessage]
mov eax, esi
imul eax, dword [ebp - reloc.ADVAPI32.dll_TraceMessage]
add eax, edx
xor edx, edx
lea ecx, [esi + 1]
div ecx
mov edx, dword [ebp - reloc.ADVAPI32.dll_TraceMessage]
mov dword [ebp - reloc.ADVAPI32.dll_TraceMessage], eax
test edx, edx
je 0x10012e79
mov eax, dword [ebp - reloc.ADVAPI32.dll_TraceMessage]
lea ecx, [eax + 1]
imul eax, dword [ebp - reloc.ADVAPI32.dll_TraceMessage]
add eax, dword [ebp - reloc.ADVAPI32.dll_TraceMessage]
xor edx, edx
div ecx
mov dword [ebp - reloc.ADVAPI32.dll_TraceMessage], ecx
lea ecx, [esi + 1]
mov dword [ebp - reloc.ADVAPI32.dll_TraceMessage], eax
mov eax, dword [ebp - reloc.ADVAPI32.dll_TraceMessage]
imul eax, esi
add eax, dword [ebp + 0x2c]
xor edx, edx
div ecx
xor edx, edx
mov dword [ebp - reloc.ADVAPI32.dll_TraceMessage], ecx
mov dword [ebp - reloc.ADVAPI32.dll_TraceMessage], eax
mov eax, dword [ebp - reloc.ADVAPI32.dll_TraceMessage]
imul eax, esi
add eax, dword [ebp + 0x20]
div ecx
mov dword [ebp - reloc.ADVAPI32.dll_TraceMessage], eax
mov edx, dword [ebp + 0x48]
test edx, edx
je 0x10012f02
mov ecx, dword [ebp - reloc.ADVAPI32.dll_TraceMessage]
mov eax, ecx
imul eax, dword [ebp - reloc.ADVAPI32.dll_TraceMessage]
add eax, edx
xor edx, edx
lea esi, [ecx + 1]
div esi
xor edx, edx
mov dword [ebp - reloc.ADVAPI32.dll_TraceMessage], esi
mov dword [ebp - reloc.ADVAPI32.dll_TraceMessage], eax
mov eax, dword [ebp - reloc.ADVAPI32.dll_TraceMessage]
imul eax, ecx
add eax, dword [ebp + 0x4c]
div esi
xor edx, edx
mov dword [ebp - reloc.ADVAPI32.dll_TraceMessage], eax
mov eax, dword [ebp - reloc.ADVAPI32.dll_TraceMessage]
imul eax, ecx
add eax, dword [ebp + 0x34]
div esi
mov dword [ebp - reloc.ADVAPI32.dll_TraceMessage], eax
cmp dword [ebp + 0x38], reloc.ADVAPI32.dll_TraceMessage
je 0x10012f2b
mov eax, dword [ebp - reloc.ADVAPI32.dll_TraceMessage]
lea ecx, [eax + 1]
imul eax, dword [ebp - reloc.ADVAPI32.dll_TraceMessage]
add eax, dword [ebp + 0x38]
xor edx, edx
div ecx
mov dword [ebp - reloc.ADVAPI32.dll_TraceMessage], ecx
mov dword [ebp - reloc.ADVAPI32.dll_TraceMessage], eax
cmp dword [ebp + 0x1c], edi
jge 0x10012f36
inc dword [ebp - reloc.ADVAPI32.dll_TraceMessage]
cmp dword [ebp + 0x30], edi
jge 0x10012f41
inc dword [ebp - reloc.ADVAPI32.dll_TraceMessage]
cmp dword [ebp + 0x3c], edi
jge 0x10012f4c
inc dword [ebp - reloc.ADVAPI32.dll_TraceMessage]
mov eax, dword [ebp + 0x40]
add eax, 0xfffffe70
cmp eax, 0xc7
ja 0x10012f61
inc dword [ebp - reloc.ADVAPI32.dll_TraceMessage]
push edi
push edi
push dword [ebx + 0x20]
call dword [sym.imp.msvcrt.dll_fseek]
add esp, 0xc
test eax, eax
jne 0x10012f8f
push dword [ebx + 0x20]
lea eax, reloc.ADVAPI32.dll_TraceMessage
push 1
push 0x50
push eax
call dword [sym.imp.msvcrt.dll_fwrite]
add esp, 0x10
cmp eax, 1
je 0x10012f94
mov edi, 0x80004005
push dword [ebp - 0x107c]
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, edi
mov ecx, dword [ebp - 4]
pop edi
xor ecx, ebp
pop esi
call fcn.100024c8
leave
ret 0x48