Function at 0x42d388
Capabilities:
Write file on windows

Disassembly:
sub esp, 0x14
and dword [esp + 4], 0
push ebx
mov ebx, dword [esp + 0x20]
push ebp
push esi
push edi
mov eax, dword [ebx + 4]
test eax, eax
jne 0x42d3a1
mov eax, dword [ebx]
mov edi, dword [esp + 0x28]
mov dword [esp + 0x10], eax
mov esi, dword [edi + 8]
test esi, esi
mov dword [esp + 0x1c], esi
mov dword [esp + 0x28], esi
jg 0x42d3bf
mov eax, esi
jmp 0x42d5d9
test byte [ebx + 8], 8
je 0x42d520
push ebx
push dword [esp + 0x14]
call fcn.0042d1a6
push dword [esp + 0x18]
call dword [sym.imp.MSVCRT.dll__fileno]
push eax
call sym.ruby187g.exc_rb_thread_fd_writable
add esp, 0x10
test eax, eax
jne 0x42d3f1
push ebx
call sym.ruby187g.exc_rb_io_check_closed
pop ecx
mov ebx, dword [sym.imp.KERNEL32.dll_InterlockedExchange]
mov esi, dword [sym.imp.MSVCRT.dll__errno]
mov ebp, sym.ruby187g.exc_rb_trap_immediate
mov eax, dword [esp + 0x28]
cmp eax, 0x400
mov dword [esp + 0x18], eax
jle 0x42d439
cmp dword [sym.ruby187g.exc_rb_thread_critical], 0
jne 0x42d439
call sym.ruby187g.exc_rb_thread_alone
test eax, eax
jne 0x42d439
push dword [esp + 0x2c]
call fcn.0042d5e1
test eax, eax
pop ecx
je 0x42d439
mov dword [esp + 0x18], 0x400
push 1
push ebp
call ebx
push dword [esp + 0x18]
mov dword [esp + 0x24], eax
mov eax, dword [esp + 0x18]
add eax, dword [edi + 0xc]
push eax
push dword [esp + 0x18]
call dword [sym.imp.MSVCRT.dll__fileno]
pop ecx
push eax
call sym.ruby187g.exc_rb_w32_write
add esp, 0xc
mov dword [esp + 0x18], eax
push dword [esp + 0x20]
push ebp
call ebx
call esi
mov eax, dword [eax]
mov dword [esp + 0x20], eax
xor eax, eax
cmp dword [sym.ruby187g.exc_rb_prohibit_interrupt], eax
jne 0x42d4ad
cmp dword [sym.ruby187g.exc_rb_thread_critical], eax
jne 0x42d4ad
cmp dword [sym.ruby187g.exc_rb_thread_pending], eax
jne 0x42d49e
mov eax, dword [sym.ruby187g.exc_rb_thread_tick]
dec dword [sym.ruby187g.exc_rb_thread_tick]
test eax, eax
jg 0x42d4ad
mov dword [sym.ruby187g.exc_rb_thread_tick], 0x1f4
call sym.ruby187g.exc_rb_thread_schedule
cmp dword [sym.ruby187g.exc_rb_trap_pending], 0
je 0x42d4bb
call sym.ruby187g.exc_rb_trap_exec
call esi
mov ecx, dword [esp + 0x20]
mov dword [eax], ecx
mov eax, dword [esp + 0x18]
cmp eax, dword [esp + 0x28]
je 0x42d517
test eax, eax
jl 0x42d4e1
add dword [esp + 0x14], eax
sub dword [esp + 0x28], eax
call esi
mov dword [eax], 0xb
push dword [esp + 0x10]
call dword [sym.imp.MSVCRT.dll__fileno]
push eax
call sym.ruby187g.exc_rb_io_wait_writable
pop ecx
test eax, eax
pop ecx
je 0x42d5ce
push dword [esp + 0x2c]
call sym.ruby187g.exc_rb_io_check_closed
mov eax, dword [esp + 0x18]
pop ecx
cmp eax, dword [edi + 8]
jge 0x42d5ce
jmp 0x42d402
mov eax, dword [esp + 0x1c]
jmp 0x42d5d9
mov ebx, dword [sym.imp.MSVCRT.dll__errno]
call ebx
push dword [esp + 0x10]
and dword [eax], 0
push esi
push 1
push dword [edi + 0xc]
call dword [sym.imp.MSVCRT.dll_fwrite]
mov ebp, eax
add esp, 0x10
sub esi, ebp
test esi, esi
jle 0x42d5d3
mov eax, dword [esp + 0x10]
test byte [eax + 0xc], 0x20
je 0x42d5aa
call ebx
cmp dword [eax], 0
jne 0x42d57a
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xe8
jne 0x42d572
call ebx
mov dword [eax], 0x20
jmp 0x42d57a
call ebx
mov dword [eax], 9
push dword [esp + 0x10]
call dword [sym.imp.MSVCRT.dll__fileno]
push eax
call sym.ruby187g.exc_rb_io_wait_writable
pop ecx
test eax, eax
pop ecx
je 0x42d5ce
push dword [esp + 0x2c]
call sym.ruby187g.exc_rb_io_check_closed
push dword [esp + 0x14]
call dword [sym.imp.MSVCRT.dll_clearerr]
cmp ebp, dword [edi + 8]
pop ecx
pop ecx
jge 0x42d5ce
call ebx
and dword [eax], 0
push dword [esp + 0x10]
mov eax, ebp
add eax, dword [edi + 0xc]
push esi
push 1
push eax
call dword [sym.imp.MSVCRT.dll_fwrite]
add esp, 0x10
add ebp, eax
sub esi, eax
jmp 0x42d542
or eax, 0xffffffff
jmp 0x42d5d9
mov eax, dword [esp + 0x1c]
sub eax, esi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret