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

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
and esp, 0xfffffff8
mov eax, 0x1858
call fcn.006c9620
mov eax, dword [0x7a8498]
xor eax, ebp
mov dword [esp + 0x1850], eax
test ecx, ecx
je 0x4d58ea
mov esi, edx
test edx, edx
je 0x4d58ea
mov ebx, ecx
movzx eax, byte [0x7bd04b]
test al, al
jns 0x4d533d
mov eax, dword [0x7bd044]
test eax, eax
je 0x4d58ea
push 0x7bd064
call dword [sym.imp.KERNEL32.dll_TryAcquireSRWLockExclusive]
test al, al
je 0x4d5907
movzx eax, byte [0x7bd057]
test al, al
jns 0x4d5368
mov eax, dword [0x7bd050]
test eax, eax
je 0x4d550d
mov dword [esp + 4], esi
xor eax, eax
dec eax
lea esi, [esp + 0x30]
mov dword [esi + 4], eax
mov dword [esi], eax
push esi
call fcn.0046d440
add esp, 4
lea eax, [esp + 0x450]
push 0x400
push 0
push eax
call fcn.006ccfc0
add esp, 0xc
mov eax, 0x7bd058
cmp byte [0x7bd063], 0
jns 0x4d53b3
mov eax, dword [0x7bd058]
mov ecx, esi
mov edx, 0x7bd04c
lea edi, [esp + 0x450]
push edi
push eax
call fcn.004d65dc
add esp, 8
push edi
call fcn.006e65e0
add esp, 4
lea esi, [esp + 0x850]
push eax
push edi
push esi
call fcn.0045ee00
add esp, 0xc
push esi
call fcn.00470cc0
add esp, 4
test al, al
je 0x4d5528
mov ecx, 0x7bd04c
call fcn.004d5efa
mov byte [esp + 8], al
lea ecx, [esp + 0x850]
call fcn.0045d3c0
cmp byte [esp + 8], 0
mov edi, dword [esp + 4]
je 0x4d5538
mov ecx, ebx
mov edx, edi
push dword [0x7bd0ac]
call fcn.004d64a2
add esp, 4
cmp dword [0x7bd08c], 1
jne 0x4d5461
mov eax, dword [0x7bd0ac]
test eax, eax
je 0x4d5461
xor esi, esi
mov dword [0x7bd4bc], esi
mov dword [0x7bd4b8], esi
push eax
call fcn.0045f450
add esp, 4
mov dword [0x7bd0ac], esi
lea esi, [esp + 0x50]
push 0x400
push 0
push esi
call fcn.006ccfc0
add esp, 0xc
mov eax, 0x7bd058
cmp byte [0x7bd063], 0
jns 0x4d5488
mov eax, dword [0x7bd058]
lea ecx, [esp + 0x30]
mov edx, 0x7bd040
push esi
push eax
call fcn.004d65dc
add esp, 8
lea edi, [esp + 0x24]
mov ecx, edi
push esi
call fcn.004037b8
lea esi, [esp + 0x18]
mov ecx, esi
lea eax, [esp + 0x450]
push eax
call fcn.004037b8
mov al, byte [esi + 0xb]
movzx ecx, byte [edi + 0xb]
mov edi, ecx
test cl, cl
jns 0x4d54cb
mov edi, dword [esp + 0x28]
test al, al
mov byte [esp + 8], al
movzx ebx, al
mov edx, dword [esp + 0x1c]
mov dword [esp + 0x14], ebx
cmovns edx, ebx
mov eax, dword [esp + 0x18]
mov ebx, esi
mov dword [esp + 0xc], eax
cmovs ebx, eax
mov dword [esp + 4], edx
cmp edx, edi
jne 0x4d562b
mov dword [esp + 0x10], ebx
test cl, cl
jns 0x4d57bf
mov ecx, dword [esp + 0x24]
jmp 0x4d57c3
mov ecx, 0x7bd040
call fcn.004d5efa
test al, al
je 0x4d58df
mov ecx, ebx
mov edx, esi
jmp 0x4d55e1
lea ecx, [esp + 0x850]
call fcn.0045d3c0
mov edi, dword [esp + 4]
mov ecx, 0x7bd040
call fcn.004d5efa
test al, al
je 0x4d55cb
mov ecx, ebx
mov edx, edi
push dword [0x7bd0ac]
call fcn.004d64a2
add esp, 4
cmp dword [0x7bd08c], 0
jne 0x4d5594
mov ecx, dword [0x7bd0ac]
test ecx, ecx
je 0x4d5594
xor esi, esi
mov dword [0x7bd4bc], esi
mov dword [0x7bd4b8], esi
push ecx
mov byte [esp + 8], al
call fcn.0045f450
mov al, byte [esp + 8]
add esp, 4
mov dword [0x7bd0ac], esi
test al, al
jne 0x4d58df
cmp dword [0x7bd08c], 1
jne 0x4d55cb
mov eax, dword [0x7bd0ac]
test eax, eax
je 0x4d55cb
xor esi, esi
mov dword [0x7bd4bc], esi
mov dword [0x7bd4b8], esi
push eax
call fcn.0045f450
add esp, 4
mov dword [0x7bd0ac], esi
mov ecx, 0x7bd04c
call fcn.004d5efa
test al, al
je 0x4d58df
mov ecx, ebx
mov edx, edi
push dword [0x7bd0ac]
call fcn.004d64a2
add esp, 4
cmp dword [0x7bd08c], 0
jne 0x4d58df
mov eax, dword [0x7bd0ac]
test eax, eax
je 0x4d58df
xor esi, esi
mov dword [0x7bd4bc], esi
mov dword [0x7bd4b8], esi
push eax
call fcn.0045f450
add esp, 4
mov dword [0x7bd0ac], esi
jmp 0x4d58df
mov esi, ebx
mov ebx, dword [esp + 4]
lea edi, [esp + 0x44]
xor eax, eax
dec eax
mov dword [edi], eax
mov dword [edi + 4], eax
mov dword [edi + 8], eax
push ebx
push esi
push edi
call fcn.0045ee00
add esp, 0xc
push edi
call fcn.00470cc0
add esp, 4
test al, al
je 0x4d5839
lea esi, [esp + 0x38]
xor eax, eax
dec eax
mov dword [esi + 4], eax
mov dword [esi], eax
push esi
push edi
call fcn.0045f3d0
add esp, 8
mov eax, dword [esi]
or eax, dword [esi + 4]
je 0x4d5828
push 0x6fb8a0
push edi
call fcn.00471540
add esp, 8
test eax, eax
je 0x4d5839
mov esi, eax
movzx eax, byte [esp + 0x2f]
test al, al
lea ecx, [esp + 0x24]
jns 0x4d56aa
mov ecx, dword [esp + 0x24]
mov eax, dword [esp + 0x28]
push eax
push ecx
lea ebx, [esp + 0x858]
push ebx
call fcn.0045ee00
add esp, 0xc
push 0x72f254
push ebx
call fcn.00471540
add esp, 8
mov edi, eax
mov ecx, ebx
call fcn.0045d3c0
test edi, edi
je 0x4d5830
mov ebx, esi
xor esi, esi
push 2
push esi
push ebx
call fcn.006db4f0
add esp, 0xc
push ebx
call fcn.006dc328
add esp, 4
mov dword [esp + 0xc], eax
push edi
call fcn.006dc328
add esp, 4
mov dword [esp + 8], eax
push esi
push esi
push ebx
call fcn.006db4f0
add esp, 0xc
push 0x1000
push esi
lea eax, [esp + 0x858]
push eax
call fcn.006ccfc0
add esp, 0xc
push ebx
call fcn.006e423b
add esp, 4
test eax, eax
jne 0x4d577f
push ebx
push 0x1000
push 1
lea eax, [esp + 0x85c]
push eax
call fcn.006e4b20
add esp, 0x10
test eax, eax
je 0x4d577f
mov esi, eax
push ebx
call fcn.006e4267
add esp, 4
test eax, eax
jne 0x4d577f
push edi
push esi
push 1
lea eax, [esp + 0x85c]
push eax
call fcn.006e4d30
add esp, 0x10
push edi
call fcn.006e4267
add esp, 4
test eax, eax
je 0x4d5726
mov dword [esp + 4], ebx
mov ebx, dword [esp + 8]
add ebx, dword [esp + 0xc]
push edi
call fcn.006dc328
add esp, 4
mov esi, eax
cmp ebx, eax
jle 0x4d57a3
push edi
call fcn.0045f470
add esp, 4
cmp ebx, esi
setle bl
push dword [esp + 4]
call fcn.0045f450
add esp, 4
push edi
call fcn.0045f450
add esp, 4
jmp 0x4d583b
lea ecx, [esp + 0x24]
mov edi, dword [esp + 0x10]
mov ebx, dword [esp + 4]
mov al, byte [esp + 8]
test al, al
js 0x4d5809
test ebx, ebx
je 0x4d582c
mov edx, dword [esp + 0xc]
cmp byte [ecx], dl
jne 0x4d5631
xor edi, edi
inc edi
mov edx, dword [esp + 0x14]
cmp edx, edi
je 0x4d5900
mov ah, byte [esp + edi + 0x18]
lea ebx, [edi + 1]
cmp ah, byte [ecx + edi]
mov edi, ebx
je 0x4d57ea
mov esi, dword [esp + 0x10]
jmp 0x4d562d
test ebx, ebx
je 0x4d5824
push ebx
push ecx
push edi
call fcn.006cbb2d
add esp, 0xc
mov esi, dword [esp + 0xc]
test eax, eax
jne 0x4d5631
xor ebx, ebx
jmp 0x4d584c
mov bl, 1
jmp 0x4d583b
xor ebx, ebx
jmp 0x4d5858
push esi
call fcn.0045f450
add esp, 4
xor ebx, ebx
lea ecx, [esp + 0x44]
call fcn.0045d3c0
mov al, byte [esp + 0x23]
test al, al
jns 0x4d5858
push dword [esp + 0x18]
call fcn.006c90e6
add esp, 4
cmp byte [esp + 0x2f], 0
jns 0x4d586b
push dword [esp + 0x24]
call fcn.006c90e6
add esp, 4
test bl, bl
je 0x4d58df
mov eax, dword [0x7bd0ac]
test eax, eax
je 0x4d5895
xor esi, esi
mov dword [0x7bd4bc], esi
mov dword [0x7bd4b8], esi
push eax
call fcn.0045f450
add esp, 4
mov dword [0x7bd0ac], esi
xor eax, eax
dec eax
mov dword [esp + 0x850], eax
mov dword [esp + 0x854], eax
mov dword [esp + 0x858], eax
lea esi, [esp + 0x450]
push esi
call fcn.006e65e0
add esp, 4
push eax
push esi
lea esi, [esp + 0x858]
push esi
call fcn.0045ee00
add esp, 0xc
push esi
call fcn.00470a90
add esp, 4
mov ecx, esi
call fcn.0045d3c0
push 0x7bd064
call dword [sym.imp.KERNEL32.dll_ReleaseSRWLockExclusive]
mov ecx, dword [esp + 0x1850]
xor ecx, ebp
call fcn.006c9121
lea esp, [ebp - 0xc]
pop esi
pop edi
pop ebx
pop ebp
ret
xor ebx, ebx
jmp 0x4d5848
mov ecx, 0x7bd064
call fcn.00474260
jmp 0x4d5358