Function at 0x9f9590
Capabilities:
Resolve function by parsing pe exports
Write file on windows

Disassembly:
push 0xffffffffffffffff
push 0xa89ed7
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x8a4
push ebx
push ebp
push esi
xor ebx, ebx
push edi
push ebx
call fcn.009e4180
push ebx
mov dword [esp + 0x8c4], ebx
mov byte [esp + 0x1a], bl
call fcn.00a50c00
mov edi, eax
add esp, 8
cmp edi, ebx
jne 0x9f9612
mov eax, dword [esp + 0x8d0]
cmp eax, ebx
je 0x9f95fa
mov ecx, dword [0xaa2204]
mov edx, dword [ecx]
shr edx, 0x1c
test dl, 1
je 0x9f95fa
push str._Sandboxdir_not_set__
push eax
call fcn.00a16060
add esp, 8
push 5
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov dword [esp + 0x8bc], 0xffffffff
jmp 0x9f97e2
lea ecx, [esp + 0x244]
call fcn.00a155c0
mov esi, dword [esp + 0x8cc]
mov ecx, dword [0xaf4698]
xor eax, eax
mov byte [esp + 0x8bc], 1
mov ax, word [esi + 0x5c]
mov edx, dword [esi + 0x50]
push eax
mov eax, dword [esi + 0x34]
push ecx
push edx
push eax
push edi
lea ecx, [esp + 0x258]
push str._ls_x_x_x_di
push ecx
call fcn.00a16060
mov edx, dword [esp + 0x268]
push ebx
push edx
call fcn.00a27010
add esp, 0x24
lea ecx, [esp + 0x454]
call fcn.00a155c0
mov edx, dword [esp + 0x8c4]
lea eax, [esp + 0x30]
lea ecx, [esp + 0x454]
push eax
push ecx
push edx
mov byte [esp + 0x8c8], 2
call fcn.009ef8b0
mov eax, dword [esp + 0x3c]
mov ecx, dword [esp + 0x258]
mov edi, dword [esp + 0x8d4]
add esp, 0xc
push eax
push ecx
push 0xa9e668
push edi
call fcn.00a16060
mov eax, dword [edi + 8]
add esp, 0x10
lea edx, [esp + 0x664]
push edx
push eax
call fcn.00a1fe50
mov ebp, eax
cmp ebp, 0xffffffff
je 0x9f9710
mov eax, dword [esp + 0x8d0]
cmp eax, ebx
je 0x9f96ff
mov ecx, dword [0xaa2204]
mov edx, dword [ecx]
shr edx, 0x1c
test dl, 1
je 0x9f96ff
mov edi, dword [edi + 8]
push edi
push str._stub_already_generated__ls_
push eax
call fcn.00a16060
add esp, 0xc
push ebp
call dword [sym.imp.KERNEL32.dll_FindClose]
mov byte [esp + 0x12], 1
jmp 0x9f9b63
lea ecx, [esp + 0x34]
call fcn.00a155c0
mov edi, dword [edi + 8]
mov byte [esp + 0x8bc], 3
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
push eax
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
push eax
push edi
lea eax, [esp + 0x40]
push str._ls._x_x.tmp
push eax
call fcn.00a16060
mov eax, dword [0xaf47e0]
add esp, 0x14
push ebx
push 0x80
push 3
push ebx
push 3
push 0x80000000
push eax
call fcn.00a227b0
mov ebp, eax
or edi, 0xffffffff
cmp ebp, edi
jne 0x9f9807
mov ecx, dword [esp + 0x8d0]
cmp ecx, ebx
je 0x9f979b
mov edx, dword [0xaa2204]
mov eax, dword [edx]
shr eax, 0x1c
test al, 1
je 0x9f979b
mov eax, dword [0xaf47e0]
push eax
push str._failed_to_open_wad__ls_
push ecx
call fcn.00a16060
add esp, 0xc
push 5
call dword [sym.imp.KERNEL32.dll_SetLastError]
lea ecx, [esp + 0x34]
mov byte [esp + 0x8bc], 2
call fcn.00a155e0
lea ecx, [esp + 0x454]
mov byte [esp + 0x8bc], 1
call fcn.00a155e0
lea ecx, [esp + 0x244]
mov byte [esp + 0x8bc], bl
call fcn.00a155e0
mov dword [esp + 0x8bc], edi
push 1
call fcn.009e4180
add esp, 4
xor al, al
mov ecx, dword [esp + 0x8b4]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x8b0
ret
mov ecx, dword [esp + 0x3c]
push ebx
push 0x80
push 2
push ebx
push ebx
push 0x40000000
push ecx
call fcn.00a227b0
cmp eax, edi
mov dword [esp + 0x14], eax
jne 0x9f9862
mov eax, dword [esp + 0x8d0]
cmp eax, ebx
je 0x9f9856
mov edx, dword [0xaa2204]
mov ecx, dword [edx]
shr ecx, 0x1c
test cl, 1
je 0x9f9856
mov edx, dword [esp + 0x3c]
push edx
push str._failed_to_create_tmp_file__ls__
push eax
call fcn.00a16060
add esp, 0xc
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x9f979b
mov al, byte [esp + 0x13]
push 0x200
mov byte [esp + 0x1c], al
call fcn.009ef380
add esp, 4
mov dword [esp + 0x1c], eax
mov ecx, eax
mov edx, 0x200
cmp ecx, ebx
je 0x9f988c
mov byte [ecx], bl
mov eax, dword [esp + 0x1c]
inc ecx
dec edx
jne 0x9f9882
lea ecx, [eax + 0x200]
mov dword [esp + 0x20], ecx
mov dword [esp + 0x24], ecx
cmp eax, ebx
mov byte [esp + 0x8bc], 4
jne 0x9f98ae
xor ecx, ecx
jmp 0x9f98b0
sub ecx, eax
lea edx, [esp + 0x28]
push ebx
push edx
push ecx
push eax
push ebp
call fcn.00a2abe0
test eax, eax
je 0x9f9ba8
mov eax, dword [esp + 0x1c]
mov edx, dword [esp + 0x20]
cmp eax, ebx
jne 0x9f98d6
xor ecx, ecx
jmp 0x9f98da
mov ecx, edx
sub ecx, eax
cmp dword [esp + 0x28], ecx
jne 0x9f9ba8
mov ecx, dword [eax + 0x3c]
mov byte [esp + 0x13], bl
lea edi, [ecx + eax + 4]
xor ecx, ecx
cmp eax, ebx
mov cx, word [edi + 2]
lea ecx, [ecx + ecx*4]
mov ecx, dword [edi + ecx*8 + 0xe0]
jne 0x9f9907
xor edi, edi
jmp 0x9f990b
mov edi, edx
sub edi, eax
cmp edi, ecx
jae 0x9f9933
cmp eax, ebx
jne 0x9f9917
xor edi, edi
jmp 0x9f991b
mov edi, edx
sub edi, eax
lea eax, [esp + 0x13]
sub ecx, edi
push eax
push ecx
push edx
lea ecx, [esp + 0x24]
call fcn.009fd6a0
mov edx, dword [esp + 0x20]
jmp 0x9f9953
cmp eax, ebx
je 0x9f995b
mov edi, edx
sub edi, eax
cmp ecx, edi
jae 0x9f9957
lea edi, [eax + ecx]
push edx
push edi
lea ecx, [esp + 0x20]
call fcn.009ee060
mov edx, edi
mov dword [esp + 0x20], edx
mov eax, dword [esp + 0x1c]
cmp eax, ebx
jne 0x9f995f
xor edx, edx
jmp 0x9f9961
sub edx, eax
lea ecx, [esp + 0x28]
push ebx
add edx, 0xfffffe00
push ecx
add eax, 0x200
push edx
push eax
push ebp
call fcn.00a2abe0
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x1c]
xor ecx, ecx
mov edx, dword [eax + 0x3c]
dec word [edx + eax + 6]
mov dword [edx + eax + 0x88], ebx
mov dword [edx + eax + 0x8c], ebx
lea eax, [edx + eax + 4]
mov dword [eax + 0x74], ebx
mov dword [eax + 0x78], ebx
mov dword [eax + 0xa4], ebx
mov dword [eax + 0xa8], ebx
mov dword [eax + 0x6c], ebx
mov cx, word [eax + 2]
dec ecx
mov edi, dword [eax + 0x34]
lea ecx, [ecx + ecx*4]
mov edx, dword [eax + ecx*8 + 0x104]
lea ecx, [eax + ecx*8 + 0xf4]
lea edx, [edx + edi - 1]
dec edi
not edi
and edx, edi
mov dword [ecx + 8], edx
mov ebp, dword [ecx + 0xc]
mov edi, dword [esi + 0x50]
add edx, ebp
cmp edx, edi
jae 0x9f99ec
sub edi, ebp
mov dword [ecx + 8], edi
mov edx, dword [ecx + 0xc]
mov edi, dword [ecx + 8]
add edx, edi
mov dword [eax + 0x4c], edx
mov ecx, dword [esi + 0x34]
mov dword [eax + 0x30], ecx
mov dx, word [esi + 0x5c]
mov word [eax + 0x58], dx
mov ecx, dword [esi + 0x60]
mov dword [eax + 0x5c], ecx
mov edx, dword [esi + 0x64]
mov dword [eax + 0x60], edx
mov ecx, dword [esi + 0x68]
mov dword [eax + 0x64], ecx
mov edx, dword [esi + 0x6c]
mov dword [eax + 0x68], edx
mov cx, word [esi + 0x44]
mov word [eax + 0x40], cx
mov dx, word [esi + 0x46]
mov word [eax + 0x42], dx
mov cx, word [esi + 0x48]
mov word [eax + 0x44], cx
mov dx, word [esi + 0x4a]
mov word [eax + 0x46], dx
mov ecx, dword [esp + 0x1c]
cmp ecx, ebx
jne 0x9f9a49
xor eax, eax
jmp 0x9f9a4f
mov eax, dword [esp + 0x20]
sub eax, ecx
mov esi, dword [esp + 0x14]
lea edx, [esp + 0x2c]
push ebx
push edx
push eax
push ecx
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov ecx, dword [esp + 0x1c]
test eax, eax
je 0x9f9b00
cmp ecx, ebx
jne 0x9f9a76
xor eax, eax
jmp 0x9f9a7c
mov eax, dword [esp + 0x20]
sub eax, ecx
cmp dword [esp + 0x2c], eax
jne 0x9f9b00
push esi
call fcn.00a2aff0
mov esi, dword [esp + 0x8c8]
mov dword [esp + 0x14], 0xffffffff
mov eax, dword [esi + 8]
push eax
mov eax, dword [esp + 0x40]
push eax
call fcn.00a1faf0
test eax, eax
jne 0x9f9af9
mov eax, dword [esi + 8]
push eax
call fcn.00a1fd60
cmp eax, 0xffffffff
jne 0x9f9abd
mov byte [esp + 0x12], bl
jmp 0x9f9b29
mov eax, dword [esp + 0x8d0]
cmp eax, ebx
je 0x9f9aef
mov ecx, dword [0xaa2204]
mov edx, dword [ecx]
shr edx, 0x1c
test dl, 1
je 0x9f9aef
mov esi, dword [esi + 8]
mov ecx, dword [esp + 0x3c]
push esi
push ecx
push str._failed_to_move_file__ls___ls__
push eax
call fcn.00a16060
add esp, 0x10
mov edx, dword [esp + 0x3c]
push edx
call fcn.00a20610
mov byte [esp + 0x12], 1
jmp 0x9f9b29
mov eax, dword [esp + 0x8d0]
cmp eax, ebx
je 0x9f9b29
mov ecx, dword [0xaa2204]
mov edx, dword [ecx]
shr edx, 0x1c
test dl, 1
je 0x9f9b29
push str._failed_to_write_header__
push eax
call fcn.00a16060
add esp, 8
mov eax, dword [esp + 0x1c]
push eax
call fcn.00a7d8f0
add esp, 4
lea ecx, [esp + 0x34]
mov dword [esp + 0x1c], ebx
mov dword [esp + 0x20], ebx
mov dword [esp + 0x24], ebx
mov byte [esp + 0x8bc], 2
call fcn.00a155e0
mov eax, dword [esp + 0x14]
cmp eax, 0xffffffff
je 0x9f9b63
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ecx, [esp + 0x454]
mov byte [esp + 0x8bc], 1
call fcn.00a155e0
lea ecx, [esp + 0x244]
mov byte [esp + 0x8bc], bl
call fcn.00a155e0
push 1
mov dword [esp + 0x8c0], 0xffffffff
call fcn.009e4180
mov al, byte [esp + 0x16]
add esp, 4
jmp 0x9f97ee
lea ecx, [esp + 0x14]
push 0xa93e20
push ecx
mov dword [esp + 0x1c], str.Read_failed
call fcn.00a7e4dc
nop
push 1
call fcn.009e4180
pop ecx
ret