Function at 0x5161d0
Capabilities:
Write file on windows

Disassembly:
push 0xffffffffffffffff
push 0x5c6e29
mov eax, dword fs:[0]
push eax
sub esp, 0x70
mov eax, dword [0x70a108]
xor eax, esp
mov dword [esp + 0x6c], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x70a108]
xor eax, esp
push eax
lea eax, [esp + 0x84]
mov dword fs:[0], eax
xor esi, esi
mov ebx, ecx
mov dword [esp + 0x18], esi
cmp dword [ebx + 0x44], esi
je 0x516469
cmp byte [ebx + 0x49], 0
je 0x516469
mov eax, dword [ebx]
mov edx, dword [eax + 0xc]
push 0xffffffffffffffff
call edx
cmp eax, 0xffffffff
je 0x516451
push esi
push 8
lea ecx, [esp + 0x68]
call fcn.00516100
mov dword [esp + 0x8c], esi
lea eax, [esp + 0x54]
push eax
lea ecx, [esp + 0x64]
call fcn.00515f60
mov esi, eax
lea ecx, [esp + 0x30]
push ecx
lea ecx, [esp + 0x64]
mov byte [esp + 0x90], 1
call fcn.00515f60
mov edi, eax
mov ecx, esi
mov byte [esp + 0x8c], 2
call fcn.00515180
mov ebp, dword [esp + 0x74]
mov ecx, edi
mov esi, eax
call fcn.00515180
mov ecx, dword [ebx + 0x44]
mov edx, dword [ecx]
lea edi, [esp + 0x20]
push edi
add ebp, esi
push ebp
push eax
lea eax, [ebx + 0x4c]
push eax
mov eax, dword [edx + 0x18]
call eax
push 3
lea ecx, [esp + 0x28]
mov esi, eax
mov byte [esp + 0x90], 1
call fcn.00585060
lea ecx, [esp + 0x30]
mov byte [esp + 0x8c], 3
call fcn.0040a330
lea ecx, [esp + 0x24]
mov byte [esp + 0x8c], 1
call fcn.005850a0
push 3
lea ecx, [esp + 0x2c]
mov byte [esp + 0x90], 0
call fcn.00585060
lea ecx, [esp + 0x54]
mov byte [esp + 0x8c], 4
call fcn.0040a330
lea ecx, [esp + 0x28]
mov byte [esp + 0x8c], 0
call fcn.005850a0
mov eax, esi
sub eax, 0
je 0x516333
dec eax
je 0x516337
sub eax, 2
mov dword [esp + 0x8c], 0xffffffff
lea ecx, [esp + 0x60]
jne 0x51644c
jmp 0x516464
mov byte [ebx + 0x49], 0
lea ecx, [esp + 0x3c]
push ecx
lea ecx, [esp + 0x64]
call fcn.00515f60
mov ecx, eax
mov byte [esp + 0x8c], 5
call fcn.00515180
mov esi, dword [esp + 0x20]
push 3
lea ecx, [esp + 0x20]
sub esi, eax
mov byte [esp + 0x90], 0
call fcn.00585060
lea ecx, [esp + 0x3c]
mov byte [esp + 0x8c], 6
call fcn.0040a330
lea ecx, [esp + 0x1c]
mov byte [esp + 0x8c], 0
call fcn.005850a0
test esi, esi
je 0x5163ce
lea edx, [esp + 0x48]
push edx
lea ecx, [esp + 0x64]
call fcn.00515f60
or dword [esp + 0x18], 1
mov ecx, eax
mov byte [esp + 0x8c], 7
call fcn.00515180
mov ecx, dword [ebx + 0x54]
push ecx
push esi
push 1
push eax
call fcn.00586390
add esp, 0x10
mov byte [esp + 0x17], 1
cmp esi, eax
jne 0x5163d3
mov byte [esp + 0x17], 0
test byte [esp + 0x18], 1
mov dword [esp + 0x8c], 0
je 0x516417
and dword [esp + 0x18], 0xfffffffe
push 3
lea ecx, [esp + 0x30]
call fcn.00585060
lea ecx, [esp + 0x48]
mov byte [esp + 0x8c], 8
call fcn.0040a330
lea ecx, [esp + 0x2c]
mov byte [esp + 0x8c], 0
call fcn.005850a0
cmp byte [esp + 0x17], 0
jne 0x51643d
cmp byte [ebx + 0x49], 0
je 0x516455
test esi, esi
jne 0x516245
push esi
push 8
lea ecx, [esp + 0x68]
call fcn.00515e10
jmp 0x516245
mov dword [esp + 0x8c], 0xffffffff
lea ecx, [esp + 0x60]
call fcn.0042cd50
xor al, al
jmp 0x51646b
mov dword [esp + 0x8c], 0xffffffff
lea ecx, [esp + 0x60]
call fcn.0042cd50
mov al, 1
mov ecx, dword [esp + 0x84]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x6c]
xor ecx, esp
call fcn.00586d40
add esp, 0x7c
ret