Function at 0x51f070
Capabilities:
Resolve function by parsing pe exports

Disassembly:
sub esp, 0x78
mov eax, dword [0x58f140]
xor eax, esp
mov dword [esp + 0x74], eax
push ebx
push ebp
push esi
mov esi, dword [esp + 0x88]
xor ebp, ebp
mov dword [esp + 0x2c], ebp
mov dword [esp + 0x30], ebp
movzx ebx, byte [esi + 0x2d]
inc ebx
cmp byte [esi + 0x2b], 0
mov dword [esp + 0x10], ebx
jne 0x51f0c2
mov ecx, dword [esi + 4]
mov eax, 3
push 0xa
sub eax, ebx
push eax
mov edx, dword [ecx]
push ebx
push ecx
mov eax, dword [edx + 0x38]
call eax
add esp, 0x10
test eax, eax
jne 0x51f4c9
push edi
push 0x30
lea eax, [esi + 0x34]
push 0
push eax
call fcn.005326d0
mov eax, dword [esi + 8]
lea edx, [esp + 0x44]
push edx
push eax
mov ecx, dword [eax]
mov eax, dword [ecx + 0x18]
call eax
mov edi, eax
add esp, 0x14
test edi, edi
jne 0x51f4a7
cmp dword [esp + 0x3c], ebp
jl 0x51f3df
jg 0x51f104
cmp dword [esp + 0x38], 0x20
jbe 0x51f3df
mov eax, dword [esi + 8]
lea edx, [esp + 0x64]
push 0
push 0
push 0x20
mov ecx, dword [eax]
push edx
push eax
mov eax, dword [ecx + 8]
call eax
mov edi, eax
add esp, 0x14
test edi, edi
jne 0x51f4a7
mov edx, dword [esp + 0x64]
mov edi, dword [esp + 0x6c]
bswap edx
mov eax, edx
and eax, 0xfffffffe
bswap edi
mov dword [esp + 0x50], edi
cmp eax, 0x377f0682
jne 0x51f3df
lea eax, [edi - 1]
test edi, eax
jne 0x51f3df
cmp edi, 0x10000
jg 0x51f3df
cmp edi, 0x200
jl 0x51f3df
mov eax, dword [esp + 0x70]
lea ebx, [esi + 0x4c]
mov ecx, dword [esp + 0x78]
and dl, 1
bswap eax
mov dword [esi + 0x70], eax
mov eax, dword [esp + 0x74]
push ebx
mov dword [esi + 0x54], eax
lea eax, [esp + 0x68]
push 0
push 0x18
push eax
movzx eax, dl
xor eax, 1
mov byte [esi + 0x41], dl
push eax
mov dword [esi + 0x24], edi
mov dword [esi + 0x58], ecx
call fcn.0051e030
mov eax, dword [esp + 0x90]
add esp, 0x14
bswap eax
cmp dword [ebx], eax
jne 0x51f3df
mov eax, dword [esp + 0x80]
bswap eax
cmp dword [esi + 0x50], eax
jne 0x51f3df
mov eax, dword [esp + 0x68]
bswap eax
cmp eax, 0x2de218
je 0x51f1e7
push 0xff9e
call fcn.004d1260
mov edi, eax
jmp 0x51f3d4
lea ebx, [edi + 0x18]
lea eax, [ebx + 0x8000]
mov dword [esp + 0x20], ebx
push 0
push eax
call fcn.00494170
add esp, 8
mov dword [esp + 0x10], eax
test eax, eax
jne 0x51f20f
lea edi, [eax + 7]
jmp 0x51f4a3
mov ecx, dword [esp + 0x3c]
add eax, 0x18
mov dword [esp + 0x44], eax
add eax, edi
mov edi, dword [esp + 0x38]
mov dword [esp + 0x28], eax
sub edi, 0x20
mov eax, ebx
cdq
sbb ecx, ebp
push edx
push eax
push ecx
push edi
call fcn.0052e950
xor ebx, ebx
mov dword [esp + 0x60], eax
mov dword [esp + 0x2c], ebx
mov dword [esp + 0x58], 0x7f78
lea ecx, [eax + 0x21]
shr ecx, 0xc
mov dword [esp + 0x5c], ecx
mov ebp, ebx
shl ebp, 0xc
lea ecx, [ebp + 0xfde]
cmp eax, ecx
cmovb ecx, eax
mov dword [esp + 0x18], ecx
test ebx, ebx
jne 0x51f26e
lea ebp, [ebx + 1]
jmp 0x51f271
add ebp, 0xffffffdf
cmp dword [esi + 0x18], ebx
jle 0x51f28c
mov eax, dword [esi + 0x20]
mov edx, dword [eax + ebx*4]
mov dword [esp + 0x24], edx
mov dword [esp + 0x1c], edx
test edx, edx
je 0x51f28c
xor edi, edi
jmp 0x51f2a5
lea eax, [esp + 0x1c]
push eax
push ebx
push esi
call fcn.0051ed40
mov edx, dword [esp + 0x28]
add esp, 0xc
mov edi, eax
mov dword [esp + 0x24], edx
test edx, edx
je 0x51f3c7
mov eax, dword [esi + 0x20]
mov ecx, dword [esp + 0x28]
mov dword [eax + ebx*4], ecx
cmp ebp, dword [esp + 0x18]
ja 0x51f37e
mov eax, dword [esp + 0x20]
cdq
mov dword [esp + 0x40], eax
mov eax, edx
mov dword [esp + 0x54], eax
mov edi, dword [esi + 8]
lea ecx, [ebp - 1]
push eax
push dword [esp + 0x44]
mov ebx, dword [edi]
push 0
push ecx
call fcn.0052ea00
add eax, 0x20
adc edx, 0
push edx
push eax
push dword [esp + 0x28]
mov eax, dword [ebx + 8]
push dword [esp + 0x1c]
push edi
call eax
mov edi, eax
add esp, 0x14
test edi, edi
jne 0x51f376
push dword [esp + 0x10]
lea eax, [esp + 0x50]
push dword [esp + 0x48]
push eax
lea eax, [esp + 0x54]
push eax
push esi
call fcn.0051e1b0
add esp, 0x14
test eax, eax
je 0x51f376
push dword [esp + 0x48]
push ebp
push esi
call fcn.0051ebb0
mov edi, eax
add esp, 0xc
test edi, edi
jne 0x51f376
mov eax, dword [esp + 0x4c]
test eax, eax
je 0x51f367
mov dword [esi + 0x48], eax
mov eax, dword [esp + 0x50]
mov ecx, eax
and eax, 0xff00
sar ecx, 0x10
or ecx, eax
mov dword [esi + 0x44], ebp
mov word [esi + 0x42], cx
mov eax, dword [esi + 0x4c]
mov dword [esp + 0x30], eax
mov eax, dword [esi + 0x50]
mov dword [esp + 0x34], eax
mov eax, dword [esp + 0x54]
inc ebp
cmp ebp, dword [esp + 0x18]
jbe 0x51f2d0
mov ebx, dword [esp + 0x2c]
mov edx, dword [esp + 0x24]
mov eax, dword [esi + 0x20]
xor ecx, ecx
test ebx, ebx
mov dword [eax + ebx*4], edx
mov eax, 0x88
cmove ecx, eax
mov eax, 0x8000
cmove eax, dword [esp + 0x58]
push eax
mov eax, dword [esp + 0x2c]
add eax, ecx
push eax
lea eax, [ecx + edx]
push eax
call fcn.00532150
add esp, 0xc
cmp ebp, dword [esp + 0x18]
jbe 0x51f3c7
mov eax, dword [esp + 0x60]
inc ebx
mov dword [esp + 0x2c], ebx
cmp ebx, dword [esp + 0x5c]
jbe 0x51f251
push dword [esp + 0x10]
call fcn.004941f0
mov ebp, dword [esp + 0x34]
add esp, 4
test edi, edi
jne 0x51f4a3
mov eax, dword [esp + 0x34]
push esi
mov dword [esi + 0x4c], ebp
mov dword [esi + 0x50], eax
call fcn.0051f640
mov eax, dword [esi + 0x20]
add esp, 4
mov ebx, 1
mov ecx, dword [eax]
add ecx, 0x60
mov dword [esp + 0x10], ecx
mov dword [ecx], 0
mov eax, dword [esi + 0x44]
mov dword [ecx + 0x20], eax
mov dword [ecx + 4], 0
cmp byte [esi + 0x2b], 0
lea ebp, [ebx + 3]
je 0x51f423
xor edi, edi
jmp 0x51f440
mov ecx, dword [esi + 4]
push 0xa
push 1
push ebp
mov eax, dword [ecx]
push ecx
mov eax, dword [eax + 0x38]
call eax
mov edi, eax
add esp, 0x10
test edi, edi
jne 0x51f476
mov ecx, dword [esp + 0x10]
cmp ebx, 1
jne 0x51f453
cmp dword [esi + 0x44], 0
je 0x51f453
mov eax, dword [esi + 0x44]
mov dword [ecx + 8], eax
jmp 0x51f45b
mov dword [ecx + ebx*4 + 4], 0xffffffff
cmp byte [esi + 0x2b], 0
jne 0x51f47f
mov eax, dword [esi + 4]
push 9
push 1
push ebp
mov ecx, dword [eax]
push eax
mov eax, dword [ecx + 0x38]
call eax
add esp, 0x10
jmp 0x51f47b
cmp edi, 5
jne 0x51f4a3
mov ecx, dword [esp + 0x10]
inc ebx
cmp ebx, 5
jl 0x51f416
cmp dword [esi + 0x48], 0
je 0x51f4a3
push dword [esi + 0x6c]
push dword [esi + 0x44]
push str.recovered__d_frames_from_WAL_file__s
push 0x11b
call fcn.004849d0
add esp, 0x10
mov ebx, dword [esp + 0x14]
cmp byte [esi + 0x2b], 0
jne 0x51f4c6
mov eax, dword [esi + 4]
mov edx, 3
push 9
sub edx, ebx
push edx
mov ecx, dword [eax]
push ebx
push eax
mov eax, dword [ecx + 0x38]
call eax
add esp, 0x10
mov eax, edi
pop edi
mov ecx, dword [esp + 0x80]
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.0052df19
add esp, 0x78
ret